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\nfrom rest_framework import viewsets\n\nfrom .models import Farmer\nfrom .serializers import FarmerSerializer\n\n\nclass FarmerViewSet(viewsets.ReadOnlyModelViewSet):\n queryset = Farmer.objects.all()\n serializer_class = FarmerSeriali...
python
edit
1
0
bsd-2-clause
5d7f2f84600abcede94a0aaee087ef299cf740a6
tm-kn/farmers-api
farmers_api/farmers/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nimport sdv\n\nproject = u'stix-validator'\ncopyright = u'2015, The MITRE Corporation'\nversion = sdv.__version__\nrelease = version\n\nextensions = [\n 'sphinx.ext.autodoc',\n 'sphinxcontrib.napoleon',\n]\n\ntemplates_pat...
python
edit
1
0
bsd-3-clause
d7c5001f2109b7e97fbb5f8f82282f8187683365
pombredanne/stix-validator,STIXProject/stix-validator
docs/conf.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nfrom glob import glob\n\n# -------------------------------------------------------------------------\n# Configure extensions\n\nextensions = [\n 'sphinx.ext.autodoc',\n]\n\n# ------------...
python
edit
4
1
apache-2.0
fd76a19b399bb52dc2cd69fda9bbfed912c8a407
t4ngo/sphinxcontrib-traceables
docs/conf.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\n\n# Attach Python Cloud Debugger\nif __name__ == \"__main__\":\n #import warnings\n #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\\.path', append=True)\n\...
python
edit
1
0
mit
af6f4868f4329fec75e43fe0cdcd1a7665c5238a
DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation
contentcuration/manage.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\n\n\nextensions = []\ntemplates_path = []\nsource_suffix = \".rst\"\nmaster_doc = \"index\"\nproject = \"django-user-accounts\"\ncopyright_holder = \"James Tauber and contribu...
python
edit
1
0
mit
8581d3bb9a0066b872dc8daddfde070fdcda7b89
jmburbach/django-user-accounts,mysociety/django-user-accounts,jpotterm/django-user-accounts,mgpyh/django-user-accounts,GeoNode/geonode-user-accounts,mentholi/django-user-accounts,ntucker/django-user-accounts,pinax/django-user-accounts,osmfj/django-user-accounts,pinax/django-user-accounts,jawed123/django-user-accounts,j...
docs/conf.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, unicode_literals\n\n\nfrom flask import Flask\n\nfrom .middleware.me import me\nfrom .cache import cache\n\n\ndef _register_module(app, module):\n ...
python
edit
1
2
mit
bd5c215c1c481f3811753412bca6b509bb00591a
lord63/me-api
me_api/app.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport socket\nfrom unittest import TestCase\n\ntry:\n from unitetest import mock\nexcept ImportError:\n import mock\n\nfrom routeros_api import api_socket\n\nclass TestSocketWrapper(TestCase):\n def test_socket(self):\n inn...
python
edit
1
1
mit
5c3863fdb366f857fb25b88c2e47508f23660cf3
kramarz/RouterOS-api,socialwifi/RouterOS-api,pozytywnie/RouterOS-api
tests/test_socket.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport tempfile\nimport shutil\nimport tzlocal\nimport pytest\nfrom ..mongoquery.mds import MDS\n\n\n@pytest.fixture(params=[1], scope='function')\ndef mds_all(request):\n '''Provide a function level scoped FileStore instance ...
python
edit
1
2
bsd-3-clause
881e693d16d12109c3ececffda61336b020c172a
ericdill/databroker,ericdill/databroker
portable_mds/tests/conftest.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\" Auxiliary functions for models \"\"\"\n\n\ndef unpack_args(args, layer_no, layers_max):\n \"\"\" Return layer parameters \"\"\"\n new_args = {}\n for arg in args:\n if isinstance(args[arg], list) and layers_max > 1:\n...
python
edit
1
7
apache-2.0
dd0cef83edbd3849484b7fc0ec5cb6372f99bb3a
analysiscenter/dataset
batchflow/models/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nAn example client. Run simpleserv.py first before running this.\n\"\"\"\n\nimport json\n\nfrom twisted.internet import reactor, protocol\n\n\n# a client protocol\n\nclass EchoClient(protocol.Protocol):\n \"\"\"Once connected, sen...
python
edit
5
1
mit
208f90497c7a6867f9aeece84b1161926ca1627b
ryansb/netHUD
nethud/nh_client.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom gevent.wsgi import WSGIServer\nimport werkzeug.serving\nfrom werkzeug.debug import DebuggedApplication\nfrom app import get_app\n\nAPP_PORT = 5000\nDEBUG = True\n\n\n@werkzeug.serving.run_with_reloader\ndef main(...
python
edit
1
1
mit
6699526ab04684ca9af3f6eb0f5361221e46e195
bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje
src/purkinje/purkinje.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nversion = '1.3.0'\nmilestone = 'Chami'\nrelease_number = '5'\nprojectURL = 'http://syncplay.pl/'\n\n```\n\nApply this change: Move up to release 6 (1.3.0 Beta 3b)" }, { "role": "assistant", "content": "version = '1.3.0'\nmilesto...
python
edit
1
0
apache-2.0
431b8db027ce016a957a744ed38f833031e93070
NeverDecaf/syncplay,alby128/syncplay,alby128/syncplay,Syncplay/syncplay,NeverDecaf/syncplay,Syncplay/syncplay
syncplay/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom fabtastic.db import util\n\ndb_engine = util.get_db_setting('ENGINE')\n\nif 'postgresql_psycopg2' in db_engine:\n from fabtastic.db.postgres import *\nelse:\n raise NotImplementedError(\"Fabtasti...
python
edit
4
0
bsd-3-clause
83dabc9fc1142e1575843d3a68c6241185543936
duointeractive/django-fabtastic
fabtastic/db/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport inspect\n\n# find the current absolute path using inspect\n_pwd = os.path.dirname(\n os.path.abspath(\n inspect.getfile(\n inspect.currentframe())))\n\n\ndef get_resource(name, decode=True):\n \"\"\...
python
edit
1
3
mit
acf3819d433f3ebc3d3eed17c61f2542f7429f8e
mikedh/trimesh,mikedh/trimesh,dajusc/trimesh,mikedh/trimesh,mikedh/trimesh,dajusc/trimesh
trimesh/resources/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom decouple import config\n\nfrom .base import BaseCeleryConfig\n\n\nclass CeleryProduction(BaseCeleryConfig):\n enable_utc = config('CELERY_ENABLE_UTC', default=True, cast=bool)\n broker_url = config('CELERY_BROKER_URL')\n resul...
python
edit
1
0
mit
fc70feec85f0b22ebef05b0fa1316214a48a465a
RaitoBezarius/ryuzu-fb-bot
background/config/prod.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport requests\nfrom babel import Locale\n\nclass JustWatch:\n\tdef __init__(self, country='AU', **kwargs):\n\t\tself.kwargs = kwargs\n\t\tself.country = country\n\t\tself.language = Locale.parse('und_{}'.format(self.country)).language\n\t...
python
edit
1
4
mit
61448043a039543c38c5ca7b9828792cfc8afbb8
dawoudt/JustWatchAPI
justwatch/justwatchapi.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom mongoengine import Document, DateTimeField, EmailField, IntField, \\\n ReferenceField, StringField\nimport datetime, enum\n\nclass Priority(enum.IntEnum):\n LOW = 0,\n MIDDLE = 1,\n HIGH = 2\n\n\"\"\"\nThis defines the bas...
python
edit
6
0
mit
36b8ec51dc6e1caca90db41d83d4dc21d70005a5
Zillolo/lazy-todo
app/task.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#\n# See top-level LICENSE.rst file for Copyright information\n#\n# -*- coding: utf-8 -*-\n\"\"\"\ndesispec.io\n===========\n\nTools for data and metadata I/O.\n\"\"\"\n\n# help with 2to3 support\nfrom __future__ import absolute_import, div...
python
edit
47
0
bsd-3-clause
828fec30b5b1deddcca79eae8fd1029bd5bd7b54
desihub/desispec,gdhungana/desispec,timahutchinson/desispec,gdhungana/desispec,desihub/desispec,timahutchinson/desispec
py/desispec/io/__init__.py
rejected_lint
Too many lint violations: 47
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport random\nimport string\nfrom datetime import date, datetime\n\n\ndef random_name():\n return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)])\n\n\ndef json_serial(obj):\n \"\"\"JSON ...
python
edit
1
2
mit
c3ead28e278e2b4e3d44071fb891fa54de46b237
gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list
shopping_app/utils/helpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pygametemplate import Game\nfrom example_view import ExampleView\n\n\nclass TestGame(Game):\n \"\"\"An altered Game class for testing purposes.\"\"\"\n def __init__(self, StartingView, resolution):\n super(TestGame, self)....
python
edit
1
1
mit
9fda3df6ae1f31af139c03eaf8b385746816f3b4
AndyDeany/pygame-template
spec/helper.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom subprocess import call, check_output\nimport sys\nfrom shutil import copy2\n\nplatform = sys.platform\n\n\ndef checkAndInstall():\n try:\n check_output('pandoc -v'.split())\n except OSError:\n cudir = os....
python
edit
3
3
bsd-3-clause
4b578fb7683054727444f1ed5c2a7d9732a3d8e9
jr-garcia/AssimpCy,jr-garcia/AssimpCy
ci_scripts/installPandoc.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom . import lattice as _lattice\nfrom . import accelerator as _accelerator\nfrom . import record_names\n\ncreate_accelerator = accelerator.create_accelerator\n\n# -- default accelerator values for LI_V00 --\n\nenergy = _lattice._energy\ns...
python
edit
5
0
mit
14bd2c0732b5871ac43991a237a8f12a334e982d
lnls-fac/sirius
sirius/LI_V00/__init__.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pelicanconf import *\n\n# Over-ride so there is paging.\nDEFAULT_PAGINATION = 5\n\n```\n\nApply this change: Fix Python import path on Travis." }, { "role": "assistant", "content": "import sys\n# Hack for Travis, where loca...
python
edit
2
0
apache-2.0
10b9d412c26b90bb86fe1abd04c3fe0f86826104
dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog
pelicanconf_with_pagination.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pupa.scrape import Event\nfrom .base import OpenstatesBaseScraper\nimport dateutil.parser\n\ndparse = lambda x: dateutil.parser.parse(x) if x else None\n\n\n\nclass OpenstatesEventScraper(OpenstatesBaseScraper):\n\n def scrape(self)...
python
edit
1
5
bsd-3-clause
7b66af8bea8e6c25e3c2f88efc22875504e8f87a
openstates/billy,sunlightlabs/billy,sunlightlabs/billy,openstates/billy,sunlightlabs/billy,openstates/billy
openstates/events.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Console outputs a person list\n\nimport os\nimport csv\n\nwith open('tmp/person_list_input.csv') as csvfile:\n csvreader = csv.reader(csvfile)\n for row in csvreader:\n print \"\"\" - role: {}\n name: {}\"\"\".format(row[...
python
edit
3
0
mit
fc904d8fd02cecfb2c3d69d6101caaab7b224e93
johnathan99j/history-project,johnathan99j/history-project,newtheatre/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project
_bin/person_list_generator.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\"\"\"\n tests.stonemason.service.tileserver.test_tileserver\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Test interfaces of the tile server application.\n\n\"\"\"\n\nimport os\nimport unitte...
python
edit
1
1
mit
a509cd74d1e49dd9f9585b8e4c43e88aaf2bc19d
Kotaimen/stonemason,Kotaimen/stonemason
tests/stonemason/service/tileserver/test_tileserver.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom webtest import TestApp\nimport dropshot\n\ndef test_create_player():\n app = TestApp(dropshot.app)\n params = {'username': 'chapmang',\n 'password': 'deadparrot',\n 'email': '<EMAIL>'}\n\n app.post('/...
python
edit
1
1
mit
05d498cc1f216ba722ce887b212ac5e750fb0c8d
dropshot/dropshot-server
tests/test_player_creation.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Test redefinition of colors.\"\"\"\n\nimport colorise\nimport pytest\n\n\n@pytest.mark.skip_on_windows\ndef test_redefine_colors_error():\n with pytest.raises(colorise.error.NotSupp...
python
edit
1
1
bsd-3-clause
caf4c29bada9d5b819d028469424ec195ffbc144
MisanthropicBit/colorise
tests/test_redefine_colors.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef map_range(x, in_min, in_max, out_min, out_max):\n out_delta = out_max - out_min\n in_delta = in_max - in_min\n\n return (x - in_min) * out_delta / in_delta + out_min\n\n```\n\nApply this change: Add function for linear interpol...
python
edit
1
1
bsd-3-clause
a4eb952cc2e583d3b7786f5dea101d1e013c8159
gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2
services/controllers/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Helper to output stuff\"\"\"\n\nfrom tabulate import tabulate\n\n\ndef print_list(header, entries):\n \"\"\"Prints out a list\"\"\"\n print(tabulate(entries, header, tablefmt=\"grid\"))\n\n\ndef std_input(text, default):\n \"...
python
edit
1
2
mit
251a0d1b1df0fd857a86878ecb7e4c6bc26a93ef
tradebyte/paci,tradebyte/paci
paci/helpers/display_helper.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License:...
python
edit
3
0
apache-2.0
650e0497c99500810f0fd1fc205e975892b26ff2
stoeps13/ibmcnx2,stoeps13/ibmcnx2
ibmcnx/doc/DataSources.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom BlinkyTape import BlinkyTape\n\nbb = BlinkyTape('/dev/tty.usbmodemfa131')\n\nwhile True:\n\n for x in range(60):\n bb.sendPixel(10, 10, 10)\n bb.show()\n\n for x in range(60):\n bb.sendPixel(0, 0, 0)\n bb.show...
python
edit
1
0
mit
2410255e846c5fbd756ed97868299e1674c89467
Blinkinlabs/BlinkyTape_Python,jpsingleton/BlinkyTape_Python,railsagainstignorance/blinkytape
flash_example.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import url, patterns, include\n\nfrom . import views\n\n\nurlpatterns = patterns(\n '',\n url(r'^$', views.DonateListView.as_view(), name='donate'),\n url(r'^contribute/$', views.DonateCreateView.as_view(), na...
python
edit
3
0
mit
e7e21188daba6efe02d44c2cef9c1b48c45c0636
mhils/readthedocs.org,wijerasa/readthedocs.org,davidfischer/readthedocs.org,atsuyim/readthedocs.org,CedarLogic/readthedocs.org,istresearch/readthedocs.org,wanghaven/readthedocs.org,atsuyim/readthedocs.org,CedarLogic/readthedocs.org,hach-que/readthedocs.org,mhils/readthedocs.org,kenwang76/readthedocs.org,kenwang76/readt...
readthedocs/donate/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\n\nfrom . import TestCase\n\n\nclass MetricsTests(TestCase):\n def test_find(self):\n url = '/metrics/find'\n\n response = self.app.get(url)\n self.assertEqual(response.status_code, 400)\n\n respon...
python
edit
1
1
apache-2.0
186a72b91798b11d13ea7f2538141f620b0787a8
vladimir-smirnov-sociomantic/graphite-api,michaelrice/graphite-api,GeorgeJahad/graphite-api,vladimir-smirnov-sociomantic/graphite-api,michaelrice/graphite-api,alphapigger/graphite-api,raintank/graphite-api,hubrick/graphite-api,rackerlabs/graphite-api,Knewton/graphite-api,raintank/graphite-api,Knewton/graphite-api,bogus...
tests/test_metrics.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport sys\n\nclass SentryHandler(logging.Handler):\n def emit(self, record):\n from sentry.client.models import get_client\n from sentry.client.middleware import SentryLogMiddleware\n\n # Fetch the r...
python
edit
5
3
bsd-3-clause
9f345963d1c8dc25818d2cf6716d40e6c90cb615
pauloschilling/sentry,ngonzalvez/sentry,gencer/sentry,camilonova/sentry,NickPresta/sentry,Natim/sentry,dbravender/raven-python,fuziontech/sentry,korealerts1/sentry,jmagnusson/raven-python,imankulov/sentry,felixbuenemann/sentry,songyi199111/sentry,jokey2k/sentry,SilentCircle/sentry,zenefits/sentry,jean/sentry,jbarbuto/r...
sentry/client/handlers.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\ndef str_to_num(i, exact_match=True):\n \"\"\"\n Attempts to convert a str to either an int or float\n \"\"\"\n # TODO: Cleanup -- this is really ugly\n if not isinstance(i, str):\n return i\n...
python
edit
1
6
mit
312a742e31fb33b43a946da0016db201ca809799
rtluckie/seria
seria/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport ast\n\n\nEXCEPTION_TYPE_PREFIX = \"<class 'webfaction_api.exceptions.\"\nEXCEPTION_TYPE_SUFFIX = \"'>\"\n\n\ndef _parse_exc_type(exc_type):\n # This is horribly hacky, but there's not a particularly elegant\n # way to go from t...
python
edit
1
4
bsd-3-clause
a3df62c7da4aa29ab9977a0307e0634fd43e37e8
dominicrodger/pywebfaction,dominicrodger/pywebfaction
pywebfaction/exceptions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom web_ui import app\nfrom flask import session\nfrom datetime import datetime\n\n\n# For calculating scores\nepoch = datetime.utcfromtimestamp(0)\nepoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000\n\n\ndef score(star_o...
python
edit
1
4
apache-2.0
d150db290a72590e0f7cf9dae485bf98901bb2c2
ciex/souma,ciex/souma,ciex/souma
web_ui/helpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom nose2 import config\nfrom nose2.compat import unittest\n\n\nclass TestConfigSession(unittest.TestCase):\n def test_can_create_session(self):\n config.Session()\n\n\nclass TestConfig(unittest.TestCase):\n def setUp(self):\n...
python
edit
2
1
bsd-2-clause
19d99f6040d1474feee0f2fb0bda7cb14fbf407c
ojengwa/nose2,little-dude/nose2,leth/nose2,leth/nose2,ptthiem/nose2,ptthiem/nose2,ezigman/nose2,ojengwa/nose2,ezigman/nose2,little-dude/nose2
nose2/tests/unit/test_config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nscripts = ['sed_fit', 'sed_plot', 'sed_filter_output', 'sed_fitinfo2data', 'sed_fitinfo2ascii']\n\nsetup(name='sedfitter',\n version='0.1.1',\n description='SED Fitter i...
python
edit
1
0
bsd-2-clause
28ac2b259d89c168f1e822fe087c66f2f618321a
astrofrog/sedfitter
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ntry:\n from pysb_assembler import PysbAssembler\nexcept ImportError:\n pass\ntry:\n from graph_assembler import GraphAssembler\nexcept ImportError:\n pass\ntry:\n from sif_assembler import SifAssembler\nexcept ImportError:\n ...
python
edit
8
0
bsd-2-clause
310cebbe1f4a4d92c8f181d7e4de9cc4f75a14dc
johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,bgyori/indra,jmuhlich/indra,pvtodorov/indra,sorgerlab/indra,jmuhlich/indra,johnbachman/belpy,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,sorgerlab/belpy,johnbachman/belpy,jmuhlich/ind...
indra/assemblers/__init__.py
rejected_lint
Too many lint violations: 8
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n'''\nCopyright (c) 2016 anti-XSS developers\n'''\n\nimport sys\n\nfrom lib.core.link import Link\nfrom optparse import OptionParser\nfrom lib.core.engine import getPage\nfrom lib.core.engine import getScript\nfrom l...
python
edit
6
3
mit
6b3f568a6615e9439fc0df0eac68838b6cbda0d9
lewangbtcc/anti-XSS,lewangbtcc/anti-XSS
anti-XSS.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport cPickle as pickle\n\ntry: DATA_DIR = os.path.dirname(os.path.realpath(__file__))\nexcept: DATA_DIR = os.getcwd()\n\n\ncache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name)\n\ndef get_cache(name):\n return ...
python
edit
1
1
mit
297f42a2013428c2f6caefdf83735cc4a528e225
bendmorris/tax_resolve
caching.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.conf import settings\nfrom cms.plugin_pool import plugin_pool\nfrom cms.plugin_base import CMSPluginBase\nfrom models import Table\nfrom djangocms_table.forms import Table...
python
edit
4
2
bsd-3-clause
785236ca766d832d859c2933389e23fd3d1bea20
freelancersunion/djangocms-table,freelancersunion/djangocms-table,freelancersunion/djangocms-table,divio/djangocms-table,divio/djangocms-table,divio/djangocms-table
djangocms_table/cms_plugins.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pysam\n\ndef test_idxstats_parse():\n bam_filename = \"./pysam_data/ex2.bam\"\n lines = pysam.idxstats(bam_filename)\n for line in lines:\n _seqname, _seqlen, nmapped, _nunmapped = line.split()\n\ndef test_bedcov():\n...
python
edit
1
2
mit
6d2f9bfbe1011c04e014016171d98fef1d12e840
pysam-developers/pysam,kyleabeauchamp/pysam,pysam-developers/pysam,TyberiusPrime/pysam,bioinformed/pysam,TyberiusPrime/pysam,bioinformed/pysam,TyberiusPrime/pysam,pysam-developers/pysam,bioinformed/pysam,kyleabeauchamp/pysam,TyberiusPrime/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,pysam-develo...
tests/test_samtools_python.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# igcollect - Mysql Status\n#\n# Copyright (c) 2016, InnoGames GmbH\n#\n\nimport time\nimport socket\nimport MySQLdb\n\nhostname = socket.gethostname().replace(\".\", \"_\")\nnow = str(int(time.time()))\n\ndb = My...
python
edit
3
0
mit
d74e134ca63b7d3cd053d21168ca526a493999df
innogames/igcollect
mysql.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# TODO, figure out how to load gevent monkey patch cleanly in production\ntry:\n from gevent.monkey import patch_all\n patch_all()\nexcept ImportError:\n print \"unable to apply gevent monkey.patch_all\"\n\nimport os\n\nfrom werkze...
python
edit
1
0
mit
42f5b2c53474f20fbffbc0b8cdaa4e5b47a4751d
spacedogXYZ/email-validator,spacedogXYZ/email-validator,spacedogXYZ/email-validator
app/wsgi.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport mimetypes\n\nfrom django.http import HttpResponse, HttpResponseNotModified, Http404\nfrom django.contrib.staticfiles.views import serve as staticfiles_serve\nfrom django.views.static import was_modified_since, http_date\n\nfrom stati...
python
edit
1
4
mit
badba5070ac40a70de2be47b6d58afd0364ed7fe
davidelias/django-staticassets,davidelias/django-staticassets,davidelias/django-staticassets
staticassets/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\n ydf/yaml_ext\n ~~~~~~~~~~~~\n\n Contains extensions to existing YAML functionality.\n\"\"\"\n\nimport collections\n\nfrom ruamel import yaml\nfrom ruamel.yaml import resolver\n\n\n__all__ = ['load_all', 'load_all_gen']\n\n...
python
edit
3
1
apache-2.0
79e68ca4b377f479d7eb557879b3450134efaf16
ahawker/ydf
ydf/yaml_ext.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nimport marshal\nimport os.path\n\n\nif not hasattr(sys, 'implementation'):\n raise ImportError('Python 3.3 or newer is required')\n\nPY_TAG = sys.implementation.cache_tag\nPY_VERSION = sys.hexversion\n\nif PY_TAG is None:...
python
edit
2
0
mit
e3919de815594c73c35c265380c66ef14a51acbd
pyos/dg
__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render\nfrom django.core.urlresolvers import reverse\nfrom django.contrib.auth import authenticate, login as auth_login, logout as auth_logout\nfrom django.contrib.a...
python
edit
1
5
bsd-3-clause
40e96e99dc8538ae3b5e5a95d9c6d81ec656ad6c
losmiserables/djangodash2012,losmiserables/djangodash2012
dash2012/auth/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.core.exceptions import ObjectDoesNotExist\nfrom django.contrib.auth.backends import BaseBackend\nfrom django.contrib.auth.models import User\n\nfrom apps.user.models import ItsiUser, ConcordUser\n\n\ncla...
python
edit
1
3
apache-2.0
83ceca04758c6546c41d5bc7f96583d838f25e11
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
src/mmw/apps/user/backends.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nclass UnionFind(object):\n def __init__(self, n):\n self.p = [-1]*n\n self.leaders = set( i for i in range(n) )\n\n def find(self, x):\n if self.p[x] < 0:\n return x\n self.p[x] = self.find(sel...
python
edit
1
3
bsd-3-clause
2b2e0b180393af779c7d303a1a3162febe098639
PermutaTriangle/Permuta
permuta/misc/union_find.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom urllib.request import urlopen\n\n\ndef fetch_words():\n with urlopen('http://sixty-north.com/c/t.txt') as story:\n story_words = []\n word_list = ''\n for line in story:\n line_words = line.decode('ut...
python
edit
1
6
mit
2c0ff93e3ef5e6914a85e4fc3443f0432337854e
kentoj/python-fundamentals
text_processor.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport inspect\nimport sys\nif sys.version_info[0] == 2:\n from .python2 import httplib2\nelse:\n from .python3 import httplib2\nglobals().update(inspect.getmembers(httplib2))\n\n```\n\nApply this change: Rewrite python version depend...
python
edit
3
0
mit
5a8788222d9a5765bf66a2c93eed25ca7879c856
jayvdb/httplib2,wikimedia/pywikibot-externals-httplib2,jayvdb/httplib2,wikimedia/pywikibot-externals-httplib2
__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Functions for converting and comparing colors.\"\"\"\n\nimport colorsys\nimport math\nimport operator\n\n\ndef hls_to_rgb(hue, lightness, saturation):\n \"\"\"Convert HLS (hue, ligh...
python
edit
1
2
bsd-3-clause
d1edcb2f59d96168e94ec748633221a2d5f95b99
MisanthropicBit/colorise
colorise/color_tools.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom subprocess import call, check_output\nimport sys\nimport os\n\nisPython3 = sys.version_info.major == 3\n\n# https://stackoverflow.com/a/3357357\ncommand = 'git log --format=%B -n 1'.split()\nout = check_output(command)\n\nif b'build wh...
python
edit
1
0
bsd-3-clause
6dfd6a4ae687dc9c7567c74a6c3ef3bd0f9dc5a1
jr-garcia/AssimpCy,jr-garcia/AssimpCy
ci_scripts/buildLinuxWheels.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for classicalguitar 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.7/howto/deployment/wsgi/\n\"\"...
python
edit
1
0
bsd-3-clause
48ffd37eb826edb78750652628145a924053b204
chrisguitarguy/GuitarSocieties.org,chrisguitarguy/GuitarSocieties.org
website/wsgi.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport collections\nimport os\nimport site\nimport sys\nfrom distutils.sysconfig import get_python_lib\n\nSITE_PACKAGES_PATHS = set()\nif hasattr(site, 'getsitepackages'):\n SITE_PACKAGES_PATHS.update(site.getsitepackages())\nif hasattr(...
python
edit
1
0
bsd-2-clause
34031f2b16303bcff69a7b52ec3e85ce35103c96
ionelmc/python-hunter
src/hunter/const.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass Lattice(object):\n\n def __init__(self, name):\n self.name = name\n self._elements = []\n\n def __getitem__(self, i):\n return self._elements[i]\n\n def __len__(self):\n ''' Get the number of eleme...
python
edit
1
4
apache-2.0
9d8e3b650d02537c0693a2a5ebe4b17ce1be24ae
willrogers/pml,willrogers/pml,razvanvasile/RML
rml/lattice.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pathlib\n\nfrom mopidy import config, ext\n\n__version__ = \"1.2.1\"\n\n\nclass Extension(ext.Extension):\n\n dist_name = \"Mopidy-Scrobbler\"\n ext_name = \"scrobbler\"\n version = __version__\n\n def get_default_config(...
python
edit
1
1
apache-2.0
0830f131b50d9679e6b2097febc7913bc09e5132
mopidy/mopidy-scrobbler
mopidy_scrobbler/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom IPython.display import Image\n\nimport boto\n\ndef parse_s3_uri(uri):\n if uri.startswith('s3://'):\n uri = uri[5:]\n\n return uri.split('/', 1)\n\n\ndef get_s3_key(uri):\n bucket_name, key_name = parse_s3_uri(uri)\n\n ...
python
edit
1
2
mit
b374221d8d0e902494066d666570c1a882c962bc
AustinRochford/s3img-ipython-magic,AustinRochford/s3img-ipython-magic
s3img_magic.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Move Feature_Type_Choices to toplevel name sapce" }, { "role": "assistant", "content": "from .features import Giraffe_Feature_Base\nfrom .features import Aligned_Feature\nfrom .features import Feature_Type_Choices\n" } ]
python
new_file
5
0
mit
f517442097b6ae12eb13b16f2fa6ca40a00b9998
benjiec/giraffe-features
__init__.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Blueprint, render_template, redirect, session, url_for\n\nfrom app.decorators import login_required\n\nblueprint = Blueprint('public', __name__)\n\n\n@blueprint.route('/')\ndef home():\n \"\"\"Return Home Page\"\"\"\n ...
python
edit
4
3
apache-2.0
23a88191e5d827dea84ad533853657110c94c840
ueg1990/customer-info,ueg1990/customer-info
app/public/views.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .sortedlist import *\nfrom .embeddedterminal import *\nfrom .aboutwindow import *\nfrom .fileselector import *\nfrom .tabbedbox import *\nfrom .StandardButton import *\nfrom .StandardPopup import *\nfrom .SearchableList import *\n\n```...
python
edit
10
0
bsd-3-clause
89fe38163426efe02da92974bac369538ab5532f
JeffHoogland/python-elm-extensions
elmextensions/__init__.py
rejected_lint
Too many lint violations: 10
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pathlib import Path\n\nimport pytest\nfrom sqlalchemy import create_engine\nfrom testcontainers import PostgresContainer as _PostgresContainer\n\ntests_dir = Path(__file__).parents[0].resolve()\ntest_schema_file = Path(tests_dir, 'data...
python
edit
1
1
mit
822afb73e35d4f1651ee44e974dcc51deaacb361
RazerM/pg_grant,RazerM/pg_grant
tests/conftest.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport uuid\n\nfrom django.core.exceptions import ValidationError\nfrom django.db import models\nfrom django.utils import six\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom psycop...
python
edit
1
4
bsd-3-clause
b457eac63690deba408c4b5bdc1db179347f43da
wlanslovenija/django-postgres
postgres/fields/uuid_field.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport random\nimport string\nimport sys\n\nfrom django.utils.crypto import get_random_string\n\n\n## Check if the script was already executed\nflag_filename = '/opt/graphite/post-setup-complete'\nif os.p...
python
edit
2
0
mit
bac71c099f0196d5ab74a8ec08cedc32ab008e1c
rvernica/Dockerfile,rvernica/docker-library,rvernica/docker-library
graphite/post-setup-graphite-web.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Create derived test data files if they do not exist when running nosetests" }, { "role": "assistant", "content": "import os\n\nDATADIR = os.path.abspath('docs/data')\nFILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk...
python
new_file
1
4
bsd-3-clause
a1583d181170302df72fc0a97e5db7f6300061b3
perrygeo/Fiona,rbuffat/Fiona,perrygeo/Fiona,johanvdw/Fiona,Toblerity/Fiona,rbuffat/Fiona,Toblerity/Fiona
tests/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nfrom xhtml2pdf.parser import pisaParser\nfrom xhtml2pdf.context import pisaContext\n\n_data = b\"\"\"\n<!doctype html>\n<html>\n<title>TITLE</title>\n<body>\nBODY\n</body>\n</html>\n\"\"\"\n\n\nclass TestCase(unittest.TestC...
python
edit
1
1
apache-2.0
3afe14ee6beb1a3177d929bacb20b3c4bb9363d7
trib3/xhtml2pdf,chrisglass/xhtml2pdf,jensadne/xhtml2pdf,tinjyuu/xhtml2pdf,xhtml2pdf/xhtml2pdf,orbitvu/xhtml2pdf,chrisglass/xhtml2pdf,trib3/xhtml2pdf,tinjyuu/xhtml2pdf,orbitvu/xhtml2pdf,jensadne/xhtml2pdf,xhtml2pdf/xhtml2pdf
tests/test_parser.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Create mixins package for testing" }, { "role": "assistant", "content": "# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n" } ]
python
new_file
1
0
apache-2.0
d2716cf8a5d605098b296ab835c1f4115dd45a5b
VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,AleksNeStu/gg...
test/integration/ggrc/models/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__author__ = 'ankesh'\n\nfrom django.conf.urls import patterns, url\nimport views\n\nurlpatterns = patterns('',\n url(r'^(?P<filename>[a-zA-Z0-9]+)/$', views.show_result, name='showResult'),\n url(r'^compare/(?P<filename>[a-zA-Z0-9]+)...
python
edit
1
0
bsd-2-clause
b2e743a19f13c898b2d95595a7a7175eca4bdb2c
ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark,ankeshanand/benchmark
results/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\nfrom ckanext.qa import __version__\n\nsetup(\n name='ckanext-qa',\n version=__version__,\n description='Quality Assurance plugin for CKAN',\n long_description='',\n classifiers=[],...
python
edit
1
0
mit
a15fd8df979865a44f2699eb15f2825667cbcd7f
ckan/ckanext-qa,ckan/ckanext-qa,ckan/ckanext-qa
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"@author: Bryan Silverthorn <<EMAIL>>\"\"\"\n\nimport os\n\nmachine_speed = 1.0\nminimum_fake_run_budget = 1800.0 # XXX\nproc_poll_period = 1.0\nroot_log_level = os.environ.get(\"BORG_LOG_ROOT_LEVEL\", \"NOTSET\")\n\ntry:\n from bor...
python
edit
2
0
mit
3048bf667ec24c93d1c60f08124d68b6d1fc458d
borg-project/borg
src/python/borg/defaults.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file...
python
edit
1
2
apache-2.0
d3f4d43b36b8d21a3102389d53bf3f1af4e00d79
StackStorm/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2
st2common/st2common/runners/base_action.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nimport os\nimport sys\n\nimport dateparser\n\n__DATA_DIR = '../data/'\n\ndef harmonize_data( data ):\n ## make dates as date objects\n data2 = []\n for d in data:\n if 'created_time' in d:\n d['date'] ...
python
edit
2
4
mit
d5a54a7fe207c0fde76774cdc8a11e12fcc3218a
HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core
core/data_loader.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.views.generic.simple import direct_to_template\nfrom django.conf import settings\n\n\nurlpatterns = patterns('',\n (r\"^$\", direct_to_template, { \"template\": \"home.html\" }),\n ...
python
edit
9
0
bsd-3-clause
b5fe965315920cc10664b3e0ba52bc50bf717374
zjuwangg/scrapy,famorted/scrapy,pranjalpatil/scrapy,yusofm/scrapy,Geeglee/scrapy,foromer4/scrapy,CodeJuan/scrapy,rahulsharma1991/scrapy,jeffreyjinfeng/scrapy,dhenyjarasandy/scrapy,emschorsch/scrapy,lacrazyboy/scrapy,webmakin/scrapy,cleydson/scrapy,Preetwinder/scrapy,olorz/scrapy,cyrixhero/scrapy,pfctdayelise/scrapy,far...
sites/scrapy.org/site/urls.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis module is a general example using test data showing usage of sparks, excel\nand the studbook structure.\n\"\"\"\nimport os\n\nfrom GTT import SPARKS\nfrom GTT import excel as ew\nfrom GTT import studBookStruct\n\nTEST_DIR = os....
python
edit
1
0
mit
d5acdacbbe4e4a5464b789a92a31b56cb94aa6a0
314ish/StudbookToolkit
GTT/test/example_usage.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2009-2010 Sebastian Krysmanski\n# Copyright (C) 2012 Greg Lavallee\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as pa...
python
edit
1
0
bsd-3-clause
3e083c4ed6f6ebd6739d10a639939c8a290aebc9
trac-hacks/TicketGuidelinesPlugin
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Future Imports\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\n# Django Imports\nfrom django.conf.urls import include, url\n\n# App Imports\nfrom .views import CategoryView...
python
edit
1
0
apache-2.0
a1a8ef302ac24d56a36d0671eb692943d14c4ddf
srct/whats-open,srct/whats-open,srct/whats-open
whats_open/website/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport setuptools\nimport pathlib\n\n\nsetuptools.setup(\n name='crafter',\n version='0.17.0',\n description='Open world survival game for reinforcement learning.',\n url='http://github.com/danijar/crafter',\n long_descriptio...
python
edit
1
0
mit
a1ed05089c983f3347b5164fffe4030d75b9453d
danijar/crafter
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nVERSION = (0, 0, 0)\n__version__ = '.'.join(map(str, VERSION))\n\n\nfrom django import template\ntemplate.add_to_builtins('common.templatetags.common')\ntemplate.add_to_builtins('common.templatetags.development')\n```\n\nApply this change: ...
python
edit
1
0
bsd-3-clause
354fb43cc95d68b06b85e8d1fa2426ca663ef8b9
baskoopmans/djcommon,baskoopmans/djcommon,baskoopmans/djcommon
common/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom marrow.mailer import Mailer as MarrowMailer\nfrom message import Message\n\nimport sys\n\n\nclass Mailer:\n\n MAILER = MarrowMailer(dict(manager=dict(use='immediate'), transport=dict(use='sendmail')))\n\n @staticmethod\n def send(me...
python
edit
1
2
isc
3d7b5d61b7e985d409cd50c98d4bcbdc8ab9c723
2mv/raapija
mailer.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n # Examples:\n # url(r'^$', 'purepython.views.home', name='home'),\n # url(r'^blog/', incl...
python
edit
1
0
apache-2.0
0c18e83248a752a3191da1d9c8369fafc2b61674
pure-python/brainmate
purepython/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License:...
python
edit
3
0
apache-2.0
65973802a3e68e23f9a903937ef94f8afa277013
stoeps13/ibmcnx2,stoeps13/ibmcnx2
ibmcnx/doc/DataSources.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\nimport django\n\nfrom django.conf import settings\n\n\ndef main():\n import warnings\n warnings.filterwarnings('error', category=DeprecationWarning)\n\n if not settings.configured:\n ...
python
edit
1
4
bsd-3-clause
8b9065b99c8bcbb401f12e9e10b23d6ea4b976f0
willandskill/django-parse-push
runtests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nfrom nose.plugins.attrib import attr\n\n\nclass ElasticTestMixin(object):\n\n def checkQuery(self, query, json_output, is_raw_query=False):\n if is_raw_query:\n raw_query = query\n else:\n ...
python
edit
1
2
bsd-3-clause
b0029cffae96e25611d7387e699774de4d9682d3
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/es/tests/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nGoogle App Engine support using User API\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom google.appengine.api import users\n\nfrom social.backends.base import BaseAuth\nfrom social.exceptions import AuthException\n\n\nclass ...
python
edit
1
2
bsd-3-clause
b74c56b3999800917946378f20288407347710e6
ononeor12/python-social-auth,barseghyanartur/python-social-auth,tutumcloud/python-social-auth,webjunkie/python-social-auth,cmichal/python-social-auth,henocdz/python-social-auth,mchdks/python-social-auth,falcon1kr/python-social-auth,cmichal/python-social-auth,contracode/python-social-auth,SeanHayes/python-social-auth,Vi...
social/backends/gae.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nAutocompletion example.\n\nPress [Tab] to complete the current word.\n- The first Tab press fills in the common part of all completions\n and shows all the completions. (In the menu)\n- Any following tab pr...
python
edit
1
1
bsd-3-clause
a934303f40d835626cdd42096c869acb536d788d
jonathanslenders/python-prompt-toolkit
examples/prompts/autocompletion.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\nversion = '0.2dev'\nlong_description = '\\n\\n'.join([\n open('README.rst').read(),\n open('CHANGES.txt').read(),\n])\n\nsetup(\n name = \"compare\",\n version = version,\n descripti...
python
edit
3
0
bsd-3-clause
4dc8316d1f5378db974437e462df12d697d126ea
rudylattae/compare,rudylattae/compare
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\ncargo/condor/host.py\n\nHost individual condor jobs.\n\n@author: Bryan Silverthorn <<EMAIL>>\n\"\"\"\n\nimport os\nimport sys\nimport cPickle as pickle\n\ndef main():\n \"\"\"\n Application entry point.\n \"\"\"\n\n # ma...
python
edit
3
1
mit
0f9cb6eb32ce014cb6ae8d24aefed2347efe68d9
borg-project/cargo,borg-project/cargo
src/python/cargo/condor/host.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask.json import JSONEncoder\nfrom bson import json_util\nfrom mongoengine.base import BaseDocument\nfrom mongoengine import QuerySet\n\n\ndef _make_encoder(superclass):\n class MongoEngineJSONEncoder(superclass):\n '''\n ...
python
edit
3
3
bsd-3-clause
edcfe2b156af23943478bc86592b4c8d5dc07e10
gerasim13/flask-mongoengine-1,rochacbruno/flask-mongoengine,quokkaproject/flask-mongoengine,quokkaproject/flask-mongoengine,gerasim13/flask-mongoengine-1,losintikfos/flask-mongoengine,rochacbruno/flask-mongoengine,losintikfos/flask-mongoengine
flask_mongoengine/json.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport importlib\nimport logging\nfrom typing import Sequence, Tuple, Callable\n\nimport pkg_resources\n\nlogger = logging.getLogger(__name__)\n\n\ndef import_module_from_string(name):\n return importlib.import_module(name)\n\n\ndef impo...
python
edit
1
2
apache-2.0
2e9cb250d58474354bdfff1edb4fc9e71ee95d60
adamcharnock/lightbus
lightbus/utilities/importing.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom ..attribute_processor import AttributeProcessorError\nfrom .base_processor import BaseProcessor\n\n\nCONFIG_KEY_MAPPEDATTRIBUTE = 'mapped_attribute'\nCONFIG_DEFAULT_MAPPEDATTRIBUTE = ''\n\n\nclass ScopeExtractorProcessor(BaseProcessor)...
python
edit
1
8
apache-2.0
67b50cde0fa1885dce936b95d58d82fc64316c85
SUNET/SATOSA,its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,irtnog/SATOSA
src/satosa/micro_services/processors/scope_extractor_processor.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport typing as tp # NOQA\n\nfrom chainer import types # NOQA\nfrom chainer import utils\n\n\nclass Initializer(object):\n \"\"\"Initializes array.\n\n It initializes the given array.\n\n Attributes:\n dtype: Data type sp...
python
edit
1
3
mit
7d79e6f0404b04ababaca3d8c50b1e682fd64222
niboshi/chainer,tkerola/chainer,niboshi/chainer,keisuke-umezawa/chainer,okuta/chainer,chainer/chainer,wkentaro/chainer,niboshi/chainer,okuta/chainer,okuta/chainer,wkentaro/chainer,pfnet/chainer,okuta/chainer,hvy/chainer,wkentaro/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,chainer/cha...
chainer/initializer.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nVERSION = '0.2.9'\n\n\nsetup(\n name='jinja2_standalone_compiler',\n packages=['jinja2_standalone_compiler', ],\n version=VERSION,\n author='Filipe Waitman',\n author_email='<EMAIL>',\n inst...
python
edit
1
0
mit
877c2e1c453386b3fa4d249f3a76a7e345c97d23
filwaitman/jinja2-standalone-compiler
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport pytest\nimport pandas as pd\nfrom glob import glob\nimport numpy as np\n\nfrom gypsy import DATA_DIR\nfrom gypsy.forward_simulation import simulate_forwards_df\n\n\nTEST_FILES = glob(os.path.join(DATA_DIR, 'forward_simulat...
python
edit
1
1
mit
409182019048a5cb84499258f6f8daaffb62aeae
tesera/pygypsy,tesera/pygypsy
tests/test_simulation_forward.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport zeit.content.article.edit.browser.testing\n\n\nclass HeaderModules(zeit.content.article.edit.browser.testing.EditorTestCase):\n\n def test_can_create_module_by_drag_and_drop(self):\n s = self.selenium\n self.add_arti...
python
edit
1
1
bsd-3-clause
ce2ea43a9ca49caa50e26bc7d7e11ba97edea929
ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article,ZeitOnline/zeit.content.article
src/zeit/content/article/edit/browser/tests/test_header.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom bitcategory import models\nfrom django.dispatch import receiver\nfrom django.db.models.signals import post_syncdb\n\n\n@receiver(post_syncdb, sender=models)\ndef load_test_categories(sender, **kwargs):\n r1, c = models.Category.obje...
python
edit
1
1
bsd-3-clause
e9b3865e37c1f4a275c323dcbf778696a27d69bd
atheiste/django-bit-category,atheiste/django-bit-category,atheiste/django-bit-category
testapp/testapp/management.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Refactor to lerp param names." }, { "role": "assistant", "content": "def lerp(fromValue, toValue, percent):\n return fromValue + (toValue - fromValue) * percent" } ]
python
new_file
1
1
mit
ebdafecea8c5b6597a7b2e2822afc98b9c47bb05
JoshuaSkelly/Toast,JSkelly/Toast
toast/math/__init__.py
accepted
null
true