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\nimport os\n\nfrom celery.schedules import crontab\nfrom celery.task import periodic_task\nfrom django.conf import settings\n\nfrom django.db import connections\n\n\n@periodic_task(run_every=crontab(minute=0, hour=0, day_of_week=7))\ndef mov... | python | edit | 1 | 2 | bsd-3-clause | 7427ee344545356070db1300aae83272d5568e89 | dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | custom/icds_reports/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_script import Manager\nfrom flask_restful import Api\nfrom config import app\nfrom api import api\n\nmanager = Manager(app)\n\ndef setup_api(app):\n \"\"\"\n Config resources with flask app\n \"\"\"\n service = Api(ap... | python | edit | 1 | 1 | mit | dfe8f453bd28d290016d2d86c3b9502c988d1cdf | tforrest/soda-automation,tforrest/soda-automation | app/runserver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.sysconfig import get_config_var\nimport sys\nfor var in ('executable', 'exec_prefix', 'prefix'):\n print(var + ': ' + str(getattr(sys, var)))\nprint('multiarch: ' + str(getattr(sys, 'implementation', sys)._multiarch))\nfor v... | python | edit | 1 | 0 | mit | a146319132a21916747f98fa183fbe29139653ae | mrkn/pycall.rb,mrkn/pycall,mrkn/pycall.rb,mrkn/pycall,mrkn/pycall.rb,mrkn/pycall,mrkn/pycall,mrkn/pycall.rb | lib/pycall/python/investigator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyrebase\n\n\ndef store_url(is_yes, url, FB_API_KEY, FB_USER, FB_PASS):\n # do nothing if it's unnecessary\n if is_yes is False:\n return is_yes\n\n # connect to firebase\n config = {\n \"apiKey\": FB_API_KE... | python | edit | 1 | 2 | mit | 3229340a11a1fcfe9f11ad0c5b558469043deaf4 | iwi/linkatos,iwi/linkatos | linkatos/firebase.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\"\"\"Example of reversible reaction.\"\"\"\n\nimport os\n\nfrom chemkinlib.utils import Parser\nfrom chemkinlib.reactions import ReactionSystems\nfrom chemkinlib.config import DATA_DIRECTORY\n\n# USER INPUT: reaction (xml) file\nxml_file... | python | edit | 1 | 0 | mit | b4b87f00f170828accb1974d51fc446694d8334c | cs207-group11/cs207-FinalProject,hsim13372/cs207-FinalProject,krmotwani/cs207-FinalProject | examples/rev_rxns.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nfrom heartbeat import Challenge\n\nimport requests\n\nfrom .utils import urlify\nfrom .exc import DownstreamError\n\n\nclass DownstreamClient(object):\n def __init__(self, server... | python | edit | 3 | 3 | mit | bd0cf3920121ada2c35928130b910667ce16a85a | Storj/downstream-farmer | downstream-farmer/client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"usage: git-xblob add <path> [...]\"\"\"\n\nimport os\n\nfrom ..utils import git\n\n\ndef bail(code=1):\n print __doc__.strip()\n exit(code)\n\n\ndef run_add(paths):\n\n if not paths:\n bail()\n\n missing_any = False... | python | edit | 3 | 6 | bsd-3-clause | 3ba739dccb1753d15b7e1911d9da1ef021ee1fb4 | mikeboers/git-xblob | gitxblob/commands/add.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfullversion = sys.argv[1]\npath = f\"btsoot_{fullversion}/DEBIAN/control\"\nversion = fullversion[1:]\ncontrol_content = f\"\"\"Package: btsoot\nVersion: {version}\nSection: base\nPriority: optional\nArchitecture: i386\nDepend... | python | edit | 1 | 0 | bsd-3-clause | 34504f0600dd8f3d7cb2594d51db9fa07e2e139a | paulkramme/btsoot | package_deb_replace_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom app import db\nfrom app.dao.decorators import transactional\n\n\n@transactional\ndef dao_create_record(record):\n db.session.add(record)\n\n\n@transactional\ndef dao_update_record(data_type, id, **kwargs):\n return data_type.quer... | python | edit | 1 | 1 | mit | 8eea97c45c3e40299db251867eb01a862ca1fdbc | NewAcropolis/api,NewAcropolis/api,NewAcropolis/api | app/dao/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabfile.config import *\n\n@task\n@roles('all')\ndef get_all_time():\n date = run(\"DATE=$( sudo date ); DATEMILLISEC=$( sudo date +%s ); echo $DATE; echo $DATEMILLISEC\")\n return tuple(date.split('\\r\\n'))\n\n@task\n@roles('bu... | python | edit | 3 | 4 | apache-2.0 | bd761accdc38b4ed71f94048c3d9ceae05859925 | Juniper/contrail-fabric-utils,Juniper/contrail-fabric-utils | fabfile/tasks/ntp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 The Swarming Authors. All rights reserved.\n# Use of this source code is governed by the Apache v2.0 license that can be\n# found in the LICENSE file.\n\n\"\"\"This modules is imported by AppEngine and defines the 'app' obj... | python | edit | 3 | 1 | apache-2.0 | 4b061a25b579c5463b963bcba580284c8dc64903 | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | appengine/isolate/main_frontend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport RMF\nimport cPickle\n\nb = RMF.BufferHandle()\nf = RMF.create_rmf_buffer(b)\n\nf.get_root_node().add_child(\"hi\", RMF.ORGANIZATIONAL)\n\ndel f\n\npicklestring = cPickle.dumps(b)\nbb = cPickle.loads(picklestring)\n\nf = RMF.open_rmf_... | python | edit | 2 | 0 | apache-2.0 | c72decbfaddc6fe697c8afa5330a40afded6ef6f | salilab/rmf,salilab/rmf,salilab/rmf,salilab/rmf | test/test_pickle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom http import HttpJSONResponse\nfrom serializers import Serializer as GeoJSONSerializer\nfrom django.views.generic import ListView\n\n\nclass GeoJSONResponseMixin(object):\n \"\"\"\n A mixin that can be used to render a GeoJSON res... | python | edit | 1 | 1 | bsd-2-clause | c89ce9429a85aaf0546c278c2de6fe5061e350e6 | johan--/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,camillemonchicourt/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,camillemonchicourt... | django-geojson/djgeojson/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom todoman.model import Database\n\n\ndef test_querying(create, tmpdir):\n for list in 'abc':\n for i, location in enumerate('abc'):\n create(\n 'test{}.ics'.format(i),\n ('SUMMARY:test_q... | python | edit | 1 | 4 | isc | 7f4d6c9b1ba69cdb0af8774edb0eeb415aa25d8f | rimshaakhan/todoman,hobarrera/todoman,Sakshisaraswat/todoman,AnubhaAgrawal/todoman,pimutils/todoman,asalminen/todoman | tests/test_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import NamedTuple, Callable, List, Dict, Sequence\nimport pulp\nfrom .resources import ScheduledItem\n\n\ndef variables(events: Sequence, rooms: Sequence, slots: Sequence):\n \"\"\"Defines the required instances of pulp.LpVar... | python | edit | 1 | 4 | mit | 5764b582fde86570fe15c71509c9b7d718d7303a | PyconUK/ConferenceScheduler | conference_scheduler/parameters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom pywidl.pywidl import App\n\nimport unittest\n\nfrom difflib import context_diff\nimport os.path\nimport sys\n\n\n\nclass TestPyWIdl(unittest.TestCase):\n def _match(self, fromfile, tofile):\n diff = context_dif... | python | edit | 1 | 4 | mit | a01981b818ca97f57da5a75c3342178639c08e3c | VasilyStepanov/pywidl | tests/test_suite.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport rumps\n\nwindow = rumps.Window('Nothing...', 'ALERTZ')\nwindow.title = 'WINDOWS jk'\nwindow.message = 'Something.'\nwindow.default_text = 'eh'\n\nresponse = window.run()\nprint response\n\nwindow.add_buttons('One', 'Two', 'Three')\n\... | python | edit | 1 | 0 | bsd-3-clause | 1a18bfed90f6423a0c52b3f3fe523b4ed77188af | jaredks/rumps,cbenhagen/rumps | examples/example_windows.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility method for converting all elements in list to string."
},
{
"role": "assistant",
"content": "def without_spaces(the_str):\r\n return \"\".join(the_str.split())\r\n\r\ndef listwise_to_str(the_list):\r\n return li... | python | new_file | 1 | 1 | mit | d209020be5369345e04ba5d5cdd30cd8538409a1 | welchbj/tt,welchbj/tt,welchbj/tt | tt/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport site\nimport sys\n\napproot = os.path.dirname(__file__)\nsys.path.append(os.path.join(approot, 'lib'))\nsite.addsitedir(os.path.join(approot, 'site-packages'))\n\n```\n\nApply this change: Add the appstats recording middle... | python | edit | 1 | 1 | mit | 85cf0af73ddfdce0281a112e4e86d1104e0222e1 | xchewtoyx/pulldb | appengine_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This file is part of h5py, a Python interface to the HDF5 library.\n#\n# http://www.h5py.org\n#\n# Copyright 2008-2018 Andrew Collette and contributors\n#\n# License: Standard 3-clause BSD; see \"license.txt\" for full license terms\n# ... | python | edit | 5 | 1 | bsd-3-clause | a67b2c7280ab7e5ae831d372b1fc81f0a2f1f2ce | h5py/h5py,h5py/h5py,h5py/h5py | h5py/tests/hl/test_deprecation.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Callable, Iterable\nfrom plenum.server.quorums import Quorums\n\n\nclass NetworkI3PCWatcher:\n def __init__(self, cb: Callable):\n self.nodes = set()\n self.connected = set()\n self.callback = cb\n... | python | edit | 1 | 3 | apache-2.0 | 2d379a3bd04d2b687c719cb9ccca5f289b434d00 | evernym/plenum,evernym/zeno | plenum/server/i3pc_watchers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom pprint import pformat\n\nfrom rest_framework import serializers\n\nlog = logging.getLogger(__name__)\n\n\nclass PageSearchSerializer(serializers.Serializer):\n project = serializers.CharField()\n version = seriali... | python | edit | 1 | 4 | mit | e909759730be51a16fb7656de6a9844fdbf8fb2e | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/search/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom settings import *\nimport settings\n\nTEMPLATE_DIRS_BASE = TEMPLATE_DIRS\n\nTEMPLATE_DIRS = (\n '%s/library/templates/mobile/auth' % ROOT_PATH, \n '%s/library/templates/mobile' % ROOT_PATH, \n)\n\n\nTEMPLATE_DIRS += TEMPLAT... | python | edit | 7 | 0 | bsd-3-clause | 7b758788bdf8ca52d6b75892d8ee97484188d699 | srilatha44/threepress,srilatha44/threepress,srilatha44/threepress,srilatha44/threepress | bookworm/settings_mobile.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Wrapper to run make and preprocess any paths in the output from MSYS Unix-style paths\n# to Windows paths, for Eclipse\nfrom __future__ import print_function, division\nimport sys\nimport subprocess\nimport os.pa... | python | edit | 1 | 4 | apache-2.0 | 3c7954ea497649a4cd6520842151deb632bc4723 | espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf | tools/windows/eclipse_make.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import INETOID, CIDROID, MACADDROID\nfrom . import lib\ntry:\n\timport ipaddress\nexcept ImportError:\n\timport ipaddr as ipaddress\n\noid_to_type = {\n\tMACADDROID : str,\n\tINETOID: ipaddress._IPAddressBase,\n\tCIDROID: ipaddress.... | python | edit | 1 | 1 | bsd-3-clause | 52679561fce3d03c0c2838c209067b070d664e94 | python-postgres/fe,python-postgres/fe | postgresql/types/io/pg_network.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nfrom jinja2 import Template\n\nclusters = ['1-12', '2-0', '2-1', '2-2', 'multi-az']\ntiles = [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]\n\nwith open('pipeline.... | python | edit | 2 | 0 | apache-2.0 | d3904489f03aaba94354be548589564d2104082d | cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator | ci/generate_pipeline_yml.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\n\nfrom infosystem.common.subsystem.controller import *\nfrom infosystem.common.subsystem.driver import *\nfrom infosystem.common.subsystem.manager import *\nfrom infosystem.common.subsystem.router import *\n\n\nclass Subsystem... | python | edit | 9 | 8 | apache-2.0 | 38006f3b68edcdd7707d2b9056fa6564126747d0 | samueldmq/infosystem | infosystem/common/subsystem/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndjango = __import__(\"django.conf.urls.defaults\", {})\n\nfrom zuice import Injector\n\ndef _view_builder(bindings):\n def view(request, view_class, **kwargs):\n view_injector = Injector(bindings)\n view = view_injector.get... | python | edit | 1 | 2 | bsd-2-clause | f367d3122084c85e11efeb20d560a856e9f24d0e | mwilliamson/zuice | zuice/django.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport numpy as np\n\nfrom fastats.core.decorator import fs\n\n\ndef value(x): # pragma: no cover\n return x\n\n\n@fs\ndef single_pass(x):\n \"\"\"\n Performs a single iteration over the first\n dimension of `x`.\n\n Tests... | python | edit | 1 | 2 | mit | eac05dfe5c4190cc10b00d18aa9f03344eb3a6ea | dwillmer/fastats,fastats/fastats | fastats/core/single_pass.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# ############# version ##################\nfrom pkg_resources import get_distribution, DistributionNotFound\nimport os.path\nimport subprocess\ntry:\n _dist = get_distribution('pyethapp')\n # Normalize case f... | python | edit | 2 | 0 | mit | 0668192acf349e02694daf6480e7858f67dfeba0 | ethereum/pyethapp,RomanZacharia/pyethapp,gsalgado/pyethapp,ethereum/pyethapp,gsalgado/pyethapp,changwu-tw/pyethapp,d-das/pyethapp,RomanZacharia/pyethapp,changwu-tw/pyethapp,vaporry/pyethapp | pyethapp/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix the callable check to not emit exception when method not found"
},
{
"role": "assistant",
"content": "import json\n\nVERSION=\"0.1\"\n\nclass Handler:\n def __init__(self):\n self.log = []\n self.result = Fal... | python | new_file | 1 | 6 | mit | 6bd6be4219f5fbf6c1d045aff1d0ef09b912fe8c | cmouse/pdns-remotebackend-python | src/pdns/remotebackend/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import DetailView\n\nfrom .models import Page\n\n\nclass PageView(DetailView):\n\n model = Page\n\n def get_object(self, queryset=None):\n\n slug = self.kwargs.get('slug')\n if not slug:\n ... | python | edit | 1 | 2 | mit | 1361b5ebb4afd0c3c80df5bf936f3817427cd917 | MeirKriheli/debian.org.il,MeirKriheli/debian.org.il | apps/pages/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom fabric.api import env, run\n\ndef _get_base_folder(host):\n return '/var/www/sites/{}'.format(host)\n\ndef _get_manage_py(host):\n command = 'export $(cat /etc/www/gunicorn-{host}|xargs) && \\\n ... | python | edit | 2 | 1 | mit | 58de0a968b4cee5a670ce8e98b494d7a839b0992 | XeryusTC/projman,XeryusTC/projman,XeryusTC/projman | functional_tests/fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Aparajita Fishman\n# Copyright (c) 2013 Aparajita Fishman\n#\n# License: MIT\n#\n\n\"\"\"This module exports the Rubocop plugin class... | python | edit | 1 | 0 | mit | 8f0f1331fc554c2a15722543017da3ce3a3f894b | SublimeLinter/SublimeLinter-rubocop | linter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2015 University of Chicago\n# Available under Apache 2.0 License\n# setup for fsurfer-libs\nfrom distutils.core import setup\n\nsetup(name='fsurfer-libs',\n version='PKG_VERSION',\n description... | python | edit | 1 | 0 | apache-2.0 | 8ef9618850794dd499617bb28b5044336f155568 | OSGConnect/freesurfer_workflow,OSGConnect/freesurfer_workflow | python/setup_fsurfer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom utils import module_exists\n\nfrom gevent import monkey\n\n\ndef make_django_green():\n monkey.patch_all()\n\n if module_exists('psycogreen'):\n from psycogreen.gevent.psyco_gevent import make_psycopg_green\n... | python | edit | 1 | 4 | mit | e94503e25bff0ba986c28ce3f16636b3bb9f2c3d | philipn/green-monkey | green_django/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom app import db\n\nlogger = logging.getLogger(__name__)\n\n\ndef save_data(data):\n try:\n db.session.add(data)\n db.session.commit()\n except Exception as err:\n logger.error(err)\n\n```\n\nApp... | python | edit | 1 | 2 | mit | d95d4da272915ad6a581260679df756bf24a6f4c | brayoh/bucket-list-api | app/utils/db/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! -*- coding:utf-8 -*-\n\nimport time\nimport threading\n\n\nclass Heart(threading.Thread):\n \"\"\"Implementation of an heart beating routine\n\n To be used by actors to send swf heartbeats notifications\n once in a while.\n\n ... | python | edit | 1 | 2 | mit | e2735cba808ac4eb33e555fbb3d5d5f774ace032 | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | swf/actors/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# flake8: noqa\nimport pytest\nannfab._annfab = pytest.importorskip(\"annfab._annfab\")\n\n\ndef test_import():\n assert True\n\n```\n\nApply this change: Use _annfab instead of annfab._annfab in an import test."
},
{
"role": "as... | python | edit | 1 | 1 | mit | cd996816a49642c766ffd4390a7d1586c4b6765f | elezar/ann-fab,elezar/ann-fab,elezar/ann-fab | annfab/tests/test_lib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nfrom ooni.utils import pushFilenameStack\nclass TestUtils(unittest.TestCase):\n def test_pushFilenameStack(self):\n basefilename = os.path.join(os.getcwd(), 'dummyfile')\n f = open(basefilename, ... | python | edit | 3 | 3 | bsd-2-clause | 331b3987ba09db5d8f774509bedd30c3c6522795 | juga0/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,kd... | ooni/tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"This module contains functions that mutate or make transformations on a network.\"\"\"\n\nfrom . import deletion, expansion, induction, inference, metadata, transfer\nfrom .deletion import *\nfrom .expansion... | python | edit | 8 | 0 | mit | d741b41e814930130a30e99b0fece893786f7190 | pybel/pybel,pybel/pybel,pybel/pybel | src/pybel/struct/mutation/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\ndef add_all(nums):\n\treturn sum(nums)\n\ndef multiply_all(nums):\n\treturn reduce(lambda a, b: a * b, nums)\n\nif __name__== '__main__':\n\tcommand = sys.argv[1]\n\tnums = map(float, sys.argv[2:])\n\tif command == 'add':\n\t\... | python | edit | 2 | 1 | bsd-3-clause | 08dede97d1ad9694df18a8262e777769e88f9578 | tanecious/calc | calc.py | rejected_duplicate | Near-duplicate of sample 20803 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render_to_response\nfrom categories.models import Category\n\ndef index(request):\n category_list = Category.tree.all()\n return render_to_response(\"home.html\",\n {'nodes': category_list})\n\n```\... | python | edit | 1 | 1 | isc | 5baa4fb91d9b6a80d748b47192b91e2a68b567d0 | westphahl/verleihsystem,westphahl/verleihsystem,westphahl/verleihsystem | verleihsystem/categories/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add version information and header"
},
{
"role": "assistant",
"content": "# -*- coding:utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) Spyder Project Developers\n#\n# Li... | python | new_file | 3 | 0 | mit | fe50ea0dd1ceb51fdff455484cb5d2d32c94b076 | jitseniesen/spyder-unittest | spyder_unittest/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom tinymce import models as tinymce_models\n\nphotos_path = \"/simple-faq/\"\n\n\nclass Topic(models.Model):\n text = models.CharField(max_length=200)\n number = models.IntegerField()\n\n class Meta:... | python | edit | 1 | 1 | mit | 50cf6e64955d1e82ba702b8817b830c23534da11 | devartis/django-simple-faq,devartis/django-simple-faq | simple_faq/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mbuild as mb\nimport parmed as pmd\nimport pytest\n\nfrom foyer import Forcefield\nfrom foyer.tests.utils import get_fn\n\n\n@pytest.mark.timeout(1)\ndef test_fullerene():\n fullerene = pmd.load_file(get_fn('fullerene.pdb'), struc... | python | edit | 1 | 1 | mit | 6856c469da365c7463017e4c064e1ed25c12dfdc | mosdef-hub/foyer,mosdef-hub/foyer,iModels/foyer,iModels/foyer | foyer/tests/test_performance.py | rejected_duplicate | Near-duplicate of sample 914 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Contains a Directory class to represent real directories\"\"\"\n\nfrom ..base import _BaseFileAndDirectoryInterface\n\n\nclass Directory(_BaseFileAndDirectoryInterface):\n \"\"\"A class that groups together the (meta)data and behav... | python | edit | 1 | 2 | mit | 52f510b64e4ded6e159119b2fa544de577b7d949 | SizzlingVortex/classyfd | classyfd/directory/directory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nimport xml.etree.ElementTree as ET\nfrom os import path\n\nfrom tmc.exercise_tests.basetest import BaseTest, TestResult\n\n\nclass CheckTest(BaseTest):\n\n def __init__(self):\n super().__init__(\"Check\")\n\n def ... | python | edit | null | null | mit | 29178a5a1e258e0f7c7392233858f36bf67241d0 | JuhaniImberg/tmc.py,JuhaniImberg/tmc.py | tmc/exercise_tests/check.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: set fileencoding=utf-8 :\n# Andre Anjos <<EMAIL>>\n# Fri 20 Sep 14:45:01 2013\n\n\"\"\"Blitz++ Array bindings for Python\"\"\"\n\nfrom ._library import array, as_blitz, __version__, __api_version__\n\ndef get_i... | python | edit | 4 | 1 | bsd-3-clause | e1b177d58be0c41c6e1fa7abf8cef0cb06b272d0 | tiagofrepereira2012/bob.blitz,tiagofrepereira2012/bob.blitz,tiagofrepereira2012/bob.blitz | blitz/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .configuration import Configuration\nfrom girder.utility import setting_utilities\nfrom .constants import Features\n\nfrom girder.plugin import GirderPlugin\n\n@setting_utilities.validator({\n Features.NOTEBOOKS\n})\n\nclass AppPlug... | python | edit | 1 | 1 | bsd-3-clause | 4f72617702881bde979648a8ddf240b0d721cf4e | OpenChemistry/mongochemserver | girder/app/app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys, signal\nimport pygame\n\ndef fixup_sigterm_behaviour():\n '''\n SDL registers its own signal handler for SIGTERM, which pushes a SDL_QUIT event to the event\n loop, instead of killing the process right away. This is a p... | python | edit | 1 | 1 | bsd-2-clause | 85dedf4c02d28f9a4928d46757cbaa1baf8994ed | furbrain/tingbot-python | tingbot/quit.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest, urllib\nfrom rest_framework.compat import BytesIO\n\n\nclass TestParser(unittest.TestCase):\n\n def setUp(self):\n from drf_to_s3.parsers import NestedFormParser\n self.parser = NestedFormParser()\n\n de... | python | edit | 1 | 1 | mit | 1cc10287a7a9666d7478adc1271250ba49663e24 | pombredanne/drf-to-s3,pombredanne/drf-to-s3,bodylabs/drf-to-s3,pombredanne/drf-to-s3,bodylabs/drf-to-s3,bodylabs/drf-to-s3,bodylabs/drf-to-s3,pombredanne/drf-to-s3,bodylabs/drf-to-s3,pombredanne/drf-to-s3 | drf_to_s3/tests/test_parsers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport plugin\nimport re\nimport urllib2\nfrom utils import url_parser\n\nfrom twisted.python import log\n\ntitle_re = re.compile(r'<title>(.*?)</title>', re.IGNORECASE)\n\nclass Titlegiver(plugin.Plugin):\n\n def __init__(se... | python | edit | 1 | 3 | mit | aec62c210bc1746c6fefa12030ada548730faf62 | Tigge/platinumshrimp | plugins/titlegiver/titlegiver.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom django.conf import settings\n\nfrom django.contrib.auth.models import Group\nfrom django.contrib.auth.admin import GroupAdmin\nfrom django.contrib.auth.forms import UserChangeForm\n\ntry:\n User = s... | python | edit | 1 | 0 | bsd-3-clause | 04a3f7e0e079f0db23f723c7a08e32841fc7a9fd | digitalemagine/django-hierarchical-auth,zhangguiyu/django-hierarchical-auth | hierarchical_auth/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom piper.cli import cmd_piperd\nfrom piper.api import api\n\nimport mock\n\n\nclass TestEntry(object):\n @mock.patch('piper.cli.cmd_piperd.CLIBase')\n def test_calls(self, clibase):\n self.mock = mock.Mock()\n cmd_pipe... | python | edit | 1 | 1 | mit | 2cd897195c545d36dbde962588e31505bb2bc556 | thiderman/piper | test/cli/test_cmd_piperd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright 2015 University of Chicago\n# Available under Apache 2.0 License\n# setup for fsurf on OSG Connect login\nfrom distutils.core import setup\nimport fsurfer\n\nsetup(name='fsurfer-backend',\n version=... | python | edit | 1 | 0 | apache-2.0 | 70a2196d7748a9b01a0c23e2b2bda6a074ae4c8a | OSGConnect/freesurfer_workflow,OSGConnect/freesurfer_workflow | python/setup_fsurfer_backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"module concerns itself with tasks involving branch deployments of projects.\"\"\"\n\nfrom fabric.api import task\nfrom decorators import requires_aws_stack, debugtask\nfrom buildercore import bootstrap, cloudformation\nfrom buildercor... | python | edit | 1 | 1 | mit | 67149700771c05e735703ed9a12ac2d16e10e886 | elifesciences/builder,elifesciences/builder | src/deploy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nmajor = 0\nminor=0\npatch=11\nbranch=\"master\"\ntimestamp=1376505745.87\n```\n\nApply this change: Tag commit for v0.0.12-master generated by gitmake.py"
},
{
"role": "assistant",
"content": "major = 0\nminor=0\npatch=12\nbranc... | python | edit | 1 | 0 | mit | 16a67da087349e5f661030702c488bd644dac3a8 | ryansturmer/gitmake | version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as f:\n readme = f.read()\n\nsetup(\n name = \"django-disposable-email-checker\",\n version = \"0.1.1\",\n packages = find_packages(),\n package_data = {\... | python | edit | 1 | 0 | bsd-3-clause | 9c5eb9aa4d8de3d3060c7c6551b1e726d7577f57 | aaronbassett/DisposableEmailChecker | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nclass Schema(dict):\n \"\"\"\n Lightweight encapsulation of a JSON Schema.\n \"\"\"\n\n @classmethod\n def from_file(cls, path_or_stream):\n \"\"\"\n Create a schema from a file name or stream.\n ... | python | edit | 1 | 2 | bsd-3-clause | 339f5c6d7cc5b3a70fa71fd423c0a4226acc77e7 | jacobian/valor | valor/schema.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom celery.schedules import crontab\nfrom celery.task.base import periodic_task\n\nfrom corehq.preindex.accessors import index_design_doc, get_preindex_designs\nfrom corehq.util.decorators import serial_task\nfrom django.conf import settin... | python | edit | 1 | 2 | bsd-3-clause | bf6ab9532db2e2bc67cb72415674a0fdefe3bc46 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/preindex/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\nimport django\nfrom django.test import TestCase\nfrom django.core.management import call_command\n\nif django.VERSION >= (1, 7):\n from django.test import override_settings\n from django.apps import apps\n... | python | edit | 1 | 1 | apache-2.0 | 12cc6a6bf3e0d6c55a1f2780b76aecd615dfa47a | pivotal-energy-solutions/django-datatable-view,pivotal-energy-solutions/django-datatable-view,pivotal-energy-solutions/django-datatable-view,doganmeh/django-datatable-view,jangeador/django-datatable-view,doganmeh/django-datatable-view,doganmeh/django-datatable-view,jangeador/django-datatable-view,jangeador/django-datat... | datatableview/tests/testcase.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom simple_es.identifier.identifies import Identifies\n\n\nclass DomainEvent():\n \"\"\"\n Base class for all domain driven events\n\n TODO: Split logic around saving to a data store into a separate class\n TODO: Restrict the a... | python | edit | 1 | 3 | apache-2.0 | 88e8968502003f8e08c0f1d4e8bb5a575f5297b4 | OnShift/simple-es | simple_es/event/domain_event.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nCTCP_DELIMITER = chr(1)\nMAX_MESSAGE_LENGTH = 450 #Officially 512 including the newline characters, but let's be on the safe side\nCHANNEL_PREFIXES = \"#&!+.~\" #All the characters that could possibly indicate something is a channel name ... | python | edit | 1 | 0 | mit | e3d3c17988fee0a9f616cf4c0f0dc67a5a60fb34 | Didero/DideRobot | Constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport statsd as _statsd\n\n\n__all__ = ['statsd']\n\n\nclass StatsClient(object):\n \"\"\"Wrap statsd.StatsClient to allow data_set to be added to stat\"\"\"\n def __init__(self, statsd):\n self._statsd = statsd\n\n... | python | edit | 1 | 2 | mit | e679b7d45cd4fd552b1fe54b61b914f23aca2c94 | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | backdrop/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom django.shortcuts import get_object_or_404\nfrom django.http import HttpResponse, Http404\n\nfrom cyder.base.utils import make_megafilter\nfrom cyder.base.views import cy_detail\nfrom cyder.cydhcp.workgroup.models import ... | python | edit | 1 | 3 | bsd-3-clause | d756406ac78830a2f54308814979e497d43f5ec7 | OSU-Net/cyder,akeym/cyder,akeym/cyder,drkitty/cyder,akeym/cyder,OSU-Net/cyder,drkitty/cyder,drkitty/cyder,murrown/cyder,drkitty/cyder,OSU-Net/cyder,murrown/cyder,murrown/cyder,OSU-Net/cyder,murrown/cyder,akeym/cyder | cyder/cydhcp/workgroup/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add __all__ to rank filter package"
},
{
"role": "assistant",
"content": "from .rank import (autolevel, bottomhat, equalize, gradient, maximum, mean,\n meansubstraction, median, minimum, modal, morph_contr_enh,\... | python | new_file | 1 | 0 | bsd-3-clause | 927d91239e9e374b36fead2f5c2e76b95f27b069 | rjeli/scikit-image,chriscrosscutler/scikit-image,Hiyorimi/scikit-image,emon10005/scikit-image,GaZ3ll3/scikit-image,ClinicalGraphics/scikit-image,Britefury/scikit-image,chriscrosscutler/scikit-image,juliusbierk/scikit-image,Midafi/scikit-image,dpshelio/scikit-image,ofgulban/scikit-image,GaZ3ll3/scikit-image,SamHames/sci... | skimage/filter/rank/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport spytify\n\nfrom mopidy import settings\nfrom mopidy.backends.base import BaseBackend\n\nclass SpotifyBackend(BaseBackend):\n def __init__(self, *args, **kwargs):\n super(SpotifyBackend, self).__init__(*args, **kwargs)\n ... | python | edit | 1 | 5 | apache-2.0 | 671ccd8e82e0c106b0ccd9cb61b674f342319725 | hkariti/mopidy,ali/mopidy,jcass77/mopidy,priestd09/mopidy,jmarsik/mopidy,pacificIT/mopidy,mopidy/mopidy,priestd09/mopidy,kingosticks/mopidy,vrs01/mopidy,jcass77/mopidy,bacontext/mopidy,bacontext/mopidy,woutervanwijk/mopidy,tkem/mopidy,mokieyue/mopidy,ZenithDK/mopidy,mopidy/mopidy,jodal/mopidy,swak/mopidy,bencevans/mopi... | mopidy/backends/spotify.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Mock module for Sphinx autodoc.\"\"\"\n\n\nclass ffi(object):\n\n NULL = NotImplemented\n I_AM_FAKE = True # This is used for the documentation of \"default\"\n\n def dlopen(self, _):\n return FakeLibrary()\n\n\nffi =... | python | edit | 1 | 1 | mit | a95f4ea250f4bf85b510791f6eb287e7f01a431f | tgarc/python-sounddevice,spatialaudio/python-sounddevice,spatialaudio/python-sounddevice,tgarc/python-sounddevice | doc/fake__sounddevice.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Mainak Jas <<EMAIL>>\n#\n# License: BSD (3-clause)\n\nfrom sklearn.base import TransformerMixin\nfrom mne.fiff import pick_types\n\n\nclass RtClassifier:\n\n \"\"\"\n TODO: complete docstring ...\n\n Parameters\n -----... | python | edit | 1 | 2 | bsd-3-clause | 9b8a39f58b32135e4fecb6ce925c239d198aa2e1 | kingjr/mne-python,bloyl/mne-python,rkmaddox/mne-python,kambysese/mne-python,agramfort/mne-python,alexandrebarachant/mne-python,Teekuningas/mne-python,Teekuningas/mne-python,cmoutard/mne-python,dgwakeman/mne-python,andyh616/mne-python,wronk/mne-python,jniediek/mne-python,dgwakeman/mne-python,aestrivex/mne-python,kambyse... | mne/realtime/classifier.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add vowels and consonants constants"
},
{
"role": "assistant",
"content": "class Pattern(object):\n\n def __init__(self):\n self.consonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x',... | python | new_file | 1 | 1 | mit | 6cf147986317ed5c7d7fe4fa9785f2d88f7d7e8a | achyutreddy24/WordGen | Class_Pattern.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport django.test\nfrom django.core.exceptions import ValidationError\n\nfrom core.tests.setups import RobrechtSocialUserFactory\nfrom ..validators import RepoExistanceValidator\n\n\n#######################################... | python | edit | 1 | 1 | mit | bac9b62c40d0c69dcb346adfe82309e10a480276 | robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth | inonemonth/challenges/tests/test_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport requests\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass APIError(Exception):\n pass\n\n\nclass BaseService(object):\n\n def __init__(self, api, **config):\n self.api = api\n self.requester = ... | python | edit | 1 | 3 | mit | 7ca0291b5ef0c9505d36abdc15fa9622aa433788 | rkhleics/police-api-client-python | police_api/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport os\nimport numpy as np\n\nfrom ....tests.helper import pytest\nfrom .. import read\n\nROOT = os.path.abspath(os.path.dirname(__file__))\n\n\n@pytest.mark.parametrize('f... | python | edit | 1 | 1 | bsd-3-clause | 34ba8742d576414a65a4f19b8bdc89e5e3c759b3 | dhomeier/astropy,StuartLittlefair/astropy,mhvk/astropy,saimn/astropy,saimn/astropy,astropy/astropy,aleksandr-bakanov/astropy,joergdietrich/astropy,DougBurke/astropy,dhomeier/astropy,stargaser/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,joergdietrich/astropy,MSeifert04/astropy,astropy/astropy,lpsinger/astropy... | astropy/io/ascii/tests/test_compressed.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management import BaseCommand, CommandError\n\nfrom channels import DEFAULT_CHANNEL_LAYER\nfrom channels.layers import get_channel_layer\nfrom channels.log import setup_logger\nfrom channels.routing import get_default_appli... | python | edit | 1 | 3 | bsd-3-clause | afcb007c7c8b68bc4cace5ff6d634330f70603ec | django/channels,andrewgodwin/django-channels,andrewgodwin/channels | channels/management/commands/runworker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom providers.popularity.provider import PopularityProvider\nfrom utils.torrent_util import torrent_to_search_string, remove_bad_torrent_matches\n\nIDENTIFIER = \"Torrentz\"\n\nclass Provider(PopularityProvider):\n PAGES_TO_FETCH = 1\n\... | python | edit | 1 | 3 | mit | 8033ce16b11ff7317ecc3c9ef7db448c44b72b1b | EmilStenstrom/nephele | providers/popularity/torrentz.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/env python\n# \n# Copyright 2010 bit.ly\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 | null | null | apache-2.0 | a662475e148b8ccd3186303cebdc0615ae2dab1b | RealGeeks/asyncmongo | asyncmongo/__init__.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# test.py\r\ndef application(env, start_response):\r\n start_response('200 OK', [('Content-Type', 'text/html')])\r\n #return [b\"Hello World\"] # python3\r\n return [\"Hello World from uwsgi-nginx:base\"] # python2\r\n\n```\n\nAppl... | python | edit | 1 | 1 | apache-2.0 | bd2c459b14103786f25aacf1daf3a7f23638df00 | tiangolo/uwsgi-nginx-docker,tiangolo/uwsgi-nginx-docker | base/app/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Iterable, Tuple\n\n\ndef gallery(samples: Iterable[Tuple[str, str]], *, refresh: bool = False) -> str:\n lines = []\n\n for url, template in samples:\n if refresh:\n url += \"?time=0\"\n lin... | python | edit | 1 | 4 | mit | d220f56a72a6481b33e7c75acf2f92bb89c17561 | jacebrowning/memegen,jacebrowning/memegen | app/utils/html.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test runner that will execute all the tests in /tests/"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"Gathers all tests in the /tests/ subdirectory and runs them.\"\"\"\nimport os\nimport unittest\n\n... | python | new_file | 1 | 1 | mit | 2e730cee505f70f0d0dad5deea417a8b9ed892d9 | mrhappyasthma/HappyDebugging,mrhappyasthma/happydebugging | run_all_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\r\nMain runner entry point for Gooey.\r\n'''\r\n\r\nimport wx\r\n# wx.html and wx.xml imports required here to make packaging with\r\n# pyinstaller on OSX possible without manually specifying `hidden_imports`\r\n# in the build.spec\r\ni... | python | edit | 1 | 1 | mit | 06ae3ea593d4af5379307c2383e113000883db45 | chriskiehl/Gooey | gooey/gui/application.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport threading\nimport tornado.httpserver\nimport tornado.ioloop\nimport tornado.web\n\nfrom astral.conf import settings\nfrom urls import url_patterns\n\nclass NodeWebAPI(tornado.web.Application):\n def __init... | python | edit | 1 | 1 | mit | deb70e977ad59a84fbafe2251f60f2da1d4abf20 | peplin/astral | astral/api/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom django.utils.version import get_version\nfrom subprocess import check_output, CalledProcessError\n\nlogger = logging.getLogger(__name__)\n\n\nVERSION = (0, 0, 3, 'beta', 1)\n\n__version__ = get_version(VERSION)\n\ntry... | python | edit | 1 | 0 | mit | 93725280614984955cc8ac4fac74b90e6b5b4076 | ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player | radio/__init__.py | rejected_duplicate | Near-duplicate of sample 1195 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python3\n\nimport os\nimport sys\n\n# n: the integer number of sticks to buy\n# k: the integer number of box sizes the store carries\n# b: the integer number of boxes to buy\ndef bonetrousle(n, k, b):\n if (minimumValue(k, b) <= n... | python | edit | 3 | 2 | mit | 74d0e710711f1b499ab32784b751adc55e8b7f00 | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/bonetrousle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import DetailView, UpdateView\nfrom django.core.urlresolvers import reverse_lazy\n\nfrom braces.views import LoginRequiredMixin\n\nfrom .models import User\nfrom .forms import ProfileUpdateForm\n\n\nclass ProfileDe... | python | edit | 1 | 1 | mit | 729a814f976ceffba0092ba56efca8ccea06e6e6 | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | apps/profiles/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom pubrunner.command_line import *\nfrom pubrunner.upload import *\nfrom pubrunner.FTPClient import *\nfrom pubrunner.getresource import *\nfrom pubrunner.pubrun import pubrun,cleanWorkingDirectory\nfrom pubrunner.convert import *\n\nde... | python | edit | 16 | 3 | mit | ad888e5c5423fcb2419c497597990868216edfe3 | jakelever/pubrunner,jakelever/pubrunner | pubrunner/__init__.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django.contrib.auth.models import AnonymousUser\nfrom django.utils.crypto import constant_time_compare\nfrom rest_framework.authentication import BasicAuthentication\nfrom rest_framework.except... | python | edit | 1 | 5 | bsd-3-clause | 1892fc910e2a23971248121b44ff120ddc118270 | fotinakis/sentry,daevaorn/sentry,hongliang5623/sentry,ngonzalvez/sentry,looker/sentry,fuziontech/sentry,mitsuhiko/sentry,felixbuenemann/sentry,kevinlondon/sentry,BuildingLink/sentry,kevinlondon/sentry,Natim/sentry,wujuguang/sentry,ewdurbin/sentry,kevinastone/sentry,alexm92/sentry,ifduyue/sentry,zenefits/sentry,drcapule... | src/sentry/api/authentication.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom hoomd.update.box_resize import BoxResize\n\n\n# TODO remove when no longer necessary\nclass _updater:\n pass\n\n```\n\nApply this change: Add an __all__ variable to hoomd.upate module"
},
{
"role": "assistant",
"content"... | python | edit | 1 | 0 | bsd-3-clause | ce41f12aebfec5412c0bb9a4fb9a550b8be951a8 | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/update/__init__.py | rejected_duplicate | Near-duplicate of sample 19093 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom itertools import chain\nfrom typing import Iterable\n\nfrom minoshiro import Medium, Minoshiro, Site\nfrom minoshiro.helpers import get_synonyms\n\n\nclass AnimeSearcher(Minoshiro):\n async def get(self, query: str, medium: Medium,\... | python | edit | 1 | 6 | apache-2.0 | 7aa89902f8af2ca1f4b3c9e356a62062cc74696b | MaT1g3R/YasenBaka | bot/anime_searcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# coding=utf-8\n\"\"\"Constants and definitions\"\"\"\n\nimport re\n\n# Used for command parsing, tab completion and word breaks. Do not change.\nQUOTES = ['\"', \"'\"]\nREDIRECTION_CHARS = ['|', '<', '>']\n\n# Regular expression to matc... | python | edit | 1 | 0 | mit | 8c69e0e75454a5665ed2d428aba3c052b97b68b5 | python-cmd2/cmd2,python-cmd2/cmd2 | cmd2/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nGlue some events together \n\"\"\"\n\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\nfrom django.conf import settings\nfrom django.utils.translation import ugettext as _\n\nimport helios.views, helio... | python | edit | 5 | 2 | apache-2.0 | cad5087328bd462d6db8758929d212c4b34fae6c | shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server,shirlei/helios-server | server_ui/glue.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\":mod:`nirum.validate`\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n\"\"\"\n__all__ = 'validate_boxed_type', 'validate_record_type'\n\n\ndef validate_boxed_type(boxed, type_hint):\n if not isinstance(boxed, type_hint):\n raise TypeError('{0}... | python | edit | 1 | 3 | mit | b8850bd7d457ebb14220213d18a6aa779d64b547 | spoqa/nirum-python,spoqa/nirum-python | nirum/validate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport angus.cloud\n\nconn = angus.connect()\n\nservice = conn.services.get_service('voice_detection', version=1)\n\njob = service.process({'sound': open(\"./sound.wav\", 'rb'), 'sensitivity... | python | edit | 2 | 0 | apache-2.0 | 1f884083b612637b64f26532c221b7341c3dda8c | angus-ai/angus-doc,angus-ai/angus-doc,angus-ai/angus-doc | services/voicedetection/voicedetection.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2020 The Pigweed Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# https://ww... | python | edit | 1 | 0 | apache-2.0 | 4bcfb45ef0934dcbcfc711bac1a01c7204e83231 | google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed | pw_docgen/py/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\n\nfrom common import *\n\n\nclass TestContainers(TestCase):\n\n def test_unicode_filename(self):\n\n container = av.open(self.sandboxed(u'¢∞§¶•ªº.mov'), 'w')\n\n\n```\n\nApply this change: Fix relative import in te... | python | edit | 6 | 1 | bsd-3-clause | 5d190f8d3b228820d1a537f0ed2b584b8c09fbae | mikeboers/PyAV,PyAV-Org/PyAV,PyAV-Org/PyAV,mikeboers/PyAV | tests/test_container.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom threading import Timer\n\nimport sublime_plugin\nimport sublime\n\nDEFAULT_NAME = 'Find Results'\nALT_NAME_BASE = 'Find Results '\n\n\nclass OpenSearchInNewTab(sublime_plugin.EventListener):\n\n # set a bit changed name\n... | python | edit | 1 | 3 | mit | 5b8a39dc0fc5e383c30451a819c8e1542fd6f7ed | everyonesdesign/OpenSearchInNewTab | OpenSearchInNewTab.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport doctest\nimport glob\nimport pkg_resources\n\ntry:\n pkg_resources.require('OWSLib')\nexcept (ImportError, pkg_resources.DistributionNotFound):\n pass\n\ntestfiles = glob.glob('*.txt')\n\nfor file in testfiles: \n doctest.te... | python | edit | 2 | 3 | bsd-3-clause | 5c1f9b0a70fe47bbfa7d3813a47e2da81cd81506 | sabman/OWSLib,monoid/owslib,monoid/owslib | tests/runalldoctests.py | rejected_duplicate | Near-duplicate of sample 3119 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass TestRunner(object):\n def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):\n self.verbosity = verbosity\n self.interactive = interactive\n self.failfast = failfast\n\n def run_tests(se... | python | edit | 1 | 7 | bsd-3-clause | 0a96055a08b27d195920ad88141676b02937e029 | 0101/django-pytest,buchuki/django-pytest | django_pytest/test_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDjango-aware exception handler for integration with Errordite.\n\nAdds django user and request information to the exception as appropriate.\n\"\"\"\nfrom errordite import ErrorditeHandler\n\n\nclass DjangoErrorditeHandler(ErrorditeH... | python | edit | 1 | 8 | bsd-2-clause | 403a949a4b248076420d79ceb9d87983b1d26812 | yunojuno/django-errordite | django_errordite/handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# Last Change: Sat Jun 09 10:00 PM 2007 J\n\nfrom info import __doc__\n\nfrom gauss_mix import GmParamError, GM\nfrom gmm_em import GmmParamError, GMM, EM\n#from online_em import OnGMM as _OnGMM\n#import examples as ... | python | edit | 8 | 0 | bsd-3-clause | 4aa8cd1f2230b5c2b180a097815802ed1bcb4905 | newemailjdm/scipy,mdhaber/scipy,Newman101/scipy,Shaswat27/scipy,ilayn/scipy,haudren/scipy,nmayorov/scipy,pschella/scipy,zxsted/scipy,njwilson23/scipy,jseabold/scipy,anntzer/scipy,Srisai85/scipy,pyramania/scipy,jor-/scipy,jseabold/scipy,lukauskas/scipy,woodscn/scipy,raoulbq/scipy,grlee77/scipy,sargas/scipy,aman-iitj/sci... | Lib/sandbox/pyem/__init__.py | rejected_lint | Too many lint violations: 8 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.