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\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-template-tests',\n\n url=\"https://chris-lamb.co.uk/projects/django-template-tests\",\n version='1.0.0',\n description=\"Performs some...
python
edit
1
0
bsd-3-clause
841cb6e54c40ee745e69f8e0d538024a40e113c2
lamby/django-template-tests
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nfrom django.http import HttpResponse\nfrom django.template import RequestContext, loader\n\n\ndef ajax_aware_render(request, template_list, extra_context=None, **kwargs):\n if isinstance(template_list, basestring):\n ...
python
edit
2
4
bsd-3-clause
6f3b45cd6b5558a7d81472c0298aae7d04f64846
lincolnloop/django-jsonit
jsonit/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom models import AuthenticationError,AuthenticationRequired\nimport trello\nimport unittest\nimport os\n\nclass TestTrello(unittest.TestCase):\n\n\tdef test_login(self):\n\t\tusername = os.environ['TRELLO_TEST_USER']\n\t\tpassword = os.en...
python
edit
3
2
bsd-3-clause
f06c7813663dc9ac4bf63601574617acf5d7324d
mehdy/py-trello,sarumont/py-trello,nMustaki/py-trello,Wooble/py-trello,ntrepid8/py-trello,WoLpH/py-trello,portante/py-trello,merlinpatt/py-trello,gchp/py-trello
tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom datetime import date\nimport os\nimport sys\n\nargv = sys.argv\nif '-w' not in argv and '--where' not in argv:\n argv[1:1] = ['-w', 'tests']\nif '--logging-level' not in argv:\n argv[1:1] = ['--logging-leve...
python
edit
4
0
apache-2.0
a134179d143f05842315a134f0a744f61003d2ca
mikekap/batchy
tests.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\nfrom mpi4py import MPI\n\n\ncomm = MPI.COMM_WORLD\n\n\ndef get_host():\n return MPI.Get_processor_name()\n\n\ndef get_rank():\n return comm.Get_rank()\n\n\ndef finalize():\n return MPI.Finalize()\n\n```\n\...
python
edit
1
3
mit
28bf565f30a6d9b25bd6bc24ce5958a98a106161
IanLee1521/utilities
mpi/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nimport re\n\nLABEL_LENGTH = 255\n\n\ndef is_managed(db_table):\n return False\n\n\ndef model_name_to_snake(value):\n original_model_string = re.findall('[A-Z][^A-Z]*', value)\...
python
edit
3
2
mit
f2ef48c3b1753e4b53b86c1f9d7a3da517a6d136
masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api
web/impact/impact/models/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nclass Worker():\n def __init__(self,job,name):\n self.fn = job\n self.name = name\n\n def do(self,timestamp):\n pid = None\n try:\n print('[{timestamp}] {name}'.format(timestamp=time...
python
edit
1
5
apache-2.0
14f3df107a2b129ff7f22c849de2aa19326db074
stvreumi/electronic-blackboard,stvreumi/electronic-blackboard,stvreumi/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electronic-blackboard,Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,stvreumi/electronic-blackboard,SWLBot/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electr...
worker.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom control_milight.models import LightAutomation\nfrom control_milight.views import update_lightstate\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.utils.timezone import ...
python
edit
3
7
bsd-3-clause
468f41f0bf734cdbb27dea7b5d910b6234f4c21a
ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display
homedisplay/control_milight/management/commands/run_timed.py
rejected_duplicate
Near-duplicate of sample 425
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport platform\n\nif platform.node().startswith('garnet') or platform.node().startswith('copper'):\n from garnet import *\nelse:\n from default import *\n```\n\nApply this change: Correct detection on Garnet/Copper compute nodes" }...
python
edit
3
0
mit
71a417d2558776cd29195c1a1b905070a08407b5
erdc/proteus,erdc/proteus,erdc/proteus,erdc/proteus
proteus/config/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef test_not_dirty_by_default(nested_config):\n assert not nested_config.is_dirty()\n assert not nested_config['a'].is_dirty()\n\n\ndef test_set_parent(nested_config):\n nested_config.root.value += 1\n assert nested_config.is_di...
python
edit
1
1
bsd-3-clause
18a3b758311174d0be2519789f985d8113438c90
vmalloc/confetti
tests/test_dirty_mark.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom types import UnicodeType, StringType\n\nclass PropertyMappingFailedException(Exception):\n pass\n\ndef get_transformed_properties(source_properties, prop_map):\n results = {}\n for key, value in prop_map.iteritems():\n ...
python
edit
1
10
mit
67a5eb0921f746c205e555ae296b6c15e4eb7eab
OpenBounds/Processing
property_transformation.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# RUN: python %s | display-check -\n\nimport uwhd\n\ndef main():\n version = 1\n black_score = 3\n white_score = 5\n time = 42\n\n mgr = uwhd.GameModelManager()\n\n print('# SET-VERSION: %d' % (version,))\n print('# SET-STATE: FirstH...
python
edit
1
1
bsd-3-clause
22e41d02d9c877703f21c5121202d295cb5fbcb0
Navisjon/uwh-display,Navisjon/uwh-display,Navisjon/uwh-display,jroelofs/uwh-display,Navisjon/uwh-display,jroelofs/uwh-display,jroelofs/uwh-display
test/swig/canvas.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\nJunction = namedtuple('Junction',\n ['ref', 'ref_count', 'contig', 'contig_count'])\n\n\ndef get_ref_jbrowse_link(contig, loc):\n return (contig.parent_reference_genome.get_client_jbrowse_...
python
edit
1
2
mit
633c52cf90655981d1adc962d7571d5d67619ccb
churchlab/millstone,churchlab/millstone,woodymit/millstone,woodymit/millstone,woodymit/millstone,churchlab/millstone,woodymit/millstone,churchlab/millstone
genome_designer/genome_finish/contig_display_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\ncategories: Core\ndescription: f-strings don't support concatenation with adjacent literals if the adjacent literals contain braces\ncause: MicroPython is optimised for code space.\nworkaround: Use the + operator between literal str...
python
edit
1
0
mit
e99f7b6d25464f36accc2f04899edfa9e982bee2
adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython
tests/cpydiff/core_fstring_concat.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport frappe\nfrom frappe.utils import get_datetime\n\ndef execute():\n\tweekdays = [\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"]\n\n\tweekly_events = frappe.get_list(\"Event\", filters={\"rep...
python
edit
1
2
mit
bbe425da10607692c1aace560b1b61b089137704
mhbu50/frappe,saurabh6790/frappe,vjFaLk/frappe,almeidapaulopt/frappe,vjFaLk/frappe,frappe/frappe,almeidapaulopt/frappe,vjFaLk/frappe,mhbu50/frappe,mhbu50/frappe,StrellaGroup/frappe,StrellaGroup/frappe,almeidapaulopt/frappe,adityahase/frappe,adityahase/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,yashodh...
frappe/patches/v12_0/rename_events_repeat_on.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nfrom IPython.parallel import Client\nfrom distarray.client import DistArrayContext\n\n\nclass TestDistArrayContext(unittest.TestCase):\n\n def setUp(self):\n self.client = Client()\n self.dv = self.client[:...
python
edit
1
1
bsd-3-clause
02d7f2b946293169e3d46f84f50f2fa801a33c95
RaoUmer/distarray,enthought/distarray,enthought/distarray,RaoUmer/distarray
distarray/tests/test_client.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom os.path import dirname, join\nimport uuid\n\nimport qiniu.conf\nimport qiniu.io\nimport qiniu.rs\nimport qiniu.rsf\n\n\nQINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')\nQINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_K...
python
edit
2
2
mit
55b0d7eba281fc2c13505c956f5c23bb49b34988
glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,Mark-Shine/django-qiniu-storage,jackeyGao/django-qiniu-storage
tests/test_qiniu.py
rejected_duplicate
Near-duplicate of sample 16893
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport os\n\n\nurlpatterns = []\n\n\n# load the rapidsms configuration\nfrom rapidsms.config import Config\nconf = Config(os.environ[\"RAPIDSMS_INI\"])\n\n\n# iterate each of the active...
python
edit
10
0
bsd-3-clause
e26434ee69545b8c16b62ebd78e5bec0c95d579a
rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy
lib/rapidsms/webui/urls.py
rejected_lint
Too many lint violations: 10
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pickle\nfrom six.moves import range\n\nfrom fuel.utils import do_not_pickle_attributes\n\n\n@do_not_pickle_attributes(\"non_pickable\", \"bulky_attr\")\nclass TestClass(object):\n def __init__(self):\n self.load()\n\n de...
python
edit
1
1
mit
f67704c271b8b88ba97d1b44c73552119d79b048
chrishokamp/fuel,ejls/fuel,harmdevries89/fuel,glewis17/fuel,EderSantana/fuel,rodrigob/fuel,markusnagel/fuel,bouthilx/fuel,janchorowski/fuel,aalmah/fuel,vdumoulin/fuel,rodrigob/fuel,orhanf/fuel,laurent-dinh/fuel,rizar/fuel,capybaralet/fuel,aalmah/fuel,hantek/fuel,mila-udem/fuel,janchorowski/fuel,hantek/fuel,dmitriy-serd...
tests/test_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom framework.tasks.handlers import enqueue_task\nfrom framework.archiver.tasks import archive, send_success_message\nfrom framework.archiver.utils import (\n link_archive_provider,\n)\nfrom framework.archiver import (\n ARCHIVER_SUC...
python
edit
1
7
apache-2.0
527d460289cb574528f70a2a6c530e86627eb81a
pattisdr/osf.io,ticklemepierce/osf.io,billyhunt/osf.io,wearpants/osf.io,mluo613/osf.io,ckc6cz/osf.io,doublebits/osf.io,aaxelb/osf.io,chrisseto/osf.io,amyshi188/osf.io,abought/osf.io,DanielSBrown/osf.io,adlius/osf.io,Nesiehr/osf.io,laurenrevere/osf.io,monikagrabowska/osf.io,kwierman/osf.io,amyshi188/osf.io,reinaH/osf.io...
framework/archiver/listeners.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport subprocess\nimport sys\nimport setup_util\nfrom os.path import expanduser\nimport os\nimport getpass\n\ndef start(args, logfile, errfile):\n setup_util.replace_text(\"dancer/app.pl\", \"localhost\", args.database_host)\n setup_util...
python
edit
4
4
bsd-3-clause
8a80e33c80732fc03ba2293e1b1219407c3c634c
joshk/FrameworkBenchmarks,sgml/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,jetty-project/FrameworkBenchmarks,testn/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,Synchro/FrameworkBenchmarks,nbrady-techempower/Framework...
frameworks/Perl/dancer/setup.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom nose.tools import *\nfrom analyse_idynomics import *\nfrom os.path import join, dirname, realpath\n\nclass TestAnalyseiDynomics:\n expected_solutes = ['MyAtmos', 'pressure']\n expected_species = ['MyBact']\n \n def setUp(se...
python
edit
9
1
mit
95b6035b82ffeee73bbde953e5d036c50fa4fa8c
fophillips/pyDynoMiCS
unit_tests/test_analyse_idynomics.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom fluent_pages.extensions import page_type_pool\nfrom fluent_pages.integration.fluent_contents.page_type_plugins import FluentContentsPagePlugin\nfrom fluent_pages.models import UrlNode\n\nfrom...
python
edit
5
2
mit
1e082f8c39dd1a1d41064f522db10478b0c820e1
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
icekit/page_types/layout_page/page_type_plugins.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\" Explore how python works with lambda expressions. \"\"\"\nimport unittest\nimport string\nimport random\n\nclass TestGetWebsites(unittest.TestCase):\n\n def test_closure(self, m):\n \"\"\" See that python supports closures ...
python
edit
1
2
mit
d32e1d8349c115027e3095d61f8fa882fca1ab52
b-ritter/python-notes,b-ritter/python-notes
functions/test_lambda.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\n\ndef path(*p):\n import __main__\n project_root = os.path.dirname(os.path.realpath(__main__.__file__))\n return os.path.join(project_root, *p)\n\n\n```\n\nApply this change: Set docstring for \"path\" function" }, ...
python
edit
1
1
mit
670a5ffe8de9f21fbb2fe65e72e006d143bfa8e3
piotrekw/pirx
pirx/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.db import models\n\n\nclass User(models.Model):\n MALE = -1\n UNDEFINED = 0\n FEMALE = 1\n GENDER_CHOICES = (\n (MALE, 'Male'),\n (UNDEF...
python
edit
1
0
mit
384f7a8da21ca5e4ffa529e0e5f9407ce2ec0142
dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet
backend/unichat/models/user.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.9.3\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", \".\", 1).split(\".\")\n ]\n)\n\n```\n\n...
python
edit
1
0
mit
d0b0a89a7149c5853e0e827fa819deb17699bf55
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
dthm4kaiako/config/__init__.py
rejected_duplicate
Near-duplicate of sample 1349
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"share 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 impor...
python
edit
1
0
apache-2.0
b59d1dd5afd63422cd478d8ee519347bd1c43e3b
CenterForOpenScience/SHARE,aaxelb/SHARE,zamattiac/SHARE,aaxelb/SHARE,laurenbarker/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,zamattiac/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,zamattiac/SHARE
project/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom nodeconductor.structure import perms as structure_perms\n\n\nPERMISSION_LOGICS = (\n ('openstack_tenant.OpenStackTenantService', structure_perms.service_permission_logic),\n ('openstack_tenant.OpenStackTenantServiceProjectLink', ...
python
edit
1
0
mit
01847c64869298a436980eb17c549d49f09d6a91
opennode/nodeconductor-openstack
src/nodeconductor_openstack/openstack_tenant/perms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n######\n# Class for Menus\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License: Apache 2.0\n#\ncl...
python
edit
5
2
apache-2.0
95d80b076d374ab8552e292014f9fbed08e7b6e1
stoeps13/ibmcnx2,stoeps13/ibmcnx2
ibmcnx/menu/MenuClass.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport theano\n\nfrom sft import Size\nfrom sft.Actions import Actions\nfrom sft.agent.ah.ActionHistory import ActionHistory\n\nimport numpy as np\n\n\nclass RunningAvg(ActionHistory):\n\tdef __init__(self, logger, n, factor):\n\t\tself.log...
python
edit
1
2
mit
8f2cf9f30b5748117a6cc98d74aa0c8493f21852
kevinkepp/search-for-this
sft/agent/ah/RunningAvg.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport subprocess\n\nsubprocess.check_call([\"coverage\", \"run\", \"--source\", \"toyplot\", \"-m\", \"nose\"])\nsubprocess.check_call([\"coverage\", \"run\", \"--append\", \"--source\", \"toyplot\", \"-m\", \"behave\"])\nsubprocess.check_...
python
edit
1
0
bsd-3-clause
f463247198354b0af1d0b8a4ff63c0757d4c2839
cmorgan/toyplot,cmorgan/toyplot
regression.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import redirect, url_for\nfrom portal import app\n\n@app.route('/', methods=['GET'])\ndef index():\n\treturn redirect(url_for('practices_index', _external=True))\n\n```\n\nApply this change: Fix incorrect protocol being using whe...
python
edit
1
1
mit
c458b78ccecc28971ef239de5a5366bd56d2562e
LCBRU/genvasc_portal,LCBRU/genvasc_portal,LCBRU/genvasc_portal,LCBRU/genvasc_portal
web/portal/views/home.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom highton.models import HightonModel\nfrom highton.highton_constants import HightonConstants\nfrom highton import fields\n\n\nclass EmailAddress(\n HightonModel,\n):\n \"\"\"\n :ivar id: fields.IntegerField(name=HightonConstants...
python
edit
1
1
apache-2.0
048f2d9469b3f9eb266a343602ddf608e3bd6d86
seibert-media/Highton,seibert-media/Highton
highton/models/email_address.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls.defaults import patterns, include, url\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.http import HttpResponse\n\nfrom funfactory.monkeypatches impor...
python
edit
1
0
bsd-3-clause
813ddc03b652d0594bc9cb540a5a5f50a196a073
Ritsyy/fjord,mozilla/fjord,mozilla/fjord,mozilla/fjord,rlr/fjord,DESHRAJ/fjord,Ritsyy/fjord,staranjeet/fjord,Ritsyy/fjord,staranjeet/fjord,hoosteeno/fjord,rlr/fjord,mozilla/fjord,DESHRAJ/fjord,lgp171188/fjord,hoosteeno/fjord,rlr/fjord,DESHRAJ/fjord,lgp171188/fjord,hoosteeno/fjord,hoosteeno/fjord,staranjeet/fjord,staran...
fjord/urls.py
rejected_duplicate
Near-duplicate of sample 13294
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth import get_user_model\nfrom django.core.management.base import BaseCommand\n\nfrom ...actions import customers\n\n\nclass Command(BaseCommand):\n\n help = \"Create customer objects for existing users that do not ...
python
edit
1
2
mit
980a1a40aeb5f76bc8675890237f5624920b7602
pinax/django-stripe-payments
pinax/stripe/management/commands/init_customers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# (C) Datadog, Inc. 2019-present\n# All rights reserved\n# Licensed under a 3-clause BSD style license (see LICENSE)\nimport json\n\nimport yaml\n\nfrom .utils import file_exists, path_join, read_file\n\n\ndef load_spec(check_root):\n sp...
python
edit
1
4
bsd-3-clause
e8708c28e79a9063469e684b5583114c69ec425f
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
datadog_checks_dev/datadog_checks/dev/spec.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport json\nfrom flask import Flask, request, Response\nfrom flask import render_template, send_from_directory, url_for\n\napp = Flask(__name__)\nbasedir = os.path.abspath(os.path.dirname('data'))\n\napp.config[\"SECRET_KEY\"] =...
python
edit
9
0
mit
a651e748164865a8ca658085819c1d978338824c
Clarity-89/blog,Clarity-89/blog,Clarity-89/blog
angular_flask/__init__.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nNames of the modalities\n\"\"\"\n\n# Set constants of the names of the models so they can always be referenced\n# as variables rather than strings\n\n# Most of the density is at 0\nNEAR_ZERO = '~0'\n\n# Old \"middle\" modality - mos...
python
edit
1
0
bsd-3-clause
a41d2e79dcf83793dab5c37c4a4b46ad6225d719
YeoLab/anchor
anchor/names.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!python\n# coding=utf-8\nfrom netCDF4 import Dataset\n\n\nclass EnhancedDataset(Dataset):\n def __init__(self, *args, **kwargs):\n super(EnhancedDataset, self).__init__(*args, **kwargs)\n\n def get_variables_by_attributes(self...
python
edit
1
6
mit
f7a8c4a293538c4cd592ba23860b873cb378f28f
axiom-data-science/pyaxiom,ocefpaf/pyaxiom,ocefpaf/pyaxiom,axiom-data-science/pyaxiom
pyaxiom/netcdf/dataset.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python2.5\n#\n# Copyright 2008 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the L...
python
edit
1
0
apache-2.0
86968b5bc34a0c7f75ff04ad261ee59da8dcf94f
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
app/soc/models/host.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom asciimatics.renderers import FigletText, Fire\nfrom asciimatics.scene import Scene\nfrom asciimatics.screen import Screen\nfrom asciimatics.effects import Print\nfrom asciimatics.exceptions import ResizeScreenError\nfrom pyfiglet impor...
python
edit
1
2
apache-2.0
1c14d45ba620118401728c56e5ef3a189f9b4145
peterbrittain/asciimatics,peterbrittain/asciimatics
samples/fire.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!C:\\Users\\qlab\\Anaconda3\\envs\\pyqt5\\python.exe\n# coding: utf-8\n# Raytheon BBN Technologies 2016\n# Contributiors: Graham Rowlands\n#\n# This file runs the main loop\n\nfrom qtpy.QtWidgets import QApplication\nimport sys\nimport arg...
python
edit
3
0
apache-2.0
d7b3579edf9efb48fc80290fe0cf1c9c6db3b7bc
BBN-Q/Quince
run-quince.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nPython in Astronomy 2016 is the second iteration of the Python in Astronomy\nconference series.\n\nThis is the docstring for the pyastro module, this gets included as the\ndescription for the module.\n\"\"\"\n\nimport numpy as np\n\...
python
edit
1
1
mit
523a25d30241ecdd0abdb7545b1454714b003edc
cdeil/sphinx-tutorial
astrospam/pyastro16.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django_evolution.mutations import AddField, RenameField\nfrom django.db import models\nfrom djblets.db.fields import JSONField\n\n\nMUTATIONS = [\n AddField('WebHookTarget', 'encoding', models.CharField,\n initial='appli...
python
edit
1
0
mit
d6c228468ad519f735a12388383b719ee9830f5e
reviewboard/reviewboard,beol/reviewboard,sgallagher/reviewboard,chipx86/reviewboard,custode/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,davidt/reviewboard,beol/reviewboard,KnowNo/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,davidt/reviewboard,chipx86/reviewboard,beol/reviewboard,reviewboard/r...
reviewboard/notifications/evolutions/webhooktarget_extra_state.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens...
python
edit
1
2
apache-2.0
aab9efbcec0bbded807bf207e2324266573fa3a6
petewarden/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,aldian/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experime...
tensorflow/python/tf2.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nimport os\nimport sys\n\nfrom IPython.kernel.kernelspec import install_kernel_spec\nfrom IPython.utils.tempdir import TemporaryDirectory\n\nkernel_json = {\"argv\":[sys.executable,\"-m\",\"bash_kernel\", \"-f\", \"{connection_f...
python
edit
1
2
bsd-3-clause
3b5e66f8051043e8b6863fe1b3c9fc81a13fc38c
newtux/KdbQ_kernel
bash_kernel/install.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ntry:\n from http.server import SimpleHTTPRequestHandler\nexcept ImportError:\n from SimpleHTTPServer import SimpleHTTPRequestHandler\n\ntry:\n from socketserver import TCPServer\nexcept ImportError:\n from SocketServer import TC...
python
edit
2
2
mit
a668afc87465989e85153c9bd2a608ba0ba54d9b
kragniz/containers
tests/test_containers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom ..code_registry import MethodCode, MessageType\nfrom ..coap import Coap\n\ndef test_build_message():\n c = Coap('coap.me')\n result = c.get('hello')\n print str(bytearray(result.server_reply_list[0].payload))\n c.destroy()\...
python
edit
5
1
bsd-3-clause
550101a804cb48f07042014ac5d413071a0e29d7
samueldotj/pycoap
coap/test/test_request.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport sys\n\nfrom helpers.statuspage import StatusPage\nfrom test_postgresql import MockConnect\n\nif sys.hexversion >= 0x03000000:\n from io import BytesIO as IO\nelse:...
python
edit
1
3
mit
f3e1c74d9b85814cd56397560c5023e7ef536caa
zalando/patroni,zalando/patroni,sean-/patroni,pgexperts/patroni,sean-/patroni,pgexperts/patroni,jinty/patroni,jinty/patroni
tests/test_statuspage.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom datetime import datetime\n\nimport logging\n\n\nclass ISODatetime(object):\n def __call__(self, value):\n # type: (str) -> datetime\n try:\n return datetime.strptime...
python
edit
1
2
apache-2.0
afd10d89ead46a8df35f6a0d17a2ca7dd4c7e826
dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes
changes/api/validators/datetime.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom scipy.io import loadmat\n\ndef load_clean_data():\n data = loadmat('data/cleandata_students.mat')\n return data['x'], data['y']\n\ndef load_noisy_data():\n data = loadmat('data/noisydata_students.mat')\n return data['x'], d...
python
edit
1
1
mit
d1e2dc224b7b922d39f0f8f21affe39985769315
MLNotWar/decision-trees-algorithm,MLNotWar/decision-trees-algorithm
src/loader.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__name__ = \"Year View\"\n__author__ = \"Decklin Foster <<EMAIL>>\"\n__description__ = \"Calendar of all dates in a given year.\"\n\nimport time\n\ndef make(instance, entries, all, vars):\n # we get all the entries for this year in ``ent...
python
edit
4
3
isc
55d13c7f59d5500fbbf2cbe915a6f2fe8e538e14
decklin/ennepe
example/layout/__year__/index.html.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Simple testing blueprint. Will be deleted once real functionality is added.\n\"\"\"\n\nimport flask\nimport flask_classful\n\nviews = flask.Blueprint('views', __name__)\n\n\nclass IndexView(flask_class...
python
edit
1
1
mit
6b5a4dd75bc1d6dc5187da4ea5e617f30e395b89
BMeu/Orchard,BMeu/Orchard
orchard/views/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, jsonify\n\n\napp = Flask(__name__)\napp.config.update(\n JSONIFY_PRETTYPRINT_REGULAR=False,\n)\n\n# Read in the entire wordlist at startup and keep it in memory.\n# Optimization for improving sea...
python
edit
1
3
mit
22a889dd8f12a11ff22f1b1e167b3c888f892f88
rlucioni/typesetter,rlucioni/typesetter,rlucioni/typesetter
typesetter/typesetter.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\nPACKAGE = \"allure-behave\"\nVERSION = \"2.6.4\"\n\nclassifiers = [\n 'Development Status :: 5 - Production/Stable',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: Apac...
python
edit
1
1
apache-2.0
579b566c33174b53276ece63c40d345b207890c8
allure-framework/allure-python
allure-behave/setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Backport of importlib.import_module from 3.x.\"\"\"\nimport sys\n\ndef _resolve_name(name, package, level):\n \"\"\"Return the absolute name of the module to be imported.\"\"\"\n level -= 1\n try:\n if package.count('....
python
edit
1
6
mit
969a4f011c7f78a04b6939768d59ba768ff4d160
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/importlib/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport functools\nimport subprocess\n\nfrom doit.exceptions import TaskFailed\n\n\ndef capture_subprocess_error(fn):\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n try:\n return fn(*args, **kwargs)\n ...
python
edit
1
5
bsd-3-clause
90e557d681c9ea3f974ee5357ec67f294322d224
ento/elm-doc,ento/elm-doc
src/elm_doc/decorators.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport json\n\n# save info from common.print_info()\nlast_info = None\n\ndef output(video_extractor, pretty_print=True):\n ve = video_extractor\n out = {}\n out['url'] = ve.url\n out['title'] = ve.title\n out['site'] = ve.n...
python
edit
1
4
mit
8799197befd1f52278a4344fc41ba94cc45c548a
zmwangx/you-get,zmwangx/you-get,xyuanmu/you-get,qzane/you-get,qzane/you-get,xyuanmu/you-get,cnbeining/you-get,cnbeining/you-get
src/you_get/json_output.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__version_info__ = {\n 'major': 1,\n 'minor': 6,\n 'micro': 0,\n 'releaselevel': 'final',\n 'serial': 1\n}\n\n\ndef get_version(short=False):\n assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')\n ver...
python
edit
1
5
apache-2.0
f9c351bbddb9f0e212b92bdada4825d79bad2812
callowayproject/django-categories,callowayproject/django-categories,callowayproject/django-categories
categories/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom troposphere import (\n Ref,\n)\n\nfrom troposphere.ec2 import (\n InternetGateway,\n VPC,\n VPCGatewayAttachment,\n)\n\nfrom .template import template\n\n\nvpc = VPC(\n \"Vpc\",\n template=template,\n CidrBlock=\"1...
python
edit
1
0
mit
6d04f0f924df11968b85aa2c885bde30cf6af597
caktus/aws-web-stacks,tobiasmcnulty/aws-container-basics
stack/vpc.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport json\n\nfrom lib import contract\n\ndata_dir = os.path.join(os.environ['PORTER'], 'data')\n\n\n@contract.accepts(str)\n@contract.returns(list)\ndef read_and_parse_json(data_type):\n sub_dir = os.path.join(data_dir, data...
python
edit
2
2
mit
1107fc26cf9baa235d62813ea0006687d4710280
Tactique/game_engine,Tactique/game_engine
src/engine/file_loader.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nimport telegram\n\nfrom leonard import Leonard\n\nif __name__ == '__main__':\n os.chdir('../')\n telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])\n bot = Leonard(telegram_client)\n i = 0\n while True:\n ...
python
edit
1
0
mit
f529c9f5092262f9089ad51831a8545d8f8650fa
sevazhidkov/leonard
workers/subscriptions.py
rejected_duplicate
Near-duplicate of sample 14139
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport torchaudio\nimport librosa\n\n\n# resampling reference https://core.ac.uk/download/pdf/228298313.pdf\n# resampling input transformation defense for audio\n\nT = torchaudio.transforms\n\n# Read audio file\naudio_data = librosa.load(fi...
python
edit
4
0
mit
8170aca01f6922ef653bceb9121eb7fc098f85de
cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans
defenses/torch/audio/input_tranformation/resampling.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport amqp\nfrom contextlib import closing\n\n\ndef publish_message(message_body, exchange, type, routing_key):\n \"\"\" Publish a message to an exchange with exchange type and routing key specified.\n\n A message is sent to a specif...
python
edit
1
1
mit
b03c0898897bbd89f8701e1c4d6d84d263bbd039
jdgillespie91/trackerSpend,jdgillespie91/trackerSpend
utils/publish_message.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\n\nfrom django.core.management.base import BaseCommand\n\nfrom peering.models import InternetExchange\n\n\nclass Command(BaseCommand):\n help = \"Update peering session states for Internet Exchanges.\"\n logger = loggin...
python
edit
1
2
apache-2.0
1768207c57b66812931d2586c5544c9b74446918
respawner/peering-manager,respawner/peering-manager,respawner/peering-manager,respawner/peering-manager
peering/management/commands/update_peering_session_states.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom django.test import SimpleTestCase\nfrom corehq.apps.userreports.reports.view import ConfigurableReportView\n\n\nclass VeryFakeReportView(...
python
edit
1
1
bsd-3-clause
24da0f84e1a844b1f53e5afafc34cfcc915a9a67
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/userreports/tests/test_report_rendering.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\n Beacon to manage and report the status of\n one or more salt proxy processes\n\n .. versionadded:: 2015.8.3\n'''\n\n# Import python libs\nfrom __future__ import absolute_import\nimport logging\n\nlog ...
python
edit
3
3
apache-2.0
662d103adffd0592474378e2aaf98b8fafc3fb93
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/beacons/salt_proxy.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom SUASImageParser.utils.image import Image\nfrom SUASImageParser.utils.color import bcolors\n\nimport cv2\nimport numpy as np\n\n\nclass CharacteristicIdentifier:\n \"\"\"\n Identify target characteristics\n \"\"\"\n\n def __...
python
edit
6
1
mit
0f047cded957bc67441a9acd65b46fab4bac6302
FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition
SUASImageParser/ADLC/characteristic_identifier.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom click.testing import CliRunner\n\nfrom morenines import application\n\n\ndef test_init(data_dir):\n runner = CliRunner()\n\n result = runner.invoke(application.main, ['init', data_dir])\n\n assert result.exit_code =...
python
edit
1
1
mit
2fd3123eb00c16d325a7ec25dfcb6a92872a3849
mcgid/morenines,mcgid/morenines
tests/test_init.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass TransformQuerySet(models.query.QuerySet):\n def __init__(self, *args, **kwargs):\n super(TransformQuerySet, self).__init__(*args, **kwargs)\n self._transform_fns = []\n\n def _clone(...
python
edit
null
null
bsd-3-clause
689d1d1f128b4a72aad6783ea2f770c21cd4c2da
alex/django-queryset-transform
queryset_transform/__init__.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\nimport serial\n\ndef get_active_drones():\n\tport = serial.Serial('/dev/ttyUSB0', 9600)\n\tport.write('0;1;0;\\n')\n\tdrones = []\n\t\n\tmsg = port.readline()\n\tdrone_id = msg[2]\n\tdrones.append(drone_id)\n\t\n\treturn drones\n```\n\nAppl...
python
edit
1
1
mit
88d65d4f9cf41bbc5b080fd4245a3a6d81c1ef46
kalail/queen,kalail/queen
queen/helpers/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\n\nfrom chainer import testing\n\n\nclass Dummy(object):\n pass\n\n\nclass TestNoNumpyFunction(unittest.TestCase):\n\n def test_no_numpy_function(self):\n with self.assertRaises(ValueError):\n testing...
python
edit
1
1
mit
a2cb560851cbbabab0474092f59e1700e1c93284
wkentaro/chainer,jnishi/chainer,jnishi/chainer,keisuke-umezawa/chainer,anaruse/chainer,okuta/chainer,ktnyt/chainer,niboshi/chainer,hvy/chainer,tkerola/chainer,ktnyt/chainer,hvy/chainer,niboshi/chainer,jnishi/chainer,chainer/chainer,wkentaro/chainer,hvy/chainer,ronekko/chainer,okuta/chainer,aonotas/chainer,keisuke-umeza...
tests/chainer_tests/testing_tests/test_unary_math_function_test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom logya.content import read_all\nfrom logya.template import init_env\nfrom logya.util import load_yaml, paths\n\n\nclass Logya:\n \"\"\"Object to store data such as site index and settings.\"\"\"\n\n def __...
python
edit
1
2
mit
c33ce5e8d998278d01310205598ceaf15b1573ab
elaOnMars/logya,elaOnMars/logya,elaOnMars/logya,yaph/logya,yaph/logya
logya/core.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom django.views.generic.base import RedirectView\n\nfrom .google_merchant import get_feed_file_url\n\nurlpatterns = [\n url(r'google/$', RedirectView.as_view(\n get_redirect_url=get_feed_file_ur...
python
edit
1
0
bsd-3-clause
23c1413c14a81ee40bbb0bb3adeb20e1a231b9c5
jreigel/saleor,maferelo/saleor,UITools/saleor,UITools/saleor,KenMutemi/saleor,tfroehlich82/saleor,UITools/saleor,jreigel/saleor,car3oon/saleor,mociepka/saleor,car3oon/saleor,maferelo/saleor,HyperManTT/ECommerceSaleor,itbabu/saleor,UITools/saleor,tfroehlich82/saleor,itbabu/saleor,UITools/saleor,HyperManTT/ECommerceSaleo...
saleor/data_feeds/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport config\nimport logging\nimport logging.handlers\n\n\n# ######### Set up logging ##########\n# log.basicConfig(format=\"%(asctime)s - %(levelname)s: %(message)s\", level=log.DEBUG)\nlogger = logging.getLogger('bb_log')\nlogger.setLeve...
python
edit
1
0
mit
8ed7983859e2b7031b736b92b875040fa13fb39c
mattstibbs/blockbuster-server,mattstibbs/blockbuster-server
blockbuster/bb_logging.py
rejected_duplicate
Near-duplicate of sample 4405
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\nimport hues\n\nfrom django.core.management.base import BaseCommand\n\nfrom elasticsearch import exceptions\nfrom elasticsearch_dsl.connections import connections\nfrom elasticsearch_flex.indexes import registered_indices\n\...
python
edit
1
4
mit
1eff8a7d89fd3d63f020200207d87213f6182b22
prashnts/dj-elasticsearch-flex,prashnts/dj-elasticsearch-flex
elasticsearch_flex/management/commands/flex_sync.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add utility function for retrieving the active registration backend." }, { "role": "assistant", "content": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib im...
python
new_file
4
3
bsd-3-clause
953ffccae266f123a3b50f260af259bed1d1d336
lubosz/django-registration,lubosz/django-registration
registration/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom types import ModuleType\n\nfrom .resource import Resource\n\n\nclass SelfWrapper(ModuleType):\n def __init__(self, self_module, baked_args={}):\n for attr in [\"__builtins__\", \"__doc__\", \"__name__\", \"__package__\"]:\n ...
python
edit
1
3
apache-2.0
5ef8b09a055326e2a92c9eccbcb187fa5362fb95
PressLabs/zipa
zipa/magic.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright (C) 2014 eNovance SAS <<EMAIL>>\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 th...
python
edit
1
1
apache-2.0
9742e372a6ccca843120cb5b4e8135033d30cdd6
redhat-cip/cauth,enovance/cauth,redhat-cip/cauth,redhat-cip/cauth,enovance/cauth,enovance/cauth
cauth/controllers/root.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport random\n\nfrom unittest2 import TestCase\n\nfrom chef.api import ChefAPI\n\nTEST_ROOT = os.path.dirname(os.path.abspath(__file__))\n\ndef test_chef_api():\n return ChefAPI('https://api.opscode.com/organizations/pychefte...
python
edit
3
3
apache-2.0
4169f60ce8fa6666b28a1129845c816889a6459a
coderanger/pychef,jarosser06/pychef,jarosser06/pychef,Scalr/pychef,Scalr/pychef,dipakvwarade/pychef,cread/pychef,coderanger/pychef,dipakvwarade/pychef,cread/pychef
chef/tests/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom urlparse import urljoin\ndef site_url(request):\n scheme = 'https' if request.is_secure() else 'http'\n site = get_current_site(request)\n #domain = \"{}://{}\".form...
python
edit
1
2
mit
8680eac07c50546968c1525642cab41c1c99a6b3
Parbhat/wagtail-cookiecutter-foundation,aksh1/wagtail-cookiecutter-foundation,Parbhat/wagtail-cookiecutter-foundation,ilendl2/wagtail-cookiecutter-foundation,Parbhat/wagtail-cookiecutter-foundation,ilendl2/wagtail-cookiecutter-foundation,Parbhat/wagtail-cookiecutter-foundation,Parbhat/wagtail-cookiecutter-foundation,ch...
{{cookiecutter.repo_name}}/pages/context_processors.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pyramid.view import (\n view_config,\n notfound_view_config,\n )\n\n# Always send the default index.html\n@notfound_view_config(renderer='templates/index.mako', accept='text/html')\n@view_config(renderer='templates...
python
edit
1
1
isc
44d701eea86f9c2152368f64e54c012cdb937bb1
bertjwregeer/alexandria,bertjwregeer/alexandria,cdunklau/alexandria,cdunklau/alexandria,cdunklau/alexandria
alexandria/views/home.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef assign_to_variable_spec(data, spec, value):\n if not spec.startswith('@') or not spec.endswith('@'):\n raise ValueError(\"{} is not a reference\".format(spec))\n parts = spec.strip('@').split('.')\n data[parts[0]] = {}\n...
python
edit
1
7
apache-2.0
6de2bd60922c012ae3ec179a49aaff950018076d
leapp-to/snactor
snactor/utils/variables.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Mark as dev release until 0.3 is ready." }, { "role": "assistant", "content": "\n# The version is defined in its own module so we can import it from setup.py\n# without introducing unwanted dependencies at that stage.\nVERSION = ...
python
new_file
1
0
bsd-3-clause
0b00187083b29a38eaf949e41824dcb9fd72f48c
redtoad/python-amazon-product-api,redtoad/python-amazon-product-api,redtoad/python-amazon-product-api
amazonproduct/version.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom flask import Blueprint, Flask\nfrom flask import Flask, g\nfrom views import blueprint, Resources, UnixTime, PrintArg, ExampleApiUsage\nfrom flask.ext.restful import Api\nfrom client import Client\n\ndef create_app():\n api...
python
edit
6
2
mit
bb59028a3dab81139a83f9a0eb8a4c58b9c25829
adsabs/adsabs-webservices-blueprint,jonnybazookatone/adsabs-webservices-blueprint
sample_application/app.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#! python3\n\"\"\"Combine PDFs\n\nCombines all the PDFs in the current working directory into a single PDF.\n\nNote:\n * Example PDFs can be downloaded from http://nostarch.com/automatestuff/\n * Book uses PyPDF2; I'm an overachiever ...
python
edit
1
10
mit
2bf4aacbc2a43305506d2d16cef97c6c89c30ee9
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
pythontutorials/books/AutomateTheBoringStuff/Ch13/P3_combinePDFs.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function\n\n__all__ = ['ProviderManager']\n\nfrom .exceptions import ProviderNotRegistered\n\n\n# Ideally this and PluginManager abstracted from the same base, but\n# InstanceManager has become ...
python
edit
1
2
bsd-3-clause
20c8d494519b3d54bc3981aebdad18871deef3cb
argonemyth/sentry,gencer/sentry,JamesMura/sentry,vperron/sentry,nicholasserra/sentry,alexm92/sentry,jokey2k/sentry,zenefits/sentry,jokey2k/sentry,zenefits/sentry,Kryz/sentry,llonchj/sentry,llonchj/sentry,daevaorn/sentry,zenefits/sentry,ewdurbin/sentry,TedaLIEz/sentry,boneyao/sentry,nicholasserra/sentry,felixbuenemann/s...
src/sentry/auth/manager.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding=utf-8\n\"\"\"A simple example demonstrating support for unicode command names.\n\"\"\"\nimport math\nimport cmd2\n\n\nclass UnicodeApp(cmd2.Cmd):\n \"\"\"Example cmd2 application with unicode command names...
python
edit
1
1
mit
dc4307a781e34bf051b20b18935d4939b2de1f8e
python-cmd2/cmd2,python-cmd2/cmd2
examples/unicode_commands.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\n\n\"\"\"\nclint.textui.prompt\n~~~~~~~~~~~~~~~~~~~\n\nModule for simple interactive prompts handling\n\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom re import match, I\n\ndef yn(prompt, default='y', batch...
python
edit
2
10
isc
ce25cea7e8d10f9c318e2e7ef1dc1013921ed062
1gitGrey/clint,thusoy/clint,wkentaro/clint,1gitGrey/clint,glorizen/clint,wkentaro/clint,tz70s/clint,Lh4cKg/clint,nathancahill/clint,kennethreitz/clint,nathancahill/clint
clint/textui/prompt.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\ntravis_tag = os.getenv('TRAVIS_TAG')\nappveyor_tag = os.getenv('APPVEYOR_REPO_TAG')\n\n\ndef generate_label(version):\n dev_names = ['dev', 'alpha', 'beta', 'rc']\n\n is_dev = any(name in version for name in dev_names)\n\...
python
edit
1
3
mit
2b0f1c47a85c79c39e6066e0658c9b47090b46c4
mwcraig/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter,BruceSherwood/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter
.ci-support/upload_label.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ntest = {\n 'name': 'Question 1',\n 'points': 3,\n 'suites': [\n {\n 'cases': [\n {\n 'answer': 'Domain is numbers. Range is numbers',\n 'choices': [\n 'Domain is numbers. Range is numbers',\n ...
python
edit
1
0
apache-2.0
13f8d6feebcfb28b96bb0f69d1e5625a337c22fa
jathak/ok-client,Cal-CS-61A-Staff/ok-client,jackzhao-mj/ok-client
demo/ok_test/tests/q1.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .tag_map import TAG_MAP\nfrom .stop_words import STOP_WORDS\nfrom .lemmatizer import LOOKUP\nfrom .syntax_iterators impo...
python
edit
1
0
mit
4244e285c25c0c13a1f7f6e172b31ebb8f2bb7b1
recognai/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,honnibal/spaCy,aikramer2/...
spacy/lang/es/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport luigi\nimport sciluigi as sl\nimport os\n\nTESTFILE_PATH = '/tmp/test.out'\n\nclass TestTask(sl.Task):\n\n def out_data(self):\n return sl.TargetInfo(self, TESTFILE_PATH)\n\n def run(self):\n with self.out_data()....
python
edit
1
1
mit
241d1e6b36eb8f87a5c6111bfa52104feb821bb8
pharmbio/sciluigi,samuell/sciluigi,pharmbio/sciluigi
test/dependencies_test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport collections\nimport pickle\n\nimport redis\n\nfrom .tools import location\n\n\nclass Store(collections.MutableMapping):\n\n def __init__(self, db=0):\n host, port = location('redis', 6379)\n self._db = redis.StrictRe...
python
edit
1
2
mit
78af5e585eb109049299bd1c826f93001e4f6c68
waltermoreira/adama-app,waltermoreira/adama-app,waltermoreira/adama-app
adama/store.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport sys\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\ndef main(argv=None):\n if argv is None:\n argv = sys.argv\n return 0\n\nif __name__ == \"__main__\":\n sys.exit(main())\n\n```\n\nA...
python
edit
1
2
unlicense
e94e3931ec254e432993d18d9f4ac79f559a2257
paolobolzoni/useful-conf,paolobolzoni/useful-conf,paolobolzoni/useful-conf
scripts/starting_py_program.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nTests for filetolist.py\n\nfiletolist.py:\nhttp://www.github.com/samjabrahams/anchorhub/lib/filetolist.py\n\"\"\"\nfrom anchorhub.lib.filetolist import FileToList\nfrom anchorhub.util.getanchorhubpath import get_anchorhub_path\nfrom...
python
edit
1
1
apache-2.0
9be4dcdf9ea312465a27d6f105213d88d8dd0909
samjabrahams/anchorhub
anchorhub/lib/tests/test_data/test_filetolist.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Little helper application to improve django choices (for fields)\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom .choices import Choices, OrderedChoices\n\n__author__ = 'Stephane \"Twidi\" Ange;'\n__contact__ = \"<EMAIL>\"\n_...
python
edit
1
0
bsd-3-clause
758a8bff354d1e1542b5c4614276bdfa229f3dbc
twidi/django-extended-choices
extended_choices/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom geokey.extensions.base import register\n\n\nVERSION = (0, 2, 0)\n__version__ = '.'.join(map(str, VERSION))\n\nregister(\n 'geokey_export',\n 'Export',\n display_admin=True,\n superuser=False,\n version=__version__\n)\n\n...
python
edit
1
0
mit
6dadf50366b1e142f96ef3bf4a356f7aa98f37be
ExCiteS/geokey-export,ExCiteS/geokey-export,ExCiteS/geokey-export
geokey_export/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport string\nimport os, sys\nimport types, traceback\n\ntry:\n if sys.version_info[0] == 3:\n from tkinter import Tk\n from tkinter import messagebox\n else:\n from Tkinter import Tk\n import tkMessageBox...
python
edit
7
2
bsd-3-clause
a6774092839f8c6aff743cf8f4cc982fe8ce2e63
Heathckliff/cantera,imitrichev/cantera,imitrichev/cantera,imitrichev/cantera,Heathckliff/cantera,Heathckliff/cantera,Heathckliff/cantera,imitrichev/cantera,Heathckliff/cantera,imitrichev/cantera,Heathckliff/cantera,imitrichev/cantera
interfaces/cython/cantera/mixmaster/utilities.py
rejected_lint
Too many lint violations: 7
true