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\ndef test_normal():\n pass\n\ndef test_gosper():\n pass\n\n```\n\nApply this change: Add test for part of gosper's algorithm."
},
{
"role": "assistant",
"content": "from sympy import Symbol, normal\nfrom sympy.abc import n\... | python | edit | 3 | 1 | bsd-3-clause | d656c0117e8487b8b56b4ee3caceb2dcb38ec198 | abhiii5459/sympy,mafiya69/sympy,atreyv/sympy,wanglongqi/sympy,pandeyadarsh/sympy,liangjiaxing/sympy,srjoglekar246/sympy,Sumith1896/sympy,bukzor/sympy,atsao72/sympy,sunny94/temp,moble/sympy,cccfran/sympy,yashsharan/sympy,drufat/sympy,maniteja123/sympy,AunShiLord/sympy,shikil/sympy,pandeyadarsh/sympy,Davidjohnwilson/symp... | sympy/concrete/tests/test_gosper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom os import environ as env\n\n__all__ = []\n\n_log_level_default = logging.WARN\n_log_level = getattr(logging, env.get('GHTOOLS_LOGLEVEL', '').upper(), _log_level_default)\n\nlogging.basicConfig(format='%(levelname)s: %(m... | python | edit | 1 | 0 | mit | 4f903a6b974fafba7c4a17b41e0a75b6b62209b3 | alphagov/ghtools | ghtools/command/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand, CommandError\nfrom match.models import User\n\nimport csv\nimport sys\n\nclass Command(BaseCommand):\n help = 'Import a list of users from stdin'\n\n def handle(self, *args, **optio... | python | edit | 3 | 2 | mit | bc6e6f0faec8405849c896b0661c181e9853359d | maxf/address-matcher,maxf/address-matcher,maxf/address-matcher,maxf/address-matcher | match/management/commands/import-users.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date, timedelta\n\nclass DateWithCalendar(object):\n def __init__(self, calendar_class, date):\n self.calendar = calendar_class\n self.date = date\n\n def convert_to(self, calendar):\n return ... | python | edit | 1 | 4 | apache-2.0 | 00103355232a0efb76f401dbec3ab4f8be32526a | jwg4/calexicon,jwg4/qual | qual/calendar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nfrom lenrmc.nubase import System\nfrom lenrmc.terminal import TerminalView\n\n\nclass App(object):\n\n def __init__(self, **kwargs):\n self.kwargs = kwargs\n\n def run(self):\n s = System.parse(self.kw... | python | edit | 1 | 2 | mit | bcb84a5b85259644ec0949f820ac1ed8f03d1676 | emwalker/lenrmc | scripts/reactions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django.test import Client, TestCase\nfrom django.core.urlresolvers import reverse\nfrom django.core.management import call_command\n\nimport views\n\n\nclass DocsTestCase(TestCase):\n\n def setUp(self):\n self.cl... | python | edit | 1 | 3 | mit | c4cd02672c81a486f6397ea099b9ed1e95b05df6 | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | docs/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cc.license.interfaces import ILicenseFormatter\nimport zope.interface\n\nclass Formatter(object):\n zope.interface.implements(ILicenseFormatter)\n id = \"HTML + RDFa formatter\"\n def format(self, license, work_dict = {}, loca... | python | edit | 2 | 1 | mit | 8e01ce70a76811152a86c461fc7235a58dc7f5e3 | creativecommons/cc.license,creativecommons/cc.license | cc/license/formatters/rdfa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from functools import total_ordering\nexcept ImportError:\n # Use Python 2.6 port\n from total_ordering import total_ordering\n\n\n@total_ordering\nclass Infinity(object):\n \"\"\"\n An object that is greater than any ... | python | edit | 3 | 3 | bsd-3-clause | 952550b344e96236995ac72eaa0777fd356f21e2 | kvesteri/infinity | infinity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport json\nimport time\n\nimport SocketExtend as SockExt\nimport config as conf\nimport parser as p\n\ndef ping(sock):\n\ttry:\n\t\trand = random.randint(1, 99999)\n\t\tdata = {'request':'ping', 'contents': {'value':rand}}\... | python | edit | 3 | 4 | bsd-2-clause | 4334cbf05da1c1f6a6a984e1a062a7e8f252b664 | mavroudisv/Crux | components/includes/utilities.py | rejected_duplicate | Near-duplicate of sample 12379 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom utils.summary_downloader import SummaryDownloader\n\nif __name__ == '__main__':\n\n # setting target dir and time interval of interest\n tgt_dir = r\"D:\\nhl\\official_and_json\\2... | python | edit | 1 | 0 | mit | c538e1a673e208030db04ab9ad3b97e962f3e2ac | leaffan/pynhldb | download_summaries.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\nfrom . import views\n\nurlpatterns = patterns('',\n url(\n regex=r'^step([1234])/$',\n view=views.edit_initial_config,\n name='initialconfig'\n ),\n url(r'^debug/st... | python | edit | 1 | 0 | bsd-3-clause | c55d0ff6071c5b96125160da1e911419ee70314c | Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto,Kvoti/ditto | ditto/configuration/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\nimport json\n\n\ndef _experiment_runner_path():\n this_path = os.path.dirname(os.path.realpath(__file__))\n return this_path + \"/../../target/release/experiments\"\n\n\ndef run_experiment(params):\n a... | python | edit | 1 | 2 | mit | 2f5417811eb8048659bd9b5408c721d481af4ece | Andlon/crest,Andlon/crest,Andlon/crest | tests/python-support/experiments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime_plugin\nfrom bower.utils.api import API\n\nclass InstallCommand(sublime_plugin.WindowCommand):\n def run(self, *args, **kwargs):\n self.list_packages()\n\n def list_packages(self):\n fileList = []\n ... | python | edit | 1 | 3 | mit | cc2fcbf73b0f3eb6ddfee2b55edc6239df3171e0 | benschwarz/sublime-bower,ebidel/sublime-bower | bower/commands/install.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use appropriate version naming scheme."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, print_function\n\n__version__ = '1.0.dev0'\n"
}
] | python | new_file | 1 | 0 | mit | fcfc9165526daf69d73a3822684efb8098fbb9d1 | catch22/moment_polytopes | moment_polytopes/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\n\nEvent = namedtuple('Event', ['id', 'type', 'data'])\n\ndef parse(source):\n eid = None\n etype = None\n data = []\n retry = None\n extra = ''\n\n dispatch = False\n lines = sou... | python | edit | 1 | 15 | apache-2.0 | 4178bb331014089c69df81b8a99204c94b6e200f | tOkeshu/eventsource-parser | eventsource_parser.py | rejected_complexity | Cyclomatic complexity too high: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nVERSION = (1, 0, 'alpha', 14)\n\n\ndef get_version(join=' ', short=False):\n \"\"\"\n Return the version of this package as a string.\n\n The version number is built from a ``VERSION`` tuple, which should consist\n of integers, ... | python | edit | 1 | 8 | bsd-3-clause | 969a36dc68ba9675b790f6712405ceb272cf7cbd | emschorsch/easy-thumbnails,siovene/easy-thumbnails,jrief/easy-thumbnails,Mactory/easy-thumbnails,jrief/easy-thumbnails,jaddison/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,sandow-digital/easy-thumbnails-cropman,emschorsch/easy-thumbnails,SmileyChris/easy-thumbnails | easy_thumbnails/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\n\n\nif settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql':\n from django.contrib.postgres.fields import JSONFie... | python | edit | 1 | 1 | bsd-3-clause | dd9fb6cf515d9e7ceb26cc6f7e8fd869d721552c | divio/django-shop,khchine5/django-shop,nimbis/django-shop,khchine5/django-shop,khchine5/django-shop,awesto/django-shop,khchine5/django-shop,awesto/django-shop,awesto/django-shop,divio/django-shop,nimbis/django-shop,divio/django-shop,nimbis/django-shop,nimbis/django-shop | shop/models/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# importing modules/ libraries\nimport pandas as pd\nimport random\n\n# loading the data\naisles_df = pd.read_csv('Data/aisles.csv')\nprint(aisles_df.head())\n\ndepartments_df = pd.read_csv('Data/departments.csv')\nprint(departments_df.head... | python | edit | 1 | 0 | mit | 5e3a9ad00558547475e7b5674bb623cafc99643a | rjegankumar/instacart_prediction_model | data_exploration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom shortuuid.main import (\n encode,\n decode,\n uuid,\n random,\n get_alphabet,\n set_alphabet,\n ShortUUID,\n)\n\n__version__ = \"0.4.2\"\n\n```\n\nApply this change: Change to the correct version."
},
{
"ro... | python | edit | 9 | 0 | bsd-3-clause | adc5c00f5496fed8b0b1b4c523737cfbaf688945 | skorokithakis/shortuuid,stochastic-technologies/shortuuid | shortuuid/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n__all__ = ('to_bool', 'ConfigPropertyList')\n\nfrom kivy.properties import ConfigParserProperty\nfrom re import compile, split\nfrom functools import partial\n\nto_list_pat = compile(', *')\n\n\ndef to_bool(val):\n '''\n Takes anyth... | python | edit | 1 | 5 | mit | 3c1203d5f4665873e34de9600c6cf18cbd7f7611 | matham/moa | moa/tools.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\"\"\"\nflask_hal.document\n==================\n\nModule for constructing ``HAL`` documents.\n\nExample:\n >>> from flask_hal.document import Document\n >>> d = Document()\n >>> d.to_dict... | python | edit | 1 | 3 | unlicense | c367d96cdfb7991cbabb38950cf08207f0662f20 | thisissoon/Flask-HAL,thisissoon/Flask-HAL | flask_hal/document.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom zeus.config import db, nplusone\nfrom zeus.models import Build, ItemStat, Revision\nfrom zeus.pubsub.utils import publish\n\nfrom .base_build import BaseBuildResource\nfrom ..schemas import BuildSchema\n\nbuild_schema = BuildSchema()\n... | python | edit | 1 | 4 | apache-2.0 | 0a7b83a2866b3988d7718efa8f7798fa9052f7ae | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | zeus/api/resources/build_details.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\nfrom django.utils.translation import gettext_lazy as _\n\n\nclass FormDesignerConfig(AppConfig):\n name = \"form_designer\"\n verbose_name = _(\"Form Designer\")\n\n```\n\nApply this change: Set the ... | python | edit | 1 | 0 | bsd-3-clause | b80e1facf3c47364384fa04f764838ba1b8cb55c | feincms/form_designer,feincms/form_designer | form_designer/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport imp\nimport json\nimport os\nimport sys\n\n\nclass Dot(dict):\n\n def __init__(self, d):\n super(dict, self).__init__()\n for k, v in d.iteritems():\n if isinstance(v, dict):\n self[k] = Dot... | python | edit | 1 | 5 | mit | 4c84dafeca9977543824653e354f113b5142d259 | kragniz/json-sempai | jsonsempai.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\ndef extract_function_names(module):\n '''\n extract function names from attributes of 'module'.\n '''\n from importlib import import_module\n\n mod = import_module(module.__... | python | edit | 1 | 2 | mit | 9c176de1fd280e72dd06c9eaa64060e52abca746 | koji-kojiro/matplotlib-d | python/prebuild.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\nfrom mail import models as mail_api\nfrom groups import models as group_api\nfrom mailgun import api as mailgun_api\n\ndef send_email( email_uri ):\n \"\"\" Send the email to the intended target audien... | python | edit | 1 | 4 | mit | d0f2b11fb67655b884f298bd8c1bf6be8396de4f | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | mail/email.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport email\nfrom os.path import dirname, join\n\nfrom django.utils import six\nfrom django_mailbox.models import Mailbox\n\nfrom feder.letters.signals import MessageParser\n\n\nclass MessageMixin(object):\n def setUp(self):\n se... | python | edit | 1 | 4 | mit | e21fd90de3b97f3ea2564a8d2c35351f2136b4e5 | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | feder/letters/tests/base.py | rejected_duplicate | Near-duplicate of sample 3266 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom .connectors import (GithubConnector, S3Connector,\n BaltradFTPConnector, LocalConnector)\nfrom .transporters import (BaltradToS3, LocalToS3)\nfrom .s3enram import S3EnramHandler\nfrom .utils import (parse_file... | python | edit | 13 | 0 | mit | 48ff585da5f499abeedb73d1e131a6d488644a05 | enram/infrastructure,enram/data-repository,enram/data-repository,enram/data-repository,enram/data-repository,enram/infrastructure | file_transfer/datamover/__init__.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#--coding:utf-8--\nimport getpass\nimport keyring\n\nn = int(raw_input(\"Number of Accounts: \"))\nkeyring.set_password('FbSpider', 'Account', n)\nfor i in range(0, n):\n Email = raw_input(\"Email: \")\n keyring.set_password('FbSpider... | python | edit | 3 | 0 | mit | 37c0969db4459162b35b76da4142c290bd4a2fc7 | nday-dev/FbSpider | Utilities/DefaultLoginInfoSetter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef read_map_file(map_name):\n \"\"\" Load map data from disk. \"\"\"\n root = os.path.dirname(os.path.abspath(__file__))\n map_path = os.path.join(root, 'maps', map_name + '.txt')\n\n print('Loading map file [{}]'.... | python | edit | 1 | 3 | mit | cdd8b6a7b669dc81e360fa1bcc9b71b5e798cfd5 | supermitch/mech-ai,supermitch/mech-ai,supermitch/mech-ai | map_loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import (\n get_object_or_404, redirect, render)\nfrom django.views.generic import View\n\nfrom .forms import ExampleForm\nfrom .models import ExampleModel\n\n\nclass ModelDetail(View):\n\n def get(self, request, ... | python | edit | 1 | 2 | bsd-2-clause | 043b5e7026663c8fdae8df4f27d3887ef881d405 | jambonrose/djangocon2015-views,jambonrose/djangocon2015-views | src/viewsapp/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom getpass import getpass\n\n\nclass CLIInput():\n def get_user_name(self):\n return input('user name: ')\n\n def get_password(self):\n return getpass()\n\n def entry_selector(self, entries):\n ... | python | edit | 1 | 5 | mit | 8be701cabf05e62385f5cc2eaf008b0d0da93d9c | meganehouser/pww | pww/inputs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\nfrom ..assets import build_asset\nfrom ..exceptions import FileNotFound\nfrom .base import BaseProcessor\n\n\nURL_RE = re.compile(r\"\"\"url\\((['\"]?)\\s*(.*?)\\s*\\1\\)\"\"\")\n\n\ndef rewrite_paths(source, func):\n ... | python | edit | 1 | 2 | isc | 59426d66a252a5f53fab2d56d1f88883b743f097 | gears/gears,gears/gears,gears/gears | gears/processors/hexdigest_paths.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# A patched version of QMessageBox that allows copying the error\n\nfrom ...external.qt import QtGui\n\n__all__ = ['QMessageBoxPatched']\n\n\nclass QMessageBoxPatched(QtGui.QMessageBox):\n\n def __init__(self, *args, **kwargs):\n\n ... | python | edit | 1 | 1 | bsd-3-clause | 0eb1b641f55a43e83ccc098a0ee33ec2620a86ce | JudoWill/glue,stscieisenhamer/glue,stscieisenhamer/glue,saimn/glue,saimn/glue,JudoWill/glue | glue/utils/qt/qmessagebox_widget.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass HttpResponse(object):\n\n def __init__(self):\n self.body = ''\n self.headers = {}\n self.status_code = 200\n self.status_string = 'OK'\n self.version = 'HTTP/1.1'\n\n def to_string(self):\n ... | python | edit | 1 | 3 | apache-2.0 | 8aed9b9402446a311f1f3f93c9bac4416ea114d9 | USMediaConsulting/pywebev | server/response.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2007-2009 Christopher Lenz\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as part of this distribution.\n\nimport uuid\... | python | edit | 2 | 4 | bsd-3-clause | 14b9ed3052054cf983fe6b7b1903faca3f1a0a13 | djc/couchdb-python,djc/couchdb-python,infinit/couchdb-python,Roger/couchdb-python | couchdb/tests/testutil.py | rejected_duplicate | Near-duplicate of sample 375 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nSECRET_KEY = 'SEKRIT'\n\nINSTALLED_APPS = (\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.auth',\n 'django.contrib.admin',\n 'tests',\n)\n\nROOT_URLCONF = 'tests.urls'\nDATABASES = {\n 'de... | python | edit | 1 | 0 | mit | d93628d8cc63301148a139a6c1c354620e5e57d1 | suutari-ai/django-enumfields,jackyyf/django-enumfields,bxm156/django-enumfields,jessamynsmith/django-enumfields | tests/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport logbook\n\nLOG_LEVEL = logbook.DEBUG\n\nDATE_TIME_FORMAT = '%Y-%m-%d %H:%M'\n\nAUTO_INGEST = False\n```\n\nApply this change: ENH: DEBUG level can be easily overriden from the local environment"
},
{
... | python | edit | 1 | 0 | apache-2.0 | 12d5915c8ee3503770c387b0b6d623e53aef4915 | enigmampc/catalyst,enigmampc/catalyst | catalyst/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\n\n\ndef read_node_status():\n process = subprocess.Popen('pestat -f', shell=True,\n stdout=subprocess.PIPE)\n process.wait()\n return process.stdout\n\nif __name__ == '__main__':\n ... | python | edit | 2 | 1 | mit | 7af01726bbfe1474efdb0fdca58ce83975e6918e | Johanu/submit_mpi | submit_mpi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom indra.java_vm import autoclass, JavaException\n\nclass ReachReader(object):\n \"\"\"The ReachReaader wraps a singleton instance of the REACH reader.\n\n This allows calling the reader many times without having to wait for it to\n... | python | edit | 1 | 4 | bsd-2-clause | e7a6c4f669c31bc25ac0eb738e9b6584793db5dc | johnbachman/belpy,bgyori/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,jmuhlich/indra,pvtodorov/indra,johnbachman/belpy,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/belpy,jmuhlich/indra,bgyori/indra,sorgerlab/indra,jmuhlich/indra,sorgerlab/indra,jo... | indra/reach/reach_reader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\n\nclass Core(object):\n \"\"\"\n The core of the Romaine, provides BDD test API.\n \"\"\"\n # All located features\n feature_file_paths = []\n instance = None\n\n def __init__(self):\n \"\"\"\n ... | python | edit | 1 | 3 | mit | 66a6d66ccdc14ca5ad8c2870b18318c5c94524c6 | trojjer/romaine,london-python-project-nights/romaine,london-python-project-nights/romaine | src/romaine/core.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Project: retdec-python\n# Copyright: (c) 2015 by Petr Zemek <<EMAIL>> and contributors\n# License: MIT, see the LICENSE file for more details\n#\n\n\"\"\"Tests for the library and tools.\"\"\"\n\nimport abc\n\n\nclass Matcher(metac... | python | edit | 1 | 5 | mit | f1a5b1b9c5d56c12292ac2cdd42c2b7eff2dc1fc | s3rvac/retdec-python | tests/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.db import models\n\n\nclass HashTag(models.Model):\n # The hash tag length can't be more than the body length minus the `#`\n text = models.CharField(max_length=139)\n\n def __str__(sel... | python | edit | 1 | 1 | mit | 9120cfa9bb31e1cca5adba77ac7a872ed3b8dc99 | pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone | tweets/models.py | rejected_duplicate | Near-duplicate of sample 982 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\nimport re\nimport os\nimport sys\n\n# Regex for matching URLs\n# See https://mathiasbynens.be/demo/url-regex\nurl_regex = re.compile(r\"((https?|ftp)://(-\\.)?([^\\s/?\\.#-]+\\.?)+(/[^\\s]*)?)\")\n\nansi_escape_regex = re.co... | python | edit | 1 | 3 | mit | 38bb089a4885053c2058ba65ea9380fcc7c99f62 | victal/ulp,victal/ulp | ulp/urlextract.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Useful functions.\"\"\"\n\nimport numpy as _np\n\n\ndef polyfit(x, y, monomials, algorithm='lstsq'):\n \"\"\"Implement Custom polyfit.\"\"\"\n X = _np.zeros((len(x), len(monomials)))\n N = _np.zeros((len(x), len(monomials)))\... | python | edit | 1 | 1 | mit | fd4dc4bdd32283b67577630c38624d3df705efd3 | lnls-fac/mathphys | mathphys/functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2013 SignalFuse, Inc.\n#\n# Docker container orchestration utility.\n\n\nclass MaestroException(Exception):\n \"\"\"Base class for Maestro exceptions.\"\"\"\n pass\n\n\nclass DependencyException(MaestroException):\n ... | python | edit | 1 | 0 | apache-2.0 | 32c7baf89057741a898b10a01a7535c4af3f41b3 | jorge-marques/maestro-ng,jorge-marques/maestro-ng,signalfuse/maestro-ng,signalfx/maestro-ng,Anvil/maestro-ng,Anvil/maestro-ng,ivotron/maestro-ng,signalfuse/maestro-ng,ivotron/maestro-ng,signalfx/maestro-ng,zsuzhengdu/maestro-ng,zsuzhengdu/maestro-ng | maestro/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import Employee\nfrom rest_framework import serializers\n\n\nclass EmployeeSerializer(serializers.ModelSerializer):\n class Meta:\n model = Employee\n depth = 1\n fields = ('pk',\n 'user... | python | edit | 1 | 0 | apache-2.0 | 4a0516e6f7abee9378a5c46b7a262848a76d7f49 | belatrix/BackendAllStars | employees/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Wemo proxy code.\"\"\"\n\nimport logging\nimport sys\nimport threading\n\nfrom wemo import upnp\n\nclass Wemo(object):\n \"\"\"Hue proxy object.\"\"\"\n\n def __init__(self, refresh_period, callback):\n self._refresh_period = ref... | python | edit | 4 | 3 | mit | 0fb6842a85056b16b4bc4f4d48edcc4b0d749b94 | tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation | src/pi/wemo_proxy.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.assets import Environment, Bundle\n\napp = Flask(__name__, static_folder=None)\napp.config.from_pyfile('config.py')\n\n# Route static folder to /static in dev\n# and a subdomain in production\napp.sta... | python | edit | 3 | 0 | mit | abf48b4c3ab7c78e44bc2d28ef6f3271c00abc42 | joealcorn/yl.io,joealcorn/yl.io | ylio/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\n\nfrom jmbo.urls import v1_api\nfrom jmbo.views import ObjectDetail\n\nfrom post.api import PostResource\n\n\nv1_api.register(PostResource())\n\n# xxx: may need to include ckeditor urls h... | python | edit | 3 | 0 | bsd-3-clause | c3c1234fb566ad20d7e67e55f8d8d908dbda55ad | praekelt/jmbo-post,praekelt/jmbo-post | post/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# These are the functions that can be accessed from epydemiology.\r\n# Other functions that are used internally cannot be accessed\r\n# directly by end-users.\r\nfrom .phjCalculateProportions import phjCalculateBinomialProportions\r\nfrom .... | python | edit | 23 | 0 | mit | 5ee949626b2d5b132f8ec1ce7d597a7ad401cfa5 | lvphj/epydemiology | epydemiology/__init__.py | rejected_lint | Too many lint violations: 23 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.8.5'\n\n```\n\nApply this change: Increment patch version to 0.8.6"
},
{
"role": "assistant",
"content": "\"\"\"yolk.\n\nA... | python | edit | 1 | 0 | bsd-3-clause | d002011c68032dc2255f83f39c03da61c3f72525 | myint/yolk,myint/yolk | yolk/__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\nimport argparse\nimport mm1\nimport sim\nimport time\n\n\n### Parse command line arguments\nparser = argparse.ArgumentParser(description=\"M/M/1 queue simulation -- Main script\")\nparser.add_argu... | python | edit | 1 | 0 | mit | 9bc3b7b24e185b1dd8bf8f979c8341fb332a401f | kubkon/des-in-python | mm1_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tensorflow as tf\n\nfrom ..embedding import embeddings_to_embedding, ids_to_embeddings, embeddings\nfrom ..linear import linear\nfrom ..dropout import dropout\n\n\n\ndef char2doc(forward_document,\n backward_document,\n ... | python | edit | 1 | 1 | unlicense | 63109e4d91f66c135c634752d3feb0e6dd4b9b97 | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/models/char2doc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nfrom Tkinter import *\n\nmainWindow = Tk()\n\nwindowWidth = 700\nwindowHeight = 600\nscreenXpos = (mainWindow.winfo_screenwidth() / 2) - (windowWidth / 2)\nscreenYpos = (mainWindow.winfo_screenheight() / 2) - (windowHeight / 2)\... | python | edit | 12 | 1 | mit | 76bc58d577e6d529dff3fc770667897bc48f6bfc | donnell74/CSC-450-Scheduler | mainPage.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\nfrom ..sources import channelarchiver as ca\nfrom ..sources import switch\nfrom ..broker.simple_broker import POPULAR_CHANNELS\n\n\nclass TestBroker(un... | python | edit | 3 | 2 | bsd-3-clause | 051695d90b241323e650cd4931187de1750d924b | NSLS-II/dataportal,ericdill/datamuxer,ericdill/datamuxer,danielballan/datamuxer,danielballan/datamuxer,NSLS-II/datamuxer,danielballan/dataportal,tacaswell/dataportal,tacaswell/dataportal,ericdill/databroker,ericdill/databroker,danielballan/dataportal,NSLS-II/dataportal | dataportal/tests/test_broker.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import config\n\nimport requests\nfrom requests.exceptions import *\nimport hashlib, random\n\ndef run(options):\n ip = options['ip']\n port = options['port']\n\n test = random.choice(config.HTTPS_PAGES)\n\n try:\n ... | python | edit | 5 | 4 | mit | 1eb20f6d1a946acbf05be003c597e40aa1782b4d | ainterr/scoring_engine,ainterr/scoring_engine,ainterr/scoring_engine,ainterr/scoring_engine | engine/plugins/https.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# __BEGIN_LICENSE__\n# Copyright (C) 2008-2010 United States Government as represented by\n# the Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n# __END_LICENSE__\n\nfrom django.test import TestC... | python | edit | 2 | 1 | apache-2.0 | c297b219c7ae4f3e6ad3428425950c66f2832ff7 | xgds/xgds_video,xgds/xgds_video,xgds/xgds_video | xgds_video/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\ndef inPython3():\n return os.environ.get(\"CHECK_PYTHON3\",\"0\") == \"1\"\n\ndef checkForMissingModules():\n missing = []\n too_old = []\n to_try = [(\"numpy\",'numpy.version.version',\"1.7\"),\n ... | python | edit | 1 | 6 | apache-2.0 | eed413229978523b41a637c68c34100a31270643 | joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven,idaholab/raven,idaholab/raven,idaholab/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,joshua-cogliati-inl/raven,idaholab/raven | scripts/TestHarness/testers/RavenUtils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom address import has_reflection, is_compatible\n\n\nclass TestAddress(unittest.TestCase):\n def test_has_reflection(self):\n assert has_reflection(['mnop']) == False\n assert has_reflection(['abba', 'q... | python | edit | 1 | 1 | mit | 453abc420db1a9daf3b8d92d7f8ee8a8ace5bf9f | machinelearningdeveloper/aoc_2016 | 07/test_address.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\nimport json\nfrom os import path\n\nimport pytest\n\nfrom ethereum.tester import state, ABIContract\nfrom ethereum._solidity import get_solidity, compile_file\n\nSOLIDITY_AVAILABLE = get_solidity() is not None\nCONTR... | python | edit | 1 | 1 | mit | e152213012c95dd820b341d11d940a172ca467d0 | ethereum/pyethereum,ethereum/pyethereum,karlfloersch/pyethereum,karlfloersch/pyethereum | ethereum/tests/test_tester.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nimport click\nimport stripe\n\nfrom config import settings\nfrom catwatch.blueprints.billing.services import StripePlan\n\nfrom catwatch.app import create_app\n\napp = create_app()\n\n\n@click.group()\ndef cli():\n \"\"... | python | edit | 1 | 3 | mit | 11d25c3f4391d3e9eb95c5b8fb1a2b73cbf123a0 | nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask | cli/commands/cmd_stripe.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\n\nfrom paver.easy import *\n\n\ndef call(*args, **kwargs):\n return subprocess.call(args, **kwargs)\n\n\n@task\ndef push():\n \"\"\"Install the app and start it.\"\"\"\n call('palm-package', '.')\n call('palm-... | python | edit | 4 | 1 | mit | 6203b25a2d8d742f066917dd7e5f2c8dc0ee9e7c | markpasc/paperplain,markpasc/paperplain | pavement.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport openpnm as op\nfrom skimage.morphology import ball, disk\n\n\nclass CubicTemplateTest:\n def setup_class(self):\n pass\n\n def teardown_class(self):\n pass\n\n def test_2D_template(self):\n net = op.netw... | python | edit | 1 | 1 | mit | ade960c76de6773a176d2cd982ac9a26a2d072ae | TomTranter/OpenPNM,PMEAL/OpenPNM | tests/unit/network/CubicTemplateTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nScientific tests for SLCosmo package\n\"\"\"\nimport matplotlib\nmatplotlib.use('Agg')\nimport unittest\nimport desc.slcosmo\n\nclass SLCosmoScienceTestCase(unittest.TestCase):\n\n def setUp(self):\n self.message = 'Testin... | python | edit | 1 | 2 | bsd-3-clause | bb602407a176813cc1727423e1b344f0a1b0bea7 | DarkEnergyScienceCollaboration/SLCosmo,DarkEnergyScienceCollaboration/SLCosmo | tests/test_Science.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\nimport openid.urinorm\n\nclass UrinormTest(unittest.TestCase):\n def __init__(self, desc, case, expected):\n unittest.TestCase.__init__(self)\n self.desc = desc\n self.case = case\n ... | python | edit | 1 | 3 | apache-2.0 | 0925c1f2ab3332ddfaeefed81f379dc72dd41644 | misli/python3-openid,misli/python3-openid,moreati/python3-openid,misli/python3-openid,necaris/python3-openid,isagalaev/sm-openid,moreati/python3-openid,moreati/python3-openid,necaris/python3-openid | openid/test/test_urinorm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport kivy.core.window\nimport pentai.db.zodb_dict as z_m\n\nfrom pentai.gui.screen import Screen\n\nclass GoodByeScreen(Screen):\n def __init__(self, *args, **kwargs):\n super(GoodByeScreen, self).__init__(*args, **kwargs)\n ... | python | edit | 2 | 1 | mit | bb23c2bfa31913658b526b9dbaf812c749e9523c | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | pentai/gui/goodbye_screen.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom python_cowbull_game.GameController import GameController\nfrom python_cowbull_game.GameMode import GameMode\n\n\nclass ExtGameController(GameController):\n additional_modes = [\n# GameMode(mode=\"SuperTough\", priority=6, dig... | python | edit | 3 | 1 | apache-2.0 | c182e5c8cef76c852d7ae41c2fc8b8266f17c728 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | extensions/ExtGameController.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import models as auth_models\nfrom django.db import models\nimport facepy\nimport simplejson\n\nfrom facebook_auth import utils\n\nclass FacebookUser(auth_models.User):\n user_id = models.BigIntegerField(unique=T... | python | edit | 2 | 2 | mit | 10ae930f6f14c2840d0b87cbec17054b4cc318d2 | pozytywnie/django-facebook-auth,pozytywnie/django-facebook-auth,jgoclawski/django-facebook-auth,jgoclawski/django-facebook-auth | facebook_auth/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable-msg = unused-import\n\"\"\"\n*Main PhiFlow import:* `from phi.flow import *`\n\nImports important functions and classes from\n`math`, `geom`, `field`, `physics` and `vis` (including sub-modules)\nas well as the modules and... | python | edit | 50 | 0 | mit | 910d848f9c7ceb9133fe52c0c3f2df6c8ed4e4aa | tum-pbs/PhiFlow,tum-pbs/PhiFlow | phi/flow.py | rejected_lint | Too many lint violations: 50 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests concerned with the ``fab`` tool & how it overrides Invoke defaults.\n\"\"\"\n\nimport re\nimport sys\n\nfrom spec import Spec, trap, assert_contains\n\nfrom fabric.main import program\n\n\nclass Fab_(Spec):\n @trap\n def... | python | edit | 4 | 3 | bsd-2-clause | d09379bbc6898b696e762d1bb06404eb613c59f3 | fabric/fabric | tests/main.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .parameters import (Alfven_speed,\n ion_sound_speed,\n electron_thermal_speed,\n ion_thermal_speed,\n electron_gyrofrequency,\n ... | python | edit | 18 | 0 | bsd-3-clause | 44f232e179a2fe152ef6a7aa9e6e5cd52a4f201e | StanczakDominik/PlasmaPy | plasmapy/physics/__init__.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom frigg_settings.helpers import FileSystemWrapper\n\n\ndef path(*args):\n return os.path.join(os.path.dirname(os.path.dirname(__file__)), *args)\n\n\ndef test_filesystemwrapper_list_files():\n wrapper = FileSystemWrapp... | python | edit | 1 | 1 | mit | a4d0bc42cf28351e24d6239f42b51c4cc77961ff | frigg/frigg-settings | tests/test_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .io import preprocess\nfrom .train import train\nfrom .network import autoencoder\nfrom .encode import encode\n\n\ndef autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,\n mask=None, type='normal', act... | python | edit | 3 | 1 | apache-2.0 | 6a410b9079cffec380ac44cf390be381be929e5d | theislab/dca,theislab/dca,theislab/dca | autoencoder/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright (c) 2014, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional ... | python | edit | 1 | 0 | bsd-3-clause | aaa74513f8b947cf542b59408816be9ed1867644 | jamesblunt/augmented-traffic-control,linearregression/augmented-traffic-control,biddyweb/augmented-traffic-control,beni55/augmented-traffic-control,linearregression/augmented-traffic-control,duydb2/ZTC,shinyvince/augmented-traffic-control,Endika/augmented-traffic-control,drptbl/augmented-traffic-control,shinyvince/augm... | atc/atcd/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version_info__ = (1, 3, 0, None)\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join(str(i) for i in __version_info__[:-1])\nif __version_info__[-1] is not None:\n __version__ += ('-%s' % (__v... | python | edit | 1 | 0 | apache-2.0 | 25fc6df856aa77dca6660eab7c1ce9d9e01fc2c4 | emory-libraries/django-eultheme,emory-libraries/django-eultheme,emory-libraries/django-eultheme | eultheme/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thinglang.thinglang import run\n\n\ndef test_simple_arrays():\n assert run(\"\"\"\nthing Program\n does start\n array names = [\"yotam\", \"andrew\", \"john\"]\n Output.write(names)\n\n \"\"\").output == \"\"\"['... | python | edit | 1 | 1 | mit | 21d940192fa390b1a2de3183e099194bceaeeafe | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/test_arrays.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nString/unicode helper functions\n\"\"\"\n\ndef safe_unicode(obj, *args):\n \"\"\" return the unicode representation of obj \"\"\"\n try:\n return unicode(obj, *args)\n except UnicodeDecodeError:\n # obj is byt... | python | edit | 4 | 2 | mit | c87be7a48d496cffe24f31ca46db0a7629a0b2a8 | aquatix/python-utilkit | utilkit/stringutil.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport unittest\nimport subprocess\n\nclass TestSimpleMapping(unittest.TestCase):\n def test_map_1_read(self):\n subprocess.run(['python', 'bin/sillymap', 'index', 'tests/test_data/reference.fa'])\n r... | python | edit | 1 | 1 | mit | 66289d6620758de0da80e91c6a492e39626c9029 | alneberg/sillymap | tests/integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nimport django\n\nfrom django.conf import settings\n\n\nDEFAULT_SETTINGS = dict(\n INSTALLED_APPS=[\n \"django.contrib.auth\",\n \"django.contrib.contenttypes\",\n \"dja... | python | edit | 1 | 4 | mit | 96513ab379341d6db0aa7ce16aa20b8d1a93dc69 | pinax/pinax-forums | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom mamba import describe, context, before\nfrom sure import expect\n\nfrom mamba.settings import Settings\n\nIRRELEVANT_SLOW_TEST_THRESHOLD = '0.1'\n\n\nwith describe('Settings') as _:\n @before.each\n def... | python | edit | 1 | 1 | mit | 1e3109f154ab86273996e4b598cea706c766cb8b | jaimegildesagredo/mamba,nestorsalceda/mamba,alejandrodob/mamba,angelsanz/mamba,eferro/mamba,markng/mamba,dex4er/mamba | spec/settings_spec.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nimport django\nfrom django.conf import settings\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif not settings.configured:\n settings.configure(\n ... | python | edit | 1 | 3 | mit | 0398c7539c1bebcaa6622576f4acef970394d6a7 | treyhunner/django-email-log,treyhunner/django-email-log | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef test_info(logged_rocket):\n info = logged_rocket.info().json()\n assert \"info\" in info\n assert info.get(\"success\")\n\n\ndef test_statistics(logged_rocket):\n statistics = logged_rocket.statistics().json()\n assert st... | python | edit | 1 | 1 | mit | 6e04a5c4953ef3fde5f2f5b3ef4f7fd8b7e8437e | jadolg/rocketchat_API | tests/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.test import TestCase\n\nfrom localized_fields.value import LocalizedValue\nfrom localized_fields.widgets import LocalizedFieldWidget\n\n\nclass LocalizedFieldWidgetTestCase(TestCase):\n \"\"\... | python | edit | 1 | 3 | mit | 0f08eb828091204c6131ee868a43f2a8f3ed73f4 | SectorLabs/django-localized-fields,SectorLabs/django-localized-fields,SectorLabs/django-localized-fields | tests/test_widget.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTo use Jedi completion in Python interpreter, add the following in your shell\nsetup (e.g., ``.bashrc``)::\n\n export PYTHONSTARTUP=\"$(python -m jedi repl)\"\n\nThen you will be able to use Jedi completer in your Python interpre... | python | edit | 1 | 0 | mit | ae8b0d5eab43a349f33d3eb907565cb2931e15cd | tjwei/jedi,mfussenegger/jedi,WoLpH/jedi,mfussenegger/jedi,jonashaag/jedi,flurischt/jedi,WoLpH/jedi,flurischt/jedi,jonashaag/jedi,dwillmer/jedi,dwillmer/jedi,tjwei/jedi | jedi/api/replstartup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .utils import TemplateTestCase, Mock\n\n\nclass BlockTagTest(TemplateTestCase):\n\n def test_block_parse(self):\n self.assertRendered('{% block name %}%{% endblock %}', '%')\n\n\nclass ForTagTest(TemplateTestCase):\n def t... | python | edit | 3 | 1 | mit | 497be50549e9c7b3a886a1d0753386d8f93cea2b | funkybob/knights-templater,funkybob/knights-templater | tests/test_blocks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright (c) 2005 rpath, Inc.\n#\n# All Rights Reserved\n#\n\n(\n USERNAME_ASC,\n USERNAME_DES,\n FULLNAME_ASC,\n FULLNAME_DES,\n CREATED_ASC,\n CREATED_DES,\n ACCESSED_ASC,\n ACCESSED_DES\n) = range(0, 8)\n\nb... | python | edit | 1 | 0 | apache-2.0 | e50333baa8390ae3bedb77f1442c9d90cf6ea4b0 | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | mint/userlisting.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nr\"\"\"\n===============================================================================\npore_centroid\n===============================================================================\n\n\"\"\"\nimport scipy as _sp\n\n\ndef voronoi(network... | python | edit | 1 | 3 | mit | d45df810c6ae9482f935ccfddef6c96438d893a3 | amdouglas/OpenPNM,PMEAL/OpenPNM,TomTranter/OpenPNM,stadelmanma/OpenPNM,amdouglas/OpenPNM | OpenPNM/Geometry/models/pore_centroid.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest.mock import MagicMock, patch\n\nimport pytest\nfrom hypothesis_auto import auto_pytest_magic\n\nimport isort.format\n\nauto_pytest_magic(isort.format.show_unified_diff)\n\n\ndef test_ask_whether_to_apply_changes_to_file():\n ... | python | edit | 1 | 1 | mit | f682e0bc4b8506a45846a74fe537917ba0ffd5bb | PyCQA/isort,PyCQA/isort | tests/test_format.py | rejected_duplicate | Near-duplicate of sample 8782 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom os.path import dirname, abspath\nimport sys\n\nfrom django.conf import settings\n\nif not settings.configured:\n from django import VERSION\n settings_dict = dict(\n INSTALLED_APPS=(\n '... | python | edit | 1 | 3 | mit | 51c5e4e1e670f52584c157330a9a3b910be92d57 | simonluijk/django-localeurl,jmagnusson/django-localeurl | runtests.py | rejected_duplicate | Near-duplicate of sample 12433 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\n\nfrom django.conf import settings\n\n\nif not settings.configured:\n settings.configure(\n DATABASES={\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n ... | python | edit | 1 | 2 | bsd-3-clause | 60ed71891d628989fa813f2f750e8cb9d1f19f9d | rochapps/django-secure-input,rochapps/django-secure-input,rochapps/django-secure-input | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nimport unittest\n\nfrom os.path import dirname, abspath\n\nimport tests\n\ndef runtests(*test_args):\n suite = unittest.TestLoader().loadTestsFromModule(tests)\n result = unittest.TextTestRunner(verb... | python | edit | 4 | 1 | mit | 1cccb432d0f7abc468a36a22ee5c9d3845fbd636 | giserh/peewee,coleifer/peewee,Dipsomaniac/peewee,coreos/peewee,d1hotpep/peewee,jarrahwu/peewee,mackjoner/peewee,d1hotpep/peewee,bopo/peewee,bopo/peewee,coleifer/peewee,jarrahwu/peewee,jnovinger/peewee,wenxer/peewee,coleifer/peewee,fuzeman/peewee,fuzeman/peewee,new-xiaji/peewee,wenxer/peewee,zhang625272514/peewee,Sunzhi... | runtests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n## \\package globals.fieldtests\n\n# MIT licensing\n# See: LICENSE.txt\n\n\nimport wx\n\n\n## Tests if a wx control/instance is enabled/disabled\n# \n# Function for compatibility between wx versions\n# \\param ... | python | edit | 1 | 4 | mit | 80aa4574da8754db544d66167b61823de1cbf281 | AntumDeluge/desktop_recorder,AntumDeluge/desktop_recorder | source/globals/fieldtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Donald Stufft\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.or... | python | edit | 1 | 0 | apache-2.0 | 5cbc6b6f6191d69879d9ab077b57bf2b4da04586 | dstufft/sessions | sessions/__about__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport sys\nimport boto3\n\ns3 = boto3.resource('s3')\nobject = s3.Bucket('ictrp-data').upload_file(sys.argv[1], sys.argv[1])\nobject.Acl().put(ACL='public-read')\n\n```\n\nApply this change: Fix failing attempt to set AC... | python | edit | 1 | 0 | mit | 7648ac7ae01ee6cde8871128e162e8a4d5322b87 | gertvv/ictrp-retrieval,gertvv/ictrp-retrieval | s3upload.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n'''\nMain driver of the program\n'''\nimport sys\nimport random\nimport os\nimport json\nimport argparse\nimport time\nimport getpass\nimport hashlib\nimport ast\nimport threading\nimport base6... | python | edit | 15 | 5 | mit | b52a23c87bed0370c41da39785812b9064688af0 | regexpressyourself/passman | passman/__main__.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport unittest\n\nimport sys; sys.path.append(\"../\")\nfrom Selector import Selector\n\nif __name__==\"__main__\":\n unittest.main()\n\n```\n\nApply this change: Add the most basic smoke test. We make a check that ... | python | edit | 2 | 1 | apache-2.0 | 7060e3f1b1e8bda4c96cdc4b0c84ae344ac81c76 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/MPS/test/test_Selector.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\nfrom flask import g, jsonify\nfrom gather.account.models import Account\nfrom gather.api import need_auth, EXCLUDE_COLUMNS\nfrom gather.extensions import api_manager\n\n\n__all__ = [\"bp\"]\n\n\ndef patch_single_pr... | python | edit | 1 | 3 | mit | 72068701db46dc3d66cde295187b7d167cbfd880 | whtsky/Gather,whtsky/Gather | gather/account/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nclass Category(models.Model):\n name = models.CharField(max_length=50)\n number = models.CharField(max_length=50, unique=True)\n \n def __str__(self):\n return self.number\n\n\nclass Subcat... | python | edit | 2 | 1 | mit | 265e169570db18b53b86a55b94871f1eb25dfd4d | m1k3r/gvi-accounts,m1k3r/gvi-accounts,m1k3r/gvi-accounts | gvi/transactions/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ofp_app import ofp_app, ofp_run\nimport asyncio\n\n\napp = ofp_app('conntest')\n\n\n@app.event('start')\nasync def start(_):\n while True:\n await asyncio.sleep(1)\n # Obtain a list of connections.\n conns = awa... | python | edit | 1 | 4 | mit | b60e76f6d6c5363ed4d07b43338911b3cdb8ca39 | byllyfish/pylibofp,byllyfish/pylibofp | ofp_app/demo/conntest.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.