messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom itest_utils import wait_for_marathon\nfrom itest_utils import print_container_logs\n\n\ndef before_all(context):\n wait_for_marathon()\n\n\ndef after_scenario(context, scenario):\n \"\"\"If a marathon client object... | python | edit | 3 | 6 | apache-2.0 | 8ae763c69bbba11a264f8404b8189a53c63d4f40 | Yelp/paasta,gstarnberger/paasta,gstarnberger/paasta,Yelp/paasta,somic/paasta,somic/paasta | marathon_itests/environment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom asciisciit import conversions as conv\nimport numpy as np\n\n\ndef test_lookup_method_equivalency():\n img = np.random.randint(0, 255, (300,300), dtype=np.uint8)\n\n pil_ascii = conv.apply_lut_pil(img)\n np_ascii = conv.apply_... | python | edit | 1 | 1 | mit | eaa4de2ecbcf29c9e56ebf2fa69099055e469fbc | derricw/asciisciit | tests/test_conversion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport queue\nimport threading\nfrom multiprocessing import Queue\n\n\nclass ThreadPool():\n\n def __init__(self, processes=20):\n self.processes = processes\n self.threads = [Thread() for _ in range(0, processes)]\n ... | python | edit | 1 | 5 | apache-2.0 | 0f49230309ac115ff78eddd36bcd153d7f3b75ea | uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics,uw-it-aca/canvas-analytics | data_aggregator/threads.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport matplotlib\n# Do not use X for plotting\nmatplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.dates import DateFormatter\nfrom matplotlib.ticker import FormatStrFormatter\nfrom tempfile import NamedTemporaryFile\... | python | edit | 1 | 1 | mit | 37588d466928e9f25b55d627772120f16df095ec | cjluo/money-monkey | model_presenter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url \nfrom . import views \n\nurlpatterns = [\n url(r'^$', views.index, name='index'),\n url(r'^textinput', views.textinput, name='textinput'),\n url(r'^featureoutput', views.featureoutput, name='featur... | python | edit | 1 | 0 | mit | b722fe0d5b84eeb5c9e7279679826ff5097bfd91 | CS326-important/space-deer,CS326-important/space-deer | contentdensity/textifai/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import MagicMock\nfrom django.core.exceptions import PermissionDenied\nfrom django.test import TestCase\nfrom accounts.tests.factories import UserFactory\nfrom ..utils import ProjectAccessMixin\nfrom ..models import Project\nfrom ... | python | edit | 3 | 1 | mit | 17c90fd954441c2623495e50a2f89790e1ff5489 | nvbn/coviolations_web,nvbn/coviolations_web | projects/tests/test_tools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nfrom .common import Benchmark\n\nimport numpy as np\n\n\nclass Random(Benchmark):\n params = ['normal', 'uniform', 'weibull 1', 'binomial 10 0.5',\n 'poisso... | python | edit | 1 | 2 | bsd-3-clause | 931e2d1e8ba3fd6b129a6d74e3a1ad9984c1938a | shoyer/numpy,Dapid/numpy,jakirkham/numpy,WarrenWeckesser/numpy,chatcannon/numpy,WarrenWeckesser/numpy,b-carter/numpy,anntzer/numpy,ssanderson/numpy,simongibbons/numpy,nbeaver/numpy,SiccarPoint/numpy,numpy/numpy,Eric89GXL/numpy,kiwifb/numpy,seberg/numpy,rgommers/numpy,ESSS/numpy,shoyer/numpy,anntzer/numpy,utke1/numpy,dw... | benchmarks/benchmarks/bench_random.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/home/daniel/Software/anaconda3/bin/python\n\n# Import modules for CGI handling\nimport cgi, cgitb\nfrom abundanceDriver import abundancedriver\nfrom emailSender import sendEmail\n\n\ndef cgi2dict(form):\n \"\"\"Convert the form from c... | python | edit | 3 | 2 | mit | 12d22221df5786caee510cc167c9ef29f9155488 | DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web | var/www/cgi-bin/abundanceConf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom geom2d import *\n\nl1 = []\n\nfor i in range(-5, 6):\n l1.append(Point(i, i*i))\n\nl2 = []\n\nfor el in l1:\n l2.append(Point(el.x, -el.y))\n\nprint(l1)\nprint(l2)\n\n# List comprehension\nl1c = [Point(i, i*i) for i in range(-5, ... | python | edit | 3 | 0 | apache-2.0 | db08c5ae962c2e66c8ad2e668f530d08934200af | maciekp85/python-for-testers | geometry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport django.template\nimport django.template.loader\nimport pretend\n\n\ndef test_compile_filter(monkeypatch):\n\n compile_static = pretend.call_recorder(lambda source_path: \"compiled\")\n monkeypatch.setattr(\"static_precompiler.u... | python | edit | 1 | 1 | mit | c0d9a94899af84e8a075cfc7cfb054a934470e3a | liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,jaheba/django-static-precompiler,liumengjun/django-static-precompiler,jaheba/django-static-precompiler,jaheba/django-static-precompiler,jaheba/django-static-precompiler | static_precompiler/tests/test_templatetags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import task, run\n\n\n@task\ndef makerelease(ctx, version, local_only=False):\n if not version:\n raise Exception(\"You must specify a version!\")\n\n # FoodTruck assets.\n print(\"Update node modules\")\n run... | python | edit | 1 | 3 | apache-2.0 | c347e6e763b79a9c4af6d7776093ce9ed711c43d | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | monkeys/release.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nVERSION=\"0.1\"\n\ntry:\n long_description=open('DESCRIPTION.rst', 'rt').read()\nexcept Exception:\n long_description=\"Universal Analytics in Python; an implementation of Google's Universal Analytics M... | python | edit | 1 | 0 | bsd-3-clause | 7cca1f96abc8c5b4fed2984d5a1141ce14691187 | analytics-pros/universal-analytics-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport OpenPNM as op\nimport scipy as sp\nmgr = op.Base.Workspace()\nmgr.loglevel = 60\n\n\nclass OrdinaryPercolationTest:\n def setup_test(self):\n self.net = op.Network.Cubic(shape=[5, 5, 5])\n self.geo = op.Geometry.Tora... | python | edit | 1 | 1 | mit | 5d7806179d455073e020bdc6e6d0e7492f4e1d9e | TomTranter/OpenPNM,PMEAL/OpenPNM | test/unit/Algorithms/OrdinaryPercolationTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport webapp2\n\nfrom controllers.api.api_base_controller import ApiBaseController\n\nfrom helpers.model_to_dict import ModelToDict\n\nfrom models.match import Match\n\n\nclass ApiMatchControllerBase(ApiBaseController):\n\n ... | python | edit | 3 | 2 | mit | 82e82805eae5b070aec49816977d2f50ff274d30 | josephbisch/the-blue-alliance,bvisness/the-blue-alliance,bdaroz/the-blue-alliance,bvisness/the-blue-alliance,fangeugene/the-blue-alliance,1fish2/the-blue-alliance,phil-lopreiato/the-blue-alliance,synth3tk/the-blue-alliance,jaredhasenklein/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,phil-l... | controllers/api/api_match_controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\n\nfrom dmp import dmp\n\nusers = [\"adam\", \"ben\", \"chris\", \"denis\", \"eric\"]\nfile_types = [\"fastq\", \"fasta\", \"bam\", \"bed\", \"hdf5\", \"tsv\", \"wig\", \"pdb\"]\ndata_types = ['RNA-seq', 'MNase-Seq', 'ChIP-seq... | python | edit | 2 | 0 | apache-2.0 | 02ef7f864c437e92fd8f2734d8325cca843e6341 | Multiscale-Genomics/mg-dm-api,Multiscale-Genomics/mg-dm-api | test_loading.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\nversion = '0.1.0'\nname = 'apns-proxy-client'\nshort_description = 'Client library for APNs Proxy Server.'\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read(... | python | edit | 1 | 2 | bsd-2-clause | 02240275e9adba0c40f0b9a1f6d82e88272e71c8 | voyagegroup/apns-proxy-client-py | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setup.create_teams import migrate_teams\nfrom setup.create_divisions import create_divisions\n\n\nif __name__ == '__main__':\n # migrating teams from json file to database\n migra... | python | edit | 1 | 0 | mit | df000e724ce1f307a478fcf4790404183df13610 | leaffan/pynhldb | _setup_database.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 grp\nimport pwd\nimport inspect\nimport argparse\n\n\ndef list_all_users_in_group(groupname):\n \"\"\"Get list of all users of group.\n\n Get sorted list of all users of group ... | python | edit | 1 | 4 | cc0-1.0 | bbef6c5f235fc3320c9c748a32cb3af04d3903d1 | vazhnov/list_all_users_in_group | list_all_users_in_group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nsys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))\n\nfrom router import Router\nfrom views import IndexView, CurrentView, HistoryIndexView, HistoryView\n\nmount_path = '/tmp/gitfs/mnt'\n\nr... | python | edit | 1 | 0 | apache-2.0 | 5b819746a7cc768a461320c2e5de506bb477a641 | ksmaheshkumar/gitfs,PressLabs/gitfs,bussiere/gitfs,rowhit/gitfs,PressLabs/gitfs | gitfs/mount.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import getenv\n\nclass Config(object):\n DEBUG = False\n TESTING = False\n SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL')\n STRIP_WWW_PREFIX = True\n API_KEY = getenv('API_KEY')\n\nclass ProductionConfig(Config):\n ... | python | edit | 1 | 0 | mit | af17bc003e486f27d9801ae56bb2e91c4fe6abc0 | taeram/idiocy,taeram/idiocy,taeram/idiocy | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport fixture\n\n\ndef test_standard_verbosity():\n stderr = fixture.start_tangelo(stderr=True)\n stderr = '\\n'.join(stderr)\n\n assert 'TANGELO Server is running' in stderr\n assert 'TANGELO Hostname' in stderr\n fixture.s... | python | edit | 1 | 1 | apache-2.0 | 0381fe32664e246011d5917a81c81fce936ae364 | Kitware/tangelo,Kitware/tangelo,Kitware/tangelo | tests/tangelo-verbose.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nlogger = logging.getLogger(__name__)\nlogger.addHandler(logging.NullHandler())\n\nfrom . import *\n\n\n# Signals\nfrom .signal import (Signal, EpicsSignal, EpicsSignalRO)\n\n# Positioners\nfrom .positioner import Positione... | python | edit | 28 | 0 | bsd-3-clause | cfcee83354f4917e719c3ef4236a2644dc98e153 | dchabot/ophyd,dchabot/ophyd | ophyd/__init__.py | rejected_lint | Too many lint violations: 28 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import Counter\n\nhands = [line.split(' ') for line in open('p054_poker.txt')]\n\nvalues = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'T': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14}\nstraights = [(v, v - ... | python | edit | 1 | 6 | mit | 3a4ed7370455467240647a15a236c18012e9a5f1 | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | Problem054/Python/solution_1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#from twisted.words.xish import domish\n\nfrom base import *\nimport random\n\nimport bnw_core.bnw_objects as objs\n\n@require_auth\n@defer.inlineCallbacks\ndef cmd_on(request):\n \"\"\" Включение доставки сообще... | python | edit | 12 | 2 | bsd-2-clause | 6e3ddfc47487a8841a79d6265c96ba63005fccec | un-def/bnw,stiletto/bnw,un-def/bnw,stiletto/bnw,ojab/bnw,ojab/bnw,stiletto/bnw,un-def/bnw,ojab/bnw,stiletto/bnw,un-def/bnw,ojab/bnw | bnw_handlers/command_onoff.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport argparse\nimport numpy as np\n\nfrom utils.experiment import load_config, get_corpus\nfrom utils.controversialissues import perspective_jsd_matrix\n\nlogging.basicConfig(format='%(levelname)s : %(message)s', level=log... | python | edit | 3 | 0 | apache-2.0 | e3a07917ddda0bd9eb3254145342a3938c8e24a0 | NLeSC/cptm,NLeSC/cptm | cptm/experiment_calculate_perspective_jsd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework_httpsignature.authentication import SignatureAuthentication\n\nfrom keybar.models.user import User\n\n\nclass KeybarApiSignatureAuthentication(SignatureAuthentication):\n API_KEY_HEADER = 'X-Api-Key'\n\n def fetch_... | python | edit | 1 | 2 | bsd-3-clause | 587e22c86f8f811f94e1172a1f6cd60f3b0899de | keybar/keybar | src/keybar/core/auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask, render_template\nimport os\n\n\napp = Flask(__name__)\n\n@app.route('/')\ndef webprint():\n return(render_template('index.html'))\n\nif __name__ == \"__main__\":\n port = int(os.environ.get('PORT', 5000))\n ... | python | edit | 3 | 1 | mit | d81fe16eda36d3a5fa23d163de27bd46f84c4815 | fablabjoinville/groselha,fablabjoinville/groselha,fablabjoinville/groselha,fablabjoinville/groselha | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom .testing import *\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nADMINS = (\n ('CLA', '<EMAIL>'),\n)\n\nMANAGERS = ADMINS\n\nINSTALLED_APPS += ('django_jenkins',)\n\nJENKINS_TASKS = (\n 'django_jenkins.tasks.with_coverage... | python | edit | 3 | 0 | mit | 5fa43e2943c44223fc5d7d5414caca98e0be0a11 | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/settings/jenkins.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"Provide the empy templating engine.\"\"\"\n\nfrom __future__ import print_function\n\nimport os.path\n\nimport em\n\nfrom . import Engine\n\n\nclass SubsystemWrapper(em.Subsystem):\n\n \"\"\"Wrap EmPy's Subsy... | python | edit | 1 | 2 | mit | e8dc3b169d308e644efdebc25bcdc485aeb909ac | blubberdiblub/eztemplate | engines/empy_engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"empty message\n\nRevision ID: 0014_add_template_version\nRevises: 0013_add_loadtest_client\nCreate Date: 2016-05-11 16:00:51.478012\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '0014_add_template_version'\ndown_re... | python | edit | 3 | 1 | mit | a346eb2b19f3a0b72dc6565e9d0c4fabf3c5784a | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0014_add_template_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport foauth.providers\n\n\nclass Vimeo(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://vimeo.com/'\n docs_url = 'http://developer.vimeo.com/apis/advanced'\n category = 'Videos'\n\n # U... | python | edit | 1 | 2 | bsd-3-clause | d26b9d22363f9763f959332d07445a2a4e7c221c | foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org | services/vimeo.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\ntry:\n long_description = open(\"README.rst\").read()\nexcept IOError:\n long_description = \"\"\n\nsetup(\n name='odin',\n version='0.5.6',\n url='https://github.com/timsavage/o... | python | edit | 1 | 0 | bsd-3-clause | 596b71f3015235e34fa740875a565c9a82f46a6b | python-odin/odin | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport abc\n\n\ndef do_flow(flow, result=None):\n for item in flow:\n print(item, result)\n result = item(result)\n return result\n\n\nclass MapTask(object):\n\n def __init__(self, args, task):\n self.args = ar... | python | edit | 4 | 3 | bsd-3-clause | 91d104a25db499ccef54878dcbfce42dbb4aa932 | ionrock/taskin | taskin/task.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUpdates members and translations for all classes\n\nWhen LVF and LADL mappings change, everything under this change could change.\nWhen a frameset is hidden or shown, everything in that class could change.\nWhen the algorithm change... | python | edit | 3 | 2 | mit | ec1a25c541770a82953c743f13d525a447f3bd2d | aymara/verbenet-editor,aymara/verbenet-editor,aymara/verbenet-editor | syntacticframes_project/syntacticframes/management/commands/update_members_and_translations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix import errors from implicit-relative imports."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom .case_conversion import (\n camelcase, pascalcase, snakecase, dashcase, kebabcase, spinalc... | python | new_file | 13 | 0 | mit | 17655f4b099ac840712dd95ad989f7b41301b83c | AlejandroFrias/case-conversion | case_conversion/__init__.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Author, Book, Note, Tag, Section\n\n\n@admin.register(Author)\nclass AuthorAdmin(admin.ModelAdmin):\n list_display = ['name', 'goodreads_id']\n prepopulated_fields = {'slug': ('n... | python | edit | 1 | 0 | mit | 7172962abf0d5d5aad02c632944ed8cb33ca9bae | dellsystem/bookmarker,dellsystem/bookmarker,dellsystem/bookmarker | django/books/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfix_url = sys.argv[1]\n\nfor line in sys.stdin:\n e = line.strip().split(\" \")\n\n if e[0].startswith(\"_:\"):\n e[0] = \"<%s>\" % e[0].replace(\"_:\",fix_url)\n if e[2].startswith(\"_:\"):\n e[2] = \"<... | python | edit | 1 | 0 | apache-2.0 | 751c38ebe052a689b7962491ffd5f54b593da397 | liderproject/linghub,liderproject/linghub,liderproject/linghub,liderproject/linghub | harvesting/datahub.io/fix-urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: test: Create stub of fit testing"
},
{
"role": "assistant",
"content": "\"\"\"\nThis module contains tests of code from the file named\n`../forecastonishing/selection/on_the_fly_selector.py`.\n\n@author: Nikolay Lysenko\n\"\"\"\n... | python | new_file | 4 | 3 | mit | 1a51b2e2043a3b3eb4fa9d356ebaa43461d7d464 | osahp/forecastonishing | tests/on_the_fly_selector_tests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom keras.models import Model\nfrom keras.layers import Input, Convolution2D, Activation, Flatten, Dense\nfrom keras.layers.advanced_activations import PReLU\nfrom keras.optimizers import Nadam\n\nfrom eva.layers.residual_block import Resi... | python | edit | 4 | 3 | apache-2.0 | 41368a5d45aa9568d8495a98399cb92398eeaa32 | israelg99/eva | eva/models/pixelcnn.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .fixtures import * # noqa\n\n\ndef pytest_addoption(parser):\n group = parser.getgroup('girder')\n group.addoption('--mock-db', action='store_true', default=False,\n help='Whether or not to mock the database u... | python | edit | 1 | 3 | apache-2.0 | b2bab786c4af3dcca7d35b1e6ecff8699e542ec4 | jbeezley/girder,jbeezley/girder,girder/girder,kotfic/girder,jbeezley/girder,data-exp-lab/girder,Xarthisius/girder,data-exp-lab/girder,girder/girder,RafaelPalomar/girder,jbeezley/girder,girder/girder,kotfic/girder,manthey/girder,kotfic/girder,girder/girder,RafaelPalomar/girder,Xarthisius/girder,RafaelPalomar/girder,Xart... | pytest_girder/pytest_girder/plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pkgutil\nimport os\n\ndef install_kernel_resources(destination):\n \"\"\"\n Copy the resource files to the kernelspec folder.\n \"\"\"\n for filename in [\"logo-64x64.png\", \"logo-32x32.png\"]:\n data = pkgutil.ge... | python | edit | 1 | 2 | bsd-3-clause | 66d159fb1800b5e55c057316ac53fb62f1eb6b6e | Calysto/metakernel | metakernel/utils/kernel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\nimport census\n\nlong_description = open('README.rst').read()\n\nsetup(\n name=\"census\",\n version=census.__version__,\n py_modules=['census'],\n author=\"Jeremy Carbaugh\",\n au... | python | edit | 1 | 0 | bsd-3-clause | 76aaa3a07fb181a55bae6e7ea03ad04522720ea1 | sunlightlabs/census,joehand/census,dmc2015/census,UDST/census | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nThis module provides tools to return the installed astropy and photutils\nversions.\n\"\"\"\nfrom datetime import datetime, timezone\n\n\ndef _get_version_info():\n ... | python | edit | 1 | 3 | bsd-3-clause | fa609681c2732e655cde9075182af918983ccc1f | larrybradley/photutils,astropy/photutils | photutils/utils/_misc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import abort, json\nimport requests\n\n\ndef render_content(text, gfm=False, context=None,\n username=None, password=None):\n \"\"\"Renders the specified markup using the GitHub API.\"\"\"\n if gfm:\n ... | python | edit | 1 | 6 | mit | 587abec7ff5b90c03885e164d9b6b62a1fb41f76 | ssundarraj/grip,mgoddard-pivotal/grip,mgoddard-pivotal/grip,joeyespo/grip,joeyespo/grip,jbarreras/grip,jbarreras/grip,ssundarraj/grip | grip/github_renderer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.checks import run_checks, Error\nfrom django.test import override_settings\n\nfrom axes.checks import Messages, Hints, Codes\nfrom axes.conf import settings\nfrom axes.tests.base import AxesTestCase\n\n\n@override_settings(... | python | edit | 1 | 1 | mit | 7d9265cd3cb29606e37b296dde5af07099098228 | jazzband/django-axes,django-pci/django-axes | axes/tests/test_checks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mykde import Action\n\n\nclass Action(Action):\n\n name = 'git'\n description = \"Git with helper programs and custom settings\"\n\n packages = ['git', 'gitk', 'giggle']\n\n def proceed(self):\n # useful aliases\n ... | python | edit | 1 | 1 | bsd-3-clause | f360c61cbe0a895ca3d8efe5be97f08ea7ff5682 | warvariuc/mykde,warvariuc/mykde | packages/vic/git/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import get_user_model\nfrom django.forms import ModelForm\n\n\nclass UserSettingsForm(ModelForm):\n class Meta:\n model = get_user_model()\n fields = ('first_name',\n 'last_name',\n... | python | edit | 1 | 0 | apache-2.0 | 2d36b6fee7905e32aded8da7ffba68a5ec3c5d34 | lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter | dwitter/user/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# There should be a single, merged feature in each of these tiles\n\n# Natural Earth\nassert_less_than_n_features(5, 11, 11, 'water', {'kind': 'ocean'}, 2)\nassert_less_than_n_features(5, 8, 11, 'earth', {'kind': 'earth'}, 2)\n\n# OpenStree... | python | edit | 5 | 0 | mit | 86382d372fc8fd7ee42c264019989d3f119508a2 | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | integration-test/1106-merge-ocean-earth.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport machine\n\ndef setntptime(maxretries=10):\n # ntptime is a helper module which gets packaged into the firmware\n # Check https://raw.githubusercontent.com/micropython/micropython/master/esp8266/scripts/ntptime.py\n import ntptime\... | python | edit | 3 | 4 | mit | b2f1f97000c8d3479e1df6778f0cc85ec0680571 | fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout | garden-watering01/mybuddy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\nfrom pyspeedtest import __program__, __version__\n\n# allow setup.py to be run from any path\nos.chdir(os.path.dirname(os.path.abspath(__file__)))\n\nsetup(\n name=__program__,\n version=__vers... | python | edit | 1 | 0 | mit | 2a782a354bfc403c86b84e31c6fcce8d4135a2c9 | fopina/pyspeedtest,fopina/pyspeedtest | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__title__ = 'libvcs'\n__package_name__ = 'libvcs'\n__description__ = 'vcs abstraction layer'\n__version__ = '0.3.0'\n__author__ = 'Tony Narlock'\n__email__ = '<EMAIL>'\n__license__ = 'MIT'\n__copyright__ = 'Copyright 2016 Tony Narlock'\n\n`... | python | edit | 1 | 0 | mit | acd5a676b08e070c804bdae78abba266b47c67b5 | tony/libvcs | libvcs/__about__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport os\nimport logging\nimport atexit\nfrom rtrss.basedaemon import BaseDaemon\n\n_logger = logging.getLogger(__name__)\n\n\nclass WorkerDaemon(BaseDaemon):\n def run(self):\n _logger.info('Daemon started ith pid %d... | python | edit | 1 | 2 | apache-2.0 | 1ee414611fa6e01516d545bb284695a62bd69f0a | notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss | rtrss/daemon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include\nfrom django.contrib import admin\n\nurlpatterns = patterns('',\n (r'^ticket/', include('ticketus.ui.urls')),\n (r'^grappelli/', include('grappelli.urls'... | python | edit | 1 | 0 | bsd-2-clause | e4c33d57ddc9743cec1c43bf0bb8d6fae185aff7 | sjkingo/ticketus,sjkingo/ticketus,sjkingo/ticketus,sjkingo/ticketus | ticketus/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom experiment_session.models import ExperimentSession\nfrom django.core.validators import MinValueValidator\n\n\nclass Experiment(models.Model):\n LIGHTOFF_FIXED = 'fixed'\n LIGHTOFF_WAITING = 'waiting'... | python | edit | 3 | 1 | mit | 40347e45646aa57c9181cb289dfa88a3b3eb3396 | piotrb5e3/1023alternative-backend | experiment/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom linegenerator import LineGenerator\nimport math as m\n\n\nclass StepLineGenerator(LineGenerator):\n\n def __init__(self, name, units, start, end, step):\n\n num = int(m.floor((end - start)/step))\n\n super(StepLineGene... | python | edit | 1 | 1 | apache-2.0 | 6a8068942d985f0c125749d5f58ad7cb9cd189be | dls-controls/scanpointgenerator | scanpointgenerator/linegenerator_step.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# This is just be a base class / interface to be filled out by \n# human and AI players.\n\n# TODO: Undo support?\n# TODO: Resign?\n\n# super requires inheriting from object, which clashes with pickle?!\n#class Player(object):\nclass Play... | python | edit | 1 | 2 | mit | fa0f65b6b216a869cc6f1503e7af51481b570b78 | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | player.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport os\n\nfrom ..en import English\nfrom ..de import German\n\n\n@pytest.fixture(scope=\"session\")\ndef EN():\n return English(path=False)\n\n@pytest.fixture(scope=\"session\")\ndef DE():\n return German(path=False)... | python | edit | 3 | 4 | mit | 0cf4aff4702ad580f9709b33c96cd115f34b028d | Gregory-Howard/spaCy,explosion/spaCy,raphael0202/spaCy,recognai/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,banglakit/spaCy,recognai/spaCy,honnibal/spaCy,recognai/spaCy,banglakit/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,spacy-io/spaCy,banglak... | spacy/tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom aiotg import TgBot\nfrom aiotg import MESSAGE_TYPES\n\nAPI_TOKEN = \"test_token\"\n\ndef text_msg(text):\n return {\n \"message_id\": 0,\n \"from\": {},\n \"chat\": { \"id\": 0, \"type\": \"privat... | python | edit | 1 | 1 | mit | edbbf93222fc4061a18f81718a6a7233c6b840ec | SijmenSchoon/aiotg,szastupov/aiotg,derfenix/aiotg | tests/test_callbacks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nBoolean Vector Logic Expressions\n\nThis module is deprecated.\nThe functionality has been superceded by the bfarray module.\n\nInterface Functions:\n bitvec\n\"\"\"\n\nfrom pyeda.boolalg import expr\nfrom pyeda.boolalg import bf... | python | edit | 1 | 2 | bsd-2-clause | 1a6344ea1fac51a8024e1803a0391662d4ab81e0 | pombredanne/pyeda,GtTmy/pyeda,karissa/pyeda,sschnug/pyeda,sschnug/pyeda,cjdrake/pyeda,sschnug/pyeda,cjdrake/pyeda,GtTmy/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,karissa/pyeda,cjdrake/pyeda,pombredanne/pyeda | pyeda/boolalg/vexpr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\nimport json\nimport requests\nfrom flask import send_from_directory, Response, stream_with_context\n\nfrom framework.sessions import session\nfrom website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_... | python | edit | 1 | 5 | apache-2.0 | 1dfbe495972a5f4d02ce374131f40d4474f24cc6 | Johnetordoff/osf.io,adlius/osf.io,aaxelb/osf.io,felliott/osf.io,mfraezz/osf.io,mfraezz/osf.io,HalcyonChimera/osf.io,icereval/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,saradbowman/osf.io,mattclark/osf.io,aaxelb/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,caseyrollins/... | website/ember_osf_web/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom extraction.core import ExtractionRunner\nfrom extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult\nimport os\nimport sys\nimport grobid\nimport pdfbox\nimport filters\n\nif __name__ == '__main__':\n\n runner... | python | edit | 8 | 1 | apache-2.0 | 0b5a657339870c7669082c39f8290c88732aa92e | Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,Tiger66639/new-csx-extractor,Tiger66639/new-csx-extractor,SeerLabs/new-csx-extractor,SeerLabs/new-csx-extractor | extractor.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile, CMake\n\nclass ConanUsingSilicium(ConanFile):\n\tsettings = \"os\", \"compiler\", \"build_type\", \"arch\"\n\trequires = \"Boost/1.59.0@lasote/stable\", \"silicium/0.1@tyroxx/testing\"\n\tgenerators = \"cmake\"... | python | edit | 3 | 0 | mit | 47310125c53d80e4ff09af6616955ccb2d9e3bc8 | TyRoXx/conan_using_silicium,TyRoXx/conan_using_silicium | conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef overlapping(interval_a, interval_b):\n al, ah = interval_a\n bl, bh = interval_b\n\n if al > ah:\n raise ValueError(\"Interval A bounds are inverted\")\n\n if bl > bh:\n raise ValueError(\"Interval B bounds are... | python | edit | 1 | 4 | mit | 23f404b61f2c9b89bb631ad0e60edf4416500f28 | prophile/django_split | django_split/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nShim to maintain backwards compatibility with old IPython.html imports.\n\"\"\"\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nimport sys\nfrom warnings import warn\n\nwarn(... | python | edit | 1 | 0 | bsd-3-clause | 538f8e3382e274402f2f71ba79439fae0828b3cf | ipython/ipython,ipython/ipython | IPython/html.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# yvs.set_pref\n# coding=utf-8\n\nfrom __future__ import unicode_literals\n\nimport json\nimport sys\n\nimport yvs.shared as shared\n\n\n# Parse pref set data from the given JSON string\ndef parse_pref_set_data_str(pref_set_data_str):\n\n ... | python | edit | 1 | 2 | mit | f67e47fd900de3953ee8abb45e5ea56851c10dee | caleb531/youversion-suggest,caleb531/youversion-suggest | yvs/set_pref.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Tests for the main server file. \"\"\"\nfrom unittest import TestCase\nfrom unittest.mock import patch\n\nfrom app import views\n\n\nclass ViewsTestCase(TestCase):\n \"\"\" Our main server testcase. \"\"\"\n\n def test_ping(sel... | python | edit | 1 | 1 | mit | df5e6bdd03ad666afdd9b61745eec95afc08e9cb | DobaTech/github-review-slack-notifier | tests/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: fix(tests): Include static file-related tests in 'test' package."
},
{
"role": "assistant",
"content": "from .files import *\nfrom .staticfiles import *\nfrom .template import *\nfrom .test_routes import *\nfrom .test_tenants imp... | python | new_file | 7 | 0 | mit | 32d4ea22c1bca4a96a8d826f0225dfee2a4c21d2 | tomturner/django-tenants,tomturner/django-tenants,tomturner/django-tenants | django_tenants/tests/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport sys\n\nsys.path.append('..')\nfrom skytap.Quotas import Quotas # noqa\n\nquotas = Quotas()\n\n\ndef test_quota_count():\n assert len(quotas) > 0\n\n\ndef test_quota_id():\n for quota in quotas:\n ... | python | edit | 1 | 0 | mit | 8e6aebf8cb96f5ccf4a119ab213c888a4c33a0d8 | FulcrumIT/skytap,mapledyne/skytap | tests/testQuotas.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom itertools import repeat\n\n\nclass RegexParserMixin(object):\n quoted_re = r'''(?P<q>\"|')(?P<x>.+)(?P=q)'''\n version_re = r'''(?P<s>[<>=~]*)\\s*(?P<n>.*)'''\n\n def _get_value(self, lines, prefix, regex):\n ... | python | edit | 1 | 3 | mit | 7258923a3fc6467c2aac2c81f108c71e790a9e6b | elegion/djangodash2013,elegion/djangodash2013 | wtl/wtparser/parsers/regex.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport signal\nimport sys\nfrom app.main import app, queues, sched\n\n\ndef _teardown(signal, frame):\n sched.shutdown(wait=False)\n for queue in queues.values():\n queue.put(None)\n queue... | python | edit | 1 | 2 | mit | 790c9debf2f89dca49a5e6f5b3842aebfba2a796 | martinp/jarvis2,martinp/jarvis2,martinp/jarvis2,mpolden/jarvis2,mpolden/jarvis2,Foxboron/Frank,Foxboron/Frank,mpolden/jarvis2,Foxboron/Frank | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom yawf.config import INITIAL_STATE\nfrom yawf.base_model import WorkflowAwareModelBase\n\n\nclass WorkflowAwareModel(WorkflowAwareModelBase):\n\n ... | python | edit | 1 | 0 | mit | dad38c399c4687c93c69255df0f9d69d1bb386c4 | freevoid/yawf | yawf/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom urllib.parse import urljoin\n\nimport scrapy\n\n\nclass ComicSpider(scrapy.Spider):\n name = \"My spider\"\n\n def __init__(self, *args, **kwargs):\n self.start_urls = kwargs.get('start_urls') or []\n self.next_page... | python | edit | 1 | 5 | mit | c2eccb4ce1259830dd641d19624358af83c09549 | J-CPelletier/webcomix,J-CPelletier/webcomix,J-CPelletier/WebComicToCBZ | webcomix/comic_spider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import path\nimport shutil\nimport sublime\nimport sublime_plugin\n\nSUBLIME_ROOT = path.normpath(path.join(sublime.packages_path(), '..'))\nCOMMANDS_FILEPATH = path.join('Packages', 'User', 'Commands.sublime-commands')\nCOMMANDS_FU... | python | edit | 1 | 3 | unlicense | fea07e0fe53049963a744b52c38a9abdfeb1c09e | twolfson/sublime-edit-command-palette,twolfson/sublime-edit-command-palette,twolfson/sublime-edit-command-palette | commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\ntry:\n from django.utils.encoding import force_text\nexcept ImportError:\n # Django < 1.5\n from django.utils.encoding import force_unicode as force_text\nfrom django.utils.timezone import... | python | edit | 1 | 3 | bsd-3-clause | 98f8a8fb51ae539aad6a3e2faebced4b806c3f0c | o-zander/django-filer,nimbis/django-filer,nimbis/django-filer,webu/django-filer,divio/django-filer,matthiask/django-filer,skirsdeda/django-filer,stefanfoulis/django-filer,sopraux/django-filer,Flight/django-filer,sopraux/django-filer,belimawr/django-filer,matthiask/django-filer,o-zander/django-filer,DylannCordel/django-... | filer/utils/generate_filename.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic.base import View\n\nfrom mock import MagicMock\n\nfrom ..permissions import is_location_safe, location_safe\n\n\n@location_safe\ndef safe_fn_view(request, domain):\n return \"hello\"\n\n\ndef unsafe_fn_view(requ... | python | edit | 1 | 2 | bsd-3-clause | a06591fe0597d49c83899533f3ff01deec017964 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/locations/tests/test_location_safety.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\nfrom __future__ import absolute_import\n\nfrom ._version import get_versions\n\nREPO_URL = \"https://github.com/GeoscienceAustralia/eo-datasets.git\"\n\n__version__ = get_versions()[\"version\"]\ndel get_versions\n\n```\n\... | python | edit | 1 | 0 | apache-2.0 | cde02a3129d276d02054e04c1b0a0b605b837d32 | GeoscienceAustralia/eo-datasets,jeremyh/eo-datasets,jeremyh/eo-datasets,GeoscienceAustralia/eo-datasets | eodatasets3/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n{\n 'REPORT_TYPE': 'HTML',\n 'REPORT_RECIPIENTS': '<EMAIL>',\n\n 'JENKINS_USERNAME': 'sknight',\n 'JENKINS_API_TOKEN': '594849a68d4911d6c39a2cb5f700c385',\n\n 'FEATURES': {'PASSWORD_DECRYPTION': False, 'AWS': False, 'ANYBAR':... | python | edit | 1 | 0 | mit | decdec6846a1ca590713b2789d9c999b5c1d9502 | skk/dotfiles,skk/dotfiles | dotfiles/cashbot.cfg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom txircd.modbase import Mode\n\nclass InvisibleMode(Mode):\n\tdef namesListEntry(self, recipient, channel, user, representation):\n\t\tif channel not in recipient.channels and \"i\" in user.mode:\n\t\t\treturn \"\"\n\t\treturn representa... | python | edit | 1 | 3 | bsd-3-clause | f183b471bf92c03bb5353b02009e3287ffe06ae7 | ElementalAlchemist/txircd,DesertBus/txircd,Heufneutje/txircd | txircd/modules/umode_i.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport cooler.contrib.higlass as cch\nimport h5py\nimport os.path as op\n\ntestdir = op.realpath(op.dirname(__file__))\n\ndef test_data_retrieval():\n data_file = op.join(testdir, 'data', 'dixon20... | python | edit | 1 | 1 | bsd-3-clause | 70f167d3d5a7540fb3521b82ec70bf7c6db09a99 | mirnylab/cooler | tests/test_contrib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 Getlogic BV, Sardar Yumatov\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http... | python | edit | 2 | 0 | apache-2.0 | 72c122d8ff580a4c0c5fa4554844c73c657a6581 | marcinkaszynski/apnsclient | apnsclient/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport sys\n\nif any([arg in {'discover', 'setup.py', 'test'} for arg in sys.argv]):\n test_examples = True\n test_all_examples = False\n show_plots = False\nelif any(['sphinx-build' in arg for arg in sys.a... | python | edit | 1 | 0 | bsd-3-clause | 92d7a3cf2ec3ae669fab17906b10b784525a134a | cklb/pyinduct,riemarc/pyinduct,pyinduct/pyinduct | pyinduct/tests/__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.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('icekit_articles', '0001_initial'),\n ]\n\n ope... | python | edit | 1 | 0 | mit | 131033fa3ab170ac2a66c1dd89074ea74702fb52 | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/page_types/articles/migrations/0002_auto_20161012_2231.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport random\nimport string\n\nfrom flask import Flask, request, jsonify, render_template\nfrom flask.ext.pymongo import PyMongo\nfrom pymongo.errors import DuplicateKeyError\napp = Flask(__name__)\napp.config['MONGO_DBNAME'] ... | python | edit | 2 | 3 | mit | c7d0f17f552e825582a616e05e5fa91690f18b29 | clayadavis/OpenKasm,clayadavis/OpenKasm | flask/kasm-server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\nclass TenantSyncRouter(object):\n \"\"\"\n A router to control which applications will be synced,\n depending if we are syncing the shared apps or the tenant apps.\n \"\"\"\n\n def allow_... | python | edit | 1 | 4 | mit | 7b4b2fcbcb9a95c07f09b71305afa0c5ce95fe99 | goodtune/django-tenant-schemas,Mobytes/django-tenant-schemas,kajarenc/django-tenant-schemas,honur/django-tenant-schemas,mcanaves/django-tenant-schemas,ArtProcessors/django-tenant-schemas,goodtune/django-tenant-schemas,ArtProcessors/django-tenant-schemas,bernardopires/django-tenant-schemas,bernardopires/django-tenant-sc... | tenant_schemas/routers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSeveral type aliases used througout PHASM\n-----------------------------------------\n\nThis is a separate module to prevent circular imports.\n\"\"\"\n\nfrom typing import Mapping, Set, Callable, Union, Tuple, Iterable\n\n# Pairwis... | python | edit | 1 | 0 | mit | 679abfdd2b6a3c4d18170d93bfd42d73c47ff9c5 | AbeelLab/phasm,AbeelLab/phasm | phasm/typing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\n\nsetup(\n name='django-emailer',\n version='0.1.2',\n author='Evandro Myller',\n author_email='<EMAIL>',\n description='Template based email sending with SMTP connection management',\n url=... | python | edit | 1 | 0 | mit | c100aafc6b8b277b048fb6134dc50a8921dbe979 | 7ws/django-emailer | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport logging\n\n# NOTE: Be sure to keep the logging level commented out before commiting. See:\n# https://github.com/numba/numba/issues/31\n# A good work around is to make your tests handle a debug flag, per\n# numba.tests.... | python | edit | 6 | 2 | bsd-2-clause | 40af69656b71cda7f775cface3478106f070ed35 | numba/numba,stefanseefeld/numba,pitrou/numba,stonebig/numba,ssarangi/numba,ssarangi/numba,seibert/numba,gmarkall/numba,seibert/numba,pombredanne/numba,sklam/numba,shiquanwang/numba,stefanseefeld/numba,cpcloud/numba,gmarkall/numba,numba/numba,jriehl/numba,cpcloud/numba,seibert/numba,jriehl/numba,jriehl/numba,pitrou/numb... | numba/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponse\n\n\ndef index(request):\n return HttpResponse(\"Hallo Welt!\")\n```\n\nApply this change: Add views for deck CRUD"
},
{
"role": "assistant",
"content": "# coding=utf-8\n# TODO: User authe... | python | edit | 2 | 1 | mit | a21aea6a0327d697d9213ecdbfd6365a77d0b40e | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | cardbox/deck_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding: utf-8\nimport json\nimport os\nimport sys\n\nfrom coveralls import Coveralls, cli\n\n\n# Patch coveralls to get javascript coverage from mocha\norig_get_coverage = Coveralls.get_coverage\n\n\ndef get_coverag... | python | edit | 1 | 4 | apache-2.0 | 78cca16df6a5cdd90ec92e64455215c4b7292fae | exekias/django-achilles,exekias/django-achilles | report_coverage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Copyright (c) 2012 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\"\"\"Entry point for the dartium buildbots.\n... | python | edit | 2 | 6 | bsd-3-clause | 04c92e1fe7efa38f7d99d501286d3b7e627e73ca | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/chromium/dart_buildbot_run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom django.test import TestCase\n\nfrom rest_framework import status\n\nfrom tests.models import TestModel\n\n\nclass ProxyPaginationTests(TestCase):\n \"\"\"\n Tests for drf-proxy-pagination\n \"\"\"\n def setUp... | python | edit | 1 | 2 | mit | 0d89712bda6e85901e839dec3e639c16aea42d48 | tuffnatty/drf-proxy-pagination | tests/test_proxy_pagination.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport flask\n\nfrom pale.adapters import flask as pale_flask_adapter\nfrom pale.config import authenticator, context_creator\n\nfrom tests.example_app import api\n\n\n@authenticator\ndef authenticate_pale_context(context):\n \"\"\"Don't... | python | edit | 1 | 1 | mit | bc3cf7bb0ac8e271f8786b9ec982fe1297d0ac93 | Loudr/pale | tests/example_app/flask_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom src.data import meta\n\n\nclass Problem(object):\n def __init__(self, name, lines):\n self.name = name\n self.lines = lines\n self._solutions = None\n self._constraints = []\n\n def constrain(self, fn):\n self._constra... | python | edit | 1 | 5 | mit | 6eeecb5e36e5551ba3a3c35a9c7f52393d2f9d14 | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | src/puzzle/problems/problem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 NEC Corporation. All rights reserved.\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 Lic... | python | edit | 1 | 0 | apache-2.0 | 673d6cecfaeb0e919f30997f793ee2bb18e399ee | jaspreetw/tempest,openstack/tempest,Vaidyanath/tempest,vedujoshi/tempest,NexusIS/tempest,FujitsuEnablingSoftwareTechnologyGmbH/tempest,tonyli71/tempest,hayderimran7/tempest,xbezdick/tempest,akash1808/tempest,roopali8/tempest,tudorvio/tempest,alinbalutoiu/tempest,flyingfish007/tempest,manasi24/jiocloud-tempest-qatempest... | tempest/api_schema/response/compute/v2/hypervisors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom smartbot import utils\n\n\nclass Plugin:\n def on_message(self, bot, msg, reply):\n match = re.findall(r\"(https?://[^\\s]+)\", msg[\"message\"], re.IGNORECASE)\n for i, url in enumerate(match):\n ... | python | edit | 3 | 3 | mit | 6fc2e75426eb34755bf6dbedbd21a4345d9c5738 | Muzer/smartbot,Cyanogenoid/smartbot,thomasleese/smartbot-old,tomleese/smartbot | plugins/websites.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nltk.tokenize import word_tokenize, sent_tokenize\nimport getopt\nimport sys\nimport os\nimport io\n\n\ndef usage():\n\tprint(\"usage: \" + sys.argv[0] + \" -i directory-of-documents -d dictionary-file -p postings-file\")\n\nif __name_... | python | edit | 5 | 3 | mit | 9ee79dbbddb07e06948cf68f9a38d94bbbcc00da | ikaruswill/vector-space-model,ikaruswill/boolean-retrieval | index.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\n\nclass ApiClient:\n def __init__(self, host, username, password):\n self.uri = host + '/nexus/service/local/'\n self.username = username\n self.password = password\n\n def get_all_repositories(se... | python | edit | 1 | 1 | apache-2.0 | 34fe4bb5cd5c4c35a659698e8d258c78da01887a | rcarrillocruz/pynexus | pynexus/api_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext as _\nfrom Django.contrib.auth.models import User\n\nFEMALE = 'F'\nMALE = 'M'\n\n\nclass Teacher(models.Model):\n \"\"\"\n Halaqat teachers information\n \... | python | edit | 1 | 1 | mit | d16cbf8994023dba5146ddb38e0db29202bb4614 | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | back_office/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# ------------------------------------------------------------------------\n# coding=utf-8\n# ------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\n\nfrom django.contrib import a... | python | edit | 1 | 0 | bsd-3-clause | af0ec29ce0c830f096ab809fd2d69affd887ce16 | joshuajonah/feincms,mjl/feincms,matthiask/django-content-editor,matthiask/feincms2-content,feincms/feincms,feincms/feincms,pjdelport/feincms,pjdelport/feincms,mjl/feincms,michaelkuty/feincms,matthiask/django-content-editor,joshuajonah/feincms,nickburlett/feincms,matthiask/feincms2-content,matthiask/django-content-edito... | feincms/module/page/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef sum_even_fibonacci_numbers_1():\n f1, f2, s, = 0, 1, 0,\n while f2 < 4000000:\n f2, f1 = f1, f1 + f2\n if f2 % 2 == 0:\n s += f2\n return s\ndef sum_even_fibonacci_numbers_2():\n s, a, b = 0, 1, 1\n ... | python | edit | 3 | 3 | mit | 468ce899542197f8ab7ae51800b56132e6e81bd4 | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | problem_2/solution.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.