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 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you ma... | python | edit | 1 | 0 | apache-2.0 | 5b4684b3a5b2c37c23fb83bc14ceda6cf7c01412 | SauloAislan/ironic,NaohiroTamura/ironic,openstack/ironic,pshchelo/ironic,hpproliant/ironic,devananda/ironic,ionutbalutoiu/ironic,dims/ironic,bacaldwell/ironic,ionutbalutoiu/ironic,bacaldwell/ironic,NaohiroTamura/ironic,openstack/ironic,pshchelo/ironic,dims/ironic,SauloAislan/ironic | ironic/tests/unit/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may ob... | python | edit | 1 | 1 | apache-2.0 | 73660f4f539a1aeb520c33112cfc41183e4dd43a | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/rfam/clans_csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This example shows how queries can be executed in an iterative manner.\r\n# Iterative evaluation will be slower, as more server requests are performed.\r\n#\r\n# Documentation: http://docs.basex.org/wiki/Clients\r\n#\r\n# (C) BaseX Team 2... | python | edit | 4 | 0 | bsd-3-clause | 671a932682f37912b11413f989ad52cf6b046ed6 | ksclarke/basex,deshmnnit04/basex,dimitarp/basex,joansmith/basex,joansmith/basex,dimitarp/basex,ksclarke/basex,drmacro/basex,dimitarp/basex,dimitarp/basex,BaseXdb/basex,joansmith/basex,vincentml/basex,drmacro/basex,joansmith/basex,BaseXdb/basex,BaseXdb/basex,JensErat/basex,joansmith/basex,JensErat/basex,ksclarke/basex,J... | basex-api/src/main/python/QueryExample.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"calc.py: A simple calculator.\"\"\"\n\nimport sys\n\ndef add_all(nums):\n return sum(nums)\n\ndef multiply_all(nums):\n return reduce(lambda a, b: a * b, nums)\n\nif __name__ == '__main__':\n command = sys.argv[1]\n nums =... | python | edit | 2 | 1 | bsd-3-clause | d78188713ffd3e36514ba0db5f74bae111e6a7dc | mkuiper/calc-1 | calc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pip._vendor.six.moves.urllib import parse as urllib_parse\n\n\nclass PackageIndex(object):\n \"\"\"Represents a Package Index and provides easier access to endpoints\n \"\"\"\n\n def __init__(self, url, file_storage_domain):\n... | python | edit | 1 | 1 | mit | 35c66f3ade85b6b7b4e19c95b0d6a09e53b12bee | xavfernandez/pip,rouge8/pip,pfmoore/pip,techtonik/pip,rouge8/pip,pradyunsg/pip,pypa/pip,rouge8/pip,xavfernandez/pip,xavfernandez/pip,sbidoul/pip,techtonik/pip,pypa/pip,pradyunsg/pip,pfmoore/pip,sbidoul/pip,techtonik/pip | src/pip/_internal/models/index.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 csv\n\nclass CsvConverter:\n\n def __init__(self, csv_file_path):\n self.csv_file_path = csv_file_path\n self.rows = []\n self.source_product_code = \"product_... | python | edit | 1 | 2 | mit | d1e1ce5612e1437b2776043f3b6276be5b1d25a6 | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | csv_converter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\\\nUsage:\n dot.py [options] [<path>] [<address>]\n dot.py -h | --help\n dot.py --version\n\nWhere:\n <path> is the file to serve\n <address> is what to listen on, of the form <host>[:<port>], or just <port>\n\"\"\"\n\nimport sy... | python | edit | 3 | 8 | mit | b8b18160e4dad9d87bfdf4207b3cf4841af0140d | joeyespo/path-and-address | examples/dot/dot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom email import message_from_string, utils\nimport json\n\nfrom django.db import models\nfrom dateutil.parser import parse\n\n\nclass EmailManager(models.Manager):\n def create_from_message(self, mailfrom, rcpttos, data):\n from... | python | edit | 1 | 5 | bsd-3-clause | d0ccfd4558b9dcf1610140c9df95cec284f0fbe3 | transcode-de/correos,transcode-de/correos,transcode-de/correos | correos_project/correos/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom django.views.generic import TemplateView\n\nfrom cbv.views import HomeView, Site... | python | edit | 1 | 0 | bsd-2-clause | 446a760261ce4f8e8e210b2a29324c749f2bfdfb | refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector | inspector/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014-present PlatformIO <<EMAIL>>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | 66091bae24425c633d60dabfa1d1ee85869b20cb | platformio/platformio-core,platformio/platformio-core,platformio/platformio | platformio/debug/config/native.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = [\n 'SocketServer',\n]\n\nimport errno\nimport logging\n\nfrom g1.asyncs.bases import servers\nfrom g1.asyncs.bases import tasks\n\nLOG = logging.getLogger(__name__)\nLOG.addHandler(logging.NullHandler())\n\n\nclass SocketServe... | python | edit | 1 | 5 | mit | 1feed219746a2963bddc6080a5d8e9e467e50fa7 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/g1/networks/servers/g1/networks/servers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Carnegie Mellon University\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# htt... | python | edit | 1 | 2 | apache-2.0 | e80817032456fe4fb6ea4735abc0ca0b5bc18ddd | francisleunggie/openface,sahilshah/openface,cmusatyalab/openface,sahilshah/openface,cmusatyalab/openface,nmabhi/Webface,Alexx-G/openface,nhzandi/openface,nmabhi/Webface,xinfang/face-recognize,nhzandi/openface,nmabhi/Webface,francisleunggie/openface,xinfang/face-recognize,Alexx-G/openface,xinfang/face-recognize,Alexx-G/... | facenet/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef test(options, buildout):\n from subprocess import Popen, PIPE\n import os\n import sys\n\n python = options['python']\n if not os.path.exists(python):\n raise IOError(\"There is no file at %s\" % python)\n if sy... | python | edit | 1 | 7 | mit | 5b71b9e86dc09fe21717a75e45748a81d833c632 | upiq/plonebuild,upiq/plonebuild | src/test-python.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for the config command\n\"\"\"\n\nfrom pip.status_codes import ERROR\nfrom tests.lib.configuration_helpers import kinds, ConfigurationFileIOMixin\n\n\ndef test_no_options_passed_should_error(script):\n result = script.pip('co... | python | edit | 1 | 1 | mit | 6cf5d7db54ee272fa9af66d45a504d5994693ae4 | zvezdan/pip,pypa/pip,xavfernandez/pip,xavfernandez/pip,techtonik/pip,pradyunsg/pip,RonnyPfannschmidt/pip,pradyunsg/pip,zvezdan/pip,RonnyPfannschmidt/pip,RonnyPfannschmidt/pip,rouge8/pip,sbidoul/pip,xavfernandez/pip,rouge8/pip,pfmoore/pip,zvezdan/pip,techtonik/pip,pypa/pip,sbidoul/pip,pfmoore/pip,rouge8/pip,techtonik/pi... | tests/functional/test_configuration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hoomd.integrate\n\n\nclass Operations:\n def __init__(self, simulation=None):\n self.simulation = simulation\n self._compute = list()\n self._auto_schedule = False\n self._scheduled = False\n\n def a... | python | edit | 1 | 5 | bsd-3-clause | 3ea008feb5ebd0e4e67952267aa5e3a0c5e13e89 | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/operations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 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\n\"\"\"ActiveMaster definition.\"\"\"\n\nfrom config_bootstrap import Mast... | python | edit | 1 | 0 | bsd-3-clause | fc37b45a461d8973f78a359016a458b5a3769689 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | masters/master.client.v8.ports/master_site_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib.request import urlopen\nimport Utilities\n\nFILENAME_CUE = \"File:\"\nIMAGE_LOCATION_CUE = '<div class=\"fullMedia\"><a href=\"https://upload.wikimedia.org/wikipedia/commons/'\nIMAGE_LOCATION_URL_START = 'https://upload.wikimedi... | python | edit | 3 | 4 | mit | b3b28bd582d3f1e2ed5e646275760d1d0669acea | alset333/PeopleLookerUpper | WikimediaUtilities.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n\n__version__ = '0.1.1'\n\n\ndef pytest_configure(config):\n # Register the marks\n config.addinivalue_line(\n 'markers',\n 'haystack: Mark the test as using the django-haystack search engine, '\n ... | python | edit | 1 | 2 | mit | 7f649a9e4e90587bd88b4b83b648f76287610f16 | rouge8/pytest-django-haystack | pytest_django_haystack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2011 Resolver Systems Ltd.\n# All Rights Reserved\n#\n\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\nfrom datetime import timedelta\nfrom mock import call\n\n\nclass ResolverTestMixins(... | python | edit | 2 | 2 | mit | cf836d147c3f55261e41815fb1c5e0a4bd53d41a | pythonanywhere/resolver_test | resolver_test/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import with_statement\nimport sys\n\ntry:\n import json\nexcept ImportErro... | python | edit | 1 | 2 | mit | fc6ca51d4a865368f82c26426a2d6c8d8366e25d | thombashi/tcconfig,thombashi/tcconfig | tcconfig/tcshow.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\nimport transitions\n\nfrom panoptes.utils.logger import has_logger\n\n\n@has_logger\nclass PanState(transitions.State):\n\n \"\"\" Base class for PANOPTES transitions \"\"\"\n\n def __init__(self, *args, **kwargs):\n ... | python | edit | 3 | 1 | mit | b145b03b2569f4a82adefe57e843ef91384c47a4 | joshwalawender/POCS,panoptes/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS,panoptes/POCS | panoptes/state_machine/states/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# outer __init__.py\n\"\"\"\nImplementation of some simple and dumb audio codecs, like Delta Modualtion\n\"\"\"\n\nfrom ssc.aux import pack, unpack\nfrom ssc.dm import predictive_dm, decode_dm\nfrom ssc.btc import lin2btc, btc2lin, calc_rc\... | python | edit | 10 | 0 | bsd-3-clause | 06b7a81a0c89177e6ac1913cab65819b7b565754 | Zardoz89/Simple-Sound-Codecs,Zardoz89/Simple-Sound-Codecs | python/ssc/__init__.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport subprocess\n\n\ndef test_help(tmpdir, cli):\n with cli(\n args=['ceph-deploy', 'osd', '--help'],\n stdout=subprocess.PIPE,\n ) as p:\n result = p.stdout.read()\n assert 'usage: ceph-de... | python | edit | 1 | 1 | mit | 2b892b58049bd2b99ae97b62149f88c8001c82ca | trhoden/ceph-deploy,branto1/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,branto1/ceph-deploy,ceph/ceph-deploy,SUSE/ceph-deploy,isyippee/ceph-deploy,ghxandsky/ceph-deploy,imzhulei/ceph-deploy,codenrhoden/ceph-deploy,codenrhoden/ceph-deploy,shenhequnying/ceph-deploy,zhouyuan/ceph-deploy,shenhequnying/ceph-deploy,ghxandsky/... | ceph_deploy/tests/test_cli_osd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module implements python classes which inherit from\nand extend the functionality of the ROOT canvas classes.\n\"\"\"\n\nimport ctypes, ctypes.util\nctypes.cdll.LoadLibrary(ctypes.util.find_library(\"Gui\"))\n\nimport ROOT\n\nf... | python | edit | 1 | 3 | bsd-3-clause | 5c074950663d2e508fee0e015472e8460bf5b183 | rootpy/rootpy,kreczko/rootpy,kreczko/rootpy,kreczko/rootpy,rootpy/rootpy,ndawe/rootpy,rootpy/rootpy,ndawe/rootpy,ndawe/rootpy | rootpy/plotting/canvas.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Read and write Onestop data.\"\"\"\nimport sys\nimport os\nimport glob\nimport json\nimport argparse\nimport urllib\n\nimport mzgeohash\n\nimport util\nimport entities\nimport errors\n\nclass OnestopRegistry(object):\n \"\"\"Onestop ... | python | edit | 7 | 4 | mit | 37953d6ee56fedbe5e03f738ddbf28c3433718e7 | transitland/transitland-python-client,srthurman/transitland-python-client | onestop/registry.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport json\n\nfrom flask import Flask, render_template\n\n\ndef channels_json(station, escaped=False):\n channels = [{\"name\": channel} for channel in station.channels()]\n jsonbody = json.dumps(channels)\n if escaped:... | python | edit | 3 | 2 | mit | 0e2e30382def1f911987ca22fce5adc6c6b73fb6 | richo/airship,richo/airship,richo/airship | airship/__init__.py | rejected_duplicate | Near-duplicate of sample 4039 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom ez_setup import use_setuptools\nuse_setuptools()\nfrom setuptools import setup, find_packages\n\nsetup(name='django-elect',\n version='0.1',\n description='A simple voting app for Django',\n license='BSD... | python | edit | 1 | 0 | bsd-3-clause | ffcc9d8c87ddc7fd386dd51c1fca1ac8b62d5828 | MasonM/django-elect,MasonM/django-elect,MasonM/django-elect | setup.py | rejected_duplicate | Near-duplicate of sample 4826 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nanomon import resources\nfrom nanomon import registry\n\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\n\n\nwebserver_group = resources.MonitoringGroup('webservers', port=80)\nwww1 = resources.Host('www1', monitoring_groups... | python | edit | 1 | 0 | bsd-2-clause | 19c087941e193b79b6f76e75cc024878ef8c7c6f | cloudtools/nymms | examples/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# This script will generate a random 50-character string suitable for use as a SECRET_KEY.\nimport random\n\ncharset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'\nsecure_random = ra... | python | edit | 1 | 0 | apache-2.0 | b6e532f01d852738f40eb8bedc89f5c056b2f62c | digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox | netbox/generate_secret_key.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import DerivedBase, Property, Base\n\nclass Backup(DerivedBase):\n api_name = 'backups'\n api_endpoint = '/linode/instances/{linode_id}/backups/{id}'\n derived_url_path = 'backups'\n parent_id_name='linode_id'\n\n pro... | python | edit | 3 | 2 | bsd-3-clause | 6d15230f46c22226f6a2e84ac41fc39e6c5c190b | linode/python-linode-api,jo-tez/python-linode-api | linode/objects/linode/backup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name='natural',\n version='0.1.4',\n description='Convert data to their natural (human-readable) format',\n long_description='''\nExample Usage\n=============\n\nBa... | python | edit | 1 | 0 | mit | ad4b972667e9111c403c1d3726b2cde87fcbc88e | tehmaze/natural | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .tag_map import TAG_MAP\nfrom .stop_words import STOP_WORDS\nfrom .lex_attrs import LEX_ATTRS\nfrom .morph_rules import ... | python | edit | 1 | 0 | mit | 61fe55efba2c491da6a93421fa702f123615bc32 | honnibal/spaCy,aikramer2/spaCy,recognai/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/sp... | spacy/lang/en/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add RefusePickup class (for parsing)"
},
{
"role": "assistant",
"content": "from .util import XPathObject\n\n\nclass RefusePickup(XPathObject):\n \"\"\"Defines attribute to XPath specification matching\"\"\"\n\n input_prope... | python | new_file | 1 | 0 | unlicense | de6de7c43932224f2845cc540170eeaf46650491 | tomislacker/python-mke-trash-pickup,tomislacker/python-mke-trash-pickup | mkerefuse/refuse.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyramid.httpexceptions import HTTPNotFound\nfrom pyramid.i18n import TranslationString as _\n\ndef get_or_create(session, model, **kw):\n \"\"\" Django's get_or_create function\n\nhttp://stackoverflow.com/questions/2546207/does-sqla... | python | edit | 3 | 2 | mit | 585fe3142860a294a6b30edb9879f979b6ac9c49 | Qwait/apex,Qwait/apex | apex/lib/db.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n###\n# Copyright (c) 2012, spline\n# All rights reserved.\n#\n#\n###\n\nimport supybot.conf as conf\nimport supybot.registry as registry\nfrom supybot.i18n import PluginInternationalization, internationalizeDocstring\n\n_ = PluginInternatio... | python | edit | 7 | 1 | mit | 016f14304b6b86634c4608927d3345f993178682 | reticulatingspline/Scores,cottongin/Scores | config.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nimport settings\n\nOUTCOME_CHOICES = settings.EVENT_OUTCOME_CHOICES\nEVENT_TYPE_CHOICES = settings.EVENT_TYPE_CHOICES\n\n\nclass EventSearchForm(forms.Form):\n event_outcome = forms.ChoiceField(\n widge... | python | edit | 1 | 0 | bsd-3-clause | d6cd7c16e32f64c4fd3627953d751e8c8bc26f1c | unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service | premis_event_service/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n# Current directory\n# If you call this from the current directory without abspath,\n# then it will not work since __file__ is a relative path\nos.path.dirname(os.path.abspath(__file__))\n\n```\n\nApply this change: Add util for ... | python | edit | 1 | 3 | mit | 2973b664e8c9cf551d5d7277ab4995125be5fad0 | brycepg/how-to | python/reference.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\nimport os\r\nfrom xml.etree import ElementTree\r\nfrom utils import with_app, pretty_print_xml\r\n\r\n\r\n#=============================================================================\r\n# Tests\r\n\r\n@with_app(buildername=\"xml\", sr... | python | edit | 4 | 1 | apache-2.0 | b7939c13622d1134364e874da1d1903bcea6cffe | t4ngo/sphinxcontrib-traceables | tests/test_graph.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom apps.polls.models import Poll, Choice\n\nclass ChoiceInline(admin.TabularInline):\n model = Choice\n extra = 3\n\nclass PollAdmin(admin.ModelAdmin):\n fieldsets = [\n (None, {'fields'... | python | edit | 1 | 0 | bsd-3-clause | 2937af0fe2f28ed9381b6b43c337c4cca14e4e78 | datphan/teracy-tutorial,teracyhq/django-tutorial | apps/polls/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom settings import DeploymentType\n\ndef context_processor(request):\n context = {}\n context['DEPLOYMENT'] = settings.DEPLOYMENT\n context['site'] =... | python | edit | 1 | 2 | mit | 0540b78a5c83cf307c4d629bb814c8359edd8709 | bueda/django-comrade | comrade/core/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport unittest\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nfrom smartbot import events\n\n\nclass TestEvents(unittest.TestCase):\n def test_empty(self):\n event = eve... | python | edit | 1 | 1 | mit | ab1893301736e2cf5cd87cc30671898884377661 | Cyanogenoid/smartbot,tomleese/smartbot,Muzer/smartbot,thomasleese/smartbot-old | test/test_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass REPO:\n '''Repo attributes'''\n TYPE = 'type'\n\n DIRECTORY = 'directory'\n VOLATILE = 'volatile'\n SERVE_INTERFACE = 'serve_interface'\n SERVE_PORT = 'serve_port'\n SERVE_USERNAME = 'serve_username'\n SERVE_PA... | python | edit | 1 | 0 | mit | f50589ec9b61efbd2bd56cca802ffc542f5b3336 | krisztianfekete/pyrene | pyrene/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom wordgraph.points import Point\nimport wordgraph\n\nEPOCH_START = 1407109280\n\ndef time_values(values, start=EPOCH_START, increment=1):\n datapoints = []\n for index, value in enumerate(values):\n datapoints.append(Point(x... | python | edit | 1 | 2 | apache-2.0 | c34817c2740e860493692b630a11fdb7acab76aa | tleeuwenburg/wordgraph,tleeuwenburg/wordgraph | tests/test_simple_features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nUINT64_MAX = 2 ** 64 - 1\nUINT64_MIN = 0\n\nINT64_MAX = 2 ** 63 - 1\nINT64_MIN = -(2 ** 63)\n\nUINT256_MAX = 2 ** 256 - 1\n\n# Deployed to Ropsten revival on 2017-06-19 from commit 2677298a69c1b1f35b9ab26beafe457a... | python | edit | 1 | 0 | mit | 38dfe0948b063b93f5375e065129838335d5ca95 | tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden,tomashaber/raiden,hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden | raiden/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\nfrom pyparsing import ParseException\nfrom regparser.grammar.atomic import *\n\n\nclass GrammarAtomicTests(TestCase):\n def test_em_digit_p(self):\n result = em_digit_p.parseString('(<E T=\"03\">2<... | python | edit | 7 | 5 | cc0-1.0 | 019aa0d78fbf54dda405cf8df3aab92dfdaba188 | adderall/regulations-parser,willbarton/regulations-parser,grapesmoker/regulations-parser | tests/grammar_atomic_tests.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, sys\nsys.path.append(os.path.abspath('..'))\n\nimport unittest\nfrom mock import patch\nfrom pynexus import api_client\n\nclass NexusTest(unittest.TestCase):\n\n def test_constructor_appends_base(self):\n n = api_client... | python | edit | 1 | 1 | apache-2.0 | 942bd1abf9d4e74b0f1dbeb8fc5acaaaeed1a2a6 | rcarrillocruz/pynexus | tests/test_nexus.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n\n@pytest.fixture(scope='session', autouse=True)\ndef init_config():\n\t__import__('pmxbot').config = {}\n\n\n@pytest.fixture(params=['mongodb', 'sqlite'])\ndef db_uri(request):\n\tif request.param == 'mongodb':\n\t\treturn... | python | edit | 1 | 2 | mit | ff662e931cf4d57016c97698d490bc75368ecb67 | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | pmxbot/testing/fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mock\nimport unittest\n\nfrom resto.wsgi import Middleware\n\n\nclass AppTestCase(unittest.TestCase):\n\n def setUp(self):\n self.environ = {\n 'wsgi.version': (1, 0),\n 'wsgi.multithread': False,\n ... | python | edit | 1 | 2 | mit | c76e3accff36eb993ea44f4e38adad9466af1f54 | rafaelpivato/resto | tests/wsgi_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gevent import monkey\nmonkey.patch_all() # noqa\nimport sys\nimport time\n\nfrom raiden.network.transport import UDPTransport\nfrom raiden.network.sockfactory import socket_factory\n\n\nclass DummyProtocol(object):\n\n def __init__... | python | edit | 3 | 1 | mit | e2991360bb35060e570e59bbea6a1e6d23a54aa7 | hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,charles-cooper/raiden,charles-cooper/raiden | transport_tester.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom src.Sensors.BME280 import BME280\nfrom src.Sensors.BME680 import BME680\nfrom src.Sensors.DS18B20 import DS18B20\nfrom src.Notification.Subscriber.LED.RGB import RGB\n\n\nclass Factory:\n\n @staticmethod\n def create_sensor(devic... | python | edit | 1 | 5 | mit | 156ebae630c3690db875b8925bfbdc5ded396fdd | dashford/sentinel | src/Sensors/Factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom celery import Celery\n\n\napp = Celery('aubergine')\napp.config_from_object('aubergine.settings.celeryconfig')\napp.autodiscover_tasks(['aubergine'], related_name='tasks')\napp.setup_security()... | python | edit | 1 | 1 | bsd-3-clause | b05ba019143cc39ba0d02d822824172313e78591 | michaelwisely/aubergine | aubergine/celery.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n__author__ = 'Vauxoo'\n__email__ = '<EMAIL>'\n__version__ = '0.1.0'\n\n```\n\nApply this change: [REF] pstats_print2list: Add print_stats to init file"
},
{
"role": "assistant",
"content": "# -*- codin... | python | edit | 3 | 0 | isc | f1af7dad41992b53e90a5f8dd20e1635f11a7ce1 | Vauxoo/pstats-print2list | pstats_print2list/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nManage the shadow file\n'''\n\nimport salt.utils\n\n\ndef __virtual__():\n '''\n Only works on Windows systems\n '''\n if salt.utils.is_windows():\n return 'shadow'\n return False\n\n\ndef info(name):\n '''\n ... | python | edit | 2 | 2 | apache-2.0 | 875e25231dec76760bde97107d52036560347914 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/win_shadow.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nBasic Template system for project pinksign,\nsimilar to the template part of PasteScript but without any dependencies.\n\n\"\"\"\n\nfrom .pypinksign import (\n PinkSign, get_npki_path, url_encode, paramize, choose_cert, seed_cbc_... | python | edit | 13 | 0 | mit | 491613b34cb3c89e8d49670457a46b924a109529 | bandoche/PyPinkSign | pypinksign/__init__.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom ofxparse import OfxParser as op, OfxPrinter\nfrom unittest import TestCase\nfrom os import close, remove\nfrom tempfile import mkstemp\nimport sys\nsys.path.append('..')\nfrom .support import o... | python | edit | 3 | 1 | mit | d279572c255a302dd5f191b0f047c46c9184ec2a | rdsteed/ofxparse,jaraco/ofxparse,jseutter/ofxparse,udibr/ofxparse | tests/test_write.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport errno\n\nclass CPUFlags:\n def __init__(self):\n self.flags = set()\n\n try:\n self.flags = self.__parse_cpuinfo()\n except IOError as e:\n if e.errno == errno.ENOENT:\n re... | python | edit | 2 | 3 | bsd-2-clause | 5a3cdba13cb4898b76d83c949fc3ab6895c267ff | WojciechMula/toys,WojciechMula/toys,WojciechMula/toys,WojciechMula/toys,WojciechMula/toys | scripts/cpuflags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"Package for mine.\"\"\"\n\nimport sys\n\n__project__ = 'mine'\n__version__ = '0.1'\n\nCLI = 'mine'\nVERSION = __project__ + '-' + __version__\nDESCRIPTION = \"Manages running applications across multiple compu... | python | edit | 1 | 0 | mit | ea62a1cd9642dbff69cbfae3f8b540604a8a8fca | jacebrowning/mine | mine/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport time\n\nimport requests\nfrom googleapiclient.errors import HttpError\n\n\n# Number of retries in case of API errors\nNUM_RETRIES = 3\n\n# Delay between retry attempts, seconds\nRETRY_DELAY = 1\n\n_logger = logging.ge... | python | edit | 1 | 4 | apache-2.0 | da67ce3f25a708b99cb81f17703e74965dbea960 | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | rtrss/filestorage/httputil.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom busbus import util\n\n\nclass LazyEntityProperty(object):\n\n def __init__(self, f, *args, **kwargs):\n self.f = f\n self.args = args\n self.kwargs = kwargs\n\n def __call__(self):\n return self.f(*sel... | python | edit | 1 | 3 | mit | 13d9cf933e49849a3c5343e7bdbf887b9aee6097 | spaceboats/busbus | busbus/entity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport PySide2.QtCore\n\n# Prints PySide2 version\n# e.g. 5.11.1a1\nprint(PySide2.__version__)\n\n# Gets a tuple with each version component\n# e.g. (5, 11, 1, 'a', 1)\nprint(PySide2.__version_info__)\n\n# Prints the Qt version used to comp... | python | edit | 1 | 0 | mit | d7534dc3536ebe035abf063d83aa8d471cdadb16 | ericosur/myqt,ericosur/myqt,ericosur/myqt,ericosur/myqt,ericosur/myqt,ericosur/myqt | python/pyqt_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add app for lists, with deliberately failing unit test"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nclass SmokeTest(TestCase):\n def test_bad_maths(self):\n self.assertEqual(1 + 1, 3)\n"
... | python | new_file | 1 | 1 | apache-2.0 | 839a0cafca1d172f7a061dcec5f6a4eca6d725c8 | Alfawuhn/test-driven-python | superlists/lists/tests.py | rejected_duplicate | Near-duplicate of sample 5593 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\nimport logging\n\nfrom taca.server_status import server_status as status\nfrom taca.utils.config import CONFIG\nfrom taca.server_status import cronjobs as cj # to avoid similar names with command, otherwise exception\n\n\n@cli... | python | edit | 1 | 3 | mit | 5b6823ec19185ed5b413d1c01d3afeb5b1716778 | SciLifeLab/TACA,SciLifeLab/TACA,SciLifeLab/TACA | taca/server_status/cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Photo(models.Model):\n artist = models.ForeignKey('artists.Artists')\n picture = models.ImageField(null=True, blank=True, upload_to=\"art_picture/\")\n comment = models.TextField(max_length=5... | python | edit | 1 | 1 | mit | 559f3c18a7e27e4bb1147b03a27ec083a66749d0 | KeserOner/where-artists-share,KeserOner/where-artists-share | was/photo/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nMAX_PRICE_FORMAT = \t{\n\t\t\t\t\t\t'max_digits': 5, \n\t\t\t\t\t\t'decimal_places': 2\n\t\t\t\t }\n\nSPECIAL_TYPES = (\n\t\t\t\t\t('LU', 'Lunch'),\n\t\t\t\t\t('BR', 'Breakfast'),\n\t\t\t\t\t('DI', 'Dinner... | python | edit | 1 | 1 | unlicense | d20347f4a57bb195291ebc79fc1ca0858b3f1d65 | wiehan-a/pylunch | PyLunch/pylunch/specials/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom devbot import chat\n\n\ndef call(message: str, name, protocol, cfg, commands):\n if message is '':\n chat.say('/msg {} {}'.format(name, commands['help']['globaladd'].format('globaladd')))\n return \n if ' ' in messa... | python | edit | 3 | 3 | mit | 70f69f7b801404f7091e91b6ed997602709f9f42 | Ameliorate/DevotedBot,Ameliorate/DevotedBot | commands/globaladd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom cyder.base.eav.forms import get_eav_form\nfrom cyder.base.mixins import UsabilityFormMixin\nfrom cyder.cydhcp.range.models import Range, RangeAV\nfrom cyder.cydns.forms import ViewChoiceForm\n\n\nclass Range... | python | edit | 1 | 1 | bsd-3-clause | c967776872e9a5c6fa840d202f25a067020c148f | OSU-Net/cyder,zeeman/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,murrown/cyder,akeym/cyder,zeeman/cyder,akeym/cyder,murrown/cyder,murrown/cyder,drkitty/cyder,zeeman/cyder,akeym/cyder,zeeman/cyder,OSU-Net/cyder,drkitty/cyder,drkitty/cyder,OSU-Net/cyder | cyder/cydhcp/range/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom django.test import TestCase as dTestCase\nfrom django.test.runner import DiscoverRunner\n\nfrom snapshottest.reporting import reporting_lines\nfrom .unittest import TestCase as uTestCase\n\n\ncla... | python | edit | 1 | 2 | mit | 13ee0e2084765dcf958f4dbc844da54750878242 | syrusakbary/snapshottest | snapshottest/django.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport sys\n\n\n_args = sys.argv\n\nif __name__ == \"__main__\":\n if len(_args) == 4:\n keys_file = _args[1]\n target_file = _args[2]\n result_file = _args[3]\n\n with open(keys_file... | python | edit | 1 | 0 | mit | 7c591a38bc89350ea2586fb83a6880cdf71b4a9a | maxsocl/oldmailer | passwd_change.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nFORMAT = '%(asctime)s:%(levelname)s:%(module)s.%(funcName)s:%(message)s'\nlogging.basicConfig(format=FORMAT, level=logging.INFO, datefmt='%H:%M:%S')\nlogger = logging.getLogger('yatsm')\n\n```\n\nApply this change: Change ... | python | edit | 1 | 0 | mit | c79c573c93a96bf5b631472c5e7efccc60102813 | ceholden/yatsm,ceholden/yatsm,valpasq/yatsm,c11/yatsm,valpasq/yatsm,c11/yatsm | yatsm/log_yatsm.py | rejected_duplicate | Near-duplicate of sample 18621 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\nfrom django.utils import unittest\n\nfrom bakery.auth.models import BakeryUser\n\n\nclass TestBakeryUserModel(TestCase):\n\n @unit... | python | edit | 1 | 1 | bsd-3-clause | 03ebfe0518a7ac39f9414b3e8d8638c9dcba917c | muffins-on-dope/bakery,muffins-on-dope/bakery,muffins-on-dope/bakery | tests/auth/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests for the testutil module\"\"\"\n\nfrom unittest import TestCase\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.exc import DBAPIError\nimport transaction\n\nfrom tg.testutil import DBTest\nfrom tg.tests.fixtures import m... | python | edit | 4 | 1 | mit | 76dbf84facac62345ba02f17b33844a41d326d1f | lucius-feng/tg2,lucius-feng/tg2 | tg/tests/test_testutil.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) Ivan Kravets <<EMAIL>>\n# See LICENSE for details.\n\nimport requests\nfrom platformio.util import get_api_result\n\n\ndef pytest_generate_tests(metafunc):\n if \"package_data\" not in metafunc.fixturenames:\n retu... | python | edit | 1 | 4 | apache-2.0 | 73af0eed3ce746154b957af5c05137f9e432c7a3 | bkudria/platformio,awong1900/platformio,bkudria/platformio,platformio/platformio,jrobeson/platformio,platformio/platformio-core,TimJay/platformio,jrobeson/platformio,eiginn/platformio,platformio/platformio-core,bkudria/platformio,TimJay/platformio,TimJay/platformio,awong1900/platformio,valeros/platformio,ZachMassia/pla... | tests/test_pkgmanifest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom upload_s3 import set_metadata\n\nfrom flask import Flask, render_template\nfrom flask_frozen import Freezer\n\napp = Flask(__name__)\nfreezer = Freezer(app)\n\napp.config['FREEZER_DEFAULT_MIMETYPE'] = 'text/html'\napp.confi... | python | edit | 1 | 1 | apache-2.0 | da447a06c65a421b8d2fe122cb7b6bee5d11614e | vprnet/interactive-transcript-gov-peter-shumlins-2015-budget-speech,vprnet/google-s3-json,vprnet/app-template,vprnet/EOTS-iframe-widget,vprnet/soundcloud-podcast,vprnet/interactive-transcript-gov-peter-shumlins-2015-budget-speech,vprnet/timeline-dcf-systemic-failure,vprnet/live-from-the-fort,vprnet/live-from-the-fort,v... | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kafka import KafkaProducer\n\nfrom .event_emitter import EventEmitter\nfrom .exceptions import ConfigurationError\n\n__version__ = '0.1.3'\n\n\nclass Relayer(object):\n\n def __init__(self, logging_topic, context_handler_class, kafk... | python | edit | 1 | 3 | mit | fe98a627943c235ba24fc6de781deec69e7fd02e | wizeline/relayer | relayer/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, unicode_literals\n\nfrom cms.sitemaps import CMSSitemap\nfrom django.conf import settings\nfrom django.conf.urls import include, patterns, url\nfrom django.con... | python | edit | 1 | 0 | bsd-3-clause | 07b22d0e4912678e3e2e5507e8a7fe2488ce2b3c | nephila/djangocms-installer,nephila/djangocms-installer | djangocms_installer/config/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport angr\nimport logging\nimport os\n\nl = logging.getLogger(\"angr_tests\")\ntest_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)),\n '../../binaries/tests'))\n\ndef test_vfg_paths(... | python | edit | 3 | 1 | bsd-2-clause | 7816fc20c2e46a9d1a1e7c11a061862163018069 | tyb0807/angr,schieb/angr,schieb/angr,tyb0807/angr,chubbymaggie/angr,schieb/angr,chubbymaggie/angr,f-prettyland/angr,chubbymaggie/angr,angr/angr,angr/angr,axt/angr,axt/angr,axt/angr,f-prettyland/angr,angr/angr,tyb0807/angr,f-prettyland/angr,iamahuman/angr,iamahuman/angr,iamahuman/angr | tests/test_vfg_path.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP\n# Copyright 2017 FUJITSU LIMITED\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License... | python | edit | 1 | 1 | apache-2.0 | 66fe6f98c079490d2d5de4c161da1d8b3801cda4 | stackforge/monasca-persister,openstack/monasca-persister,stackforge/monasca-persister,stackforge/monasca-persister,openstack/monasca-persister,openstack/monasca-persister | monasca_persister/conf/influxdb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ephem\nfrom datetime import datetime\n\ndef const(planet_name): # function name and parameters \n planet_class = getattr(ephem, planet_name) # sets ephem object class\n date_class = datetime.now()\n planet = plan... | python | edit | 5 | 1 | mit | b698c7ab1c13353d8e9538bb42797344049812c1 | bennettscience/PySky | astro.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport socket, sys\n\nif len(sys.argv) != 6:\n print('Wrong number of arguments. Usage: ./21-ct-clean-up-nc.py <localport> <timeout> <remote-address> <remote-port> <HTTP path>')\n\nlocalport = int(sys.argv[1])\ntimeout = int(sys.argv[2])\n... | python | edit | 1 | 0 | apache-2.0 | 3ecca9dfa3f79a4c42a386e0bfe27cdca7e46a69 | cilium/cilium,cilium/cilium,tgraf/cilium,michi-covalent/cilium,cilium-team/cilium,eloycoto/cilium,tgraf/cilium,eloycoto/cilium,cilium/cilium,eloycoto/cilium,scanf/cilium,cilium-team/cilium,scanf/cilium,tklauser/cilium,scanf/cilium,cilium/cilium,scanf/cilium,cilium/cilium,tgraf/cilium,tgraf/cilium,tklauser/cilium,eloyco... | tests/21-ct-clean-up-nc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 FUJITSU LIMITED\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.ap... | python | edit | 1 | 1 | apache-2.0 | d0018748cae3f0af4818106643926f7e8effe3c6 | openstack/monasca-log-api,stackforge/monasca-log-api,stackforge/monasca-log-api,stackforge/monasca-log-api,openstack/monasca-log-api,openstack/monasca-log-api | monasca_log_api_tempest/clients.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest # noqa\nimport os\nimport sys\nimport glob\nimport imp\n\n\ndef test_examples():\n\n examples_pat = os.path.join(os.path.abspath(os.path.dirname(__file__)),\n '../../examples/*/*.py')\n\n ... | python | edit | 1 | 6 | mit | daa4021011778f7511ad2c97648155bb17539d98 | igordejanovic/parglare,igordejanovic/parglare | tests/func/test_examples.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nlogger = logging.getLogger(__name__)\n\ndef strspn(source, allowed):\n newchrs = []\n for c in source:\n if c in allowed:\n newchrs.append(c)\n return u''.join(newchrs)\n\ndef check_cell_phone_numb... | python | edit | 3 | 7 | bsd-3-clause | fb675239ae79adcdc5f050bcf8403effb067a59b | mvpoland/django-smsgateway,peterayeni/django-smsgateway,peterayeni/django-smsgateway,peterayeni/django-smsgateway,mvpoland/django-smsgateway,peterayeni/django-smsgateway,mvpoland/django-smsgateway | smsgateway/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_generalwords\n----------------------------------\n\nAll the tests for the generalword module. Simple module, simple tests.\n\"\"\"\n\nimport unittest\n\nfrom generalwords import... | python | edit | 1 | 2 | bsd-3-clause | 5dd5d4e6ac93ad3867f98bd35412de11dd6b1dc2 | petrilli/generalwords | tests/test_generalwords.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nfrom django.test import TestCase\nfrom django_extensions.management.commands.show_urls import Command\n\n\nclass UrlTests(TestCase):\n def is_exception(self, url):\n exceptions = [\".txt\", \".ics\", \".geojson\"]\n ... | python | edit | 1 | 4 | bsd-3-clause | 8d0d4704f62b223128bab193cd5f5cda8e978c19 | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/pollingstations/tests/test_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.15.2\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", \".\", 1).split(\".\")\n ]\n)\n\n```\n\... | python | edit | 1 | 0 | mit | f9c9cd4505e9055a2905a87f91cdaab399352b27 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | dthm4kaiako/config/__init__.py | rejected_duplicate | Near-duplicate of sample 1514 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-------------------------------------------------------------------------------\r\n#\r\n# Copyright (c) 2009, Enthought, Inc.\r\n# All rights reserved.\r\n# \r\n# This software is provided without warranty under the terms of the BSD\r\n... | python | edit | 1 | 0 | bsd-3-clause | e2831c6241e18d6f611eaaf51854b75b970867d7 | ContinuumIO/chaco,ContinuumIO/chaco,tommy-u/chaco,ContinuumIO/chaco,burnpanck/chaco,tommy-u/chaco,tommy-u/chaco,burnpanck/chaco,burnpanck/chaco,ContinuumIO/chaco | examples/demo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import Base\nimport re\n\n\nCompleteOutputs = \"g:LanguageClient_omniCompleteResults\"\n\n\nclass Source(Base):\n def __init__(self, vim):\n super().__init__(vim)\n\n self.name = \"LanguageClient\"\n self.... | python | edit | 1 | 3 | mit | e93ec5939d5a47e20501b4812e02a6cdac4a3ba6 | autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/L... | rplugin/python3/deoplete/sources/LanguageClientSource.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport sys\nimport threading\nfrom time import sleep\nfrom datetime import datetime\n\nimport msgpack\nimport zmq\n\ncontext = zmq.Context()\nsocket = context.socket(zmq.SUB)\nsocket.setsockopt(zmq.SUBSCRIBE, b'')\n\nsocket.bind... | python | edit | 4 | 5 | isc | e25f085025f881ccf0a0da2e620b09787819507a | jaj42/hsmedstream,jaj42/phystream | sub.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\n__all__ = ['ShellProvider']\n\nfrom .base import Provider\n\n\nclass ShellProvider(Provider):\n def get_options(self):\n return {\n 'command': {'required': Tru... | python | edit | 1 | 1 | apache-2.0 | 866026a5d2f89a8ac76a726720e4fbe812c94eb4 | rshk/freight,klynton/freight,jkimbo/freight,getsentry/freight,getsentry/freight,klynton/freight,getsentry/freight,klynton/freight,rshk/freight,klynton/freight,jkimbo/freight,getsentry/freight,rshk/freight,jkimbo/freight,jkimbo/freight,rshk/freight,getsentry/freight | ds/providers/shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCreated on Mon Dec 29 00:14:56 2014\n\n@author: pfigueira\n\nEditied Thur Dec 15 13:00 2016 by Jason Neal for eniric.\n\"\"\"\n\n# from eniric.IOmodule import read_2col\n\nimport numpy as np\nimport pandas as pd\nc = 299792458 # m/... | python | edit | 4 | 1 | mit | b05d2666c834a9c4d151d0340612010851bd4610 | jason-neal/eniric,jason-neal/eniric | eniric/Qcalculator.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\n\n\nclass SetupNetworkMixin(object):\n def _setup_hostname(self):\n with self.get_attachment().attach():\n subprocess.check_call(['hostname', self.hostname])\n\n def _setup_virtual_ethernet(self):\... | python | edit | 1 | 1 | mit | 8aa02a12883d058b498ac56673079c1e9b53fdf7 | ianpreston/cask,ianpreston/cask | src/libcask/network.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom reversion import revisions\n\nfrom wafer.talks.models import Talk\n\n\nclass TalkSerializer(serializers.ModelSerializer):\n\n class Meta:\n model = Talk\n exclude = ('_abstract_r... | python | edit | 1 | 1 | isc | 7d0f3ba1aa82c2ea5a4a2eca2bbe842b63a82c72 | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/talks/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef find_unique(sequence):\n item_counter = dict()\n uniques = list()\n\n for item in sequence:\n if item not in item_counter:\n item_counter[item] = 1\n else:\n item_counter[item] += 1\n\n fo... | python | edit | 1 | 4 | mit | 0600f3a4f9e13ac0a2a2b4d542db949f90e4185c | erocs/2017Challenges,popcornanachronism/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,popcornanachronism/2017Challenges,DakRomo/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,erocs/2017Challenges,DakRomo/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,DakRomo/2017... | challenge_2/python/ning/challenge_2.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Here we use the camhd module to write a single-frame AVI file, only\n# downloading data from the moov atom and one frame. This AVI file can\n# easily be converted to a PNG or losslessly to a raw YUV using ffmpeg.\n#... | python | edit | 1 | 0 | mit | 49f3d4d168fa62b545aa308684667c355db5c9d8 | tjcrone/pycamhd | examples/write_avi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (0, 5, 3, 'final', 0)\n\ndef get_version():\n version = '%s.%s' % (VERSION[0], VERSION[1])\n if VERSION[2]:\n version = '%s.%s' % (version, VERSION[2])\n if VERSION[3:] == ('alpha', 0):\n version = '%s pre-a... | python | edit | 1 | 4 | bsd-3-clause | 415c9bd14016453d474901fe16f2da8246b44e1b | ofirr/dojango,ofirr/dojango,william-gr/dojango,ofirr/dojango,william-gr/dojango,ricard33/dojango,ricard33/dojango,klipstein/dojango,ricard33/dojango,william-gr/dojango,klipstein/dojango | dojango/__init__.py | rejected_duplicate | Near-duplicate of sample 2776 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose2.plugins.loader import functions\nfrom nose2.tests._common import TestCase\n\n\nclass TestGeneratorUnpack(TestCase):\n tags = ['unit']\n\n def setUp(self):\n self.expect = [(0, ('call', (0, 1))),\n ... | python | edit | 1 | 2 | bsd-2-clause | 4f70897d5a85f1822a93df9bc91979ea79594901 | ojengwa/nose2,ojengwa/nose2,leth/nose2,little-dude/nose2,ptthiem/nose2,ezigman/nose2,ezigman/nose2,ptthiem/nose2,leth/nose2,little-dude/nose2 | nose2/tests/unit/test_generators_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\n# Like mkdir, but also make intermediate directories if necessary.\n# It is not an error if the given directory already exists (as long\n# as it is a directory).\n# Errors are not treated specially -- you just get ... | python | edit | 2 | 3 | mit | 540b7cbcf51745e7a7eddb5f0030bc9f52dab35a | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Demo/scripts/makedir.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass Profile(models.Model):\n user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True)\n activation_code = models.CharField(max_... | python | edit | 1 | 3 | mit | bd850668e2c599abcf110c5e3ebb65b79ee91e22 | xp2017-hackergarden/server,xp2017-hackergarden/server,xp2017-hackergarden/server,xp2017-hackergarden/server | xpserver_web/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..converter import KnowledgePostConverter\n\nfrom .html import HTMLConverter\n\n\nclass PDFConverter(KnowledgePostConverter):\n '''\n Use this as a template for new KnowledgePostConverters.\n '''\n _registry_keys = ['pdf']\... | python | edit | 1 | 1 | apache-2.0 | 36e0821fcd871935e48ae10926be7594d42f13b8 | airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo,airbnb/knowledge-repo | knowledge_repo/converters/pdf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nHelpers.\n\"\"\"\n\n\ndef cached(f):\n \"\"\"\n Cache decorator for functions taking one or more arguments.\n :param f: The function to be cached.\n :return: The cached value.\n \"\"\"\n class CachedDict(dict):\n ... | python | edit | 1 | 2 | mit | afdab20403a360508bced14f4750dd6ef4e6aa57 | viniciuschiele/flask-apidoc | flask_apidoc/utils.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.