messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nfrom google.appengine.ext import db\n\n\nclass CHPIncident(db.Model):\n\tCenterID = db.StringProperty(required=True)\n\tDispatchID = db.StringProperty(required=True)\n\tLogID = db.StringProperty(r... | python | edit | 1 | 3 | isc | 1afebd46c8cf786673adface7724e9488df17a7e | lectroidmarc/SacTraffic,lectroidmarc/SacTraffic | appengine-experimental/src/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.internet import defer\n\nimport bnw_core.bnw_objects as objs\n\n\n@defer.inlineCallbacks\ndef cmd_userinfo(request, user=''):\n if not user:\n defer.returnValue(dict(ok=False, desc='Username required.'))\n user_obj... | python | edit | 1 | 5 | bsd-2-clause | 724b80b44229b531d7a11cb7cc9f6ad88d9aedb0 | ojab/bnw,stiletto/bnw,stiletto/bnw,ojab/bnw,un-def/bnw,ojab/bnw,stiletto/bnw,ojab/bnw,un-def/bnw,un-def/bnw,un-def/bnw,stiletto/bnw | bnw_handlers/command_userinfo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom django.contrib.auth.backends import RemoteUserBackend\nfrom .compat import from_wsgi_safe_string\n\n\nclass WebtestUserBackend(RemoteUserBackend):\n \"\"\" Auth backend for django-webtest auth... | python | edit | 1 | 1 | mit | 75dca1c2d39126556ded5f328461986a9eabb230 | django-webtest/django-webtest,kmike/django-webtest,django-webtest/django-webtest,kmike/django-webtest | django_webtest/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.test import TestCase\n\nfrom opps.articles.models import Post\n\n\nclass PostModelTest(TestCase):\n\n fixtures = ['tests/initial_data.json']\n\n def test_basic_post_exist(sel... | python | edit | 1 | 1 | mit | 03d628abc4711bb0de4a7a0ef13cc4c0ecb92032 | YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps | opps/articles/tests/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bedrock import *\n\n@annot('void -> int')\ndef main():\n a = hint(Cons(0, Cons(1, Nil())), a='int')\n a = Cons(1, Cons(2, Cons(3, Nil)))\n b = match(a, (\"Cons(_, Cons(two, Cons(_, Nil())))\", identity),\n (\"_... | python | edit | 14 | 1 | mit | f845fcfc145edd2ef55df3275971f5c940a61bb4 | pshc/archipelago,pshc/archipelago,pshc/archipelago | tests/list_match.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\nimport sys, os.path\r\nimport subprocess\r\nimport shutil\r\n\r\npymunk_src_path = os.path.join(\"..\", \"chipmunk_src\")\r\n\r\nshutil.rmtree(os.path.join(pymunk_src_path, \"src\"), True)\r\nshutil.rmtree(os.path.join(pymunk_src_path, ... | python | edit | 1 | 0 | mit | eefc9f9757c0cf21c2ca06a791d03c4dea608fd2 | viblo/pymunk,viblo/pymunk | tools/update_chipmunk_src.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom unittest.mock import patch\n\nimport semver\n\nfrom chaostoolkit import __version__\nfrom chaostoolkit.check import check_newer_version\n\n\nclass FakeResponse:\n def __init__(self, status=200, url=None, res... | python | edit | 3 | 1 | apache-2.0 | 6233207fd57d499bc2bcd313a5b6d829ed712eab | chaostoolkit/chaostoolkit | tests/test_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .common import *\nfrom av.codec import Codec, Encoder, Decoder\n\n\nclass TestCodecs(TestCase):\n\n def test_codec_mpeg4(self):\n for cls in (Encoder, Decoder):\n c = cls('mpeg4')\n self.assertEqual(c.na... | python | edit | 5 | 3 | bsd-3-clause | d89747e26371b1986b4cec5a7514ba2c99480487 | mcpv/PyAV,danielballan/PyAV,pupil-labs/PyAV,PyAV-Org/PyAV,markreidvfx/PyAV,PyAV-Org/PyAV,xxr3376/PyAV,pupil-labs/PyAV,pupil-labs/PyAV,xxr3376/PyAV,mikeboers/PyAV,markreidvfx/PyAV,danielballan/PyAV,danielballan/PyAV,xxr3376/PyAV,markreidvfx/PyAV,mcpv/PyAV,mikeboers/PyAV,mcpv/PyAV,pupil-labs/PyAV | tests/test_codec.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .job import Job\nfrom .utils import get_backend\n\nfrom . import app_settings\n\nclass task(object):\n def __init__(self, queue='default', timeout=None, sigkill_on_stop=False):\n self.queue = queue\n self.timeout = tim... | python | edit | 1 | 1 | bsd-3-clause | 3f2d27f63c1cfe2cc4616a4314420fa23daca487 | thread/django-lightweight-queue,prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue | django_lightweight_queue/task.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom r2.lib import amqp, websockets\n\nfrom reddit_liveupdate.models import ActiveVisitorsByLiveUpdateEvent\n\n\ndef broadcast_update():\n event_ids = ActiveVisitorsByLiveUpdateEvent._cf.get_range(\n column_count=1, filter_empty=F... | python | edit | 1 | 3 | bsd-3-clause | 82380cc6631ae91e0ef961e3bdfde70b9710af0f | florenceyeun/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate | reddit_liveupdate/activity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mpl_toolkits.basemap import Basemap\nimport matplotlib.pyplot as plt\n# setup Lambert Conformal basemap.\n# set resolution=None to skip processing of boundary datasets.\nm = Basemap(width=12000000,height=9000000,projection='lcc',\n ... | python | edit | 1 | 0 | mit | 2c013f4fd30e93dc50f844a6c507b6b9f7d1c80e | matplotlib/basemap,guziy/basemap,guziy/basemap,matplotlib/basemap | doc/users/figures/background2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport logging\nfrom logging.handlers import SysLogHandler\nfrom conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL, TOTEM_ENV, \\\n LOG_IDENTIFIER\n\n\ndef init_logging(name=None):\n ... | python | edit | 1 | 2 | mit | 50c44a5708d1c054207eba264e1cdf9d1f6718da | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | deployer/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDjango settings for travis-ci builds.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.8/re... | python | edit | 2 | 0 | apache-2.0 | 01d812f83c5526cc304f8d691ce9203d3e95633a | charlon/mdot,uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot | sampleproj/settings/travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom werkzeug.exceptions import HTTPException\nimport sys\nfrom six import reraise\n\n\nclass Handler(object):\n \"\"\"\n The Exception handler\n \"\"\"\n\n def __init__(self, app):\n \"\"\"\n Initiate\n :... | python | edit | 1 | 9 | apache-2.0 | 542f0d6f3091e1cbc3ab0563d2915a9ac80c3c91 | LowieHuyghe/edmunds | edmunds/exceptions/handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport os\nimport sys\nimport logging\nfrom flexget import logger\nfrom flexget.options import CoreOptionParser\nfrom flexget import plugin\nfrom flexget.manager import Manager\n\n__version__ = '{subversion}'\n\nlog = l... | python | edit | 4 | 5 | mit | 0179e6680efca8a9a6a5f05db703da1ce7447b3e | Danfocus/Flexget,tobinjt/Flexget,OmgOhnoes/Flexget,malkavi/Flexget,sean797/Flexget,vfrc2/Flexget,asm0dey/Flexget,vfrc2/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,v17al/Flexget,qvazzler/Flexget,jawilson/Flexget,oxc/Flexget,dsemi/Flexget,qvazzler/Flexget,asm0dey/Flexget,Pretagonist/Flexget,qk4l/Flexget,OmgOhnoes/Flexget,... | flexget/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nimport logging\nimport sys\n\nassert sys.version >= '3.3', 'Please use Python 3.3 or higher.'\n\nfrom nacho.routing import Router\nfrom nacho.http import HttpServer\nfrom nacho.multithreading import Superviser\nfrom ... | python | edit | 1 | 1 | mit | 66039d5238c7c18156f6a5bbbe8c28232bb65483 | beni55/nacho,beni55/nacho,avelino/nacho | example/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'sbrochet'\n\ndef create_config(is_mc):\n \"\"\"\n Create a default CRAB configuration suitable to run the framework\n :return:\n \"\"\"\n\n from CRABClient.UserUtilities import config, getUsernameFromSiteDB\n ... | python | edit | 1 | 2 | mit | 442567a959b9fd5796de2f13154f66cdb25534b3 | cp3-llbb/GridIn,cp3-llbb/GridIn | python/default_crab_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\nimport os\nimport sys\nfrom plumbium import call, record, pipeline, recorders\n\n\n@record()\ndef pipeline_stage_1():\n call([os.path.expanduser('~/programming/Plumbium/example/example_script.sh')])\n... | python | edit | 3 | 1 | mit | 14d9b5fd2e24245ac3333d1a1fe6a4a9fd33751a | jstutters/Plumbium | example/example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"This example shows how to use the Motion Click wrapper of the LetMeCreate\nlibrary.\n\nWhenever the motion click detects an event, it flashes all LED's ten times.\nThe user must press Ctrl+C to terminate the pr... | python | edit | 1 | 3 | bsd-3-clause | e0f80de15d1ddabc3bd47d6396edbaaac5a08041 | francois-berder/PyLetMeCreate | examples/motion_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom sqlalchemy import Column, String\n\nfrom .base import Base\n\n\nclass Setting(Base):\n __tablename__ = 'settings'\n\n name = Column(String(32), nullable=False, primary_key=True)\n value = Column(String... | python | edit | 1 | 0 | apache-2.0 | 3c573e2b02a18627b82f4a25fef67adae295d653 | notapresent/rbm2m,notapresent/rbm2m | rbm2m/models/setting.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAnalytics service integration for Django\n========================================\n\nThe django-analytical application integrates analytics services into a\nDjango_ project. See the ``docs`` directory for more information.\n\n.. _... | python | edit | 1 | 0 | mit | 1160a10a3d78eee3be61d760849e70e645272355 | jcassee/django-analytical,ericdwang/django-analytical,machtfit/django-analytical,apocquet/django-analytical,bittner/django-analytical,ChristosChristofidis/django-analytical,pjdelport/django-analytical | analytical/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Scrapy settings for dataset project\n#\n# For simplicity, this file contains only the most important settings by\n# default. All the other settings are documented here:\n#\n# http://doc.scrapy.org/en/latest/topics/settings.html\n#\n\n... | python | edit | 1 | 0 | mit | 1db16a65b114d514257d4525c41e0b3f74d1d479 | MaxLikelihood/CODE | dataset/dataset/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.12.2017 16:05\n:Licence GNUv3\nPart of transofmer\n\n\"\"\"\n\nfrom grammpy import Nonterminal\n\n\ndef splitted_rules(root: Nonterminal):\n return root\n\n```\n\nApply ... | python | edit | 3 | 7 | mit | 599ec99b6f57e37f7f4009afb9498abffd70ff34 | PatrikValkovic/grammpy | grammpy_transforms/SplittedRules/splitted_rules.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/l... | python | edit | 1 | 0 | apache-2.0 | 576dc66d2826759e05d55d5ffbef446825a62481 | openstack/designate-dashboard,openstack/designate-dashboard,openstack/designate-dashboard | designatedashboard/__init__.py | rejected_duplicate | Near-duplicate of sample 15535 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools.command.egg_info import egg_info\nimport subprocess\nimport time\n\nclass EggInfoFromGit(egg_info):\n \"\"\"Tag the build with git commit timestamp.\n\n If a build tag has already been set (e.g., \"egg_info -b\", build... | python | edit | 1 | 2 | apache-2.0 | 3d6577432444c46f0b35bd4b39e0a05f39c37e7f | jeremiahsavage/cwltool,SciDAP/cwltool,chapmanb/cwltool,common-workflow-language/cwltool,dleehr/cwltool,jeremiahsavage/cwltool,chapmanb/cwltool,common-workflow-language/cwltool,dleehr/cwltool,jeremiahsavage/cwltool,common-workflow-language/cwltool,chapmanb/cwltool,SciDAP/cwltool,chapmanb/cwltool,SciDAP/cwltool,dleehr/cw... | gittaggers.py | rejected_duplicate | Near-duplicate of sample 14750 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom foundry.settings import *\n\n#FOUNDRY['layers'] = ('basic',)\nFOUNDRY['layers'] = ('web', 'basic',)\n#FOUNDRY['layers'] = ('mid', 'basic',)\n#FOUNDRY['layers'] = ('smart', 'mid', 'basic',)\n\n\ncompute_settings(sys.modules[__name__... | python | edit | 3 | 0 | bsd-3-clause | 16256c57de5b12b2a1ef148d2ba15db2dfce7407 | praekelt/jmbo-foundry,praekelt/jmbo-foundry,praekelt/jmbo-foundry | foundry/settings_dev.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport functools\nimport os\nimport sys\n\nimport logbook\n\nfrom celery import Celery\nfrom celery.signals import after_setup_logger, after_setup_task_logger\n\nfrom .app import create_app\n\n_logg... | python | edit | 1 | 2 | mit | b2a977a7285cbe832350492b967213b5261ad6b4 | getslash/mailboxer,getslash/mailboxer,getslash/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,vmalloc/mailboxer,Infinidat/lanister,Infinidat/lanister | flask_app/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Data layer \"\"\"\n# pylint: disable=line-too-long\nimport json\nimport os\nfrom frontui.models import ChecklistInfo\n\n\nclass DataProvider:\n \"\"\" Data provider (objects, questions, etc) \"\"\"\n def __init__(self):\n ... | python | edit | 1 | 2 | mit | 452b48b9313af8126052a32230e789dff2c69df7 | nixxa/SecretShopper,nixxa/SecretShopper,nixxa/SecretShopper | frontui/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nEQUALS = 'equals'\nGT = 'gt'\nLT = 'lt'\n\nOPERATOR_SEPARATOR = '__'\nREVERSE_ORDER = '-'\n\nALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1}\n\n\ndef split_to_field_and_filter_type(filter_name):\n filter_split = filter_name.split(OPERATOR_SE... | python | edit | 1 | 3 | mit | 0d572d60522ae0e80105330981a66bc541434b99 | Aplopio/rip,Aplopio/django_rip | rip/filter_operators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom oscar.apps.payment.exceptions import PaymentError\n\n\nclass PayPalError(PaymentError):\n pass\n\n```\n\nApply this change: Make gateway importable without django-oscar installed."
},
{
"role": "assistant",
"content": "t... | python | edit | 1 | 0 | bsd-3-clause | 988cac30eeb3ca9ee25378581371e5ea61faec3e | vintasoftware/django-oscar-paypal,ZachGoldberg/django-oscar-paypal,bharling/django-oscar-worldpay,britco/django-oscar-paypal,st8st8/django-oscar-paypal,evonove/django-oscar-paypal,embedded1/django-oscar-paypal,bharling/django-oscar-worldpay,FedeDR/django-oscar-paypal,django-oscar/django-oscar-paypal,django-oscar/django... | paypal/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef add_virtual_env_segment():\n env = os.getenv('VIRTUAL_ENV')\n if env is None:\n return\n\n env_name = os.path.basename(env)\n bg = Color.VIRTUAL_ENV_BG\n fg = Color.VIRTUAL_ENV_FG\n powerline.append... | python | edit | 4 | 3 | mit | 8a28dee1bc3ca8ec83705cc431768ef18be7798c | banga/powerline-shell,tswsl1989/powerline-shell,paulhybryant/powerline-shell,b-ryan/powerline-shell,rbanffy/powerline-shell,b-ryan/powerline-shell,Menci/powerline-shell,iKrishneel/powerline-shell,milkbikis/powerline-shell,paulhybryant/powerline-shell,torbjornvatn/powerline-shell,banga/powerline-shell,bitIO/powerline-sh... | segments/virtual_env.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nimport re\nimport sys\n\n\nclass DisposableEmailChecker():\n \"\"\"\n Check if an email is from a disposable\n email service\n \"\"\"\n \n def __init__(self):\n self.emails = [line.... | python | edit | 4 | 3 | bsd-3-clause | cbacb4148eba442a5d2b178721bf5805d31fdf8d | aaronbassett/DisposableEmailChecker | disposable_email_checker/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import Animal\n\nclass AnimalSerializer(serializers.HyperlinkedModelSerializer):\n class Meta:\n model = Animal\n fields = ('id', 'name', 'dob', 'gender', 'active', 'own'... | python | edit | 1 | 0 | apache-2.0 | dc6819f67a5f348d260c36c496bc9d116a875ef7 | mmlado/animal_pairing,mmlado/animal_pairing | backend/backend/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\npatched builtin time classes for use by :class:`hiro.Timeline`\n\"\"\"\nimport abc\nfrom datetime import date as realdate\nfrom datetime import datetime as realdatetime\nimport time\nimport six\n\n\nclass DatetimeMeta(abc.ABCMeta):\... | python | edit | 1 | 1 | mit | 6b762607914e1c79bc05f7e8d5cdbe6c6d7a49e4 | alisaifee/hiro,alisaifee/hiro | hiro/patches.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom constants import *\n\nclass Buffer:\n \"\"\"Stores data, buffers it and sends it to the Framer\"\"\"\n def __init__(self):\n self.buffer = []\n self.callback = None\n\n def attach(self, callback):\n self.c... | python | edit | 2 | 2 | mit | a4a139e4476fefe431e6561bd0ef950cb74c0db4 | gsathya/htpt,gsathya/htpt | htpt/buffers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"{{project_name}} URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from m... | python | edit | 1 | 0 | mit | aa6d6e59be8c0b8577517bd16de3e75de7f0e570 | Nikola-K/django-template,Nikola-K/django-template | project_name/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n#... | python | edit | 1 | 0 | apache-2.0 | 4262e9fa6b67d56c33202ce05d6a1128338ebf7f | Scapogo/zipline,florentchandelier/zipline,florentchandelier/zipline,Scapogo/zipline | zipline/gens/brokers/__init__.py | rejected_duplicate | Near-duplicate of sample 4780 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom plugins.util import command, get_url\nimport json\nimport re\n\nSPOTIFY_URI_REGEX = r\"(?<=spotify:)(?:track|album|artist):[a-zA-Z0-9]{22}\"\nENDPOINT = \"https://api.spotify.com/v1/{0}s/{1}\"\n\n@command()\ndef spotify(m):\n \"\"\"... | python | edit | 1 | 6 | mit | c9534dfb1b2aaa8cb4aaee3a3471ac39d956e5b7 | molly/GorillaBot,molly/GorillaBot,quanticle/GorillaBot,quanticle/GorillaBot | plugins/spotify.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.test import TestCase\n\nfrom unittest import skipIf\n\nfrom geotrek.core.factories import TrailFactory\nfrom geotrek.authent.factories import UserFactory\nfrom geotrek.core.forms import TrailFor... | python | edit | 1 | 1 | bsd-2-clause | 686406781af00d93e4d70049499068037d72be74 | GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | geotrek/core/tests/test_forms.py | rejected_duplicate | Near-duplicate of sample 12279 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom kinetic_widget.models import *\n\n\nadmin.site.register(TestWidgetSimple)\nadmin.site.register(TestWidgetMulti)\n\n```\n\nApply this change: Test Widget: added support for displaying raw json"
},
{... | python | edit | 8 | 1 | bsd-2-clause | 794868448bc9740bc76f9c3381ff75385f72c769 | knaperek/gits,knaperek/gits,knaperek/gits | kinetic_widget/admin.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom createCollection import createCollection\nfrom ObjectFactories.albumFactory import AlbumFactory\nfrom ObjectFactories.bookFactory import BookFactory\nfrom ObjectFactories.itemFactory import ItemFactory\nfrom ObjectFactories.movieFactor... | python | edit | 2 | 2 | apache-2.0 | a83949ef067a5302bd1bb1f428c40c1c244b9f0d | AmosGarner/PyInventory | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django.conf.urls import patterns, url\n\nfrom .conf import settings\nfrom .views import index, page, edit, file_download, file_upload\n\nurlpatterns = patterns(\n \"\",\n url(r\"^file-download/(\\d+)/([^/]+)$\", file... | python | edit | 1 | 0 | mit | ee7a49fa7094160f27993adb25fb2d98db518cb9 | pinax/pinax-wiki | pinax/wiki/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\nfrom lie2me import Field\n\n\nclass CommonTests(object):\n\n def get_instance(self):\n return self.Field()\n\n def test_submitting_empty_value_on_required_field_returns_error(self):\n field... | python | edit | 4 | 1 | mit | cd5802850fab20648748b4be4a47ad4cc050c32d | hugollm/lie2me,hugollm/lie2me | tests/test_fields/common_tests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom argparse import ArgumentParser\nfrom gocept.runner import once\nfrom zeit.find import search, elastic\n\n\ndef parse():\n parser = ArgumentParser(description='Elasticsearch debug client')\n parser.add_argument('-f', '--fulltext',... | python | edit | 1 | 4 | bsd-3-clause | 6392e2d9487d5718d13f73f87797ad142ff14e50 | ZeitOnline/zeit.find,ZeitOnline/zeit.find | src/zeit/find/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# __init__.py\n#\n# statbot - Store Discord records for later analysis\n# Copyright (c) 2017 Ammon Smith\n#\n# statbot is available free of charge under the terms of the MIT\n# License. You are free to redistribute and/or modify it under... | python | edit | 1 | 0 | mit | cef2fbc059c5c9f55e4379e1963b4b974d09b7fb | strinking/statbot,strinking/statbot | statbot/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\n\nimport yaml\n\n\ndef parse_commandline():\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"--dns-servers\",\n metavar=\"NAME\",\n help=\"A list of nameser... | python | edit | 1 | 1 | apache-2.0 | 109085a9f5f6eded6ea2afe1f6aabaf183980d7c | aspiers/automation,SUSE-Cloud/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,gosipyan/automation,SUSE-Cloud/automation,aspiers/automation,aspiers/automation,aspiers/automation,SUSE-Cloud/automation,SUSE-Cloud/automation | scripts/jenkins/cloud/ansible/roles/heat-generator/files/dns-update.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add lots of useful default imports to ipython"
},
{
"role": "assistant",
"content": "from __future__ import division\nfrom __future__ import absolute_import\n\nimport scipy as sp\nimport itertools as it\nimport functools as ft\ni... | python | new_file | 25 | 0 | cc0-1.0 | 2306478f67a93e27dd9d7d397f97e3641df3516a | davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles,davidshepherd7/dotfiles | ipython_startup.py | rejected_lint | Too many lint violations: 25 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2014 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.... | python | edit | 3 | 0 | apache-2.0 | 8ef82138d513630f5d83adef6233c6a9386019a1 | zimolzak/ffuu,zimolzak/ffuu | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 7 | 0 | apache-2.0 | 58ae075463518e477185816094eb83f42ce5b77c | CyrusBiotechnology/gcloud-python,tseaver/google-cloud-python,Fkawala/gcloud-python,waprin/gcloud-python,jonparrott/gcloud-python,EugenePig/gcloud-python,dhermes/google-cloud-python,tswast/google-cloud-python,thesandlord/gcloud-python,tswast/google-cloud-python,EugenePig/gcloud-python,jbuberel/gcloud-python,dhermes/goog... | gcloud/bigquery/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django import forms\nfrom django.db.models import get_model\nfrom django.forms.models import inlineformset_factory\n\nWishList = get_model('wishlists', 'WishList')\nLine = get_model('wishlists', 'Line')\n\n\ncl... | python | edit | 3 | 1 | bsd-3-clause | 661baf5e280f64824bf983b710c54efccb93a41a | sasha0/django-oscar,nickpack/django-oscar,elliotthill/django-oscar,DrOctogon/unwash_ecom,josesanch/django-oscar,bnprk/django-oscar,kapari/django-oscar,marcoantoniooliveira/labweb,solarissmoke/django-oscar,kapt/django-oscar,nickpack/django-oscar,machtfit/django-oscar,jlmadurga/django-oscar,marcoantoniooliveira/labweb,Bo... | oscar/apps/wishlists/forms.py | rejected_duplicate | Near-duplicate of sample 12931 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import ctask\n\n\n@ctask\ndef go(ctx):\n return ctx\n\n\n@ctask\ndef run(ctx):\n ctx.run('x')\n\n```\n\nApply this change: Tweak a test so it fails more usefully when mocking doesn't work, heh"
},
{
"role": "assist... | python | edit | 1 | 1 | bsd-2-clause | 5c64fe29690e2471aef20473592f0dcebac4eff8 | kejbaly2/invoke,frol/invoke,pyinvoke/invoke,singingwolfboy/invoke,pfmoore/invoke,mattrobenolt/invoke,tyewang/invoke,mkusz/invoke,mattrobenolt/invoke,mkusz/invoke,kejbaly2/invoke,frol/invoke,pfmoore/invoke,pyinvoke/invoke | tests/_support/contextualized.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, request, redirect\nimport requests\nimport pandas as pd\nfrom datetime import datetime\nfrom bokeh.plotting import figure, output_notebook, output_file, save\n\napp = Flask(__name__)\n\n@app.route('... | python | edit | 10 | 2 | mit | e5322958f14b2428b74de726476fd98adae8c454 | gsganden/pitcher-reports,gsganden/pitcher-reports | app.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport context\n\nfrom srvy.srvy import get_current_questions\n\n\nclass MyTest(unittest.TestCase):\n def setUp(self):\n self.questions = [\"Question 1?\", \"Question 2?\", \"Question 3?\", \"Question 4?\"]\n\n ... | python | edit | 3 | 1 | mit | 441ecd25c9fdbc3acbe0e345bbaeafd8de9e3b73 | andrewlrogers/srvy | tests/test_srvy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ConfigParser\n\n\nclass NipapConfig(ConfigParser.SafeConfigParser):\n \"\"\" Makes configuration data available.\n\n Implemented as a class with a shared state; once an instance has been\n created, new instances with... | python | edit | 4 | 2 | mit | 67a102e5da283e318928028e54f6a85b4d266043 | fredsod/NIPAP,ettrig/NIPAP,SoundGoof/NIPAP,ettrig/NIPAP,fredsod/NIPAP,ettrig/NIPAP,ettrig/NIPAP,garberg/NIPAP,bbaja42/NIPAP,bbaja42/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,plajjan/NIPAP,fredsod/NIPAP,bbaja42/NIPAP,garberg/NIPAP,fredsod/NIPAP,SoundGoof/NIPAP,SpriteLink/NIPAP,SoundGoof/NIPAP,plajjan/NIPAP,SpriteLink/NIPAP... | nipap/nipap/nipapconfig.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n######\n# Create a file (html or markdown) with the output of\n# - JVMHeap\n# - LogFiles\n# - Ports\n# - Variables\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting... | python | edit | 5 | 0 | apache-2.0 | 4c372b62ac97bc06f18dc953fd9e0ccfe4de80fe | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/doc/Documentation.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nA flat file database for json objects.\n\"\"\"\n\nfrom .db import Database\n\n__version__ = '0.1.5'\n__author__ = 'Gunther Cox'\n__email__ = '<EMAIL>'\n__url__ = 'https://github.com/gunthercox/jsondb'\n\n```\n\nApply this change: Up... | python | edit | 3 | 0 | bsd-3-clause | aceee9b19920d6a78fd8edda07009480ed48f565 | gunthercox/jsondb | jsondb/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ctypes\n\n__all__ = [\"pbkdf2\"]\n\nlibssl = ctypes.CDLL(\"libssl.dylib\")\nlibssl.PKCS5_PBKDF2_HMAC_SHA1.restype = ctypes.c_int\n\ndef cBuf(data):\n\treturn ctypes.create_string_buffer(data, len(data))\n\ndef pbkdf2(password, salt, ... | python | edit | 1 | 2 | bsd-2-clause | c4741e3246ca85d621f10530e9d70a85cdff7414 | tzwenn/luksfs | learn/my_pbkdf2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <<EMAIL>>\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 ob... | python | edit | 1 | 2 | apache-2.0 | c9eb050771c487aae67e0a1f8c69ad011b6aaa90 | sorenh/python-django-repomgmt,sorenh/python-django-repomgmt | repomgmt/management/commands/process-build-queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.core.management.base import BaseCommand, CommandError\nfrom api import models\nfrom web.utils import send_email\n\nclass Command(BaseCommand):\n can_import_settings = True\n\n def handle(self, *arg... | python | edit | 6 | 4 | apache-2.0 | 21ac167e827cde53ccbb60f713c8190ec2ff6bda | SchoolIdolTomodachi/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI | api/management/commands/cron_notifications.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\nimport node_locate\nimport node_filter\n\nimport node_select\nimport node_update\nimport node_delete\nimport node_insert\nimport node_script\n\ndef select(node, path, action=None):\n return node_select.NodeSelect().sele... | python | edit | 1 | 1 | apache-2.0 | 058a0eb16a5a807c137553042f973c907d231cf1 | PinaeOS/ndb-py,node-db/ndb-py | ndb/operate/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\nfrom pymemcache.serde import (python_memcache_serializer,\n python_memcache_deserializer)\nimport pytest\nimport six\n\n\n@pytest.mark.unit()\nclass TestSerde(TestCase):\n\n d... | python | edit | 1 | 2 | apache-2.0 | 7f611e99d36089bc6836042ba8aec2df02a56f3a | bwalks/pymemcache,sontek/pymemcache,pinterest/pymemcache,ewdurbin/pymemcache,pinterest/pymemcache,sontek/pymemcache | pymemcache/test/test_serde.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pymysql.tests import base\nfrom pymysql import util\n\n\nclass TestNextset(base.PyMySQLTestCase):\n\n def setUp(self):\n super(TestNextset, self).setUp()\n self.con = self.connections[0]\n\n def test_nextset(self):\... | python | edit | 3 | 1 | mit | f050c0429beffa13d94ad303c1730fef5b44f544 | Geoion/Tornado-MySQL,PyMySQL/PyMySQL,PyMySQL/Tornado-MySQL,boneyao/PyMySQL,aio-libs/aiomysql,jwjohns/PyMySQL,yeyinzhu3211/PyMySQL,jheld/PyMySQL,eibanez/PyMySQL,pymysql/pymysql,lzedl/PyMySQL,modulexcite/PyMySQL,xjzhou/PyMySQL,xjzhou/PyMySQL,MartinThoma/PyMySQL,wraziens/PyMySQL,mosquito/Tornado-MySQL,pulsar314/Tornado-My... | pymysql/tests/test_nextset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom allauth.account.models import EmailAddress\nfrom allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2.provider import OAuth2Provider\n\n\nclass KakaoAccount(ProviderAccount):\n @pr... | python | edit | 1 | 2 | mit | c955628b134586491265bc2e6b4045398072cead | pennersr/django-allauth,rsalmaso/django-allauth,rsalmaso/django-allauth,lukeburden/django-allauth,bittner/django-allauth,AltSchool/django-allauth,pennersr/django-allauth,AltSchool/django-allauth,rsalmaso/django-allauth,AltSchool/django-allauth,lukeburden/django-allauth,bittner/django-allauth,lukeburden/django-allauth,b... | allauth/socialaccount/providers/kakao/provider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python2.7\n\nimport cherrypy\nimport medlem\n\nwsgiapp = cherrypy.Application(medlem.Medlem(), '/', config=\"config/production.conf\")\n\n```\n\nApply this change: Change name of the wsgi-object to match what uwsgi"
},
{... | python | edit | 1 | 0 | bsd-3-clause | f0a1cd06f954094bc5ef3dfa337901a87d22485c | UngaForskareStockholm/medlem2 | prod.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n================\nPlot `errorfill`\n================\n\nWhen you have continuous data measurement and errors associated with every data point, plotting error bars can get really noisy. `special.errorfill` plots a filled region to re... | python | edit | 1 | 0 | bsd-3-clause | 68e8dfb52aea3a3f6ee99b3ce2a2b479a39c19db | tonysyu/mpltools,matteoicardi/mpltools | doc/examples/special/plot_errorfill.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\n\nfrom django.core.management.base import BaseCommand\n\nfrom wagtail.wagtailcore.models import Site\nfrom wagtailmenus import app_settings\n\nlogger = logging.getLogger(__name__)\n\n\nclass Command(... | python | edit | 1 | 3 | mit | 6064f95021119e781b13224febfeca2d7de4aec5 | rkhleics/wagtailmenus,ababic/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus | wagtailmenus/management/commands/autopopulate_main_menus.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .info import main as info\nfrom .printer import main as printer\nfrom .shifty import main as shifty\nfrom .snifty import main as snifty\nfrom .status import main as status\n\n\n(\n info,\n printer,\n shifty,\n snifty,\n ... | python | edit | 1 | 0 | mit | 94edf518993860dbff8d845292bfe4ce94d9fe5e | mjoblin/netdumplings,mjoblin/netdumplings,mjoblin/netdumplings | netdumplings/console/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport compare_mt.ngram_utils\nimport compare_mt.stat_utils\nimport compare_mt.corpus_utils\nimport compare_mt.sign_utils\nimport compare_mt.scorers\nimport compare_mt.bucketers\nimport compare_mt.reporters\nimport compare_mt.arg_utils\nimp... | python | edit | 3 | 0 | bsd-3-clause | 5aa13f1aafd2afa71d7a95f6b59ff28a1c97fbd2 | neulab/compare-mt,neulab/compare-mt | compare_mt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom social_auth.backends import PIPELINE\nfrom social_auth.utils import setting\n\n\nPIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'\n\ndef tuple_index(t, e):\n for (i, te) in enumerate(t):\n if te ==... | python | edit | 1 | 3 | bsd-3-clause | 2a2c9e01b51b10594da97c5ce273073931e44c43 | michael-borisov/django-social-auth,qas612820704/django-social-auth,VishvajitP/django-social-auth,beswarm/django-social-auth,lovehhf/django-social-auth,antoviaque/django-social-auth-norel,qas612820704/django-social-auth,MjAbuz/django-social-auth,omab/django-social-auth,caktus/django-social-auth,VishvajitP/django-social-... | social_auth/backends/pipeline/misc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# https://docs.python.org/3.6/howto/logging.html#logging-basic-tutorial\nimport logging\nimport sys\n\n\ndef get_logger(name):\n \"\"\"\n https://stackoverflow.com/questions/28330317/print-timestamp-for-logging-in-python\n https://... | python | edit | 1 | 1 | mit | 1ae98c0f2186dcdbd658f774a14172b4618bb0a8 | beepscore/fibonacci | logging_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Mirantis, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ... | python | edit | 1 | 2 | apache-2.0 | 93effb501a50d8265afd37826fbcab4dd4a87611 | molecul/qa_app_flask,molecul/qa_app_flask,molecul/qa_app_flask | qa_app/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys, math, random\n\nif len(sys.argv) > 1:\n\tcandidate = eval(sys.argv[1])\nelse:\n\tcandidate = 221\n\nmodulo = candidate - 1\ns = -1\nquotient = modulo\nremainder = 0\nwhile remainder == 0:\n\tquotient, remainder = divmod(quotient... | python | edit | 3 | 0 | mit | 98fd04596367f94b7f47056c429ea23b2dd6165b | boppreh/miller-rabin,boppreh/miller-rabin | miller-rabin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module handles creation of the user-data area\n\"\"\"\nimport os\nimport tempfile\nimport atexit\n\n\nDATA_ROOT = None\nif os.getenv('ROOTPY_GRIDMODE') not in ('1', 'true'):\n DATA_ROOT = os.getenv('ROOTPY_DATA')\n if DAT... | python | edit | 3 | 5 | bsd-3-clause | 1914bd9a9fc2f1ce7a557dd2134d98796866283d | rootpy/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,rootpy/rootpy | rootpy/userdata.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest.mock import patch\n\nfrom rcfc import server, input_methods\nfrom test_helpers import IgnoredArgument\n\ninput_value = 0\n\n\ndef set_input_value(val):\n global input_value\n input_value = val\n\n\n@patch(\"bottle.Bottle... | python | edit | 1 | 1 | mit | 0fed2ca675967f1d43d0abacb9110875b30b0d64 | pviafore/rcfc,pviafore/rcfc,pviafore/rcfc | tests/test_input.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"Script to auto-generate our API docs.\n\"\"\"\n# stdlib imports\nimport os\nimport sys\n\n# local imports\nfrom interfacedocgen import InterfaceHelpWriter\n\n#****************************************************... | python | edit | 2 | 0 | bsd-3-clause | 1d82b988fdd913e291ed73552964c8724934ad32 | arokem/nipype,grlee77/nipype,JohnGriffiths/nipype,wanderine/nipype,fprados/nipype,fprados/nipype,christianbrodbeck/nipype,dgellis90/nipype,wanderine/nipype,sgiavasis/nipype,arokem/nipype,rameshvs/nipype,mick-d/nipype,FredLoney/nipype,mick-d/nipype_source,mick-d/nipype,blakedewey/nipype,sgiavasis/nipype,rameshvs/nipype,... | tools/build_interface_docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nimport nearpy.distances\n\n\nclass MatrixCosineDistance(nearpy.distances.CosineDistance):\n \"\"\"\n A distance measure for calculating the cosine distance between matrices.\n \"\"\"\n\n def distance(self, ... | python | edit | 2 | 4 | mit | 0c69c3e25f52ab126886a2a2f1c33d099d0bb5a4 | elezar/ann-fab,elezar/ann-fab,elezar/ann-fab | annfab/distances/matrix_cosine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nfrom datetime import datetime\n\ndef my_log_parser(logger, line):\n if line.count(',') >= 6:\n date, report_type, group_id, job_id, event, package, rest = line.split(',',6)\n\n if report_type == 'J' and event !... | python | edit | 2 | 6 | apache-2.0 | 6f939e9c2bd4cf42cb4ad58112375f36abf489bf | habitat-sh/habitat,nathenharvey/habitat,nathenharvey/habitat,georgemarshall/habitat,georgemarshall/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,nathenharvey/habitat,rsertelon/habitat,nathenharvey/habitat,habitat-sh/habitat,georg... | terraform/templates/sch_log_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import AnonymousUser\nfrom django.utils.crypto import get_random_string\n\nimport pytest\nfrom cms import api\nfrom cms.page_rendering import render_page\nfrom form_designer.contrib.cms_plugins.form_designer_... | python | edit | 1 | 2 | bsd-3-clause | fcfe2513fc8532dc2212a254da42d75048e76de7 | andersinno/django-form-designer-ai,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer-ai | form_designer/tests/test_cms_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##\n# Copyright (c) 2013 Apple Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\... | python | edit | 1 | 3 | apache-2.0 | 51dc6f26ef8c063c51e1218a0cc09105ae16022c | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver | twext/who/test/test_aggregate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport numpy as np\nimport crepe\n\n\ndef test_sweep():\n # this data contains a sine sweep\n file = os.path.join(os.path.dirname(__file__), 'sweep.wav')\n\n model = crepe.build_and_load_model()\n crepe.process_file(m... | python | edit | 1 | 1 | mit | 91bdd47afe409e86bceca71ebb07ae1975e9073a | marl/crepe | tests/test_sweep.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom pyspark import SparkContext\nfrom pyspark.sql import SQLContext, Row\nfrom pyspark.sql.functions import asc, desc\n\nif __name__ == \"__main__\":\n sc = SparkContext(appName='resort data')\n sqlContext = SQLConte... | python | edit | 1 | 0 | apache-2.0 | 7698ad7a907da5e7b4ad7cfd40255bb9c44b5b87 | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | scripts/sort-cluster-issue.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015, Kay Hayen, mailto:<EMAIL>\n#\n# Python test originally created or extracted from other peoples work. The\n# parts from me are licensed as below. It is at least Free Softwar where\n# it's copied from other p... | python | edit | 4 | 1 | apache-2.0 | 6723dd3e2980d040cef4f7d0f7675933666eb088 | wfxiang08/Nuitka,kayhayen/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,tempbottle/Nuitka,wfxiang08/Nuitka | tests/benchmarks/constructs/LocalVariableAssign.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom django.contrib.auth.models import Group\n\nfrom .models import Editor\n\n\nclass ContributorMixin(admin.ModelAdmin):\n def save_model(self, request, obj, form, change):\n super(ContributorMix... | python | edit | 1 | 2 | apache-2.0 | 508ca596d46c08fdc9295769059f5de974b2d1df | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/components/accounts/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWindows-related compatibility helpers.\n\"\"\"\nimport re\n\n_find_unsafe = re.compile(r'[\\s<>|&^]').search\n\n\ndef quote_arg(s):\n \"\"\"Based on shlex.quote in the standard library.\"\"\"\n if not s:\n return '\"\"'... | python | edit | 1 | 5 | mit | a367b1d4bdbb639b4eab862c7ce691eb4a861d26 | wandb/client,wandb/client,wandb/client | wandb/compat/windows.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Obtain shared config values\nimport os, sys\nfrom os.path import abspath, join, dirname\nsys.path.append(abspath(join(dirname(__file__), '..')))\nsys.path.append(abspath(join(dirname(__file__), '..', '..')))\nfrom shared_conf import *\n\n... | python | edit | 4 | 0 | bsd-2-clause | c05e1d39af6089f31e72fa8dc1c27e22795e8e2f | fabric/fabric | sites/docs/conf.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.db import models\nfrom django.dispatch import receiver\n\nfrom south.signals import post_migrate\n\nfrom remo.base.utils import add_permissions_to_groups\n\n\nclass FeaturedRep(models... | python | edit | 2 | 3 | bsd-3-clause | e12138061b0babca3f14b1479cd3269fec36e9ea | flamingspaz/remo,akatsoulas/remo,Mte90/remo,flamingspaz/remo,johngian/remo,abdullah2891/remo,flamingspaz/remo,akatsoulas/remo,chirilo/remo,abdullah2891/remo,mozilla/remo,Mte90/remo,johngian/remo,johngian/remo,tsmrachel/remo,Mte90/remo,mozilla/remo,chirilo/remo,mozilla/remo,chirilo/remo,johngian/remo,chirilo/remo,akatso... | remo/featuredrep/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom functools import partial, update_wrapper\nfrom django.utils import six\n\n\ndef proxy(attr, default):\n def wrapper(self):\n # It has to be most recent,\n # to override settings in tests\n from djang... | python | edit | 1 | 4 | bsd-3-clause | 1a04c983eb921f47452ea6c013313f90875c400f | byashimov/django-pkgconf | pkgconf/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask.ext.socketio import emit\nfrom pi_gpio import socketio\nfrom config.pins import PinManager\n\n\nPIN_MANAGER = PinManager()\n\n\n@socketio.on('pin:list')\ndef pin_list():\n response = PIN_MANAGER.read_all()\n emit('pin:list'... | python | edit | 1 | 2 | mit | c49024439978fddee1cd688524741e8ee482132b | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server | pi_gpio/sockets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport contextlib\nimport logging\nimport time\nimport os\n\n\nlogger = logging.getLogger('network')\n\n\n@contextlib.contextmanager\ndef logNetwork(message):\n transaction = Transaction(message)\n yield\n transaction.finished()\n\... | python | edit | 1 | 2 | apache-2.0 | 9502755baf7efba7851c07edbf2579f7cff95e44 | eliran-stratoscale/rackattack-api,Stratoscale/rackattack-api | py/rackattack/tcp/debug.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom bot import Bot\n\nif __name__ == \"__main__\":\n bot = Bot()\n bot.start()\n```\n\nApply this change: Allow program termination using SIGINT\n\nIt's a rather crude method, but it wo... | python | edit | 2 | 1 | mit | d61bc5d2d5dad607332bfe131e537d139011ab57 | gehaxelt/python-rss2irc | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom brutal.core.plugin import BotPlugin, cmd, event, match, threaded\n\n\n@cmd\ndef ping(event):\n \"\"\"Responds 'pong' to your 'ping'.\"\"\"\n\n return 'pong'\n\n\n@cmd\ndef echo(event):\n \"\"\"Echoes back the message it reci... | python | edit | 7 | 3 | apache-2.0 | 5611d502c30ee0274fcd523deffcb68c77f31fd8 | Adman/brutal-plugins,mrshu/brutal-plugins | basic.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first attempt of ActualDepartureQueryApi"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\nimport requests\n\nfrom bs4 import BeautifulSoup\n\nfrom bvggrabber.api import QueryApi, Departure\n\n\nACTUAL_QUERY... | python | new_file | 1 | 6 | bsd-3-clause | 324c61e220fcb66973007cab4b95ca249aef3274 | MarkusH/bvg-grabber | bvggrabber/api/actualdeparture.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.snippet.init\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom flask import current_app\n\nfrom ...services.snippet impo... | python | edit | 1 | 2 | bsd-3-clause | e9a5bbd1eba1cdad15626a712bfc7994008c7381 | m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/snippet/init.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport RPi.GPIO as GPIO\nimport time\nimport os\n\n#sets the Input Pin for your Button\n#in this case it is GPIO24 or HardwarePin 19\nbuttonPin = 19\n#sets GPIO Mode to use Hardware Pin Layout\nGPIO.setmode(GPIO.BCM)\n#sets GPIO Pin to INPU... | python | edit | 3 | 0 | mit | d37cac61f1457609806fba507cf9568188d1664d | henne-/guest-password-printer,henne-/guest-password-printer | button.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Import python libs\nimport logging\n\n# Import salt libs\nimport salt.utils\n\nlog = logging.getLogger(__name__)\n\n\ndef held(name):\n '''\n Set package in 'hold' state, meaning it will not be upgraded.\n\n name\n The nam... | python | edit | 4 | 4 | apache-2.0 | eb39ec42078994eac9a5d085f35bcb35dea77a64 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/states/apt.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase, Client\nfrom django.contrib.auth.models import Permission\n\nfrom legalaid.tests.views.test_base... | python | edit | 10 | 1 | mit | 98bb4305ccdd8a83763bedb1f09c261e9904487c | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/legalaid/tests/test_views.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nimport logging\nfrom motor.motor_asyncio import AsyncIOMotorClient\nfrom pymongo.errors import AutoReconnect\n\n\nlog = logging.getLogger(__name__)\n\n\nclass MongoBackend(object):\n\n def __init__(self, na... | python | edit | 1 | 3 | apache-2.0 | 4719401819a877ceebfcc49f1084fb01395a3f4d | optiflows/nyuki,gdraynz/nyuki,gdraynz/nyuki,optiflows/nyuki | nyuki/bus/persistence/mongo_backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom twisted.web.template import Element, renderer, XMLFile\nfrom twisted.python.filepath import FilePath\n\n\nclass ResponseParser(object):\n\n HEADER_PATTERN = r'^(.*)[\\r\\n]{1,2}\\d?'\n ITEM_PATTERN = r'^(\\d+)\\. (.+... | python | edit | 1 | 2 | bsd-3-clause | 872875ecb3b5a09c14da8836cdd4b7a6f6610675 | TouK/vumi,TouK/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix | vumi/transports/mxit/responses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\n__all__ = ['app']\n\nfrom ConfigParser import SafeConfigParser as ConfigParser\nfrom urlparse import urlparse, urlunparse\n\nfrom flask import Flask, request, redirect\nfrom fuzzywuzzy import proces... | python | edit | 1 | 2 | mit | fbbb01a3ef5811c102be6822a16a881212e421a9 | sabf/typo | typo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nclass ETK(object):\n\n def __init__(self):\n pass\n\n def get_glossary(self, file_path):\n res = dict()\n with open(file_path) as fp:\n line = fp.readline().rstrip('\\n')\n whi... | python | edit | 1 | 4 | mit | 75e0c323871d6eae6959523b105a06cfe8460a28 | usc-isi-i2/etk,usc-isi-i2/etk,usc-isi-i2/etk | etk2/etk.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.