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# This is an auto-generated Django model module.\n# You'll have to do the following manually to clean this up:\n# * Rearrange models' order\n# * Make sure each model has one field with primary_key=True\n# * Remove `managed = False` li...
python
edit
1
0
mit
bb5c0711880f43dd8c726a9749152246eecccc84
carlcarl/rcard,carlcarl/rcard
waterfall_wall/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom collections import defaultdict\n\nfrom flask import current_app\n\nfrom .operation import Operation\nfrom .utils import flask_path_to_swagger, get_state\n\nrules = {}\n\n\ndef schema_path_helper(spec, path, view, **kwargs):\n \"\"\"...
python
edit
1
3
mit
7440f8d3b6b4f2b1022d445fda943e981e6ab890
taion/flask-jsonapiview,4Catalyzer/flask-jsonapiview,4Catalyzer/flask-resty
flask_resty/spec/plugin.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef prompt_for_answer(question=\"\"):\n \"\"\" Prompts the user for an answer\n Args:\n question (String): The question to be displayed to the user\n \n Returns:\n String: The user's answer\n \"\"\"\n\n #...
python
edit
1
3
mit
13b76c32d387e6074719818bc72847afece0080a
dpeters19/webassign2
prompter.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add a placeholder to device token" }, { "role": "assistant", "content": "# Put your device token here. To get a device token, register at http://stage.cloud4rpi.io\r\nDeviceToken = \"YOUR_DEVICE_TOKEN\"\r\n" } ]
python
new_file
1
0
mit
211665a4163801b68d90cbefd5d896f28f374f6f
cloud4rpi/cloud4rpi
settings.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nVerseBot for reddit\nBy Matthieu Grieger\nregex.py\nCopyright (c) 2015 Matthieu Grieger (MIT License)\n\"\"\"\n\nimport re\n\ndef find_verses(message_body):\n \"\"\" Uses regex to search comment body for verse quotations. Returns...
python
edit
1
1
mit
8a83c67c76d2a96fc9a70f2057787efcd9250e0e
Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot
versebot/regex.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nfrom arteria.web.app import AppService\nfrom unittest import TestCase\n\n\nclass AppServiceTest(TestCase):\n\n this_file_path = os.path.dirname(os.path.realpath(__file__))\n\n def test_can_load_configuration(self):\n ...
python
edit
1
1
mit
8a6725554451e8df61c60184d41f618a8cd5c7aa
arteria-project/arteria-core
tests/appservice_integrations_tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport os\n\nfrom plumbum.commands.base import BaseCommand\n\nfrom benchbuild.settings import CFG\nfrom benchbuild.utils.cmd import podman\n\nLOG = logging.getLogger(__name__)\nPODMAN_DEFAULT_OPTS = [\n '--root',\n os....
python
edit
1
1
mit
2a3dece4337f8c8fb1531769413bb514252a0f56
PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild
benchbuild/environments/adapters/podman.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2015 Mirantis, 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
1
apache-2.0
9787fb3a78d681aff25c6cbaac2c1ba842c4c7db
openstack/manila-ui,openstack/manila-ui,openstack/manila-ui
manila_ui/api/network.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom __future__ import print_function\nimport logging\nimport os\n\n\ndef setup_logging():\n # Set log level of the messages to show.\n logger = logging.getLogger()\n level_name = os.environ.get('BUCK_WRAPPER...
python
edit
1
1
apache-2.0
029e31b9f28e2d9882f7453b538eb2c9299ca185
kageiit/buck,facebook/buck,rmaz/buck,clonetwin26/buck,JoelMarcey/buck,clonetwin26/buck,shs96c/buck,clonetwin26/buck,Addepar/buck,romanoid/buck,SeleniumHQ/buck,clonetwin26/buck,ilya-klyuchnikov/buck,JoelMarcey/buck,romanoid/buck,Addepar/buck,JoelMarcey/buck,zpao/buck,shs96c/buck,JoelMarcey/buck,rmaz/buck,SeleniumHQ/buck...
programs/buck_logging.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport os\nimport sys\nimport neovim\n\nfiles = {os.path.abspath(arg) for arg in sys.argv[1:]}\nif not files:\n sys.exit(1)\n\naddr = os.environ.get('NVIM_LISTEN_ADDRESS', None)\nif not addr:\n os.execvp('nvi...
python
edit
1
0
apache-2.0
a9307e1ac7778f6073d275a4822bc5f1df9c45fb
rliang/termedit.nvim
termedit.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport time\n\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\nclass DateRangeTest(unittest.TestCase):\n def setUp(self):\n self.openlicensefile = os.path.join(os.path.dirname(__file_...
python
edit
1
1
mit
c7b7e62cb2585f6109d70b27564617b0be4c8c33
sendgrid/python-http-client,sendgrid/python-http-client
tests/test_daterange.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport dj_database_url\n\nDEBUG = True\nTEMPLATE_DEBUG = True\n\nSECRET_KEY = 'this is my secret key' # NOQA\n\nTEST_RUNNER = 'django.test.runner.DiscoverRunner'\n\nDATABASES = {\n 'default': dj_database_url.config(default='postgres:///...
python
edit
1
0
mit
0c60995d56f57a379438036c2775460268caa03b
SectorLabs/django-postgres-extra
settings.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom collections import defaultdict\nfrom bluesky.examples import stepscan, det, motor\nfrom bluesky.callbacks.broker import post_run, verify_files_saved\nfrom functools import partial\n\n\ndef test_scan_and_get_data(fresh_RE, db):\n RE ...
python
edit
1
1
bsd-3-clause
6ef5a1a91e78c877a099b8c55df2f3f4d84686bb
ericdill/bluesky,ericdill/bluesky
bluesky/tests/test_vertical_integration.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#\n# Copyright (c) 2014 NSONE, Inc.\n#\n# License under The MIT License (MIT). See LICENSE in project root.\n#\nfrom . import resource\n\n\nclass Monitors(resource.BaseResource):\n\n ROOT = 'monitoring/jobs'\n PASSTHRU_FIELDS = ['name...
python
edit
1
1
mit
f01921e6e2fbac76dc41e354b84f970b1591193d
nsone/nsone-python,ns1/nsone-python
nsone/rest/monitoring.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .exceptions import ConnectionError\nfrom pymongo import MongoClient\nfrom pymongo.uri_parser import parse_uri\n\n_connections = {}\n\ntry:\n import gevent\nexcept ImportError:\n gevent = None\n\n\ndef _get_connection(uri):\n g...
python
edit
4
4
mit
b68576d307474eaf6bd8a8853bee767c391d28b9
GGOutfitters/conjure
conjure/connection.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nProxy Server \"Phone Book\".\n\nSimplify running browser tests through a proxy server\nby adding your frequently-used proxies here.\n\nNow you can do something like this on the command line:\n\"pytest SOME_TEST.py --proxy=proxy1\"\n...
python
edit
1
0
mit
fb8fbdedd28eddf55a4846c4af5f0137cad9adfb
mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/seleniumspot,seleniumbase/SeleniumBase,mdmintz/seleniumspot
seleniumbase/config/proxy_list.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport datetime\nfrom cucoslib.models import Analysis, Package, Version, Ecosystem\nfrom cucoslib.workers import GraphImporterTask\n\nfrom .base import BaseHandler\n\n\nclass SyncToGraph(BaseHandler):\n \"\"\" Sync all finished analyses ...
python
edit
5
5
apache-2.0
5cbee0f9fb7ba360e00fbcf94c2c2a7a331dd1b6
fabric8-analytics/fabric8-analytics-jobs,fabric8-analytics/fabric8-analytics-jobs
bayesian_jobs/handlers/sync_to_graph.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.views import generic\n\nfrom ..mixins import BazaarPrefixMixin\nfrom .models import Product\n\n\nclass ProductListView(BazaarPrefixMixin, generic.ListView):\n model = Product\n\n\nclass ProductCreateView(BazaarPrefixMixin, ge...
python
edit
1
0
bsd-2-clause
881a133d30ab750368343d964f6b7110373cd9c5
meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,evonove/django-bazaar,meghabhoj/NEWBAZAAR,evonove/django-bazaar,evonove/django-bazaar
bazaar/goods/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# For now I am assuming the investment date will be returned from the db \n# as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time\n\n#!/usr/bin/env python3\n\nfrom datetime import datetime, timedelta\nimport pytz...
python
edit
1
1
apache-2.0
220f0199c97494e7b8a8ec913cf5251206f15550
googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks
project/scripts/dates.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nWhip's REST API\n\"\"\"\n\n# pylint: disable=missing-docstring\n\nimport socket\n\nfrom flask import Flask, abort, make_response, request\n\nfrom .db import Database\n\napp = Flask(__name__)\napp.config.from_envvar('WHIP_SETTINGS', ...
python
edit
1
3
bsd-3-clause
0ae6b19f69976d2bcff4a0206ec97c6f9198eaa1
wbolster/whip
whip/web.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport pygame\nfrom constants import *\nfrom music_maker import *\nfrom tkinter import Tk\n\ndef main():\n\n # initialize game engine\n pygame.init()\n \n # set screen width/height and caption\n scre...
python
edit
7
2
mit
d02e021a68333c52adff38cc869bf217deebfc5c
kenanbit/loopsichord
run.py
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nfrom django.conf import settings\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif not settings.configured:\n settings.configure(\n ROOT_URLCONF=...
python
edit
1
1
bsd-3-clause
fae7cd0a40d338f82404522a282b71a1cb4d84b1
luzfcb/django-simple-history,luzfcb/django-simple-history,pombredanne/django-simple-history,emergence/django-simple-history,treyhunner/django-simple-history,pombredanne/django-simple-history,treyhunner/django-simple-history,emergence/django-simple-history
runtests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Script to generate an HTML page from a KAF file that shows the text contents\nincluding line numbers.\n\"\"\"\nfrom bs4 import BeautifulSoup\n\n\nwith open('data/minnenijd.kaf') as f:\n xml_doc = BeautifulSoup(f)\n\noutput_html = [...
python
edit
2
0
apache-2.0
3fbb013e8446af0be5013abec86c5503b9343d8e
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
kaf2html.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Utils for Zinnia's tests\"\"\"\nimport cStringIO\nfrom xmlrpclib import Transport\n\nfrom django.test.client import Client\n\n\nclass TestTransport(Transport):\n \"\"\"Handles connections to XML-RPC server\n through Django test ...
python
edit
1
1
bsd-3-clause
7dbe03fcbbbf57ec9380eb9a1c24b5fd9f6594e2
1844144/django-blog-zinnia,petecummings/django-blog-zinnia,jfdsmit/django-blog-zinnia,Maplecroft/django-blog-zinnia,marctc/django-blog-zinnia,Zopieux/django-blog-zinnia,1844144/django-blog-zinnia,petecummings/django-blog-zinnia,bywbilly/django-blog-zinnia,Zopieux/django-blog-zinnia,bywbilly/django-blog-zinnia,extertion...
zinnia/tests/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n\"\"\"Contains the ValueWidget class\"\"\"\n\nfrom .widget import Widget\n\n\nclass ValueWidget(Widget):\n \"\"\"Widget that can be ...
python
edit
1
1
bsd-3-clause
b4120ec570624ae4c66269ae2a8f916ec55734e9
ipython/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets
ipywidgets/widgets/valuewidget.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__version__ = '1.0.0.dev4'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = '<EMAIL>'\n__description__ = 'A shared API for binary quadratic model samplers.'\n\n```\n\nApply this change: Update version 1.0.0.dev4 -> 1.0.0.dev5" }, ...
python
edit
1
0
apache-2.0
2355b13c180bfb065cf5826f5e1e48079822da16
oneklc/dimod,oneklc/dimod
dimod/package_info.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport base64, json, urllib2\n\napi_client_id = \"To3-IKknn36qAAAA\"\napi_client_secret = \"46d028xWl8zXGa3GCOYJMeXlr5pUebCNZcz3SCJj\"\nbasic_auth = base64.b64encode(\"%s:%s\" % (api_client_id, api_client_secret))\n\ndef _create_and_send_re...
python
edit
3
1
apache-2.0
fa89ac95954502c14105857dfbb8dece271408e0
fiesta/fiesta-python
fiesta/fiesta.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport uuid, os\n\ndef gen_uuid(apps, schema_editor):\n WooeyJob = apps.get_model('wooey', 'WooeyJob')\n for obj in WooeyJob...
python
edit
3
2
bsd-3-clause
2409dfabbd53aaa9e21d8b93485cff0dd2db308c
waytai/Wooey,wooey/Wooey,alexkolar/Wooey,wooey/Wooey,hottwaj/Wooey,wooey/Wooey,hottwaj/Wooey,wooey/Wooey,waytai/Wooey,hottwaj/Wooey,alexkolar/Wooey,waytai/Wooey,alexkolar/Wooey
wooey/migrations/0012_wooeyjob_uuid.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport time\n\nfrom simpleflow import (\n activity,\n Workflow,\n futures,\n)\n\n\n@activity.with_attributes(task_list='quickstart', version='example')\ndef repeat50k(s):\n return s * 500...
python
edit
1
2
mit
8182b0b053d45252c7800aa1bf1f750fdfa7f876
botify-labs/simpleflow,botify-labs/simpleflow
examples/jumbo_fields.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\n\nclass PIDFile():\n def __init__(self, path):\n if not path:\n raise IOError('File not found. Please specify PID file path.')\n\n self.path = path\n\n def __enter__(self):\n if not os.path...
python
edit
1
4
apache-2.0
9109d7d148abd8764b750becced3487f6d9ea8fc
Apsu/rpcdaemon
rpcdaemon/lib/pidfile.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport pygame\nimport random\n\nscreen_width = 640\nscreen_height = 480\n\nscreen = None\nready_text = None\n\ndef start():\n global screen, ready_text\n pygame.init()\n screen = pygame.display.set_mode( ( ...
python
edit
1
3
mit
316d3b783d4ca9e1551add910440f20de27d0dff
andybalaam/redgreen
redgreen.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sublime\nfrom ..common import util\n\n\nMYPY = False\nif MYPY:\n from typing import Sequence\n\n\nclass GitSavvyError(Exception):\n def __init__(self, msg, *args, cmd=None, stdout=\"\", stderr=\"\", **kwargs):\n # type: ...
python
edit
3
3
mit
44426207ba65ba6c56c1092b0313f508c59d6b1f
divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy
core/exceptions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nsys.path.append(\"../zvm\")\n\nfrom zmemory import ZMemory\nfrom zlexer import ZLexer\n\nstory = file(\"../stories/zork.z1\").read()\n\nmem = ZMemory(story)\nlexer = ZLexer(mem)\n\nprint \"This story is ...
python
edit
7
0
bsd-3-clause
12edf5a5d77f96986a12105f922fabea83032bad
BGCX262/zvm-hg-to-git,BGCX262/zvm-hg-to-git
tests/scratchtest2.py
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nFunctional tests for ``flocker.node.agents.cinder`` using a real OpenStack\ncluster.\n\"\"\"\n\n# A helper to check the environment for username and API key\n# Create a...
python
edit
2
1
apache-2.0
7c518085d0e1901f12f251069c6b4b90595664b4
jml/flocker,lukemarsden/flocker,agonzalezro/flocker,runcom/flocker,runcom/flocker,w4ngyi/flocker,runcom/flocker,Azulinho/flocker,w4ngyi/flocker,lukemarsden/flocker,AndyHuu/flocker,LaynePeng/flocker,jml/flocker,1d4Nf6/flocker,adamtheturtle/flocker,moypray/flocker,mbrukman/flocker,jml/flocker,Azulinho/flocker,Azulinho/fl...
flocker/node/agents/functional/test_cinder.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys, requests, argparse\nfrom retrying import retry\n\nargparser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\nargparser.add_argument('url')\nargparser.add_argument('-t', '--timeout', type=int, de...
python
edit
1
2
mit
09bf3b9883096e7a433508a6d6e03efad2a137df
ulich/docker-httpavail
httpavail.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Created by Noah Kantrowitz on 2007-07-04.\n# Copyright (c) 2007 Noah Kantrowitz. All rights reserved.\n\nfrom trac.db import Table, Column\n\nname = 'mastertickets'\nversion = 2\ntables = [\n Table('mastertickets', key=('source','dest'...
python
edit
2
2
bsd-3-clause
3f5a6dcd622d7b1c890ced67468ecebd02b1806f
SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin,SpamExperts/trac-masterticketsplugin
mastertickets/db_default.py
rejected_duplicate
Near-duplicate of sample 674
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\n\n\nclass Preprocessor:\n def __init__(self):\n self.reset()\n\n def reset(self):\n self.number_elements = 0\n self.length_elements = []\n self.E_elements = []\n self.I_elements = []\n ...
python
edit
1
5
mit
3ec6dda43e617ddf6ad6b755cbcf2e93d5ff0983
rbn920/feebb
feebb/preprocessor.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport groupelo\n\ndef test_win_expectancy():\n assert groupelo.win_expectancy(1500, 1500) == 0.5\n assert groupelo.win_expectancy(1501, 1499) > 0.5\n assert groupelo.win_expectancy(1550, 1450) > 0.6\n assert groupelo.win_expect...
python
edit
1
1
mit
369efdb0074ec29259e519b5d3974d55a17af56d
dripton/groupelo
test_groupelo.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom wutu.module import Module\n\n\nclass TestModule(Module):\n def __init__(self):\n super(TestModule, self).__init__()\n\n def ping(self):\n return \"pong\"\n\n def get(self):\n return {\"result\": \"Hello\"}...
python
edit
1
1
mit
3ed6c303e935a78781d096ab90e77a6c1360322d
zaibacu/wutu,zaibacu/wutu,zaibacu/wutu
wutu/tests/modules/test_module/test_module.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport autocomplete_light\nfrom models import Case\n\n\nclass CaseAutocomplete(autocomplete_light.AutocompleteModelBase):\n search_fields = ['name']\n\n def choices_for_request(self, *args, **kwargs):\n qs = super(CaseAutocompl...
python
edit
1
1
mit
3ab27c7ff2161d0ce4ccc7f2ffef8e4b5b745911
watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder
feder/cases/autocomplete_light_registry.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Main entry point\n\"\"\"\nimport couchdb\n\nfrom pyramid.config import Configurator\nfrom pyramid.events import NewRequest\nfrom daybed.db import DatabaseConnection, sync_couchdb_views\n\n\ndef add_db_to_request(event):\n request =...
python
edit
5
3
bsd-3-clause
f8a592301aa44e79e504f15e8c0b37a566c3e4cb
spiral-project/daybed,spiral-project/daybed
daybed/__init__.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Write python code for the following: Add some basic geometric functions." }, { "role": "assistant", "content": "import numpy as np\n\n\ndef normalize(v):\n '''Normalize a vector based on its 2 norm.'''\n if 0 == np.linalg.norm(v):\n return v\n return...
python
new_file
1
2
bsd-3-clause
c613b59861d24a7627844114933c318423d18866
xingjiepan/ss_generator
alpha_helix_generator/geometry.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport subprocess\nimport unittest\n\n\nclass TestDataIsInstalled(unittest.TestCase):\n TEST_CMD = \"python -c 'from vulndb import DBVuln; DBVuln.from_id(123)'\"\n\n def test_data_is_installed_in_virtualenv(self):\n # When we r...
python
edit
1
1
bsd-3-clause
a5d1879ce858618179258cca6eaed3ff087a8f42
vulndb/python-sdk,vulndb/python-sdk,LocutusOfBorg/python-sdk
vulndb/tests/test_proper_data_installation.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\n=============\nLineAnimator\n=============\n\nThis example shows off some ways in which you can use the\nLineAnimator object to animate line plots.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sunpy.visualiza...
python
edit
1
0
bsd-2-clause
54054b4e007acbb5f1389a5e2091824a4c083e91
dpshelio/sunpy,dpshelio/sunpy,dpshelio/sunpy
examples/plotting/LineAnimator_examples.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U...
python
edit
1
1
apache-2.0
72216757991a2120bb81e0003496eee908373b0c
ilay09/keystone,rajalokan/keystone,openstack/keystone,ilay09/keystone,mahak/keystone,ilay09/keystone,mahak/keystone,openstack/keystone,rajalokan/keystone,rajalokan/keystone,mahak/keystone,openstack/keystone
keystone/common/policies/ec2_credential.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom flask import Flask, g\nfrom flask.ext.babel import Babel\nfrom flask.ext.sqlalchemy import SQLAlchemy, event\nfrom .sessions import MySessionInterface\n\n\napp = Flask(__name__)\napp.config.from_object('confi...
python
edit
5
1
bsd-3-clause
1090b8b4e17b29b69eb205ac0c7fea65f597807f
Psycojoker/ffdn-db,Psycojoker/ffdn-db
ffdnispdb/__init__.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# from django.shortcuts import render\nfrom django.views.generic import ListView, CreateView, DetailView, TemplateView\nfrom django.core.urlresolvers import reverse\nfrom braces.views import SetHeadlineMixin\nfrom braces.views import Ordera...
python
edit
1
1
bsd-3-clause
99412f8b3394abdab900755095c788604669853d
watchdogpolska/prezydent.siecobywatelska.pl,watchdogpolska/prezydent.siecobywatelska.pl,watchdogpolska/prezydent.siecobywatelska.pl
ankieta/ankieta/petition/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nversion_cmd = 'java -jar /usr/share/jenkins/jenkins.war --version'\nversion_re = '(\\d\\.\\d{3})'\ndepends = ['wget']\ninstall_script = \"\"\"\nwget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -\necho \"deb htt...
python
edit
1
0
isc
b16d634ee9390864da8de6f8d4e7f9e546c8f772
cbednarski/ifs-python,cbednarski/ifs-python
ifs/source/jenkins.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom markdown import markdown\nfrom markdown.extensions.tables import TableExtension\n\nfrom .my_codehilite import CodeHiliteExtension\nfrom .my_fenced_code import FencedCodeExtension\nfrom .my_headerid import HeaderIdExtension\n\n\ndef cus...
python
edit
4
6
apache-2.0
77fac3732f1baae9f3c3be7b38f8837459fee163
belovrv/kotlin-web-site,meilalina/kotlin-web-site,hltj/kotlin-web-site-cn,madvirus/kotlin-web-site,hltj/kotlin-web-site-cn,hltj/kotlin-web-site-cn,JetBrains/kotlin-web-site,hltj/kotlin-web-site-cn,meilalina/kotlin-web-site,JetBrains/kotlin-web-site,JetBrains/kotlin-web-site,hltj/kotlin-web-site-cn,JetBrains/kotlin-web-...
src/markdown/makrdown.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Tests of the test-runner plugins.\"\"\"\n\nimport py\nimport unittest\nfrom nose.plugins import PluginTester\nfrom coverage.runners.noseplugin import Coverage\n\nclass TestCoverage(PluginTester, unittest.TestCase):\n \"\"\"Test the...
python
edit
1
1
apache-2.0
786e98f3c37e1c3bdedc424ed6eaec86e900ec83
jayhetee/coveragepy,nedbat/coveragepy,jayhetee/coveragepy,larsbutler/coveragepy,7WebPages/coveragepy,larsbutler/coveragepy,hugovk/coveragepy,blueyed/coveragepy,nedbat/coveragepy,7WebPages/coveragepy,hugovk/coveragepy,hugovk/coveragepy,blueyed/coveragepy,larsbutler/coveragepy,jayhetee/coveragepy,jayhetee/coveragepy,jayh...
test/test_testplugin.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nVERSION = (1, 6, 0, 'beta', 2)\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 re...
python
edit
1
1
bsd-3-clause
ed9b7b6295f311dbbd7f66f0cbcb393ab122afec
dex4er/django,django-nonrel/django,redhat-openstack/django,felixjimenez/django,redhat-openstack/django,dex4er/django,django-nonrel/django,dex4er/django,django-nonrel/django,redhat-openstack/django,redhat-openstack/django,django-nonrel/django,felixjimenez/django,felixjimenez/django,felixjimenez/django
django/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport shutil\nimport warnings\n\nimport six\nimport typepy\n\nfrom ._err...
python
edit
1
2
mit
dfc1851f27fa3de8de11d1facccfe28ae8e90dc6
thombashi/subprocrunner,thombashi/subprocrunner
subprocrunner/_which.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom celery.loaders.djangoapp import Loader as DjangoLoader\nfrom celery.loaders.default import Loader as DefaultLoader\nfrom django.conf import settings\nfrom django.core.management import setup_environ\n\n\"\"\"\n.. class:: Loa...
python
edit
1
0
bsd-3-clause
58ce11d293d19247e2765176983edc5e552bdfd5
frac/celery,cbrepo/celery,cbrepo/celery,mitsuhiko/celery,ask/celery,frac/celery,ask/celery,WoLpH/celery,mitsuhiko/celery,WoLpH/celery
celery/loaders/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom functools import wraps\nfrom argparse import ArgumentParser\nfrom fabric.context_managers import prefix\n\n\ndef cached_property(func):\n cach_attr = '_{0}'.format(func.__name__)\n\n @property\n def wrap(self):\n ...
python
edit
4
3
bsd-2-clause
8ce509a2a3df1fcc38442e35e8733bf00bd788ad
chop-dbhi/harvest,tjrivera/harvest
harvest/decorators.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf8\n\nfrom .common import *\n\n\nclass TestContainers(TestCase):\n\n def test_unicode_filename(self):\n\n container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')\n\n```\n\nApply this change: Disable unicode filename t...
python
edit
6
1
bsd-3-clause
27aad0e3ed95cb43b28eb3c02fa96b3a9b74de5b
PyAV-Org/PyAV,mikeboers/PyAV,PyAV-Org/PyAV,mikeboers/PyAV
tests/test_container.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Package for parsing and compiling Python source code\n\nThere are several functions defined at the top level that are imported\nfrom modules contained in the package.\n\nparse(buf, mode=\"exec\") -> AST\n Converts a string containi...
python
edit
7
0
mit
28514ecf13ee124af6fee43e032cbbfe6a2a50e0
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/compiler/__init__.py
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nclass TaxGroup(models.Model):\n\n name = models.CharField(_(\"group name\"), max_length=100)\n rate = models.DecimalField(_(\"rate\"), max_digits...
python
edit
1
1
bsd-3-clause
6b83217f422b46ef9cc4ef5aa124350eee825fe1
taedori81/satchless
satchless/contrib/tax/flatgroups/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\n\nfrom flask import (\n\tFlask,\n\trender_template,\n\tabort\n)\n\nfrom glanerbeard.server import Server\n\napp = Flask(__name__)\napp.config.from_pyfile('../settings.py')\n\nservers = Server.createFromConfig(app.config['SER...
python
edit
5
2
apache-2.0
c7a002c3c0f86db931fdc0a3240ff38ffab03ff8
daenney/glanerbeard
glanerbeard/web.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport threading\nimport time\n\nclass SensorThread(object):\n\n def __init__(self, notify, delay=0):\n self.notify = notify\n self.delay = delay\n self.interval = 0.2\n self.color = -1\n\n def start(self, ...
python
edit
2
3
bsd-2-clause
1a74d34d358940175c9e5ac50a11ac3f0f40729b
legorovers/legoflask,legorovers/legoflask,legorovers/legoflask
app/sense.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n # -*- coding: utf-8 -*-\n\nimport os\nimport pkgutil\n\nfrom mako.lookup import TemplateLookup\nfrom mako.template import Template\n\n\nclass DottedTemplateLookup(TemplateLookup):\n def __init__(self, pkg):\n self.dfltpkg = pkg\n...
python
edit
3
3
bsd-3-clause
156093f3b4872d68663897b8525f4706ec5a555c
tjcorona/PyFR,tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,iyer-arvind/PyFR,Aerojspark/PyFR
pyfr/template.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import, unicode_literals\nimport itertools\nfrom .util import trim\n\ndef render(item, **fields):\n \"\"\" Render the given item\n \"\"\"\n if item ...
python
edit
1
6
bsd-2-clause
4f9db35566332778853e993f7791116d66c49dd4
swayf/grako,swayf/grako
grako/rendering.py
rejected_duplicate
Near-duplicate of sample 4704
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# == Requires python 3.4! ==\n# Changes Unicode symbols with other symbols that looks the same.\nfrom data import Data\n\nif __name__ == \"__main__\":\n data = Data()\n if not data.load() or not data.hasMatches():\n print(\"Use...
python
edit
1
0
mit
b3cbd97738c03975f89cc0264cfd47ea44b9728e
netromdk/annoycode
annoycode.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom Measurement import Measurement\n\nclass Recorder(object):\n def __init__(self, recorderType):\n self.recorderType = recorderType\n\n def record(self, measure: Measurement):\n None\n\nclass PrintRecorder(Recorder):\n...
python
edit
1
2
mit
08b998d63808b99cf96635bd50b7d33238cda633
hectortosa/py-temperature-recorder
Recorders.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth import logout as auth_logout\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.generic.detail import SingleObjectMixin\nfrom django.views.gene...
python
edit
3
1
bsd-3-clause
9530f7a65b5381fbb178dab120454dfc40a8d604
popen2/djangopypi2,popen2/djangopypi2,pitrho/djangopypi2,hsmade/djangopypi2,pitrho/djangopypi2,hsmade/djangopypi2
djangopypi2/apps/pypi_users/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom logging import Logger\n\n\nclass OAuthStateStore:\n @property\n def logger(self) -> Logger:\n raise NotImplementedError()\n\n def issue(self) -> str:\n raise NotImplementedError()\n\n def consume(self, state: ...
python
edit
1
1
mit
dca70886d2535dd843ea995b8d193958997de41b
slackhq/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient,slackapi/python-slackclient
slack_sdk/oauth/state_store/state_store.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- encoding: utf8 -*-\nimport json\nimport sys\n\n\nresult = {}\n\nINDEX = {\n \"AREA\": 5 + 3 * 3 + 3 * 3,\n \"CITY\": 5 + 3 * 3,\n \"CODE\": 5\n}\n\nfor line in open(\"ORIGIN.txt\"):\n code = line[:IN...
python
edit
1
0
mit
009a9f401fd0c1dba6702c1114a73b77f38b9ce3
lihengl/dizu-api,lihengl/dizu-api
bin/parse.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\nimport os,time,asyncio,json\nimport logging\nlogging.basicConfig(level=logging.ERROR)\ntry:\n\tfrom aiohttp import web\nexcept ImportError:\n\tlogging.error(\"Can't import module aiohttp\")\nfrom tools.log import Log...
python
edit
7
1
mit
cca432708ec6220c8d3b7f23ff8c7c5f29d6737a
free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog
app/tools/application.py
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport importlib\nfrom typing import List, Tuple, Union\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.apps import AppConfig\n\n\nclass MqueueConfig(AppConfig):\n name = \"mqueue\"\n verbose_name = _(u\"Events q...
python
edit
1
3
mit
f0017fc656bc3ee0cfbe1bafe73efe9abc27bc32
synw/django-mqueue,synw/django-mqueue,synw/django-mqueue
mqueue/apps.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import user_passes_test\nfrom django.shortcuts import render\nfrom django.core.paginator import Paginator\n\nfrom .forms import ReportForm\nfrom .models import Report\n\n\ndef can_add_reports(user):\n ...
python
edit
1
4
mit
dfa3a3c120b2555706c37da19496557a55f743db
Hackfmi/Diaphanum,Hackfmi/Diaphanum
reports/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom app import app\nfrom app.models import Post\nfrom flask import render_template\n\n\n@app.route('/')\n@app.route('/page/<int:page>')\ndef blog(page=1):\n \"\"\"View the blog.\"\"\"\n posts = Post.query.filter_by_latest()\n if p...
python
edit
1
2
mit
b529bc715ff133147576aa9026fd281226b7f3b7
thebitstick/Flask-Blog,thebitstick/Flask-Blog
app/views.py
rejected_duplicate
Near-duplicate of sample 21538
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# This file is part of Indico.\n# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).\n#\n# Indico is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License as\n...
python
edit
1
0
mit
23bf1380d20e0782025ba997f3d33be6d873ae04
ThiefMaster/indico-plugins,indico/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins,indico/indico-plugins,indico/indico-plugins,ThiefMaster/indico-plugins,indico/indico-plugins
piwik/indico_piwik/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.views.generic.base import RedirectView\n\nfrom wagtail.wagtailc...
python
edit
3
0
mit
c3ee23290183f240f52942a121ae048108e7853e
apihackers/wapps,apihackers/wapps,apihackers/wapps,apihackers/wapps
demo/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"The top-level package for ``django-mysqlpool``.\"\"\"\n# These imports make 2 act like 3, making it easier on us to switch to PyPy or\n# some other VM if we need to for performance reasons.\nfrom __future__ im...
python
edit
1
2
mit
f8746cc68deb32d2c01201d8014c7e423e891c30
smartfile/django-mysqlpool
django_mysqlpool/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport os\nimport codecs\n\nimport kombu\n\nfrom kombulogger import default_broker_url, default_queue_name\n\n\nclass KombuLogServer(object):\n\n log_format = '{host}\\t...
python
edit
1
4
mit
e228042b7b59ab1b2be6e772dabbf595befc2cf6
tuomur/kombulogger
kombulogger/server.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\n\nclass PackageError(Exception):\n \"\"\"Exception to be raised when user wants to exit on error.\"\"\"\n\n\nclass RecipeError(Exception):\n \"\"\"Exception to be raised when user wants to exit on...
python
edit
1
1
bsd-3-clause
26e43b23a72a85c23184c2f5551885d65cc17831
mandeep/conda-verify
conda_verify/errors.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n# for details. All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\n\"\"\"Top-level presub...
python
edit
3
1
bsd-3-clause
c104c70ad79edfa23d1a2ed76d37a25f77cd6586
dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk...
PRESUBMIT.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Snap(models.Model):\n filename = models.CharField()\n downloaded = models.DateTimeField('date downloaded')\n\n\n```\n\nApply this change: Add length to filename field" }, { "role": "assist...
python
edit
1
0
mit
75433ba1f8a0c057eacc49c77caf17fe19ffcda1
burk/helgapp,burk/helgapp
snapp/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom tower import ugettext_lazy as _\n\nfrom challenges.models import Submission\n\n\nclass EntryForm(forms.ModelForm):\n \n class Meta:\n model = Submission\n fields = (\n 'title',...
python
edit
1
0
bsd-3-clause
bc9012c887065e503a5ac231df8ed4e47a2175ad
mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite
apps/challenges/forms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nbyceps.services.party.models.setting\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom ....database import db\nfrom ....typing impor...
python
edit
1
1
bsd-3-clause
fbb8408c0f31079d79e08cd77fe54d27d6eb5f45
homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps
byceps/services/party/models/setting.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport yaml\nimport newspaper\nfrom newspaper import news_pool\n\n\ndef get_config():\n with open('/options/config.yml') as file:\n config = yaml.safe_load(file)\n keys = config.keys()\n if not 'threads' in keys:\n co...
python
edit
1
1
mit
a8e87b389c8b61e986ffb3c9c25af71c09796b52
projectweekend/Article-Collector
collector.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom braces.views import LoginRequiredMixin\nfrom django.core.exceptions import PermissionDenied\nfrom django.shortcuts import (\n get_object_or_404,\n redirect\n)\n\nfrom contacts.models import (\n Book,\n BookOwner,\n)\n\n\ncl...
python
edit
4
3
mit
732a49045d0e5f2dabc6c3d4b89e9be41633b1d8
phildini/logtacts,phildini/logtacts,phildini/logtacts,phildini/logtacts,phildini/logtacts
contacts/views/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport datetime\n\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\n\nimport tmdbsimple as tmdb\nfrom .models import Movie\n\n\nclass MovieTestCase(TestCase):\n def setUp(self):\n User.objects.create(...
python
edit
1
1
mit
6ae9da5ddf987873abb6f54992907542eaf80237
simon-andrews/movieman2,simon-andrews/movieman2
movieman2/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport asyncio\nimport logging\nimport sys\n\nimport discord\nfrom discord.ext.commands import when_mentioned_or\nimport yaml\n\nfrom bot import BeattieBot\n\ntry:\n import uvloop\nexcept ImportError:\n pass\nel...
python
edit
3
0
mit
5b151720d3a2e5409e28d7f4a9c989fc8176cb32
BeatButton/beattie,BeatButton/beattie-bot
main.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass InitCommands(object):\n COPY = 'copy'\n CREATE = 'create'\n DELETE = 'delete'\n\n @classmethod\n def is_copy(cls, command):\n return command == cls.COPY\n\n @classmethod\n def is_create(cls, command):\n ...
python
edit
1
4
apache-2.0
ff66e137532593bfa3ce16b993be636236f549a2
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon/scheduler/spawners/templates/init_containers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom functools import wraps\n\nimport gevent\nfrom greenlet import GreenletExit\n\n\ndef exit_on_error(func):\n @wraps(func)\n def wrapper(*args, **kw):\n try:\n func(*args, **kw)\n except gevent.get_hub().SYS...
python
edit
1
4
bsd-3-clause
cfac1504b590d329ffb56d1a46cad7cc1b4b22ff
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/couch_sql_migration/util.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef update_keys(keys):\n \"\"\"Change keys we used to support to their new equivalent.\"\"\"\n updated_keys = list()\n for key in keys:\n if key in translations:\n updated_keys += [translations[key]]\n else...
python
edit
1
3
mit
643d7c2515c663777a058c9fce02beedeb34b77a
plotly/python-api,plotly/plotly.py,plotly/python-api,ee-in/python-api,ee-in/python-api,plotly/python-api,plotly/plotly.py,ee-in/python-api,plotly/plotly.py
plotly/graph_objs/graph_objs_tools.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\nimport json\nimport sys\nfrom os import scandir, remove\nfrom datetime import datetime\n\n\nSTART_DT = datetime(2016, 7, 1, 0, 0, 0)\nEND_DT = datetime(2016, 12, 1, 0, 0, 0)\nDRY_RUN = True\n\n\nfor dir_entry in s...
python
edit
1
0
mit
3484610b0c711b000da8dc37ab76649aa4abfc58
moskytw/mining-news
ptt_preproc_filter.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom takeyourmeds.utils.test import SuperuserTestCase\n\nclass SmokeTest(SuperuserTestCase):\n def test_index(self):\n self.assertGET(200, 'groups:admin:index', login=True)\n\n def test_view(self):\n self.assertGET(\n ...
python
edit
1
1
mit
71cf0ce2348b46841f2f37c2c8934726832e5094
takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web
takeyourmeds/groups/groups_admin/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Memoir URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.9/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app impo...
python
edit
1
0
mit
808b248d71785e44f764b7724e0d2812a750c9b4
nivbend/memoir,nivbend/memoir,nivbend/memoir
Memoir/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom discord import Embed\n\n\ndef build_embed(ctx, desc: str, title: str = ''):\n\tname = ctx.message.server.me.nick if ctx.message.server.me.nick is not None else ctx.bot.user.name\n\tembed = Embed(\n\t\ttitle=title,\n\t\tdescription=desc...
python
edit
1
3
apache-2.0
a2d4381de5dc50110a0e57d7e56a668edbee2ccf
HellPie/discord-reply-bot
bot/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright (c) 2016 Orange and others.\n#\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Apache License, Version 2.0\n# which accompanies this distr...
python
edit
1
1
apache-2.0
81189460862be9d03c951c318df6ada2ffefb02f
mywulin/functest,opnfv/functest,mywulin/functest,opnfv/functest
functest/tests/unit/utils/test_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# SPDX-License-Identifier: MIT\n\n\"\"\"Convert older RSON stylesheets to YAML format\n\nRun the script with the filename to convert, it outputs to stdout\n\"\"\"\n\nimport argparse\nimport json\n\nimport yaml\n\nfro...
python
edit
1
4
mit
23d5d0e0e77dc0b0816df51a8a1e42bc4069112b
rst2pdf/rst2pdf,rst2pdf/rst2pdf
rst2pdf/style2yaml.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nimport pprint\nimport warnings\n\nfrom gpn.node import Node\n\nsuffix = '.node'\nsuffix_default = '.node-default'\n\n\nclass Graph(object):\n def __init__(self, path=None, nodes=None):\n global ...
python
edit
3
7
mit
e44d32f18b438dc56bf483aecd3b9f3db03e6fae
shawnbrown/gpn,shawnbrown/gpn
gpn/graph.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport boris\n\nfrom .base import STATIC_URL\n\n# helper for building absolute paths\nPROJECT_ROOT = os.path.abspath(os.path.dirname(boris.__file__))\np = lambda x: os.path.join(PROJECT_ROOT, x)\n\nDATABASES = {\n 'default': {...
python
edit
1
0
mit
bd4b4af4596120d1deee6db4e420829c0d40e377
fragaria/BorIS,fragaria/BorIS,fragaria/BorIS
boris/settings/config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nfrom numba import *\nimport numpy as np\n\n@jit(object_(double[:, :]))\ndef func2(A):\n L = []\n n = A.shape[0]\n for i in range(10):\n for j in range(10):\n temp = A[i-n : i+n+1, j-2 : j+n+1]\n ...
python
edit
5
3
bsd-2-clause
e380ef8d890db4cd21ab9ceb943a38758526976f
gdementen/numba,seibert/numba,numba/numba,ssarangi/numba,pombredanne/numba,pitrou/numba,cpcloud/numba,gmarkall/numba,ssarangi/numba,stefanseefeld/numba,gmarkall/numba,seibert/numba,stuartarchibald/numba,IntelLabs/numba,GaZ3ll3/numba,stefanseefeld/numba,gdementen/numba,stefanseefeld/numba,gmarkall/numba,pombredanne/numb...
numba/tests/issues/test_issue_184.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nimport unittest\n\n\nclass TestAAPickle(unittest.TestCase):\n\n def test_no_cpickle(self):\n from celery.tests.utils import mask_modules\n del(sys.modules[\"celery.serialization\"])\n with mask_modules(\"...
python
edit
1
1
bsd-3-clause
c74cb57a8c0186b4186319018a1ed6d7f3687882
frac/celery,WoLpH/celery,mitsuhiko/celery,frac/celery,ask/celery,cbrepo/celery,WoLpH/celery,cbrepo/celery,ask/celery,mitsuhiko/celery
celery/tests/test_serialization.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\nimport operator\n\nimport numpy\n\nimport dask.array\n\nfrom . import _compat\n\n\ndef _norm_input_labels_index(input, labels=None, index=None):\n \"\"\"\n Normalize arguments to a standard form.\n \"\"...
python
edit
1
4
bsd-3-clause
2dfe6e78088f974310c1e7fc309f008310be0080
dask-image/dask-ndmeasure
dask_ndmeasure/_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('neuroimaging', parent_package, top_path)\n\n config.add_subpackage('algorithms')\n ...
python
edit
3
1
bsd-3-clause
5e12fbf432331f1cc6f16c85e9535c12e5584ecc
alexis-roche/nipy,alexis-roche/register,arokem/nipy,alexis-roche/register,alexis-roche/niseg,nipy/nireg,nipy/nipy-labs,nipy/nireg,arokem/nipy,alexis-roche/nipy,alexis-roche/register,arokem/nipy,alexis-roche/nireg,bthirion/nipy,nipy/nipy-labs,alexis-roche/nireg,bthirion/nipy,bthirion/nipy,alexis-roche/nipy,arokem/nipy,a...
neuroimaging/setup.py
rejected_duplicate
Near-duplicate of sample 20600
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom shortuuid.main import (\n encode,\n decode,\n uuid,\n get_alphabet,\n set_alphabet,\n ShortUUID,\n)\n\n```\n\nApply this change: Include `random` in imports from shortuuid.main\n\nWhen `random` was added to `main.py` ...
python
edit
9
0
bsd-3-clause
b7f2efe79e5a91ab78850842eafc73d1ee0a52cc
skorokithakis/shortuuid,stochastic-technologies/shortuuid
shortuuid/__init__.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\ntry:\n import crowdai\nexcept:\n raise Exception(\"Please install the `crowdai` python client by : pip install crowdai\")\nimport argparse\nparser = argparse.ArgumentParser(description='Upload saved docker envir...
python
edit
1
0
mit
4d8c7aea5e808075a68d810fb7c966808ad28bca
stanfordnmbl/osim-rl,vzhuang/osim-rl
scripts/upload_2_crowdai.py
accepted
null
true