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# Copyright 2017 Google Inc.\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.... | python | edit | 1 | 1 | apache-2.0 | 62297b3c937d386b759ec14a078cee36f2550d44 | google/aiyprojects-raspbian,t1m0thyj/aiyprojects-raspbian,google/aiyprojects-raspbian,t1m0thyj/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian | src/aiy/_drivers/_alsa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom streamlink.plugin import Plugin\nfrom streamlink.plugin.api import http\nfrom streamlink.plugin.api import useragents\nfrom streamlink.stream import HLSStream\n\n_url_re = re.compile(r'''https?://(www\\.)?arconaitv\\.me/st... | python | edit | 1 | 3 | bsd-2-clause | fa30c15c6bdaa49d3af2e717f559d279da770b46 | bastimeyer/streamlink,streamlink/streamlink,back-to/streamlink,melmorabity/streamlink,bastimeyer/streamlink,gravyboat/streamlink,melmorabity/streamlink,javiercantero/streamlink,gravyboat/streamlink,javiercantero/streamlink,wlerin/streamlink,wlerin/streamlink,beardypig/streamlink,chhe/streamlink,streamlink/streamlink,be... | src/streamlink/plugins/arconai.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytac.load_csv\nimport pytac.epics\n\ndef main():\n lattice = pytac.load_csv.load('VMX', pytac.epics.EpicsControlSystem())\n bpms = lattice.get_elements('BPM')\n bpms_n = 0\n try:\n for bpm in bpms:\n bp... | python | edit | 5 | 4 | apache-2.0 | b706c1a949b10a7dd4b3206c02de8d4abda088a9 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | pytac/mini_project.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport unittest\nimport re\n\nfrom faker import Factory\nfrom faker.utils import text\nfrom .. import string_types\n\n\nclass ne_NP_FactoryTestCase(unittest.TestCase):\n \n def setUp(self):\n ... | python | edit | 1 | 4 | mit | fe167bfd25c0c86b3c6fb5ef76eb24036ad2b6da | trtd/faker,joke2k/faker,joke2k/faker,danhuss/faker | tests/ne_np/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tempfile\nimport StringIO\n\nimport pytest\n\nfrom shelltest.shelltest import ShellTest, ShellTestSource, ShellTestRunner\n\n\n@pytest.fixture\ndef tests():\n return [ShellTest('echo hello', 'hello\\n', ShellTestSource('', 0)),\n ... | python | edit | 4 | 2 | mit | 6b9d9c33b4d68a008bb992b9a11ab2f02a4d5cbd | jthacker/shelltest,jthacker/shelltest | shelltest/tests/test_runner.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nfrom logging import Handler as LoggingHandler\n\n\nclass KillProcessHandler(LoggingHandler):\n\n def emit(self, record):\n if record.levelno != self.level:\n return\n\n try:\n # ... | python | edit | 1 | 5 | mit | 82f8861df01d67335499682743f69b1763cc3c35 | odedlaz/uberlogs,odedlaz/uberlogs | uberlogs/handlers/kill_process.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding: utf-8 -*-\nfrom django.shortcuts import render_to_response\nfrom django.shortcuts import get_object_or_404\nfrom django.template import RequestContext\nfrom apps.careeropportunity.models import CareerOpportunity\n\nimport datet... | python | edit | 1 | 1 | mit | e1b23cdc089b3a05ae4959c9859e16e5e21b5c91 | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | apps/careeropportunity/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nimport sqlite3\nfrom typing import Optional\n\nfrom tabledata import NameValidationError # noqa: W0611\n\n\nclass DatabaseError(sqlite3.DatabaseError):\n \"\"\"\n Excepti... | python | edit | 3 | 1 | mit | b0e3ed09d401389680db14c6892e84f016423c97 | thombashi/SimpleSQLite,thombashi/SimpleSQLite | simplesqlite/error.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\nfrom contextlib import contextmanager\n\nfrom fabric.context_managers import settings, hide, prefix\nfrom fabric.state import env\n\n__all__ = ['get_sudo_context', 'sudo', 'only_messages', 'prefix']\n\n\n@contextmanager\ndef... | python | edit | 3 | 3 | mit | 0d0b470e470ee913cb8983f932323921d405607b | 5monkeys/refabric | refabric/context_managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bluebottle.votes.models import Vote\nfrom bluebottle.bb_accounts.serializers import UserPreviewSerializer\nfrom rest_framework import serializers\n\n\nclass VoteSerializer(serializers.ModelSerializer):\n voter = UserPreviewSerialize... | python | edit | 1 | 0 | bsd-3-clause | 4aeb85126cf5f75d89cc466c3f7fea2f53702a13 | onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle | bluebottle/votes/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom time import time\n\nfrom ..core import Minette\nfrom ..models import Message\n\n\nclass MinetteForTest(Minette):\n def __init__(self, **kwargs):\n super().__init__(**kwargs)\n self.default_channel = kwargs.get(\"defaul... | python | edit | 1 | 6 | apache-2.0 | aa1bbbe1d4b463be8cedaaf445fa44612592513f | uezo/minette-python | minette/test/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django_medusa.renderers import StaticSiteRenderer\n\n\nclass ScheduleRenderer(StaticSiteRenderer):\n def get_paths(self):\n paths = [\"/schedule/\", ]\n return paths\n\nrenderers = [ScheduleRenderer, ]\n\n```\n\nApply ... | python | edit | 1 | 2 | isc | 1d043a9fa2140992435bc5d6583601464d96f5b0 | CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer | wafer/schedule/renderers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nAn extension for a command-based keyword.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom Cauldron.types import Boolean, DispatcherKeywordType\nfrom Cauldron.exc import NoWriteNecessary\n\nclass Comm... | python | edit | 1 | 2 | bsd-3-clause | 4623c8f0de7ff41f78754df6811570a4d4367728 | alexrudy/Cauldron | Cauldron/ext/commandkeywords/__init__.py | rejected_duplicate | Near-duplicate of sample 1456 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreated on Nov 10, 2014\n\n@author: fechnert\n'''\n\nimport logging\n\n\nclass Feature(object):\n ''' Represents a abstract Feature '''\n\n def __init__(self, config, clients, channels):\n ''' Initialize the Object '''\n ... | python | edit | 3 | 1 | mit | 83036bf711dd5047ef87a56ea9d8def604923882 | HWDexperte/ts3observer | ts3observer/features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 Quilt Data, Inc. All rights reserved.\n\n\"\"\"\nDefault config values the Flask app.\nShared between dev, stage, and production.\n\nSee `app.config.from_object('...')` in __init__.py.\n\"\"\"\n\nSQLALCHEMY_TRACK_MODIFI... | python | edit | 1 | 0 | apache-2.0 | 8425efaf60b642418786c523d142a370dae3c3a0 | quiltdata/quilt-compiler,quiltdata/quilt-compiler,quiltdata/quilt,quiltdata/quilt-compiler,quiltdata/quilt-compiler,quiltdata/quilt,quiltdata/quilt,quiltdata/quilt,quiltdata/quilt | quilt_server/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport json, os, requests\nfrom awsauth import S3Auth\n\nkey = os.environ.get('UWOPENDATA_APIKEY')\n\nservice = 'FoodMenu'\n# output = 'json'\n# callback = 'None'\nrequest = 'http://api.uwaterloo.ca/public/v1/'\n\nd... | python | edit | 3 | 1 | mit | 63ee6f971b99c2f030e0347c37bc9577ba9ee7cd | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | getMenu.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# test scoping rules\n\n# explicit global variable\na = 1\ndef f():\n global a\n global a, a # should be able to redefine as global\n a = 2\nf()\nprint(a)\n\n# explicit nonlocal variable\ndef f():\n a = 1\n def g():\n ... | python | edit | 1 | 1 | mit | 6cf2a3966e12af5f86781a5d20c0810953722811 | lowRISC/micropython,ryannathans/micropython,tralamazza/micropython,micropython/micropython-esp32,cwyark/micropython,deshipu/micropython,lowRISC/micropython,alex-march/micropython,adafruit/micropython,Peetz0r/micropython-esp32,SHA2017-badge/micropython-esp32,turbinenreiter/micropython,deshipu/micropython,ryannathans/mic... | tests/basics/scope.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose.tools import eq_, ok_\nimport unittest\n\nimport openxc.measurements\nfrom openxc.sources import NetworkDataSource\nfrom openxc.sources import DataSourceError\n\nclass NetworkDataSourceTests(unittest.TestCase):\n def setUp(self... | python | edit | 7 | 2 | bsd-3-clause | cbafc968343cd2b001bcee354d418c9886fe94b4 | openxc/openxc-python,openxc/openxc-python,openxc/openxc-python | tests/test_network.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n__author__ = 'oliveiraev'\n__all__ = ['Bower']\n\nfrom re import sub\nfrom re import split\nfrom aero.__version__ import enc\nfrom .base import BaseAdapter\n\n\nclass Bower(BaseAdapter):\n \"\"\"\n Twitter Bow... | python | edit | 4 | 5 | bsd-3-clause | 1726a73b81c8a7dfc3610690fe9272776e930f0f | Aeronautics/aero | aero/adapters/bower.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 os\nimport sys\n\nZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.insert(0, ZULIP_PATH)\nfrom scripts.lib.setup_path import setup_path\nfrom ... | python | edit | 1 | 0 | apache-2.0 | 98a05257eaf4ca6555ffc179a9250a7cfb3a903c | rht/zulip,rht/zulip,rht/zulip,andersk/zulip,zulip/zulip,zulip/zulip,andersk/zulip,kou/zulip,andersk/zulip,kou/zulip,zulip/zulip,rht/zulip,kou/zulip,andersk/zulip,rht/zulip,kou/zulip,andersk/zulip,rht/zulip,zulip/zulip,kou/zulip,kou/zulip,zulip/zulip,kou/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,zulip/zuli... | scripts/lib/check-database-compatibility.py | rejected_duplicate | Near-duplicate of sample 1096 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom admin_honeypot import views\nfrom django.conf.urls import url\n\napp_name = 'admin_honeypot'\n\nurlpatterns = [\n url(r'^login/$', views.AdminHoneypot.as_view(), name='login'),\n url(r'^.*$', views.AdminHoneypot.as_view(), name='... | python | edit | 1 | 0 | mit | 86d12c7d13bd7a11a93deccf42f93df4328e70fd | dmpayton/django-admin-honeypot,dmpayton/django-admin-honeypot | admin_honeypot/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django.apps import apps\n\nfrom django import forms\n\nfrom suit.sortables import SortableTabularInline\nfrom multiupload.fields import MultiFileField\n\n\nclass ProductForm(forms.ModelForm):\n\n images = MultiFileField(max_num=10... | python | edit | 1 | 2 | isc | 19964dc65cecbbb043da3fe85bf355423cf9ce3c | pmaigutyak/mp-shop,pmaigutyak/mp-shop,pmaigutyak/mp-shop | shop/products/admin/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for cement.ext.ext_argcomplete.\"\"\"\n\nimport os\nfrom cement.ext import ext_argcomplete\nfrom cement.ext.ext_argparse import ArgparseController, expose\nfrom cement.utils import test\nfrom cement.utils.misc import rando\n\nAP... | python | edit | 4 | 1 | bsd-3-clause | b9e3485030ef7acf5b3d312b8e9d9fc54367eded | akhilman/cement,fxstein/cement,datafolklabs/cement,akhilman/cement,akhilman/cement,fxstein/cement,fxstein/cement,datafolklabs/cement,datafolklabs/cement | tests/ext/argcomplete_tests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Local\nfrom .base import *\n\n\n# JWT Settings\ndef jwt_get_username_from_payload_handler(payload):\n return payload.get('email')\n\nJWT_AUTH = {\n # 'JWT_SECRET_KEY': AUTH0_CLIENT_SECRET,\n 'JWT_AUDIENCE': AUTH0_CLIENT_ID,\n ... | python | edit | 8 | 1 | bsd-2-clause | 11b16c26c182636016e7d86cd0f94963eec42556 | barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore | project/settings/ci.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Unittest of command entry point.\"\"\"\n# Copyright 2015 Masayuki Yamamoto\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 obta... | python | edit | 1 | 1 | apache-2.0 | 9bb19e21ed7f3b10af9a218cf55ea3a19ee4393c | ma8ma/yanico | tests/test_command.py | rejected_duplicate | Near-duplicate of sample 3242 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom penn import Laundry\n\n\nclass TestLaundry(unittest.TestCase):\n\n def setUp(self):\n self.laundry = Laundry()\n\n def test_all(self):\n data = self.laundry.all_status()\n self.assertEquals('... | python | edit | 1 | 3 | mit | 6a2fb450eb51d46fe4ab53dd4095527ecdcc9266 | pennlabs/penn-sdk-python,pennlabs/penn-sdk-python | tests/laundry_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n## \\package globals.fieldtests\n\n# MIT licensing\n# See: LICENSE.txt\n\n\nimport wx\n\n\n## Tests if a wx control/instance is enabled\n# \n# Function for compatibility between wx versions\n# \\param enabled\n... | python | edit | 1 | 4 | mit | 77f99f4862ded1b8493b5895e4f9d88a3bbf722b | AntumDeluge/desktop_recorder,AntumDeluge/desktop_recorder | source/globals/fieldtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom scrapy.dupefilters import BaseDupeFilter\nfrom scrapy.utils.request import request_fingerprint\n\nfrom . import connection\n\n\nclass RFPDupeFilter(BaseDupeFilter):\n \"\"\"Redis-based request duplication filter\"\"\"... | python | edit | 1 | 1 | mit | 01920b5dcced36e72a5623bf9c08c5cecfa38753 | darkrho/scrapy-redis,rolando/scrapy-redis | src/scrapy_redis/dupefilter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python3\n\nimport sys\nimport math\nimport glob\n\nfrom sweet.postprocessing.pickle_SphereDataPhysicalDiff import *\n\np = pickle_SphereDataPhysicalDiff(\"_t00000000120.00000000.csv\")\n\n\n```\n\nApply this change: Make pos... | python | edit | 8 | 0 | mit | 9f5418e5b755232e12ea18e85b131dbd04c74587 | schreiberx/sweet,schreiberx/sweet,schreiberx/sweet,schreiberx/sweet | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/postprocessing_pickle.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n################################################################################\n#\n# RMG - Reaction Mechanism Generator\n#\n# Copyright (c) 2002-2010 Prof. William H. Green (<EMAIL>) a... | python | edit | 1 | 0 | mit | 27d2cd57337497abb9d106fdb033c26771e481e4 | pierrelb/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,nickvandewiele/RMG-Py,nyee/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,chatelak/RMG-Py | rmgpy/data/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tablib\nfrom django.core.management.base import BaseCommand\n\nfrom painter.models import Card\n\n\nclass Command(BaseCommand):\n def handle(self, *args, **options):\n dataset = tablib.Dataset()\n\n```\n\nApply this change:... | python | edit | 4 | 2 | mit | 3661edd55553ff2dff27cb102a83d4751e033f2a | adam-incuna/imperial-painter,adam-thomas/imperial-painter,adam-thomas/imperial-painter,adam-incuna/imperial-painter | painter/management/commands/import_cards.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# install_dotfiles\n# This script will build platform-specific dotfiles and create the appropriate symlinks in ~\n\nimport platform\nimport os\n\nsysName = platform.system()\nos.remove('bashrc')\nbashrc = open('bashrc',... | python | edit | 2 | 4 | mit | 36ea5e58ce97b69bfd0bf3701cbc5936bc59d100 | rucker/dotfiles-manager | install_dotfiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis simulates the mlab-ns lookup request, whose code lives here:\n\nhttps://code.google.com/p/m-lab/source/browse/server/mlabns/handlers/lookup.py?repo=ns\n\nThe difference in this module is that we don't support features which\noo... | python | edit | 1 | 3 | apache-2.0 | 333afea8d8a548948f24745490c700c98500e22f | hellais/ooni-support,m-lab/ooni-support,m-lab/ooni-support,hellais/ooni-support | mlab-ns-simulator/mlabsim/lookup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright 2014-2015 Boundary, Inc.\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://... | python | edit | 1 | 2 | apache-2.0 | 47fe1412857dbc251ff89004798d5507b0e70b25 | wcainboundary/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli,jdgwartney/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli,boundary/boundary-api-cli | boundary/plugin_get.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport zstd\n\n\nclass TestTrainDictionary(unittest.TestCase):\n def test_no_args(self):\n with self.assertRaises(TypeError):\n zstd.train_dictionary()\n\n def test_bad_args(self):\n with se... | python | edit | 2 | 2 | bsd-3-clause | 6889946ebb1c1559e0e1c7b83e1d7b1d6896e0b0 | terrelln/python-zstandard,terrelln/python-zstandard,terrelln/python-zstandard,indygreg/python-zstandard,terrelln/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard | tests/test_train_dictionary.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pypyodbc\nimport csv\n\nconn = pypyodbc.connect(\"DSN=HOSS_DB\")\ncur = conn.cursor()\n\ntables = []\n\ncur.execute(\"select * from sys.tables\")\n\nfor row in cur.fetchall():\n tables.append(row[0])\n\nfor table in tables:\n p... | python | edit | 1 | 0 | isc | a057798f3e54e8d74005df10ba1f7d9b93270787 | wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts | odbc2csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# This software may be modified and distributed under the terms\n# of the BSD license. See the LICENSE file for details.\n\nfrom enum import Enum\n\nclass DateResolution(Enum):\n Year, Month, Week, Weekday, Da... | python | edit | 1 | 0 | bsd-3-clause | f188f2eb81c1310b9862b435a492b4ce6d0fac2d | 3stack-software/python-aniso8601-relativedelta | python3/aniso8601/resolution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 2012 Cloudera, Inc. All rights reserved.\n# Validates running with different scan range length values\n#\nimport pytest\nfrom copy import copy\nfrom tests.common.test_vector import TestDimension\nfrom ... | python | edit | 4 | 2 | apache-2.0 | 4b5a39c6bbc82572f67ea03236490e52049adf52 | tempbottle/Impala,cchanning/Impala,kapilrastogi/Impala,cgvarela/Impala,brightchen/Impala,mapr/impala,caseyching/Impala,rampage644/impala-cut,mapr/impala,caseyching/Impala,rampage644/impala-cut,lirui-intel/Impala,mapr/impala,ibmsoe/ImpalaPPC,cchanning/Impala,gistic/PublicSpatialImpala,gerashegalov/Impala,lnliuxing/Impal... | tests/query_test/test_scan_range_lengths.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add higher level functions encode and decode"
},
{
"role": "assistant",
"content": "\"\"\"\nThis module provides high level utility functions to encode and decode a terrain tile.\n\nReference\n---------\n\"\"\"\n\nfrom .terrain i... | python | new_file | 1 | 2 | mit | dfef23d834ab67acf91dcefd6fe39e089c71fb9a | loicgasser/quantized-mesh-tile | quantized_mesh_tile/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mopidy import settings as raw_settings\n\ndef get_version():\n return u'0.1.dev'\n\ndef get_mpd_protocol_version():\n return u'0.16.0'\n\nclass SettingsError(Exception):\n pass\n\nclass Settings(object):\n def __getattr__(s... | python | edit | 1 | 5 | apache-2.0 | b9ba8a929a539f24d674aed7d7ee98b490a6fcd3 | mokieyue/mopidy,swak/mopidy,pacificIT/mopidy,quartz55/mopidy,swak/mopidy,SuperStarPL/mopidy,mopidy/mopidy,priestd09/mopidy,jmarsik/mopidy,diandiankan/mopidy,diandiankan/mopidy,vrs01/mopidy,glogiotatidis/mopidy,adamcik/mopidy,rawdlite/mopidy,pacificIT/mopidy,dbrgn/mopidy,mokieyue/mopidy,pacificIT/mopidy,ali/mopidy,hkari... | mopidy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFunctions for connecting to the pScheduler database\n\"\"\"\n\nimport psycopg2\n\nfrom filestring import string_from_file\n\ndef pg_connection(dsn='', autocommit=True):\n \"\"\"\n Connect to the database, and return a handle t... | python | edit | 1 | 3 | apache-2.0 | ce875a972eb3efaa5201ba1a72ae1d8d6754cfe0 | mfeit-internet2/pscheduler-dev,perfsonar/pscheduler,perfsonar/pscheduler,perfsonar/pscheduler,perfsonar/pscheduler,mfeit-internet2/pscheduler-dev | python-pscheduler/pscheduler/pscheduler/db.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.contrib import admin\n\n\nclass PublishableAdmin(admin.ModelAdmin):\n \"\"\"\n Overrides standard admin.ModelAdmin save_model method\n It sets user (author) based on data ... | python | edit | 1 | 2 | mit | efe06967b4896c7d2d4c88fbda96a0504959594b | williamroot/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,opps/opps | opps/core/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom nodes import Node\nimport json\n\nclass Dictionary(Node):\n char = \".d\"\n args = 0\n results = 1\n \n def __init__(self, word_ids:Node.IntList):\n if not hasattr(Dictionary, \"word_list\... | python | edit | 1 | 4 | mit | b34634c0c9a8db389ed48b50ca4b2e4b92105f93 | muddyfish/PYKE,muddyfish/PYKE | node/dictionary.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst\n\nclass bdist_wininst(_bdist_wininst):\n def reinitialize_command(self, command, reinit_subcommands=0):\n cmd = self.distribution.reinitialize_command(\n... | python | edit | 1 | 2 | mit | 404b7af74fb65299aa9c14e0e40541e3a4a68285 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/command/bdist_wininst.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\n\nMAX_VERBOSITY_LEVEL = 100\n\n# https://www.sqlite.org/fileformat2.html\nSQLITE_SYSTEM_TABLES = [\n \"sqlite_master\",\n \"sqlite_sequence\",\n \"... | python | edit | 1 | 0 | mit | d86cfb740f4119049a7ac293037f9cba12a3516b | thombashi/sqliteschema | sqliteschema/_const.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport publisher\n\ntest_pdf_filename = \"test/test.pdf\"\ntest_css_filename = \"test/test.css\"\ntest_md_filename = \"test/test.md\"\ntest_html_filename = \"test/test.html\"\n\ntest_md = \"# Test heading\\n\\n- test item 1\\n- test item 2\... | python | edit | 6 | 1 | mit | 218b0f9a42c8d3421f80a3b2b77c9f7f3334722d | cpgillem/markdown_publisher,cpgillem/markdown_publisher | test_publisher.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import env\nfrom ..exceptions import EnvironmentFileNotFound\n\n\nclass YamlFileSpec(object):\n _environment = None\n\n def __init__(self, filename=None, **kwargs):\n self.filename = filename\n self.msg = None\n\... | python | edit | 1 | 2 | bsd-3-clause | 927172b383e1c62b9aab34f38ef95e96ed277cbe | isaac-kit/conda-env,asmeurer/conda-env,mikecroucher/conda-env,isaac-kit/conda-env,conda/conda-env,ESSS/conda-env,ESSS/conda-env,dan-blanchard/conda-env,nicoddemus/conda-env,asmeurer/conda-env,conda/conda-env,phobson/conda-env,nicoddemus/conda-env,mikecroucher/conda-env,dan-blanchard/conda-env,phobson/conda-env | conda_env/specs/yaml_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n__version__ = \"0.17.1\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n\n```\n\nApply this change: Bump version 0.17.1 --> 0.17.2rc1\n\nSigned-off-by: Jack Robis... | python | edit | 1 | 0 | mit | db751eabb690af3b2b4712f46a41b41c1e0499a2 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom dumper import *\n\ndef qdump__FixedPoint(d, value):\n d.putNumChild(3)\n raw = [ value[\"v\"][\"s\"][i].integer() for i in range( value[\"v\"][\"numWords\"].integer() ) ]\n ss = value[\"v\"][\"storageSize\"].integer()\n exp... | python | edit | 4 | 5 | mit | eac54b3080c37d2530077f23b0c022ed818ca9a4 | Cat-Ion/FixedPoint,Cat-Ion/FixedPoint | util/fixedpoint-qtcreator.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 1.10.5 on 2017-01-11 21:45\nfrom __future__ import unicode_literals\n\nimport django.db.models.deletion\nfrom django.db import migrations, models\n\nimport openslides.users.models\nimport openslides.utils.models\n\n\nc... | python | edit | 1 | 2 | mit | 6b5c32960565775d8b94825087c503e58f5eed27 | tsiegleauq/OpenSlides,normanjaeckel/OpenSlides,normanjaeckel/OpenSlides,ostcar/OpenSlides,emanuelschuetze/OpenSlides,boehlke/OpenSlides,ostcar/OpenSlides,tsiegleauq/OpenSlides,CatoTH/OpenSlides,emanuelschuetze/OpenSlides,FinnStutzenstein/OpenSlides,OpenSlides/OpenSlides,normanjaeckel/OpenSlides,boehlke/OpenSlides,jwinz... | openslides/users/migrations/0003_group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import Widget\nfrom django.template.loader import render_to_string\n\nfrom ..utils import static_url\n\n\nclass GenericKeyWidget(Widget):\n template = \"admin/hatband/widgets/generickey.html\"\n\n class Media:\n ... | python | edit | 1 | 2 | apache-2.0 | 348c28bacececb787ab73c9716dc515d0fabbe4b | armstrong/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband | armstrong/hatband/widgets/visualsearch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.signals import m2m_changed\nfrom django.dispatch import receiver\nfrom django.core.exceptions import ValidationError\nfrom django.utils.translation import ugettext_lazy as _\nfrom .models import Step\n\n\n@receiver(m2m... | python | edit | 1 | 4 | mit | 8d7f3320a9d3fd3b7365cad7631835a0a46f374e | livingsilver94/getaride,livingsilver94/getaride,livingsilver94/getaride | planner/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import VERSION as DJANGO_VERSION\nfrom django import template\nfrom django.conf import settings\nif DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] <= 9:\n from django.core.urlresolvers import reverse\nelse:\n from django.url... | python | edit | 1 | 6 | bsd-3-clause | 2247162e277f8d09cc951442673d71cd0a8ece65 | valerymelou/django-active-link | active_link/templatetags/active_link_tags.py | rejected_duplicate | Near-duplicate of sample 12003 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.db import connection\nfrom raven import Client\n\nfrom ....tasks import enqueue\nfrom ...models import UniqueFeed, Feed\nfr... | python | edit | 1 | 8 | bsd-3-clause | ba00bececdcca3d1f224128123f12a9f634798b8 | vincentbernat/feedhq,feedhq/feedhq,vincentbernat/feedhq,feedhq/feedhq,feedhq/feedhq,rmoorman/feedhq,rmoorman/feedhq,feedhq/feedhq,vincentbernat/feedhq,rmoorman/feedhq,rmoorman/feedhq,vincentbernat/feedhq,feedhq/feedhq,vincentbernat/feedhq,rmoorman/feedhq | feedhq/feeds/management/commands/updatefeeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add draft testcases for employees views"
},
{
"role": "assistant",
"content": "from .models import Employee\nfrom .serializers import EmployeeSerializer, EmployeeAvatarSerializer, EmployeeListSerializer\nfrom categories.serialize... | python | new_file | 3 | 1 | apache-2.0 | 1bad824786204353ff4f5b955ae687f088f80837 | belatrix/BackendAllStars | employees/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport json\nfrom collections import namedtuple\n\nfrom pysuru.base import BaseAPI, ObjectMixin\n\n\nSERVICE_INSTANCE_ATTRS = (\n 'name',\n 'description',\n 'type',\n 'plan',\n 'teamOwner',\n)\n\n\n_ServiceIn... | python | edit | 1 | 3 | mit | eac90ef4d470923bb823f99dc85984faac733f08 | rcmachado/pysuru | pysuru/services.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\nimport time\n\n\nDEFAULT_SLEEP = 0.01\n\n\nclass CustomError(Exception):\n pass\n\n\ndef defer(callback, *args, **kwargs):\n sleep = kwargs.pop('sleep', DEFAULT_SLEEP)\n expected_return = kwargs.pop('expected_retu... | python | edit | 1 | 3 | mit | 761e74feac34c198da75f17b6145b6ca37d7afed | FichteFoll/resumeback | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nimport os\n\nPROFILE_TYPE_MAPPING = {\n 'typical_user': 'chrome/test... | python | edit | 1 | 1 | bsd-3-clause | 487897e4b515a4c514fa0c91dec80d981c3bb98b | patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,timo... | tools/telemetry/telemetry/core/profile_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tempfile\n\nimport pytest\n\nfrom coaction import create_app\nfrom coaction.extensions import db as _db\n\n\ndbfile = tempfile.NamedTemporaryFile(delete=False)\ndbfile.close()\n\nTEST_DATABASE_FILE = dbfile.name\nTEST_DATABASE_URI = ... | python | edit | 1 | 1 | mit | 4a549a5d7509fa23fc6787662b4950291baa3407 | PythonClutch/python-clutch,PythonClutch/python-clutch,PythonClutch/python-clutch | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pprint\nimport sys\nimport clang.cindex\nfrom clang.cindex import CursorKind\n\n\ndef handle_function_decl(fdecl_cursor):\n children = list(fdecl_cursor.get_children())\n\n # Only interested in functions that have a CUDAGLOBAL_... | python | edit | 4 | 5 | unlicense | d14a34bff8e0462ebc2b8da9bc021f9c6f8f432d | eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples | libclang_samples/kernel-sigs.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove import for lib not commited yet."
},
{
"role": "assistant",
"content": "from apt import APT_RECORDS, ATT_RECORDS, RWY_RECORDS, RMK_RECORDS, APT_RECORD_MAP\nfrom awos import AWOS_RECORDS\n"
}
] | python | new_file | 8 | 0 | bsd-3-clause | f69e6555387d4cb6828baaac3ce1a17217577b48 | adamfast/faddsdata | faddsdata/format_definitions/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Django\nfrom django.apps import apps\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\nimport datetime\n\nclass Command(BaseCommand):\n help = \"Command to rebuild denorms.\"\n\n def add_argume... | python | edit | 4 | 4 | bsd-2-clause | 76af6248c479127f1a212c331a2278f69484bcbc | dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,barberscore/barberscore-api | project/api/management/commands/rebuild_data.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# SPDX-License-Identifier: MIT\n# Copyright (C) 2016-2020 Tobias Gruetzmacher\nfrom PyInstaller.utils.hooks import collect_submodules, copy_metadata\n\nhiddenimports = collect_submodules('dosagelib.plugins')\ndatas = copy_metadata('dosage')... | python | edit | 1 | 0 | mit | 5550217c028c422e7dc2d54c3b8b61ea43cfc26f | webcomics/dosage,webcomics/dosage | dosagelib/__pyinstaller/hook-dosagelib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom django.core.wsgi import get_wsgi_application\n\nimport newrelic.agent\nnewrelic.agent.initialize('/var/www-data/censusreporter/conf/newrelic.ini')\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"config.prod.settings\"... | python | edit | 1 | 0 | mit | d67099ce7d30e31b98251f7386b33caaa5199a01 | sseguku/simplecensusug,Code4SA/censusreporter,Code4SA/censusreporter,Code4SA/censusreporter,sseguku/simplecensusug,4bic/censusreporter,sseguku/simplecensusug,4bic/censusreporter,Code4SA/censusreporter,4bic/censusreporter | censusreporter/config/prod/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport dj_database_url\nimport urlparse\n\nfrom os import environ\nfrom .base import *\n\nENV = 'HEROKU'\n\n# Store files on S3\nDEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'\n\nre... | python | edit | 3 | 0 | bsd-3-clause | 76177710323f1ccb408fd006ef7b87ff36743f8c | idan/telostats,idan/telostats,idan/telostats | telostats/settings/heroku.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Test the tabulate output adapter.\"\"\"\n\nfrom __future__ import unicode_literals\nfrom textwrap import dedent\n\nfrom cli_helpers.tabular_output import tabulate_adapter\n\n\ndef test_tabulate_wrapper():\n ... | python | edit | 1 | 1 | bsd-3-clause | 4b65ab0fbc5839be9a49dd235549a13996a56108 | dbcli/cli_helpers,dbcli/cli_helpers | tests/tabular_output/test_tabulate_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\ndef _build_flag_url():\n if hasattr(settings, 'COUNTRIES_FLAG_URL'):\n url = settings.COUNTRIES_FLAG_URL\n else:\n url = 'flags/%(code)s.gif'\n prefix = getattr(settings, 'STATIC_... | python | edit | 1 | 5 | mit | dda9904a756e309047bebcbfecd2120383a257cc | degenhard/django-countries | django_countries/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\"\"\"\nDecoraterBotCore\n~~~~~~~~~~~~~~~~~~~\n\nCore to DecoraterBot\n\n:copyright: (c) 2015-2018 AraHaan\n:license: MIT, see LICENSE for more details.\n\n\"\"\"\nfrom DecoraterBotUtils.utils import BaseClient, config\n\n\n... | python | edit | 1 | 1 | mit | afb8aadcc1dbea109c7882c1a1d65fc328372a74 | DecoraterBot-devs/DecoraterBot | resources/Dependencies/DecoraterBotCore/Core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyxb.binding.generate\nimport pyxb.binding.datatypes as xs\nimport pyxb.binding.basis\nimport pyxb.utils.domutils\n\nimport os.path\nxsd='''<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLS... | python | edit | 6 | 1 | apache-2.0 | 84490442de881788a7f83bc18ec4eedb7f6edb99 | jonfoster/pyxb-upstream-mirror,pabigot/pyxb,pabigot/pyxb,jonfoster/pyxb2,balanced/PyXB,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,jonfoster/pyxb2,CantemoInternal/pyxb,balanced/PyXB,balanced/PyXB,jonfoster/pyxb2,CantemoInternal/pyxb,jonfoster/pyxb1,CantemoInternal/pyxb | tests/bugs/test-200908231005.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport pytest\n\n\nclass TestWebUI(object):\n def get_page(self, page):\n return requests.get('http://nginx' + page)\n\n pages = [\n {\n 'page': '/',\n 'matching_text': 'Diamond',\n... | python | edit | 1 | 2 | mit | ae1a2b73d0c571c49726528f9b8730c9e02ce35f | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/integration/test_webui.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an implementation that works for testing errbacks"
},
{
"role": "assistant",
"content": "import twisted.python.failure\nimport twisted.web.error\nimport scrapy.item\n\n\nclass Autoresponder(object):\n # The purpose of Auto... | python | new_file | 3 | 7 | apache-2.0 | f862823b24bfe59f6fb15fc417aea8ebacdc092d | paulproteus/autoresponse | autoresponse/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright 2012 WebFilings, LLC\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.apac... | python | edit | null | null | apache-2.0 | 978dd0161552458331870af0b524cdcff25fd71d | mattsanders-wf/furious,beaulyddon-wf/furious,Workiva/furious,andreleblanc-wf/furious,rosshendrickson-wf/furious,andreleblanc-wf/furious,beaulyddon-wf/furious,robertkluin/furious,rosshendrickson-wf/furious,Workiva/furious,mattsanders-wf/furious | furious/handlers/__init__.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Dict, List\n\nfrom typeguard import check_argument_types\nimport tensorflow as tf\nimport numpy as np\n\nfrom neuralmonkey.decoders.autoregressive import AutoregressiveDecoder\nfrom neuralmonkey.decorators import tensor\n... | python | edit | 1 | 3 | bsd-3-clause | 93650f0ae762949affcee4bfcf4a94093fe651d5 | ufal/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey | neuralmonkey/runners/perplexity_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# hack a byref_at function\n\nfrom ctypes import *\n\ntry:\n set\nexcept NameError:\n from sets import Set as set\n\ndef _determine_layout():\n result = set()\n for obj in (c_int(), c_longlong(), c_float(), c_double(), (c_int * ... | python | edit | 3 | 0 | mit | 958426d43a5aa8e153e0999417377b54be67f04b | trolldbois/ctypeslib,luzfcb/ctypeslib,luzfcb/ctypeslib,trolldbois/ctypeslib,trolldbois/ctypeslib,luzfcb/ctypeslib | ctypeslib/experimental/byref_at.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nBLOG_TITLE = 'Svenv.nl'\nBLOG_DESCRIPTION = 'Blogposts about tech related subject like Unix, Linux, Docker and programming.'\n\nBASE_URL = 'http://svenv.nl'\n\nCONTACT_PAGE_PATH = 'contact'\nCONTACT_THANK_YOU_PAGE = '/thankyou'\nEMAIL = '<E... | python | edit | 1 | 0 | mit | 77b943b8bace86d82f76dfa159c5de48d9379dbb | svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app | svenv/blog/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys,os\nfrom copy import deepcopy\nfrom scrabble import make_board,top_moves,read_dictionary\n\ndef show_board(board,play=None):\n if not play:\n for row in board:\n print ''.join(row)\n else:\n b ... | python | edit | 4 | 4 | mit | 24fa27e05e0ed58e955ed6365de101b2e9653a7b | perimosocordiae/wwf,perimosocordiae/wwf | cli.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\n\nfrom rest_framework import serializers\n\nfrom login.models import UserProfile\nfrom discussion.serializers import UserShortSerializer, UserProfileShortSerializer\nfrom news_event.models import... | python | edit | 6 | 0 | bsd-3-clause | ca6508bf6e8a1fd2032baaacb81e9131c088c6f8 | BuildmLearn/University-Campus-Portal-UCP,BuildmLearn/University-Campus-Portal-UCP,BuildmLearn/University-Campus-Portal-UCP | UCP/news_event/serializers.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom time import time\n\n\nclass Client:\n def __init__(self, host, requests, do_requests_counter):\n self.host = host\n self.requests = requests\n self.counter = do_requests_counter\n\n\nclass Reque... | python | edit | 4 | 3 | mit | 42f67bdbf94a1a186518788f9685786b5c767eec | BakeCode/performance-testing,BakeCode/performance-testing | performance/web.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyserializable import serialize, deserialize, autoserialized\nfrom pyserializable.util import repr_func\n\n\n@autoserialized\nclass Color:\n serial_format = 'r=uint:8, g=uint:8, b=uint:8, a=uint:8'\n serial_attr_converters = {'r'... | python | edit | 1 | 0 | mit | 180062c4d1159185ab113e98f41bb219d52086e8 | numberoverzero/origami | test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\nfrom ppp_datamodel.communication import Request\nfrom ppp_datamodel import Triple, Resource, Missing\nfrom ppp_libmodule.tests import PPPTestCase\n\nfrom ppp_spell_checker import app\n\nclass RequestHandlerTes... | python | edit | 6 | 1 | mit | 4672e447617e754d6b4d229ce775fbf9ee0b35aa | ProjetPP/PPP-Spell-Checker,ProjetPP/PPP-Spell-Checker | tests/test_requesthandler.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom factory import enums\nfrom collections import namedtuple\nimport gc\n\n\n# Factoryboy uses \"__\" and Salesforce uses \"__\". Luckily Factoryboy makes\n# theirs easy to override!\nenums.SPLITTER = \"____\"\n\n\n# More flexible than F... | python | edit | 4 | 3 | bsd-3-clause | db537ab80444b9e4cc22f332577c2cba640fca0a | SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus | tasks/factory_utils.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport gzip\nimport bz2\nimport rarfile\nimport zipfile\nimport tarfile\n\nclass PackageHandler:\n def __init__(self, buffer):\n self.buffer = buffer\n\n def __iter__(self):\n for name in self.archive.namelist():\n ... | python | edit | 6 | 5 | mit | 890c0d919aba273489c27243c513c822399c5d35 | occrp/datasurvey | datasurvey/packages.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen\n\n\nclass RotorTestCase(unittest.TestCase):\n def test_rotor_encoding(self):\n rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')\n ... | python | edit | 5 | 1 | mit | 1bd540f43c25dec125085acee7bbe0904363c204 | ranisalt/enigma | test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\ndef handle_cd_command(arg):\n \"\"\"Handles a `cd` shell command by calling python's os.chdir.\"\"\"\n CD_CMD = 'cd'\n directory = ''\n error = False\n\n tokens = arg.split(CD_CMD + ' ')\n d... | python | edit | 1 | 4 | bsd-3-clause | 713b91c4d7dc3737223bc70aa329ec9de2c48fb8 | mdsrosa/mycli,mdsrosa/mycli | mycli/packages/special/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\nimport xml.etree.ElementTree as ET\nfrom indra.util import UnicodeXMLTreeBuilder as UTB\nfrom indra.util import unicode_strs\nfrom io ... | python | edit | 4 | 1 | bsd-2-clause | 75b1fdc9f290c85b4d469cdce5e5d1154aed4881 | pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,pvtodorov/indra,sorgerlab/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,bgyori/indra,johnbachman/belpy,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,johnbachman/indra | indra/tests/test_util.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager\nfrom datetime import datetime\nfrom flask.ext.moment import Moment\nfrom flask_debugtoolbar import DebugToolbarExtension\n\n\... | python | edit | 4 | 0 | mit | 68dee1cfef3a765a82fe7b51395219f8e1270a12 | pombredanne/reason,pombredanne/reason,pombredanne/reason | reason/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pychecker2.util import type_filter\n\nfrom compiler import ast\n\nclass File:\n def __init__(self, name):\n self.name = name\n self.parseTree = None\n self.scopes = {}\n self.root_scope = None\n se... | python | edit | 10 | 6 | bsd-3-clause | 2c5650ef41aaf8c116f3922be02e7c5e7a79524b | smspillaz/pychecker,smspillaz/pychecker,smspillaz/pychecker | pychecker/pychecker2/File.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom couchbase.tests.base import ApiImplementationMixin, SkipTest\ntry:\n import gevent\nexcept ImportError as e:\n raise SkipTest(e)\n\nfrom gcouchbase.bucket import Bucket, GView\nfrom couchbase.tests.importer import get_configured_... | python | edit | 2 | 1 | apache-2.0 | 94197717719b580aa9b8bf7a6cbe28f95000a2dc | couchbase/couchbase-python-client,couchbase/couchbase-python-client,mnunberg/couchbase-python-client,mnunberg/couchbase-python-client | gcouchbase/tests/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCustom administration panels for tracking models.\n\"\"\"\nfrom django.contrib import admin\nfrom calaccess_raw import models\nfrom .base import BaseAdmin\n\n\n@admin.register(models.R... | python | edit | 1 | 0 | mit | 53780b6d16d631a3c0e8859ff9771a1379de16f1 | california-civic-data-coalition/django-calaccess-raw-data | calaccess_raw/admin/tracking.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\n# Model Field Reference\n# https://docs.djangoproject.com/en/1.8/ref/models/fields/\n\n\nclass Tag(models.Model):\n name = models.CharField(\n max_length=31, unique=True)\n slug = models.SlugFi... | python | edit | 1 | 1 | bsd-2-clause | 7fc4e7382665cf9eac4d19efcf9641ad57271e87 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/models.py | rejected_duplicate | Near-duplicate of sample 13372 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport requests\n\nfrom flask import Blueprint\n\nfrom utils.decorators import validate, require\nfrom utils.validators import validate_url\n\nfrom .parser import Parser\n\nendpoint = Blueprint('analyse_url', __name__)\n\n\n@endp... | python | edit | 1 | 3 | apache-2.0 | a0c2e64c92d89276d73b5e4ca31e10a352ab37f1 | vtemian/kruncher | analyser/api.py | rejected_duplicate | Near-duplicate of sample 14130 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nlong_desc = '''\nThis package contains the feed Sphinx extension.\n\nIt creates an RSS feed of recently updated sphinx pages.\n'''\n\nrequires = ['Sphinx>=0.6', 'pyth... | python | edit | 1 | 0 | bsd-2-clause | a33df3c34cf69102831c8878b71266aaa41ac8fb | sphinx-contrib/spelling,sphinx-contrib/spelling | feed/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 IBM Corp.\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... | python | edit | 1 | 0 | apache-2.0 | 8d50846847852741410463d98de2c4f9e5fea844 | openstack/zaqar-ui,openstack/zaqar-ui,openstack/zaqar-ui,openstack/zaqar-ui | zaqar_ui/content/queues/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.contrib import admin\n\nfrom djurk.models import HIT\n\nclass HIT_Admin(admin.ModelAdmin):\n list_display = (\n 'creation_time',\n 'hit_id',\n 'hit_type_i... | python | edit | 1 | 0 | bsd-3-clause | 1d2a62b87b98513bd84a0ae1433781157cb45f70 | glenjarvis/djurk | admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom django.db import models\nfrom django.conf import settings\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.sites.models import Site\n\nfrom opps.core.models.date import Date\n\nfrom d... | python | edit | 1 | 2 | mit | 0019cfc3d6bc8b81520e09daa0b84662d76aff93 | jeanmask/opps,YACOWS/opps,jeanmask/opps,opps/opps,opps/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps | opps/core/models/publishable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport argparse\nimport json\nfrom urllib.request import urlopen\n\n\ndef get_data(domain):\n response = urlopen('http://{}/media/nflc-playlist-video.json'.format(domain)).read()\n return json.loads(response.... | python | edit | 1 | 5 | mit | 381bb4e11cf6951d819fa2cf298e2cc558464fc9 | Tenzer/plugin.video.nfl-teams | utils/nflc-get-categories.py | rejected_duplicate | Near-duplicate of sample 8917 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tiddlywebplugins.markdown import render\nfrom tiddlyweb.model.tiddler import Tiddler\n\n\nsample = \"\"\"# Hello\n \nThis is WikiLink\n\n* List\n* List\n\"\"\"\n\nsample_linked = \"\"\"\n\nThis is WikiLink and this is not: [NotLink]... | python | edit | 1 | 1 | bsd-2-clause | bcb4d14e7be413a08ca9c3f98656ff7b2bcb3d7d | tiddlyweb/tiddlywebplugins.markdown | test/test_wikilinks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pytest\n\nfrom appium import webdriver\n\n\n@pytest.fixture(scope='function')\ndef driver(request):\n return get_driver(request, default_capabilities())\n\n@pytest.fixture(scope='function')\ndef no_reset_driver(request)... | python | edit | 1 | 3 | mit | 053bfa79b54a95d405d6401c86dcce3c6065bf32 | getsentry/react-native-sentry,getsentry/react-native-sentry,getsentry/react-native-sentry,getsentry/react-native-sentry,getsentry/react-native-sentry,getsentry/react-native-sentry | appium/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nDefine the command bar\n'''\n# Import third party libs\nimport urwid\n\n\nclass CommandBar(object):\n '''\n The object to manage the command bar\n '''\n def __init__(self, opts):\n self.opts = opts\n self.tgt_... | python | edit | 1 | 1 | apache-2.0 | 8b8e206c21d08fee74fd43dc4b7e4d1d95a93060 | saltstack/salt-console | sconsole/cmdbar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n\ndef is_this_chef():\n from socket import gethostname\n return gethostname() == 'chef.compbio.ucsf.edu'\n\ndef require_chef():\n if not is_this_chef():\n raise SystemExit(\"This script must be run on... | python | edit | 2 | 3 | mit | f4170ec0cff71e8bcce834bbf8f4336410d45e76 | Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab | klab/cluster/__init__.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.