messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#------------------------------------------------------------------------------\n# Copyright (c) 2010, Enthought Inc\n# All rights reserved.\n#\n# This software is provided without warranty under the terms of the BSD license.\n\n#\n# Author... | python | edit | 3 | 1 | bsd-3-clause | d45e40e9093b88d204335e6e0bae5dac30595d66 | geggo/pyface,geggo/pyface | pyface/qt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport model.wu.user\nfrom model.wu.user import User\n\n\ndef init_context(app):\n model.wu.user.init_context(app)\n\n# todo evaluate a parameter and decide which package to use (wu, hss, test(?))\n\n```\n\nApply this change: Load model ... | python | edit | 1 | 0 | mit | 13ba4fba90f6ff654c26daf4a44d77bda3992b1f | lukasjuhrich/sipa,agdsn/sipa,agdsn/sipa,fgrsnau/sipa,agdsn/sipa,agdsn/sipa,MarauderXtreme/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,fgrsnau/sipa,fgrsnau/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa | model/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\n\nurlpatterns = patterns('relationships.views',\n url(r'^$', 'relationship_redirect', name='relationship_list_base'),\n url(r'^(?P<username>[\\w-]+)/(?:(?P<status_slug>[\\w-]+)/)?$', 'relations... | python | edit | 7 | 0 | mit | 39dd8bb26523106ed3d4ea26cd63b8732482b0cf | coleifer/django-relationships,maroux/django-relationships,maroux/django-relationships,coleifer/django-relationships | relationships/urls.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom flask import Flask\nfrom flask.ext.assets import Bundle, Environment\n\napp = Flask(__name__)\n\n# Load the app config\napp.config.from_object(\"config.Config\")\n\nassets = Environment(app)\n\nassets.load_path = [\n os... | python | edit | 3 | 0 | mit | 25fc6aa427769e0d75e90e1ae0fbe41e2ca24931 | hreeder/ignition,hreeder/ignition,hreeder/ignition | manager/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import Counter\nimport string\nimport sys\n\n\ndef beautiful_strings(line):\n line = line.rstrip()\n if line:\n beauty = 0\n count = Counter(''.join(letter for letter in line.lower()\n ... | python | edit | 2 | 6 | mit | d833d3f1ae0305466b691d37f3a5560821b24490 | MikeDelaney/CodeEval | easy/beautiful_strings/beautiful_strings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pycon.settings import *\n\nDEFAULT_URL_PREFIX='http://localhost:8000'\nDEBUG=True\n\nPAYPAL_TEST = True\n\nTEMPLATES[0]['OPTIONS']['debug'] = True\n```\n\nApply this change: Add django-extensions in the dev settings"
},
{
"role... | python | edit | 4 | 0 | bsd-2-clause | f84466d96bf1d9ce1525857bcbd821f7b6ee3486 | artcz/epcon,EuroPython/epcon,artcz/epcon,artcz/epcon,artcz/epcon,artcz/epcon,EuroPython/epcon,EuroPython/epcon,artcz/epcon,EuroPython/epcon | pycon/dev-settings.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom findaconf import app, db\nfrom unittest import TestCase\nfrom findaconf.tests.config import set_app, unset_app\n\n\nclass TestAutoCompleteRoutes(TestCase):\n\n def setUp(self):\n self.app = set_app(app, db)... | python | edit | 2 | 1 | mit | 555637aa86bef0b3cf5d3fe67b0341bcee5e271a | cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,cuducos/findaconf,koorukuroo/findaconf,koorukuroo/findaconf | findaconf/tests/test_autocomplete_routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 IBM Corp.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http... | python | edit | 1 | 1 | apache-2.0 | 761c6538d33daf59135d519f1aeaaac9b920c5ff | openstack/oslo.versionedobjects,citrix-openstack-build/oslo.versionedobjects | nova/objects/__init__.py | rejected_duplicate | Near-duplicate of sample 1895 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n.. _ex-eeg-on-scalp:\n\n=================================\nPlotting EEG sensors on the scalp\n=================================\n\nIn this example, digitized EEG sensor locations are shown on the scalp.\n\"\"\"\n# Author: Eric Larso... | python | edit | 1 | 0 | bsd-3-clause | 8d392a0723205a8229512a47355452bb94b36cfb | wmvanvliet/mne-python,Eric89GXL/mne-python,Teekuningas/mne-python,mne-tools/mne-python,pravsripad/mne-python,larsoner/mne-python,drammock/mne-python,mne-tools/mne-python,olafhauk/mne-python,Teekuningas/mne-python,bloyl/mne-python,larsoner/mne-python,drammock/mne-python,kingjr/mne-python,Eric89GXL/mne-python,larsoner/mn... | examples/visualization/eeg_on_scalp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import join\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('numarray',parent_package,top_path)\n\n config.add_data_files('numpy/')\... | python | edit | 3 | 1 | bsd-3-clause | 638e531d2007e63b45e19521c0f9a05f339dc12e | Ademan/NumPy-GSoC,illume/numpy3k,chadnetzer/numpy-gaurdro,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,teoliphant/numpy-refactor,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,c... | numpy/numarray/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n\n==================\nPMT Time Slewing\n==================\n\nShow different variants of PMT time slewing calculations.\n\nVariant 3 is currently (as of 2020-10-16) what's also used in Jpp.\n\n\"\"\"\n\n# Au... | python | edit | 1 | 0 | mit | 6eec6ac19073e5bef6d8d4fc9451d173015407f7 | tamasgal/km3pipe,tamasgal/km3pipe | examples/plot_pmt_time_slewing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urllib.parse\nfrom bs4 import BeautifulSoup\nimport re\nimport syscmd\n\ndef currency( self ):\n\t\n\tamount = 1\n\tfrm = \"eur\"\n\tto = \"usd\"\n\t\n\tif len(self.msg) < 7:\n\t\tself.send_chan(\"Usage: !currency <amount> <from> <to... | python | edit | 3 | 7 | mit | cc4211e2a3cdc58bf5ac3bf64711b881d1c046d0 | jasuka/pyBot,jasuka/pyBot | modules/currency.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport assembly\nimport bill\nimport bill_feed\nimport bill_keyword\nimport bill_review\nimport bill_status\nimport bill_withdrawal\nimport candidacy\nimport cosponsorship\nimport election\nimport favorite_keyword\nimport favorite_person\ni... | python | edit | 25 | 0 | apache-2.0 | 2e1774aa0505873f7a3e8fe5a120e8931200fa35 | teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr,teampopong/pokr.kr | pokr/models/__init__.py | rejected_lint | Too many lint violations: 25 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for the hdc1008 module\"\"\"\n\nimport pyb\nfrom hdc1008 import HDC1008\n\ni2c = pyb.I2C(2)\ni2c.init(pyb.I2C.MASTER, baudrate=400000)\n\nhdc = HDC1008(i2c)\nhdc.reset()\nhdc.heated(False)\nprint(\"Sensor ID: %s\" % (hex(hdc.ser... | python | edit | 3 | 1 | mit | fa5f50a4a257477f7dc0cbacec6d1cd3d8f0d217 | kfricke/micropython-hdc1008 | hdc1008test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport re\n\nIP_REGEX = re.compile(r'(?:[\\d]{1,3})\\.(?:[\\d]{1,3})\\.(?:[\\d]{1,3})\\.(?:[\\d]{1,3})')\n\n\ndef find_ips(filename):\n \"\"\"Returns all the unique IPs found within a file.\"\"\"\n matches = []... | python | edit | 1 | 5 | mit | a23641edf1fd941768eebb1938340d2173ac2e11 | kolanos/iputil | iputil/parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Application models\n#\n# Copyright (c) 2016, Alexandre Hamelin <alexandre.hamelin gmail.com>\n\n\nimport os, os.path\nfrom datetime import datetime\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom {{PROJECTNAME}} import app\n\n\napp.con... | python | edit | null | null | mit | 996611b4ec0f0e13769d40122f21b6a6362783a5 | 0xquad/flask-app-template,0xquad/flask-app-template,0xquad/flask-app-template | app.tmpl/models.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\nfrom grammpy import Grammar\nfrom .NongeneratingSymbolsRemove import remove_nongenerating_symbols\n\n... | python | edit | 1 | 2 | mit | a633e7c1c5ca2fff4018ab7f51136ba9ad1b9cde | PatrikValkovic/grammpy | grammpy_transforms/contextfree.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for testsite project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/\n\"\"\"\n\ni... | python | edit | 1 | 0 | apache-2.0 | 18d5b71dbbef2112d9fa8c48e2e894aa7321a4dc | obytes/django-prometheus,wangwanzhong/django-prometheus,korfuri/django-prometheus,wangwanzhong/django-prometheus,DingaGa/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus,DingaGa/django-prometheus | tests/end2end/testapp/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# Functions for reading hybrid model output(s)\n\nimport os\n\ndef read_afterburner_output(filename, read_initial=False):\n id_event = 0\n particlelist = []\n if os.path.isfile(filename):\n read_data = F... | python | edit | 2 | 14 | mit | fdb63cca26170d1348526ce8c357803ac6b37cf6 | jauvinen/hybrid-model-analysis | hybrid_analysis/file_reader/hybrid_reader.py | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport json\nimport sys\n\ntry:\n from pip._internal.req import parse_requirements\nexcept ImportError:\n from pip.req import parse_requirements\ntry:\n from pip._internal.download import PipSes... | python | edit | 1 | 0 | mit | 3664b2d9b7590b6750e35abba2c0fe77c7afd4cd | pivotal/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder | bin/license_finder_pip.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .coding import Coding\nfrom .lazy import lazyprop\nfrom ..system_uri import IETF_LANGUAGE_TAG\n\n\nclass LocaleConstants(object):\n \"\"\"Attributes for built in locales\n\n Additions may be defined in persistence files, base val... | python | edit | 1 | 3 | bsd-3-clause | 09225071761ae059c46393d41180b6c37d1b3edc | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | portal/models/locale.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.contrib.contenttypes import generic\nfrom django.db.models.signals import post_save\nfrom notification import models as notification\n\nfr... | python | edit | 1 | 5 | mit | fafd048452ebfb3379ab428cc74e795d3406478f | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | apps/comments/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom ip import Ip\nfrom ipv4 import Ipv4\nfrom ipv6 import Ipv6\n\n__name__ = 'ip'\n__version__ = '0.1'\n__description__ = \"Foxfluff's IPv4 and IPv6 datatype handling\"\n__author__ = 'foxfluff/luma'\n__url__ = 'h... | python | edit | 1 | 0 | mit | fd78ef63d6f4f39886a16e495c79ca42109e7886 | foxfluff/ip-py | ip/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport os\n\nfrom pprint import pprint\nfrom tabulate import tabulate\n\nOMDB_URL = 'http://www.omdbapi.com/?type=movie&plot=short&tomatoes=true&t={}&y={}'\n\n\ndef request_data(title, year):\n return requests.get(OMDB_U... | python | edit | 6 | 3 | mit | f6d4f822d8f0f34316c5a2c92c8ceade7bc7fdbd | kshvmdn/movieman | movieman/movieman.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\ndef crop_corners(image, box=None, **kwargs):\n \"\"\"\n Crop corners to the selection defined by image_cropping\n\n `box` is a string of the format 'x1,y1,x2,y1' or a four... | python | edit | 1 | 9 | bsd-3-clause | be746c870f2015507af5513a8636905cf9018001 | henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping | image_cropping/thumbnail_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.blueprints.ticket.service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom ...database import db\n\nf... | python | edit | 1 | 2 | bsd-3-clause | 0c027086cf6491a301b08b8e0cb1565715e615fe | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | webapp/byceps/blueprints/ticket/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | 481fe3e66b51e0bed3b62a6b46919b487ac67369 | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport logging\nfrom yaml_server.YamlReader import YamlReader\nfrom yaml_server.YamlServerException import YamlServerException\n\n\nclass Test(unittest.TestCase):\n \n data1_data = {\n 'data1': 'test... | python | edit | 1 | 1 | apache-2.0 | efa20f9d88fab8b62a95d126500f220255ce6633 | ImmobilienScout24/yamlreader,pombredanne/yamlreader | src/yaml_server_test/YamlReader_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAll the forum canned responses are stored in KB articles. There is a\ncategory for them now. Luckily they follow a simple pattern of slugs, so\nthey are easy to find.\n\nThis could have been an SQL migration, but I'm lazy and prefer... | python | edit | 2 | 0 | bsd-3-clause | b2854df273d2fa84a3bb5f2e0f2574f4ea80fb04 | Osmose/kitsune,feer56/Kitsune1,orvi2014/kitsune,Osmose/kitsune,iDTLabssl/kitsune,mythmon/kitsune,asdofindia/kitsune,chirilo/kitsune,rlr/kitsune,feer56/Kitsune2,silentbob73/kitsune,mozilla/kitsune,philipp-sumo/kitsune,asdofindia/kitsune,YOTOV-LIMITED/kitsune,anushbmx/kitsune,rlr/kitsune,dbbhattacharya/kitsune,safwanrahm... | migrations/211-recategorize-canned-responses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'karl.gong'\n\n\nclass EasyiumException(Exception):\n def __init__(self, msg=None, context=None):\n self.msg = msg\n self.message = self.msg\n self.context = context\n\n def __str__(self):\n ex... | python | edit | 1 | 3 | apache-2.0 | 9d7c55855b2226ff1aef36ed82d34d2f3626d376 | KarlGong/easyium-python,KarlGong/easyium | easyium/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nREST_FRAMEWORK = {\n 'DEFAULT_THROTTLE_CLASSES': (\n 'rest_framework.throttling.AnonRateThrottle',\n ),\n 'DEFAULT_THROTTLE_RATES': {\n 'anon': '50/day',\n }\n}\n\n```\n\nApply this change: Raise throttle limit for... | python | edit | 1 | 0 | mit | 633e73238a4a5380f81dd142024efab5ae691f92 | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | frigg/settings/rest_framework.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls.defaults import patterns, url, include\n\nurlpatterns = patterns(\"\",\n # Simple PyPI\n url(r'^/?$', \"djangopypi.views.simple\",\n name=\"djangopypi-simple\"),\n\n url(r'^(?P<... | python | edit | 3 | 0 | bsd-3-clause | 4335d5430fbcae6035f90495f1ce43d351e3927a | hsmade/djangopypi2,pitrho/djangopypi2,pitrho/djangopypi2,popen2/djangopypi2,mattcaldwell/djangopypi,hsmade/djangopypi2,disqus/djangopypi,EightMedia/djangopypi,EightMedia/djangopypi,ask/chishop,popen2/djangopypi2,disqus/djangopypi,benliles/djangopypi | djangopypi/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n#\tdp for Tornado\n#\t\tYoungYong Park (<EMAIL>)\n#\t\t2014.10.23\n#\t\t\n\nfrom .singleton import Singleton\n\n\nclass Logger(object, metaclass=Singleton):\n def exception(self, e=None):\n pass\n```\n\nApply this change: Add l... | python | edit | 1 | 1 | mit | ff3e0eb9d38d2cbed1fab7b67a374915bf65b8f5 | why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado | engine/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pygments.token import Token\nfrom pygments.style import Style\nimport pygments.styles\n\n\ndef style_factory(name):\n class PGStyle(Style):\n styles = {\n Token.Menu.Completions.Completion.Current: 'bg:#00aaaa ... | python | edit | 1 | 2 | bsd-3-clause | c82efa3d0db2f3f9887f4639552e761802829be6 | j-bennet/pgcli,suzukaze/pgcli,dbcli/pgcli,darikg/pgcli,johshoff/pgcli,thedrow/pgcli,thedrow/pgcli,janusnic/pgcli,darikg/pgcli,j-bennet/pgcli,yx91490/pgcli,koljonen/pgcli,yx91490/pgcli,lk1ngaa7/pgcli,d33tah/pgcli,lk1ngaa7/pgcli,bitemyapp/pgcli,bitemyapp/pgcli,joewalnes/pgcli,d33tah/pgcli,w4ngyi/pgcli,dbcli/vcli,koljonen... | pgcli/pgstyle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n\ndef test_service_elasticsearch_running(host):\n assert host.s... | python | edit | 4 | 3 | apache-2.0 | a673bc6b3b9daf27404e4d330819bebc25a73608 | Graylog2/graylog-ansible-role | molecule/default/tests/test_default.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef read(filename):\n \"\"\"\n Reads in a corestick file and returns a dictionary keyed by core_id.\n Layer interface depths are positive and are relative to the lake bottom.\n depths are returned in meters. Northing and Easting... | python | edit | 1 | 6 | bsd-3-clause | 8b78f3e84c688b0e45ecfa0dda827870eced4c4e | twdb/sdi | sdi/corestick.py | rejected_duplicate | Near-duplicate of sample 15201 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nsys.path.insert(1, os.path.join(sys.path[0], '../..'))\nimport owid_grapher.wsgi\nfrom grapher_admin.models import Variable\n\n# use this script to extract and write short forms of unit of measurement for all variable... | python | edit | 3 | 0 | mit | 631a096eb8b369258c85b5c014460166787abf6c | OurWorldInData/owid-grapher,owid/owid-grapher,aaldaber/owid-grapher,aaldaber/owid-grapher,owid/owid-grapher,owid/owid-grapher,owid/owid-grapher,OurWorldInData/our-world-in-data-grapher,OurWorldInData/owid-grapher,OurWorldInData/owid-grapher,aaldaber/owid-grapher,owid/owid-grapher,OurWorldInData/our-world-in-data-graphe... | owid_grapher/various_scripts/extract_short_units_from_existing_vars.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom google.appengine.ext import db\n\nimport bcrypt\n\nclass User(db.Model):\n email = db.EmailProperty()\n first_name = db.StringProperty()\n last_name = db.StringProperty()\n password_hash = db.StringProperty()\n created = db.DateTi... | python | edit | 1 | 3 | mit | 8b88ca952ff562eb692f25cba54263afcbbcfafd | haldun/optimyser2,haldun/optimyser2,haldun/tornado-gae-auth | auth/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nCURATORS = \"https://auth.globus.org/6265343a-52e3-11e7-acd7-22000b100078\"\n\nDEFAULT_CONFIG = {\n \"server\": {\n \"protocol\": \"https\",\n \"host\": \"\",\n \"catalog_id\": 1\n },\n \"viewer_mode\": \"2d\",\n \"curator_mode... | python | edit | 1 | 0 | bsd-3-clause | d8347132e246caf4874384000014353ce200dff4 | informatics-isi-edu/synspy,informatics-isi-edu/synspy,informatics-isi-edu/synspy | launcher/launcher/ui/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport nbgrader\n\n\ndef test_nbextension():\n from nbgrader import _jupyter_nbextension_paths\n nbexts = _jupyter_nbextension_paths()\n assert len(nbexts) == 3\n assert nbexts[0]['section'] == 'tree'\n assert nb... | python | edit | 1 | 3 | bsd-3-clause | 7a448c4df3feb717d0b1d8abbf9d32237751aab5 | jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader | nbgrader/tests/apps/test_nbgrader_extension.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport torch\n\n'''Utility for Padding Sequences to feed to RNN/LSTM.'''\n\n\ndef pad_single_sequence(single_tensor, length):\n padding_vec_dim = (length - single_tensor.size(0), *single_tensor.size()[1:])\n return torch.cat([single_t... | python | edit | 1 | 4 | mit | 67b80161fd686ef0743470dd57e56b64fe9f9128 | reachtarunhere/pytorch-snippets | rnn_padding.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nfrom numpy.testing import assert_almost_equal\nfrom numpy.testing import assert_array_equal\nfrom numpy.testing import assert_array_almost_equal\nfrom numpy.testing import assert_equal\nfrom numpy.testing import assert... | python | edit | 4 | 1 | mit | ababeb31c0673c44b0c0e6d0b30bf369d67b9e55 | glemaitre/power-profile,clemaitre58/power-profile,glemaitre/power-profile,clemaitre58/power-profile | src/scikit-cycling/skcycling/power_profile/tests/test_power_profile.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (0, 2)\n__version__ = '.'.join(map(str, VERSION))\n\n\nfrom django.db.models import Model\nfrom django.db.models.base import ModelState\ntry:\n from itertools import izip\nexcept ImportError:\n izip = zip\n\n\ndef attnames(c... | python | edit | 1 | 3 | bsd-3-clause | 8f2b9eecc5c62be356225250783731c21a22abea | Suor/django-pickling | django_pickling.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nConvenience module to use:\n\n python -m behave args...\n\n\"\"\"\n\nfrom __future__ import absolute_import\nimport sys\n\nif __name__ == \"__main__\":\n from .main import main\n sys.exit(main())\n\n`... | python | edit | 1 | 0 | bsd-2-clause | e385a20fdb877f0c6308883709814920cf0378d7 | jenisys/behave,jenisys/behave | behave/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom ..base import ViolationsLibrary\nfrom ..exceptions import ViolationDoesNotExists\n\n\nclass ViolationsLibraryCase(TestCase):\n \"\"\"Violations library case\"\"\"\n\n def setUp(self):\n se... | python | edit | 3 | 1 | mit | 8b3e40e70101433157709d9d774b199ce606196f | nvbn/coviolations_web,nvbn/coviolations_web | violations/tests/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from urllib.parse import urlencode\nexcept ImportError:\n from urllib import urlencode\n\n\nclass Request:\n def __init__(self, config, **kwargs):\n self.config = config\n self._kwargs = kwargs or {}\n\n def... | python | edit | 1 | 2 | mit | ffbe699a8435dd0abfb43a37c8528257cdaf386d | bwind/pymogilefs,bwind/pymogilefs | pymogilefs/request.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\n\nurlpatterns = patterns('projects.views',\n url(r'^add/$', 'add_project', name='add_project'),\n url(r'^edit/(?P<project_id>\\d+)/$', 'edit_project', name='edit_project'),\n url(r'^sta... | python | edit | 1 | 0 | mit | 4551732c93b248e669b63d8ea6a9705c52b69dc3 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | projects/urls.py | rejected_duplicate | Near-duplicate of sample 4318 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom lib.flask_mailplus import send_template_message\nfrom snakeeyes.app import create_celery_app\n\ncelery = create_celery_app()\n\n\n@celery.task()\ndef deliver_contact_email(email, message):\n \"\"\"\n Send a contact e-mail.\n\n ... | python | edit | 1 | 1 | mit | fe8266beb5541f1ac5b08f365edb5f30b3e8eddd | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask | snakeeyes/blueprints/contact/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom datetime import datetime, timedelta\nfrom flask.ext.restful import reqparse\n\nfrom changes.api.base import APIView\nfrom changes.models import Cluster, JobStep, Node\n\n\nclass ClusterNodesAPI... | python | edit | 1 | 3 | apache-2.0 | 516bebe37212e72362b416bd1d9c87a83726fa5f | bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes | changes/api/cluster_nodes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport pytoml as toml\n\nfrom proppy.exceptions import InvalidCommand, InvalidConfiguration\nfrom proppy.proposal import Proposal\nfrom proppy.render import to_pdf\n\n\ndef main(filename):\n if not filename.endswith('.toml'):... | python | edit | 1 | 6 | mit | d3f181f3151e158c569cc53f4287d3c4d7ca426e | WeAreWizards/proppy,WeAreWizards/proppy | proppy/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"An Edition reflects a base install, the default being BioLinux.\n\nEditions are shared between multiple projects. To specialize an edition, create\na Flavor instead.\n\nOther editions can be found in this directory\n\"\"\"\n\nfrom clo... | python | edit | 1 | 1 | mit | 4b451721c9e3530d83cf4ada1c1a7c994c217f15 | elkingtonmcb/cloudbiolinux,averagehat/cloudbiolinux,rchekaluk/cloudbiolinux,rchekaluk/cloudbiolinux,heuermh/cloudbiolinux,lpantano/cloudbiolinux,chapmanb/cloudbiolinux,averagehat/cloudbiolinux,AICIDNN/cloudbiolinux,elkingtonmcb/cloudbiolinux,AICIDNN/cloudbiolinux,kdaily/cloudbiolinux,averagehat/cloudbiolinux,elkingtonm... | cloudbio/edition/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Views for the general application.\"\"\"\n\nfrom django.views.generic import TemplateView\nfrom django.http import HttpResponse\n\n\nclass GeneralIndexView(TemplateView):\n \"\"\"View for the homepage that renders from a template.\... | python | edit | 1 | 1 | mit | 1d7e20e1dfb113839b4b213e49308c4b3f8f6605 | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/general/views.py | rejected_duplicate | Near-duplicate of sample 12502 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nimport warnings\n\nimport pytest\n\npytest_plugins = 'pytester'\n\n\n@pytest.fixture(scope='session', autouse=True)\ndef verify_target_path():\n import pytest_testdox\n\n current_path_root = os.path... | python | edit | 1 | 2 | mit | ca0d9b40442f3ca9499f4b1630650c61700668ec | renanivo/pytest-testdox | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport locale\n\n# The test fixtures can break if the locale is non-US.\nlocale.setlocale(locale.LC_ALL, 'en_US')\n\n```\n\nApply this change: test: Set the locale to en_US.UTF-8"
},
{
"role": "assistant",
"content": "import loc... | python | edit | 1 | 0 | mit | 6e6f906b47c1750f14e02b65cd825fd246a84c63 | onyxfish/journalism,onyxfish/agate,wireservice/agate | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nConfiguration, plugins and fixtures for `pytest`.\n\"\"\"\n\nimport os\n\nimport pytest\n\nfrom tests.utils import VuforiaServerCredentials\n\n\n@pytest.fixture()\ndef vuforia_server_credentials() -> VuforiaServerCredentials:\n \... | python | edit | 1 | 1 | mit | 002be05d8bb07e610613b1ba6f24c904691c9f03 | adamtheturtle/vws-python,adamtheturtle/vws-python | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\nfrom fcm_django.settings import FCM_DJANGO_SETTINGS as SETTINGS\n\n\nclass FcmDjangoConfig(AppConfig):\n name = \"fcm_django\"\n verbose_name = SETTINGS[\"APP_VERBOSE_NAME\"]\n\n```\n\nApply this c... | python | edit | 1 | 0 | mit | 884483d27f7c0fac3975da17a7ef5c470ef9e3b4 | xtrinch/fcm-django | fcm_django/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef error_on_kwarg(func, kwargs):\n if kwargs:\n message = \"{0}() got an unexpected keyword argument {1!r}\"\n raise TypeError(message.format(func.__name__, next(iter(kwargs))))\n\n\ndef convo_property(name):\n _name = ... | python | edit | 1 | 2 | mit | 687c0f3c1b8d1b5cd0cee6403a9664bb2b8f63d1 | orlnub123/cleverbot.py | cleverbot/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom random import random\n\n\nclass Neuron:\n def __init__(self, parents=[]):\n self.parents = parents\n self.weights = [random() for parent in parents]\n\n def get_output(self):\n return sum([parent.output * sel... | python | edit | 5 | 7 | mit | a8f125236308cbfc9bb2eb5b225a0ac92a3a95e4 | tysonzero/py-ann | ANN.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nfrom tempfile import NamedTemporaryFile\nfrom .utils import get_player_name\n\nPLAYER = get_player_name()\n\ndef play(audio_segment):\n with NamedTemporaryFile(\"w+b\", suffix=\".wav\") as f:\n audio_segment.exp... | python | edit | 2 | 2 | mit | a43e1c76ba3bef9ab3cbe1353c3b7289031a3b64 | cbelth/pyMusic,miguelgrinberg/pydub,jiaaro/pydub,Geoion/pydub,joshrobo/pydub,sgml/pydub | pydub/playback.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests the isort API module\"\"\"\nimport pytest\n\nfrom isort import api, exceptions\n\n\ndef test_sort_file_invalid_syntax(tmpdir) -> None:\n \"\"\"Test to ensure file encoding is respected\"\"\"\n tmp_file = tmpdir.join(f\"tes... | python | edit | 6 | 1 | mit | d2c50272ec4509e40562f441e534ba7457a493f3 | PyCQA/isort,PyCQA/isort | tests/test_api.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .parser import GcvsParser\n\ntry:\n import ephem\nexcept ImportError:\n ephem = None\n\n\ndef read_gcvs(filename):\n \"\"\"\n Reads variable star data in `GCVS format`_.\n\n :param filename: path to GCVS data file (usual... | python | edit | 1 | 2 | mit | 414dd0b03b3e4eabc11f848f79d681f3a284380e | zsiciarz/pygcvs | pygcvs/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add friendly error message targeted at South users"
},
{
"role": "assistant",
"content": "\"\"\"\nDjango migrations for email_log app\n\nThis package does not contain South migrations. South migrations can be found\nin the ``sou... | python | new_file | 1 | 0 | mit | cba707395196e78a54a1ded52066746680c5b225 | treyhunner/django-email-log,treyhunner/django-email-log | email_log/migrations/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom settings import * # noqa\n\n# Comment this line for turn on debug on tests\nLOGGING = {}\nDEBUG = 0\nTEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\nNOSE_ARGS = [\n '--verbosity=0',\n '--no-byte-compile',\n '--debug-log=erro... | python | edit | 2 | 0 | bsd-3-clause | 332fcb6566727a4736da42ccde449679136690a6 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/dbaas/settings_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python2.5\n#\n# Copyright 2009 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licen... | python | edit | 1 | 1 | apache-2.0 | 1dfb9fd979206af415e20fc58b905c435a187008 | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | app/soc/models/grading_project_survey.py | rejected_duplicate | Near-duplicate of sample 11623 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nsys.path.insert(0, os.path.abspath(os.path.pardir))\n\nif __name__ == \"__main__\":\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)... | python | edit | 1 | 0 | mit | c9a9bf594f9d91a0a2f4c297e6200ebfa047bae6 | rfleschenberg/djangocms-cascade,jtiki/djangocms-cascade,haricot/djangocms-bs4forcascade,haricot/djangocms-bs4forcascade,jrief/djangocms-cascade,jrief/djangocms-cascade,jrief/djangocms-cascade,rfleschenberg/djangocms-cascade,rfleschenberg/djangocms-cascade,jtiki/djangocms-cascade,jtiki/djangocms-cascade | examples/manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\nfrom corehq import toggles\nfrom corehq.toggles import ALL_TAGS\n\n\ndef test_toggle_properties():\n \"\"\"\n Check toggle properties\n \"\"\"\n for toggle in toggles.a... | python | edit | 1 | 2 | bsd-3-clause | bbda0891e2fc4d2dfec157e9249e02d114c7c45a | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/tests/test_toggles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\nimport urllib\nimport httplib\nimport simplejson\n\nG = 'maps.google.com'\n\ndef geocode(address, key, country):\n \"\"\"\n Get the coordinates from Google Maps for a specified address\n \"\"\"\n # see h... | python | edit | 2 | 5 | bsd-2-clause | d8310b3d0a4664f90d89b59fd6d5660f6cc0ab2b | artcz/epcon,EuroPython/epcon,EuroPython/epcon,artcz/epcon,artcz/epcon,artcz/epcon,artcz/epcon,EuroPython/epcon,EuroPython/epcon,artcz/epcon | conference/gmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom .utils import validator\n\n\nregex = (\n r'^[a-z]+://([^/:]+{tld}|([0-9]{{1,3}}\\.)'\n r'{{3}}[0-9]{{1,3}})(:[0-9]+)?(\\/.*)?$'\n)\n\npattern_with_tld = re.compile(regex.format(tld=r'\\.[a-z]{2,10}'))\npattern_without_... | python | edit | 1 | 2 | mit | c82eaa445ddbe39f4142de7f51f0d19437a1aef0 | kvesteri/validators | validators/url.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom neo.rawio.nixrawio import NIXRawIO\nfrom neo.rawio.tests.common_rawio_test import BaseTestRawIO\n\n\ntestfname = \"neoraw.nix\"\n\nclass TestNixRawIO(BaseTestRawIO, unittest.TestCase, ):\n rawioclass = NIXRawIO\n ... | python | edit | 1 | 0 | bsd-3-clause | 92e7164cf152700c4ae60013bfbb9536e425a64c | NeuralEnsemble/python-neo,INM-6/python-neo,JuliaSprenger/python-neo,apdavison/python-neo,rgerkin/python-neo,samuelgarcia/python-neo | neo/rawio/tests/test_nixrawio.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom django.contrib import admin\nfrom .models import Report\n\nclass ReportAdmin(admin.ModelAdmin):\n list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')\n list_filt... | python | edit | 1 | 0 | mit | 1d4d317c826cd8528dfafd4ae47d006c1e8bb673 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | reports/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport argparse\n\ndef run():\n \"\"\" Reuse the Procfile to start the dev server \"\"\"\n with open(\"Procfile\", \"r\") as f:\n command = f.read().strip()\n\n command = command.replace(\"w... | python | edit | 1 | 3 | mit | 9bc7d09e9abf79f6af7f7fd3cdddbfacd91ba9d3 | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom classytags.helpers import InclusionTag\nfrom django import template\nfrom django.template.loader import render_to_string\n\n\nregister = template.Library()\n\n\nclass CookielawBanner(InclusionTag):\n \"\"\"\n Displays cookie law ... | python | edit | 1 | 2 | bsd-2-clause | b2e0b2047fa686fd716ba22dcec536b79f6fea41 | juan-cb/django-cookie-law,juan-cb/django-cookie-law,juan-cb/django-cookie-law,APSL/django-cookie-law,APSL/django-cookie-law,APSL/django-cookie-law | cookielaw/templatetags/cookielaw_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .settings import *\n\nimport dj_database_url\nDATABASES['default'] = dj_database_url.config()\n\n# Enable Connection Pooling\nDATABASES['default']['ENGINE'] = 'django_postgrespool'\n\n\n# Static files (CSS, JavaScript, Images)\n# http... | python | edit | 6 | 0 | bsd-2-clause | 25e06c0f9bb44af3cdbda5e5d9632c85cb59f0df | shearichard/polls17 | mysite/mysite/settings_heroku.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport json\nimport requests\nfrom string import Template\n\nimport dateutil.parser\n\ndef posts_at_url(url):\n \n current_page = 1\n max_page = sys.maxint\n\n while current_page <= max_page:\n\n resp = reques... | python | edit | 3 | 4 | cc0-1.0 | f1359fb6b8117a00afd833765646f03650df6a54 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | _lib/wordpress_post_processor.py | rejected_duplicate | Near-duplicate of sample 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport contextlib\n\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\nfrom rest_framework.test import APIClient\nfrom rest_framework_simplejwt.settings import api_set... | python | edit | 1 | 3 | mit | 5b702de914f55ee936292576394b2ea06ad15680 | davesque/django-rest-framework-simplejwt,davesque/django-rest-framework-simplejwt | tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Testing the functions in typhon.arts.\n\"\"\"\nimport shutil\n\nimport pytest\n\nfrom typhon import arts\n\n\nclass TestPlots:\n \"\"\"Testing the plot functions.\"\"\"\n @pytest.mark.skipif(not shutil.w... | python | edit | 1 | 1 | mit | 9dd503c8d92518f9af4c599473626b98e56393e2 | atmtools/typhon,atmtools/typhon | typhon/tests/arts/test_arts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\nfrom multiprocessing import Process\n\n\n@contextmanager\ndef terminate_process(process):\n try:\n yield\n finally:\n if process.is_alive():\n process.terminate()\n\n\n@c... | python | edit | 1 | 3 | apache-2.0 | 230664f9bbeae88ef640758d150bc5691af23e42 | tswicegood/steinie,tswicegood/steinie | tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django import forms\nfrom django.db.models import Q\nfrom django.contrib.auth.models import Group\n\nfrom admin.common_auth.models import AdminProfile\n\n\nclass LoginForm(forms.Form):\n ema... | python | edit | 1 | 0 | apache-2.0 | 1a6fa386de1c65edfdef695119b69dc124ac27fe | erinspace/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,acshi/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,erinspace/osf.io,mfraezz/osf.io,felliott/osf.io,caseyrollins/osf.io,monikagrabowska/osf.io,hm... | admin/common_auth/forms.py | rejected_duplicate | Near-duplicate of sample 3296 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect\nfrom django.conf import settings\nfrom django.contrib import auth\nfrom django.template import RequestContext\nfrom django.shortcuts import render_to_response, get_object_or_404\nfrom django.con... | python | edit | 1 | 3 | bsd-3-clause | d8a85c42079ceda2be4ec8283c4163812529bcef | lamby/django-debug-toolbar-user-panel,playfire/django-debug-toolbar-user-panel,lamby/django-debug-toolbar-user-panel | debug_toolbar_user_panel/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add connect_to_region/region functions for beanstalk"
},
{
"role": "assistant",
"content": "# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved\n#\n# Permission is hereby granted, free of charge, to any ... | python | new_file | 1 | 3 | mit | b7d16c4ae05d180327ae0b2ed020d64f91edf29e | cyclecomputing/boto,Timus1712/boto,campenberger/boto,rjschwei/boto,clouddocx/boto,shipci/boto,drbild/boto,appneta/boto,weka-io/boto,s0enke/boto,j-carl/boto,jamesls/boto,SaranyaKarthikeyan/boto,stevenbrichards/boto,jameslegg/boto,yangchaogit/boto,andresriancho/boto,trademob/boto,felix-d/boto,shaunbrady/boto,nexusz99/bot... | boto/beanstalk/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nimport uuid\n\n\ndef test_if_default_systctls_are_set(dcos_api_session):\n \"\"\"This test verifies that default sysctls are set for tasks.\n\n We use a `mesos-execute` to check for the values to make sure any task ... | python | edit | 1 | 1 | apache-2.0 | f76c1adc3081877d28a656e54eb32c1dcfc2cdb2 | mnaboka/dcos,mesosphere-mergebot/mergebot-test-dcos,mesosphere-mergebot/dcos,GoelDeepak/dcos,amitaekbote/dcos,kensipe/dcos,lingmann/dcos,surdy/dcos,dcos/dcos,BenWhitehead/dcos,darkonie/dcos,lingmann/dcos,jeid64/dcos,BenWhitehead/dcos,GoelDeepak/dcos,darkonie/dcos,lingmann/dcos,amitaekbote/dcos,jeid64/dcos,mnaboka/dcos,... | packages/dcos-integration-test/extra/test_sysctl.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_script import Manager\nimport mockserver\nfrom mockserver.database import database\nimport json\nimport codecs\nimport os\n\n\nmanager = Manager(mockserver.get_app())\n\n\n@manager.command\ndef init():\n if os.path.exists(mock... | python | edit | 1 | 3 | apache-2.0 | 09618bd6cdef2025ea02a999a869c9c6a0560989 | IfengAutomation/mockserver,IfengAutomation/mockserver,IfengAutomation/mockserver | mockserver/manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# The client of DDuplicated tool.\nfrom os import path as opath, getcwd\nfrom sys import argv\n\nfrom dduplicated import commands\n\ndef getPaths(params):\n\tpaths = []\n\tfor param in params:\n\t\tpath = opath.join(getcwd(), param)\n\t\tif... | python | edit | 1 | 7 | mit | 4d3753b7bd4ec37b7b8fde4eeab627bf96f8d12f | messiasthi/dduplicated-cli | dduplicated/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logsupport\nfrom logsupport import ConsoleWarning\n\nHelperThreads = {}\n\nclass ThreadItem(object):\n\tdef __init__(self, name, start, restart):\n\t\tself.name = name\n\t\tself.StartThread = start\n\t\tself.RestartThread = restart\n... | python | edit | 1 | 3 | apache-2.0 | c1343c392a45d2069b893841f82bf426462bef55 | kevinkahn/softconsole,kevinkahn/softconsole | threadmanager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nclass Node(object):\n def __init__(self, value=None, next_node=None):\n self.value = value\n self.next_node = next_node\n\n\nclass Stack(object):\n def __init__(self, head=None):\n self.head = head\n\n def pu... | python | edit | 2 | 3 | mit | 03a286a27e496da78efbed0ca4e4557ee4121e5c | MikeDelaney/CodeEval | stack/stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nGrab worker configuration from GCloud instance attributes.\n\"\"\"\nimport json\nimport requests\n\n\nMANAGER_URL_METADATA_URL = \"http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url\"\nSECRET_F... | python | edit | 1 | 0 | mit | 799e79b03a753e5e8ba09a436e325e304a1148d6 | lanyudhy/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,Halit... | apiserver/worker/grab_config.py | rejected_duplicate | Near-duplicate of sample 16215 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom hestia.tz_utils import now\n\nfrom kubernetes import watch\n\nfrom ocular.processor import get_pod_state\n\nlogger = logging.getLogger('ocular')\n\n\ndef monitor(k8s_api, namespace, container_names, label_selector=Non... | python | edit | 1 | 3 | apache-2.0 | eae7ea91cf3c9d2e72813d04536f113ac8fa4393 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ocular/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom werkzeug.middleware.proxy_fix import ProxyFix\n\nfrom .webauth import apply_webauth_blueprint\nfrom .webhooks import apply_webhooks_blueprint\nfrom .webapi import apply_webapi_blueprint\nfrom .webcoverage impor... | python | edit | 1 | 0 | isc | e207cab76b797418e75a0a96613e3ced3157aba4 | openaddresses/machine,openaddresses/machine,openaddresses/machine | openaddr/ci/web.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\n\nfrom .history import clone\nfrom . import config\n\n\ndef validate_remote(ctx, param, value):\n if value:\n try:\n remote, branch = value.split('/')\n return (remote, branch)\n except V... | python | edit | 1 | 7 | mit | bb70a61434f297bdcf30ccc7b95131be75c1f13b | marcwebbie/passpie,scorphus/passpie,marcwebbie/passpie,scorphus/passpie | passpie/validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\nfrom scrapi.linter.document import NormalizedDocument, RawDocument\n\nfrom scrapi.processing.postgres import PostgresProcessor, Document\n\nfr... | python | edit | 1 | 1 | apache-2.0 | 3ec857dd32330ad2321a471c05c13dad3ee5b58e | erinspace/scrapi,mehanig/scrapi,fabianvf/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,mehanig/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi | tests/test_postgres_processor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport time\n\nfrom copy import copy\nfrom datetime import datetime\nfrom eve.utils import config\nfrom py2neo import Node\n\n\ndef node_to_dict(node):\n node = dict(node)\n if config.DATE_CREATED in node:\n ... | python | edit | 1 | 3 | mit | 65bb7bc1c7e10756a3e172bfe0bf0cc64d03e178 | Abraxas-Biosystems/eve-neo4j,Grupo-Abraxas/eve-neo4j | eve_neo4j/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom accelerator_abstract.models.base_user_utils import is_employee\nfrom impact.permissions import (\n settings,\n BasePermission)\n\n\nclass V1APIPermissions(BasePermission):\n authenticated_users_only = True\n\n def has_permi... | python | edit | 1 | 3 | mit | 36675bf7be5b22f34205b8c1ff22175a4828962f | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | web/impact/impact/permissions/v1_api_permissions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Package tools for reading TRMM data.\n\n\"\"\"\n\ntry:\n from __dev_version import version as __version__\n from __dev_version import git_revision as __git_revision__\nexcept ImportError:\n from __version import version as __... | python | edit | 5 | 0 | bsd-3-clause | 03dcdca0f51ca40a2e3fee6da3182197d69de21d | sahg/pytrmm | pytrmm/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n#\n# Copyright 2014 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 1 | apache-2.0 | 841235452d92ea4e40853c8df51568e01b39dba8 | mbrukman/stackexchange-answers,mbrukman/stackexchange-answers | stackoverflow/21180496/except.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.conf.urls import url\n\nfrom . import views\n\n\nurlpatterns = [\n # Entry List\n url(\n '^$',\n views.EntryListView.as_view(),\n name='entry_list'\n ),\n url(\n '... | python | edit | 1 | 0 | mit | e664c5ec6bb90f65ab159fdf332c06d4bd0f42e2 | TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio | td_biblio/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.conf import settings\nfrom django.contrib import admin\n\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n (r'^admin/', include(admin.site.urls)),\n url(r'^admin_tools/', includ... | python | edit | 1 | 0 | mit | cc3b82a943baf42f78b131d3218ad5eb748a11ce | husbas/django-admin-tools,husbas/django-admin-tools,husbas/django-admin-tools | test_proj/urls.py | rejected_duplicate | Near-duplicate of sample 14408 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Pyflation - Cosmological simulations in Python\nAuthor: Ian Huston\n\nPyflation is a python package to simulate cosmological perturbations in the early universe.\nUsing the Klein-Gordon equations for both first and second order pertu... | python | edit | 1 | 0 | bsd-3-clause | 8f2fcb6f377c93e36612bd815fe810afba56e355 | ihuston/pyflation,ihuston/pyflation | pyflation/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nimport sys, os\n\n\n\"\"\"\nRSqueak Build Options (separated with `--` from RPython options)\n\nExample:\n .build/build.py -Ojit -- --64bit\n\n --64bit - Compile for 64bit pl... | python | edit | 3 | 0 | bsd-3-clause | 446eab8e384e28e6d679233ae0ae13dabaddb77d | HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak | .build/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom splinter import Browser\n\n\nclass TestBaseViews(TestCase):\n\n def setUp(self):\n self.browser = Browser('chrome')\n\n def tearDown(self):\n self.browser.quit()\n\n def test_hom... | python | edit | 1 | 1 | mit | e23190cb42bc64f9f381f05e24849174af3e9ff5 | tosp/djangoTemplate,tosp/djangoTemplate | base/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\n\nclass PublishableAdmin(admin.ModelAdmin):\n \"\"\"\n Overrides standard admin.ModelAdmin save_model method\n It sets user (author) based on data ... | python | edit | 1 | 2 | mit | cb9933852e0f8c46081f084ea1f365873582daf8 | YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps | opps/core/admin.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.