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#!/usr/bin/env python\nfrom __future__ import print_function\n\n\nclass Node(object):\n\n def __init__(self, value):\n self._val = value\n self._next = None\n\n @property\n def next(self):\n return self._next\n...
python
edit
1
5
mit
8e8d80e744c99ab1c5552057899bf5470d751a29
constanthatz/data-structures
linked_list.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# (C) Datadog, Inc. 2018\n# All rights reserved\n# Licensed under a 3-clause BSD style license (see LICENSE)\nfrom .disk import Disk\n\n__all__ = ['Disk']\n\n```\n\nApply this change: [Disk] Allow Agent to properly pull version info" }, ...
python
edit
4
0
bsd-3-clause
cd2b628ca118ffae8090004e845e399110aada21
DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core
disk/datadog_checks/disk/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"The vumi.dispatchers API.\"\"\"\n\n__all__ = [\"BaseDispatchWorker\", \"BaseDispatchRouter\", \"SimpleDispatchRouter\",\n \"TransportToTransportRouter\", \"ToAddrRouter\",\n \"FromAddrMultiplexRouter\", \"UserGroup...
python
edit
1
0
bsd-3-clause
b96cb194c8edd54fda9868d69fda515ac8beb29f
harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,TouK/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix
vumi/dispatchers/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport numpy as np\n\nfrom opensauce.helpers import wavread\n\nfrom test.support import TestCase, data_file_path, loadmat\n\n\nclass TestSupport(TestCase):\n\n def test_wavread(self):\n fn = data_file_path('beijing_f3_50_a.wav')\n...
python
edit
1
2
apache-2.0
978b6b46bc1f6b7cb70c14fd929e757a41436f87
voicesauce/opensauce-python,voicesauce/opensauce-python,voicesauce/opensauce-python
test/test_helpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\n\nimport datetime\n\nfrom garage.timezones import TimeZone\n\n\nclass TimeZoneTest(unittest.TestCase):\n\n def test_time_zone(self):\n utc = datetime.datetime(2000, 1, 2, 3, 4, 0, 0, TimeZone.UTC)\n cst = u...
python
edit
1
1
mit
2c38fea1434f8591957c2707359412151c4b6c43
clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage
tests/test_timezones.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.db.models.signals import pre_save, pre_delete\nfrom django.dispatch import receiver\n\n\n@receiver(pre_save)\ndef save_handler(sender, instance, using, **kwargs):\n # noinspection PyProtectedMember\...
python
edit
1
4
mit
3136f7e37b339252d4c1f5642974e180070c452d
jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu
kirppu/signals.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.core.management.base import NoArgsCommand\n\nfrom feincms.content.rss.models import RSSContent\n\nclass Command(NoArgsCommand):\n help = \"Run this as a cronjob.\"\n\n def handle_noargs(self, **options):\n for cls i...
python
edit
1
3
bsd-3-clause
58078b1d4eb64c7104715352fc11bf7abffd48a4
hgrimelid/feincms,nickburlett/feincms,feincms/feincms,nickburlett/feincms,hgrimelid/feincms,joshuajonah/feincms,pjdelport/feincms,mjl/feincms,joshuajonah/feincms,pjdelport/feincms,matthiask/django-content-editor,matthiask/django-content-editor,mjl/feincms,nickburlett/feincms,matthiask/feincms2-content,matthiask/feincms...
feincms/management/commands/update_rsscontent.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\n\nfrom tailor.utils import charformat\n\nclass MyTestCase(unittest.TestCase):\n\n def is_upper_camel_case_test_upper_camel_case_name(self):\n self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))\n\n de...
python
edit
1
1
mit
9a32f922e6d5ec6e5bd22eccbe3dceaef7bbd7dc
sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor
tailor/tests/utils/charformat_test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport asyncio\nimport logging\n\nfrom warreport import battle_monitor, battle_reporting\n\nlogger = logging.getLogger(\"warreport\")\n\n\ndef main():\n logger.info(\"Starting main loop.\")\n logger.debug(\"Debug logging enabled.\")\n...
python
edit
1
3
mit
d8f1b1151ff917cad924bd6f8fac330602c259c9
daboross/screeps-warreport
warreport/__main__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom optparse import make_option\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.db import transaction\n\nfrom credentials.management.helpers import import_sshkeypair\n\nclass Command(BaseCommand):\n hel...
python
edit
2
2
mit
2f0627c1e5c087cf5b712e846b4f687259342063
caio1982/capomastro,caio1982/capomastro,timrchavez/capomastro,timrchavez/capomastro,caio1982/capomastro
credentials/management/commands/import_sshkeypair.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom .vcalendar import vCalendar\nfro...
python
edit
1
4
mit
0a4922dba3367a747d7460b5c1b59c49c67f3026
mback2k/python-hcalendar
hcalendar/hcalendar.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom distutils.core import setup, Command\n\n\nclass PyTest(Command):\n user_options = []\n\n def initialize_options(self):\n pass\n\n def finalize_options(self):\n pass\n\n def run(self):\n import sys\n ...
python
edit
1
1
mit
fc6042cf57752ca139c52889ec5e00c02b618d0d
yamaneko1212/webpay-python
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except:\n return ''\n\nsetup(\n name='todoist-python',...
python
edit
1
2
mit
eecf64c177c25be34b597e419ce22450440e445f
electronick1/todoist-python,Doist/todoist-python
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport core\nfrom girder_worker.utils import JobStatus\nfrom .app import app\n\n\ndef _cleanup(*args, **kwargs):\n core.events.trigger('cleanup')\n\n\n@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)\ndef run(tasks, ...
python
edit
1
6
apache-2.0
e9e4c622ff667e475986e1544ec78b0604b8a511
girder/girder_worker,girder/girder_worker,girder/girder_worker
girder_worker/tasks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\nimport os, sys\nsys.path.append(os.path.join(sys.path[0], '..'))\n\nfrom carlo import model, entity, generate\n\ndef test_minimal_model():\n m = model(entity('const', {'int': lambda: 42})).build()\n assert [('const', ...
python
edit
3
1
mit
2a23e72f7ad01976bcd80aa91f89882e2a37cbf6
ahitrin/carlo
test/test_model.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.core.urlresolvers import reverse\n\nfrom .views import RegistrationView, PasswordChangeView, password_reset_done\n\n\nurlpatterns = patterns('',\n url('^new/$', RegistrationView.as_...
python
edit
1
0
mit
3b9508ff6546974ffb2aee8fe38aae15799aafc5
haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter
cellcounter/accounts/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nCAUTION! Keep everything here at at minimum. Do not import stuff.\nThis module is imported in setup.py, so you cannot for instance\nimport a dependency.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_f...
python
edit
1
0
mit
00a3da330668284f700275c7fc3072c792eff374
indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri
kolibri/__init__.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add first model for Enrollment application" }, { "role": "assistant", "content": "from django.db import models\nfrom Portal.models import CharacterAttribute\nfrom django.utils.translation import ugettext as _\n\n# Create your mod...
python
new_file
1
1
mit
62c51799953c1299e7c89c61a23270bf55e9cd69
elryndir/GuildPortal,elryndir/GuildPortal
PortalEnrollment/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport shutil\nimport deck2pdf\nfrom pytest import raises\nfrom . import (\n current_dir,\n test_dir,\n skip_in_ci,\n)\n\n\nclass TestForMain(object):\n def setUp(self):\n shutil.rmtree(os.path.join(current_dir...
python
edit
1
1
mit
f4c56937caacb4709847d67752f4ff3cba4568f6
attakei/deck2pdf-python,attakei/deck2pdf-python,attakei/slide2pdf,attakei/deck2pdf,attakei/slide2pdf,attakei/deck2pdf
tests/test_it.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\n\nurlpatterns = patterns('django.contrib.auth.views',\n url(r'^login/', 'login', name='login'),\n url(r'^logout/', 'logout', {'next_page':'/'}, name='logout'),\n url(r'^password/forgot/$', '...
python
edit
12
0
mit
0534c1cdeb92503a90ef309dee6edddb45234bf7
bueda/django-comrade
comrade/users/urls.py
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom ...models import Address\nfrom ...models import AgencyDocument\nfrom .agency_chain import AgencyChain\n\nfrom ..base import Resource\nfrom ..tour import Promotion\n\n\nclass Agency(Resource):\...
python
edit
1
0
mit
13a2ea421b761b9009fb7e1328e54cf0ae5cc54f
gadventures/gapipy
gapipy/resources/booking/agency.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask\napp = Flask(__name__)\n\nVERSION_PREFIX=\"/api/v1\"\n\n@app.route(VERSION_PREFIX + \"/handovers\")\ndef handovers():\n return \"handovers\\n\"\n\n@app.route(VERSION_PREFIX + \"/drafts\")\ndef drafts():\n return \"...
python
edit
1
1
mit
19dd4495b09a0019fcce2cfb21b083724033dd7f
Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService
handover_service.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.http import HttpResponse\nfrom django.utils.translation import ugettext as _\nfrom django.views.generic import View\n\nfrom .pdf import generate_receipt_pdf\n\n\nclass ReceiptHTMLView(View):\n template_name = 'django_afip/inv...
python
edit
1
1
isc
78ca15758018d52f1353b29410f97bba215e0be2
hobarrera/django-afip,hobarrera/django-afip
django_afip/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport requests\nimport json\n\n\nclass KickstarterScraper(object):\n # TODO: get list of all categories from projects for rendering possible list on main view\n\n\n base_url = \"https://www.kickstarter.com/\"\n projects_query_path...
python
edit
2
4
mit
a9a794384c6f4c153768cf609f3d8dc657f59daf
lorenanicole/almost_funded,lorenanicole/almost_funded,lorenanicole/almost_funded
campaigns/scrapers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom wtforms import TextField, BooleanField, Form\nfrom wtforms.validators import Required\n\nclass SearchPackageForm(Form):\n package = TextField('package', validators = [Required()])\n maintainer = TextField('maintainer', validators...
python
edit
1
0
mit
70847e9d88f086d52e167629666aebe5137c7a2e
opencollab/debile-web,opencollab/debile-web,opencollab/debile-web
debileweb/blueprints/forms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nCopyright 2014 Universitatea de Vest din Timișoara\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy o...
python
edit
1
2
apache-2.0
9f10dbdabe61ed841c0def319f021a4735f39217
mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit,mneagul/scape-cloud-toolkit
src/sct/templates/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__author__ = 'katharine'\n\nimport PyV8 as v8\nfrom geolocation import Geolocation\n\n\nclass Navigator(v8.JSClass):\n def __init__(self, runtime):\n # W3C spec says that if geolocation is disabled, navigator.geolocation should no...
python
edit
1
2
mit
e5a94d2902a66d55be62b92e35ac90ac7aed7991
youtux/pypkjs,pebble/pypkjs
javascript/navigator/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom optparse import make_option\nfrom rapidsms_httprouter.router import get_router\nfrom rapidsms.models import Connection\n\nclass Command(BaseCommand):\n\n option_list = BaseCommand...
python
edit
6
3
bsd-3-clause
7416f2fc34bad2036024874ad6a0c9a5f57d0657
unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac
education/management/commands/fake_incoming_message.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport asyncore\nimport util\n\ntry:\n\timport simplejson as json\nexcept ImportError:\n\timport json\n\n\nclass ChannelServer(asyncore.dispatcher):\n\t\n\tdef __init__(self, sock, dest):\n\t\tasyncore.dispatcher.__init__(self, sock)\n\t\ts...
python
edit
1
2
bsd-3-clause
d6a6fc478d9aaea69ff6c1f5be3ebe0c1b34f180
jvirtanen/fixlib
fixlib/channel.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.shortcuts import _get_queryset\nfrom django.conf import settings\n\n\ndef get_object_or_None(klass, *args, **kwargs):\n \"\"\"\n Uses get() to return an object or None if the object does not exist.\n\n klass may be a Mo...
python
edit
1
2
bsd-3-clause
d09fb55bd49e266901305b9126077f44f7a1301e
skorokithakis/django-annoying,artscoop/django-annoying,kabakchey/django-annoying,skorokithakis/django-annoying,kabakchey/django-annoying,YPCrumble/django-annoying,JshWright/django-annoying
annoying/functions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\n\nRevision ID: 0313_email_access_validated_at\nRevises: 0312_populate_returned_letters\nCreate Date: 2020-01-28 18:03:22.237386\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\n\n\nrevision = '0313_email_access_validated_...
python
edit
1
1
mit
20124d599c6305889315847c15329c02efdd2b8c
alphagov/notifications-api,alphagov/notifications-api
migrations/versions/0313_email_access_validated_at.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nOutput an Eliot message to a log file using the threaded log writer.\n\"\"\"\nfrom __future__ import unicode_literals, print_function\n\nfrom twisted.internet.task import react\n\nfrom eliot.logwriter import ThreadedFileWriter\nfrom...
python
edit
1
1
apache-2.0
cadee051a462de765bab59ac42d6b372fa49c033
iffy/eliot,ClusterHQ/eliot,ScatterHQ/eliot,ScatterHQ/eliot,ScatterHQ/eliot
examples/logfile.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nimport raven\n\nfrom flamingo.settings.base import BaseSettings\n\n\nclass ProdSettings(BaseSettings):\n\n DEBUG = False\n ALLOWED_HOSTS = ['127.0.0.1', 'localhost',]\n\n # Sentry\n # @property\n # def RAVEN_CONF...
python
edit
4
0
isc
c0e90114c7a84cfa94fb3f0e862e0453101544ba
RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo,RevolutionTech/flamingo
flamingo/flamingo/settings/prod.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nZipline\n\"\"\"\n\n# This is *not* a place to dump arbitrary classes/modules for convenience,\n# it is a place to expose the public interfaces.\n\n__version__ = \"0.5.11.dev\"\n\nfrom . import data\nfrom . import finance\nfrom . imp...
python
edit
1
0
apache-2.0
16fe23b18f69e475858a975f3a2e3f743f4b4c57
iamkingmaker/zipline,ChinaQuants/zipline,chrjxj/zipline,michaeljohnbennett/zipline,ronalcc/zipline,nborggren/zipline,sketchytechky/zipline,joequant/zipline,grundgruen/zipline,zhoulingjun/zipline,alphaBenj/zipline,CDSFinance/zipline,alphaBenj/zipline,umuzungu/zipline,dhruvparamhans/zipline,cmorgan/zipline,otmaneJai/Zipl...
zipline/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Test praw.models.front.\"\"\"\nfrom praw.models.listing.generator import ListingGenerator\n\nfrom ... import UnitTest\n\n\nclass TestListingGenerator(UnitTest):\n def test_params_are_not_modified(self):\n params = {\"prawtes...
python
edit
1
1
bsd-2-clause
80a940305765a22f96b0c0af0b0b46f1e3f5c377
praw-dev/praw,praw-dev/praw
tests/unit/models/listing/test_generator.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom keras.layers import Convolution2D, Merge\nfrom keras.layers.advanced_activations import PReLU\nfrom keras.engine.topology import merge\n\nfrom eva.layers.masked_convolution2d import MaskedConvolution2D\n\ndef ResidualBlock(model, filte...
python
edit
3
2
apache-2.0
f522a464e3f58a9f2ed235b48382c9db15f66029
israelg99/eva
eva/layers/residual_block.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\n\ndef galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',\n out_filename=None):\n \"\"\"Convert a GALAPAGOS multi-band catalogue to a pandas-compatible ...
python
edit
1
6
mit
5ac84c4e9d8d68b7e89ebf344d2c93a5f7ef4c4c
MegaMorph/megamorph-analysis
notebooks/galapagos_to_pandas.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nU.S. state capitals overlayed on a map of the U.S\n================================================-\nThis is a geographic visualization that shows US capitals\noverlayed on a map.\n\"\"\"\n\nimport altair as alt\nfrom vega_datasets...
python
edit
1
0
bsd-3-clause
dfc7c7ae72b91f3bc7724da6b0d8071b3e9253b7
ellisonbg/altair,jakevdp/altair,altair-viz/altair
altair/vegalite/v2/examples/us_state_capitals.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#Common utility methods\n\n#Test if a dictionary value is not None and has a length greater than 0\ndef test_value(value):\n if value.get('value') is not None:\n if value.get('value') is not None and len(str(value.get('value'))) ...
python
edit
1
2
bsd-3-clause
c7ec2805d1c3dde9ff3bf8caacf0bac474a1d468
CybOXProject/python-cybox
cybox/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.test.runner import DiscoverRunner\n\nfrom behave_django.environment import BehaveHooksMixin\nfrom behave_django.testcase import (BehaviorDrivenTestCase,\n ExistingDatabaseTestCase)\n\n\nclass B...
python
edit
1
1
mit
fd9c73fc65a7234732ed55a7ae89365aec6cf123
bittner/behave-django,behave/behave-django,behave/behave-django,bittner/behave-django
behave_django/runner.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nInvoke's own 'binary' entrypoint.\n\nDogfoods the `program` module.\n\"\"\"\n\nfrom ._version import __version__\nfrom .program import Program\n\n\nprogram = Program(name=\"Invoke\", binary='inv[oke]', version=__version__)\n\n```\n\...
python
edit
1
0
bsd-2-clause
937fd7c07dfe98a086a9af07f0f7b316a6f2f6d8
frol/invoke,frol/invoke,pyinvoke/invoke,mkusz/invoke,mattrobenolt/invoke,pfmoore/invoke,pyinvoke/invoke,mkusz/invoke,mattrobenolt/invoke,pfmoore/invoke
invoke/main.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport json\nimport re\nfrom datetime import datetime\n\nclass JsonFormatter(logging.Formatter):\n \"\"\"A custom formatter to format logging records as json objects\"\"\"\n\n def parse(self):\n standard_formatt...
python
edit
1
3
bsd-2-clause
9f005120c6d408e8cf3097dd74d5dada24305c88
madzak/python-json-logger,bbc/python-json-logger
src/jsonlogger.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# :coding: utf-8\n# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips\n# :license: See LICENSE.txt.\n\nfrom .handler.distribute import Distribute\n\n#: Top level handler responsible for relaying all logs to other handlers.\nhandle = D...
python
edit
1
0
apache-2.0
210c7b7fb421a7c083b9d292370b15c0ece17fa7
4degrees/mill,4degrees/sawmill
source/bark/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: <EMAIL>\n# Maintained By: <EMAIL>\n\nimport re\nfrom sqlalchemy.ex...
python
edit
1
3
apache-2.0
ed23b1a44263de0e0a3b34ead22cd149116c063a
j0gurt/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,kr41/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,uskudnik/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,uskudnik/ggrc-core,jmako...
src/ggrc/models/exceptions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n'''\nThis module extracts the student IDs from the collection certificates_generatedcertificate\nof the students who completed the course and achieved a certificate. The ids\nare then used to extract the usernames of the course completers\n...
python
edit
3
0
mit
b0bed22c3ccafe596cf715f2be56c3261b4a6853
McGillX/edx_data_research,andyzsf/edx_data_research,McGillX/edx_data_research,andyzsf/edx_data_research,McGillX/edx_data_research
reporting_scripts/course_completers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\n\n\nif __name__ == '__main__':\n import chatterbot\n\n if '--version' in sys.argv:\n print(chatterbot.__version__)\n\n if 'list_nltk_data' in sys.argv:\n import nltk.data\n\n print('\\n'.join(nltk.d...
python
edit
1
0
bsd-3-clause
8abdce9c60c9d2ead839e0065d35128ec16a82a1
gunthercox/ChatterBot,vkosuri/ChatterBot
chatterbot/__main__.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add Jaro-Winkler distance based pyjarowinkler library" }, { "role": "assistant", "content": "from pyjarowinkler import distance\nfrom itertools import combinations\nfrom time import time\n\nstart = time()\nlog_file = '/home/hs328...
python
new_file
3
0
mit
bff6e81fc952efdbee12e9c05be630f12f61d929
studiawan/pygraphc
pygraphc/similarity/pyjwJaroWinkler.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nA list field field that supports query string parameter parsing.\n\n\"\"\"\nfrom marshmallow.fields import List, ValidationError\n\n\nclass SelfSerializableList(list):\n def __str__(self):\n return \",\".join(str(item) for...
python
edit
1
6
apache-2.0
a5274f0628bec7a77fc2722ced723c4f35f3fb4b
globality-corp/microcosm-flask,globality-corp/microcosm-flask
microcosm_flask/fields/query_string_list.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom string import ascii_lowercase\nimport django\nimport os\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')\ndjango.setup()\n\nfrom breach.models import Target, Victim\n\nendpoint = 'https://dimkarakostas.com/rupture...
python
edit
3
0
mit
4666849791cad70ae1bb907a2dcc35ccfc0b7de4
esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimkarakostas/ruptu...
backend/populate_dimkarakostas.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2011 Takeshi KOMIYA\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...
python
edit
4
0
apache-2.0
b2c8acb79ea267f9777f1f370b588a1d93b28d86
aboyett/blockdiag,aboyett/blockdiag
src/blockdiag_sphinxhelper.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom corehq.apps.products.models import SQLProduct\nfrom custom.ewsghana.handlers import HELP_TEXT\nfrom custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler\n\n\nclass HelpHandler(KeywordHandler):\n\n def help(self):\n ...
python
edit
1
9
bsd-3-clause
faa74af66ff0542c5a08d85caf2e2b897506b1d0
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
custom/ewsghana/handlers/help.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nfrom infrastructure.models import FinancialYear\n\nfrom django.test import (\n TransactionTestCase,\n Client,\n override_settings,\n)\n\nfrom . import (\n import_data,\n)\nfrom .resources import (\n GeographyReso...
python
edit
1
1
mit
80f1ee23f85aee9a54e0c6cae7a30dddbe96541b
Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data
scorecard/tests/test_views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom Crypto.Cipher import AES\n\n\ndef decrypt(data, key_iv):\n key = key_iv[0:16]\n iv = key_iv[16:]\n print(data)\n cipher = AES.new(key, AES.MODE_CBC, iv)\n return cipher.decrypt(data)\n\n\ndef encrypt(data, key_iv):\n ...
python
edit
1
1
mit
33505f9b4dfeead0b01ee1b8cf3f8f228476e866
openpassword/blimey,openpassword/blimey
openpassword/crypt_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom axiom import iaxiom, userbase\n\nfrom xmantissa import website, offering, provisioning\n\nfrom sine import sipserver, sinetheme\n\nsineproxy = provisioning.BenefactorFactory(\n name = u'sineproxy',\n description = u'Sine SIP Prox...
python
edit
3
0
mit
f2fc7f1015fc24fdbb69069ac74a21437e94657b
habnabit/divmod-sine,twisted/sine
xmantissa/plugins/sineoff.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom functools import wraps\nfrom exceptions import StandardError\n\nfrom turbodbc_intern import Error as InternError\n\n\nclass Error(StandardError):\n pass\n\n\nclass InterfaceError(Error):\n ...
python
edit
1
2
mit
c82f0f10ea8b96377ebed8a6859ff3cd8ed4cd3f
blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc
python/turbodbc/exceptions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport sys\n\n\n# Disable django-pipeline when in test mode\nPIPELINE_ENABLED = 'test' not in sys.argv\n\n# Main project directory\nBASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nSTATIC_BASE_DIR = os.p...
python
edit
1
0
apache-2.0
c7f6e0c2e9c5be112a7576c3d2a1fc8a79eb9f18
brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc,brasilcomvc/brasilcomvc
brasilcomvc/settings/staticfiles.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport threading\nimport traceback\n\nimport plogger\n\n\n__author__ = 'karl.gong'\n\n\ndef take_screen_shot():\n current_thread = threading.currentThread()\n active_browser = current_thread.get_property(\"browser\")\n\n if active_...
python
edit
3
7
apache-2.0
4c1bf1757baa5beec50377724961c528f5985864
KarlGong/ptest,KarlGong/ptest
ptest/screencapturer.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask, jsonify\nfrom flask.helpers import make_response\n\nimport urls\nimport scrapy\n\napp = Flask(__name__)\n\n@app.route('/fuelprice/v1.0/petrol/', methods=['GET'])\ndef petrol_prices_all():\n all_petrol_prices = sc...
python
edit
1
1
apache-2.0
7bd4d126269e516f3a9a54721e3d710e19120eb4
phalgun/fuelprice-api
app.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework.exceptions import APIException\nfrom rest_framework import status\n\ndef jsonapi_exception_handler(exc, context):\n \"\"\"\n Custom exception handler that returns errors object as an array with a 'detail' member\n ...
python
edit
1
7
apache-2.0
1fa0eb2c792b3cc89d27b322c80548f022b7fbb9
monikagrabowska/osf.io,hmoco/osf.io,asanfilippo7/osf.io,njantrania/osf.io,sloria/osf.io,MerlinZhang/osf.io,acshi/osf.io,mluke93/osf.io,asanfilippo7/osf.io,Johnetordoff/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,GageGaskins/osf.io,chrisseto/osf.io,ticklemepierce/osf.io,chennan47/osf.io,caseyrygt/osf.io,DanielSBrown/osf.i...
api/base/exceptions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .base import CommandCompiler\n\n\nclass SassCompiler(CommandCompiler):\n content_type = 'text/css'\n options = {'compass': True}\n command = 'sass'\n params = ['--trace']\n\n def compile(self, asset):\n if self.co...
python
edit
1
3
mit
8bfd49c7aef03f6d2ad541f466e9661b6acc5262
davidelias/django-staticassets,davidelias/django-staticassets,davidelias/django-staticassets
staticassets/compilers/sass.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nUse behave4cmd0 step library (predecessor of behave4cmd).\n\"\"\"\n\n# -- REGISTER-STEPS:\nimport behave4cmd0.command_steps\n\n```\n\nApply this change: Use all behave4cmd0 steps now." }, { "role": "...
python
edit
3
0
bsd-2-clause
0e3edd3be1748dd62323037760337b8819adaeea
hugeinc/behave-parallel
features/steps/use_steplib_behave4cmd.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis file defines the types for type annotations.\n\nThese names aren't part of the module namespace, but they are used in the\nannotations in the function signatures. The functions in the module are only\nvalid for inputs that matc...
python
edit
1
0
mit
a703bed82bb2cfcf8b18b5e651bd2e992a590696
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
numpy/_array_api/_types.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom nodes import Node\n\nclass Multiply(Node):\n char = \"*\"\n args = 2\n results = 1\n \n @Node.test_func([4,5], [20])\n def func(self, a,b):\n \"\"\"a*b\"\"\"\n return a*b\n```\n\...
python
edit
1
1
mit
63c72e9606ba9c9030ba63f25331c351873ab8b1
muddyfish/PYKE,muddyfish/PYKE
node/multiply.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import models\n\nfrom components.games.models import Game\n\n\nclass Broadcast(models.Model):\n airdate = models.DateField()\n status = models.CharField(max_length=200)\n number = models.Inte...
python
edit
1
1
apache-2.0
5885c053e9bf20c7b91ebc2c8aebd1dfb9c78a46
bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv
avalonstar/components/broadcasts/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport oauth.oauth as oauth\n\nfrom django.conf import settings\nfrom django.http import HttpResponse\n\nfrom stores import DataStore\n\nOAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'\n\ndef initialize_server_request(request):\n \"\"\"Sho...
python
edit
1
4
bsd-3-clause
0a1358f27db3abb04032fac1b8a3da09d846d23e
e-loue/django-oauth-plus
oauth_provider/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\ndef add_current_unit(request):\n \"\"\"Template context processor to add current unit\"\"\"\n\n return {'CURRENT_UNIT': get_current_unit(request)}\n\n\ndef get_current_unit(request):\n \"\"\"Return the current unit\"\"\"\n\n f...
python
edit
1
3
bsd-2-clause
18a874f312a57b4b9b7a5ce5cf9857585f0f0fef
agepoly/truffe2,ArcaniteSolutions/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2
truffe2/app/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\ndef readreq(filename):\n result = []\n with open(filename) as f:\n for req in f:\n req = req.partition('#')[0].strip()\n if not req:\n ...
python
edit
1
3
apache-2.0
0d176d6d40c5267a8672e2f8511eeec3ff7e4102
klmitch/cli_tools
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nimport hashlib\n\nfrom wdim import orm\nfrom wdim.orm import fields\nfrom wdim.orm import exceptions\n\n\nclass Blob(orm.Storable):\n\n HASH_METHOD = 'sha256'\n\n _id = fields.StringField(unique=True)\n data = fields.D...
python
edit
1
2
mit
4b56e0da85cec4aa89b8105c3a7ca416a2f7919e
chrisseto/Still
wdim/client/blob.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport ircbotframe\nimport sys\n\nclass Handler:\n def __init__(self, host, port=6667, name=\"MediaWiki\", description=\"MediaWiki recent changes bot\", channels=[]):\n self.channels = channels\n self.bot = ircbotframe.ircB...
python
edit
1
3
mit
3e54119f07b0fdcbbe556e86de3c161a3eb20ddf
fenhl/mwikiircbot
mwikiircbot.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom compass.models import (Category,\n Book)\n\n\nclass CategoryTestCase(TestCase):\n def test_can_add_category(self,):\n Category.create(title=\"Mock Category\")\n ...
python
edit
1
1
mit
a78445cfada5cc1f77a7887dc5241071bef69989
andela-osule/bookworm,andela-osule/bookworm
compass/tests/test_models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Tweepy\n# Copyright 2010-2021 Joshua Roesslein\n# See LICENSE for details.\n\nimport datetime\n\n\ndef list_to_csv(item_list):\n if item_list:\n return ','.join(map(str, item_list))\n\n\ndef parse_datetime(datetime_string):\n ...
python
edit
1
2
mit
5bf24464b00257a9fa5f66047a2f7815c1e4f8fb
svven/tweepy,tweepy/tweepy
tweepy/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, unicode_literals\n\nfrom sqlalchemy.orm import joinedload\n\nfrom changes.api.base import APIView\nfrom changes.models import Project, Build\n\n\nclass ProjectIndexAPIView(APIView):\n def...
python
edit
1
2
apache-2.0
b6fc4a8db76b3aad100c6e40ab1b0fb9977dfd0d
wfxiang08/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,dropbox/changes
changes/api/project_index.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport ephem\n\n\nINTERESTING_PLANETS = [\n ephem.Mercury,\n ephem.Venus,\n ephem.Mars,\n ephem.Jupiter,\n ephem.Saturn,\n ephem.Uranus,\n ephem.Neptune,\n]\n\nMIN_ALT = 5.0 * ephem.degree\n\n\nclass AstroObject():\n ...
python
edit
1
3
mit
16a3b90b4b08f83988b659a986d723ee5ac75bfb
peap/alexa-astro,peap/alexa-astro
app/astro.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Make import compatable with python3.5" }, { "role": "assistant", "content": "from __future__ import absolute_import\n\nfrom fenced_code_plus.fenced_code_plus import FencedCodePlusExtension\nfrom fenced_code_plus.fenced_code_plus ...
python
new_file
4
0
bsd-3-clause
c6f2ff563c08eb43ba3f33bc9aaa2647e78701d2
amfarrell/fenced-code-plus
fenced_code_plus/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pyramid.view import view_config\n\nfrom pyramid.httpexceptions import (\n HTTPNotFound,\n)\n\n@view_config(route_name='page', renderer='templates/page.mako')\n@view_config(route_name='page_view', renderer='templates/page.mako')\ndef...
python
edit
1
3
mit
52d32849f4cd38ca7a0fcfc0418e9e9580dd426a
matslindh/kimochi-consumer
kimochiconsumer/views.py
rejected_duplicate
Near-duplicate of sample 169
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2015 UnitedStack, Inc.\n# All Rights Reserved.\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 ...
python
edit
1
0
apache-2.0
b5523a7f3bfd67eac646ee1313bcbb6c9e069f8c
unitedstack/stetho,unitedstack/stetho,openstack/steth,openstack/steth
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nbind = ':5000'\nworkers = 2\nerrorlog = '/var/log/hgprofiler_gunicorn_error.log'\nloglevel = 'info'\naccesslog = '/var/log/hgprofiler_gunicorn_access.log'\n\n```\n\nApply this change: Set gunicorn workers to 4" }, { "role": "assista...
python
edit
1
0
apache-2.0
c81a94568f12fca42c1cce1237c128c3123f6f73
TeamHG-Memex/hgprofiler,TeamHG-Memex/hgprofiler,TeamHG-Memex/hgprofiler,TeamHG-Memex/hgprofiler
gunicorn_config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- encoding: utf-8\n\nimport json\n\nfrom flask import Response, jsonify\n\n\nclass ContextResponse(Response):\n \"\"\"\n This class adds the \"@context\" parameter to JSON responses before\n they're sent to the user.\n\n For...
python
edit
1
4
mit
9be09ccf5749fae1d7a72663d592de5a88a755eb
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
archive/archive_api/src/responses.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.forms.fields import IntegerField, CharField\n\nimport evelink.account\n\n\nclass AddAPIForm(forms.Form):\n key_id = IntegerField()\n v_code = CharField(max_length=64, min_length=1)\n\n def clea...
python
edit
1
7
mit
d0db4010ca9c6d2a6cbc27ae0029dd1ccfc6de42
randomic/aniauth-tdd,randomic/aniauth-tdd
evexml/forms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport tensorflow as tf\n\nslim = tf.contrib.slim\n\n\ndef le_net(images, num_classes=10, scope='LeNet'):\n with tf.variable_scope(scope, 'LeNet', [images, num_classes]):\n net = slim.conv2d(images, 32, [5, 5], scope='conv1')\n ...
python
edit
1
1
mit
a07ac44d433981b7476ab3b57339797edddb368c
philipperemy/tensorflow-class-activation-mapping
lenet_slim.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import Group\nfrom django.db import models\n\nfrom jsonfield import JSONField\n\n\nclass KeyValue(models.Model):\n group = models.ForeignKey(Group, on_delete=models.CASCADE)\n key = models.CharField(max...
python
edit
1
1
isc
7f48dde064acbf1c192ab0bf303ac8e80e56e947
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/kv/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nVERSION = (1, 6, 6, 'alpha', 0)\n\ndef get_version(*args, **kwargs):\n # Don't litter django/__init__.py with all the get_version stuff.\n # Only import if it's actually called.\n from django.utils.version import get_version\n r...
python
edit
1
1
bsd-3-clause
8b19a4e275313cf2226f535d3ec10f414e0c6885
felixjimenez/django,django-nonrel/django,felixjimenez/django,redhat-openstack/django,felixjimenez/django,redhat-openstack/django,redhat-openstack/django,django-nonrel/django,django-nonrel/django,redhat-openstack/django,django-nonrel/django,felixjimenez/django
django/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Load and Unload all GitGutter modules.\n\nThis module exports __all__ modules, which Sublime Text needs to know about.\nThe list of __all__ exported symbols is defined in modules/__init__.py.\n\"\"\"\n\ntry:\n...
python
edit
3
3
mit
facaa380b9b0fbb8f5d6d4d7c6c24257235cbb65
jisaacks/GitGutter
plugin.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport random\nfrom collections import defaultdict, Counter\nfrom . import Player\nfrom ..util import utility\n\n\nclass MonteCarlo(Player):\n\n name = 'MonteCarlo'\n\n def __init__(self, n_sims=1000):\n self.n_sims = n_sims\n ...
python
edit
1
4
mit
7966f771c4b5450625d5247c6bf5369901457d9a
davidrobles/mlnd-capstone-code
capstone/player/monte_carlo.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom markdown2 import markdown, markdown_path\nfrom weasyprint import HTML, CSS\n\nfrom .exceptions import ValidationError\n\n\n__title__ = 'md2pdf'\n__version__ = '0.2.1'\n__author__ = 'Julien Maupetit'\n__license_...
python
edit
1
5
mit
fad484694174e17ef8de9af99db3dda5cd866fac
jmaupetit/md2pdf
md2pdf/core.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\n'Test the functions in the instrumentdb module.'\n\nimport os.path\nimport unittest as ut\n\nimport stripeline.instrumentdb as idb\n\nclass TestInstrumentDb(ut.TestCase):\n def test_pat...
python
edit
1
2
mit
9ff92d0a437e5af08fbf996ed0e3362cbd9cf2c9
ziotom78/stripeline,ziotom78/stripeline
tests/instrumentdb_test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.bower import Bower\nfrom flask.ext.pymongo import PyMongo\n\nfrom config import Config\n\napp = Flask(__name__)\napp.config.from_object(Config)\n\n# Register bower\nBower(app)\n\n# Create mongodb clie...
python
edit
4
0
mit
d98b891d882ca916984586631b5ba09c52652a74
mingrammer/pyreportcard,mingrammer/pyreportcard
app/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .. utils import TranspileTestCase, BuiltinFunctionTestCase\n\n\nclass SumTests(TranspileTestCase):\n def test_sum_list(self):\n self.assertCodeExecution(\"\"\"\n print(sum([1, 2, 3, 4, 5, 6, 7]))\n \"\"\")\n...
python
edit
1
1
bsd-3-clause
14b9ef43fd244d4709d14478ec0714325ca37cdb
cflee/voc,cflee/voc,freakboy3742/voc,freakboy3742/voc
tests/builtins/test_sum.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nsentry.tsdb.dummy\n~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom sentry.tsdb.ba...
python
edit
1
2
bsd-3-clause
8ebec493b086525d23bbe4110c9d277c9b9b8301
daevaorn/sentry,gencer/sentry,mvaled/sentry,BuildingLink/sentry,daevaorn/sentry,beeftornado/sentry,jean/sentry,JackDanger/sentry,JamesMura/sentry,zenefits/sentry,jean/sentry,jean/sentry,ifduyue/sentry,mvaled/sentry,gencer/sentry,BayanGroup/sentry,imankulov/sentry,nicholasserra/sentry,JamesMura/sentry,beeftornado/sentry...
src/sentry/tsdb/dummy.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\n\n\nclass HTTPGetRootTestCase(TestCase):\n def setUp(self):\n pass\n\n def test_get_root_expect_http_200(self):\n url = reverse('microauth_a...
python
edit
1
1
mit
176c03e26f46bad73df39c11ea4a190baca6fe54
microserv/microauth,microserv/microauth,microserv/microauth
apps/authentication/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom wagtail.contrib.modeladmin.options import (\n ModelAdmin, modeladmin_register\n)\nfrom longclaw.longclawshipping.models import ShippingCountry\n\n\nclass ShippingCountryModelAdmin(ModelAdmin):\n model = ShippingCountry\n menu_...
python
edit
1
2
mit
e9949cdf609aeb99cfe97c37638c6cb80c947198
JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw
longclaw/longclawshipping/wagtail_hooks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom PIL import Image\nimport glob\n\n\ndef _get_rectangle_masks():\n TRAIN_MASKS = './data/train/*_mask.tif'\n rectangle_masks = []\n for file_name in glob.glob(TRAIN_MASKS):\n image = Image.open(file_name)\n rectang...
python
edit
2
5
mit
ee5cf0b47d50904061daf62c33741d50b848f02b
Brok-Bucholtz/Ultrasound-Nerve-Segmentation
feature_extraction.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom data_collection.management.commands import BaseXpressWebLookupCsvImporter\n\nclass Command(BaseXpressWebLookupCsvImporter):\n council_id = 'E07000090'\n addresses_name = 'HavantPropertyPostCodePollingStationWebLookup-2017-0...
python
edit
1
0
bsd-3-clause
b94697fe7b4299f66336f56fb98f1c902278caed
DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_havant.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask, Response\nfrom twilio.jwt.client import ClientCapabilityToken\n\napp = Flask(__name__)\n\n\n@app.route('/token', methods=['GET'])\ndef get_capability_token():\n \"\"\"Respond to incoming requests.\"\"\"\n\n # ...
python
edit
1
1
mit
dde622c7296ef1ebb7ee369c029ed1c8c861cf50
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
client/capability-token-incoming/capability-token.6.x.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.auth.models import User\nimport datetime\n\ndef default_expiry_time():\n return datetime.datetime.now() + datetime.timedelta(days=1)\n\ndef random_string():\n return User.objects.make_rand...
python
edit
1
2
mit
0cc4e839d5d7725aba289047cefe77cd89d24593
ndevenish/auth_mac
auth_mac/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom kivy.app import App\n\n\nclass CalendarApp(App):\n \"\"\"Basic App to hold the calendar widget.\"\"\"\n\n def build(self):\n return self.root\n\n```\n\nApply this change: Set the window size to emulate a mobile device" }...
python
edit
1
1
mit
265edc24561bdacfae2412680048c203f7f78c14
hackebrot/garden.calendar
calendarapp.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport pytest\n\nfrom astropy.io import fits\n\nfrom ..pvextractor import extract_pv_slice\nfrom ..geometry.path import Path\nfrom ..gui import PVSlicer\n\nfrom .test_slicer imp...
python
edit
2
2
bsd-3-clause
1f914a04adb4ad7d39ca7104e2ea36acc76b18bd
radio-astro-tools/pvextractor,keflavich/pvextractor
pvextractor/tests/test_gui.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2017-12-04 10:03\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\nimport uuid\n\n\nclass Migration(migrations.Mi...
python
edit
1
0
apache-2.0
6eae274fc200df9319e82abf99d0f2314a17a2af
toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity
formlibrary/migrations/0005_auto_20171204_0203.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add some failsafes to strtobool" }, { "role": "assistant", "content": "def strtobool(x):\r\n try:\r\n b = x.lower() in (\"true\", \"yes\", \"1\", \"y\")\r\n return b\r\n except AttributeError:\r\n retur...
python
new_file
null
null
mit
0bb777c0c77e5b7cac8d48f79f78d3a7cf944943
uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi
backend/uclapi/uclapi/utils.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\nimport arrayfire\n\n# We're going to test several arrayfire behaviours that we rely on\n\n\nfrom asserts import *\nimport afnumpy as af\nimport numpy as np\n\ndef test_cast():\n a = afnumpy.random.rand(2,3)\n # Check that device_ptr d...
python
edit
7
1
bsd-2-clause
34f0e697ba4d6a787f0f4fc294163a09a52c185f
FilipeMaia/afnumpy,daurer/afnumpy
tests/test_arrayfire.py
rejected_lint
Too many lint violations: 7
true