messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n# Copyright (c) 2006 rPath, Inc\n# All rights reserved\n\nimport sys\nimport os\nimport pwd\nfrom conary.server import schema\nfrom conary.lib import cfgtypes, tracelog\nfrom conary.repository.netrepos.netserver import ... | python | edit | 2 | 1 | apache-2.0 | f7bb5a58774cdb6ecdfae12f7919ae2e3dfd8f8d | sassoftware/rbm,sassoftware/rbm,sassoftware/rbm | upsrv/conary_schema.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom shlex import quote\n\nimport click\n\n\n@click.command()\n@click.option('-p', '--print/--exec', 'print_cmd', default=False,\n help='Print the command instead of executing it.')\n@click.argument('environment')\n@click.pass_... | python | edit | 1 | 3 | mit | 388653366ee4db58ed8ce8a9c8ab071593b9fc53 | GaretJax/lancet,GaretJax/lancet | lancet/contrib/dploi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Intercept HTTP connections that use `requests <http://docs.python-requests.org/en/latest/>`_.\n\"\"\"\n\nfrom . import WSGI_HTTPConnection, wsgi_fake_socket\nfrom requests.packages.urllib3.connectionpool import (HTTPConnectionPool,\n ... | python | edit | 1 | 1 | mit | ae8a91dbfb657ba2ac4f1ef9aa89c8b8ba25cde2 | cdent/wsgi-intercept,sileht/python3-wsgi-intercept | wsgi_intercept/requests_intercept.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom django.core.urlresolvers import reverse\n\n@pytest.mark.django_db\ndef test_homepage(client):\n\n for url in (\n \"/donor\",\n \"/students\",\n \"/courses\",\n \"/talks\",\n... | python | edit | 3 | 2 | isc | 3ca46f1407d8984ca5cbd1eb0581765386533d71 | rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory | observatory/rcos/tests/test_rcos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright (c) 2008 rPath, Inc.\n#\n# All rights reserved.\n#\n\n'''\nMechanism for expanding macros from a trove context.\n'''\n\nimport logging\n\ndef expand(raw, parent, trove=None):\n '''Transform a raw string with available conf... | python | edit | 1 | 7 | apache-2.0 | 8be2d6c735ebdca542063c34d1048cb70ba7f882 | sassoftware/bob,sassoftware/bob | bob/macro.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nfrom numpy.testing import assert_approx_equal, assert_allclose, assert_array_less\nfrom nose.tools import raises, assert_true, assert_equal\nfrom UliEngineering.Physics.NTC import *\nfrom Uli... | python | edit | 15 | 1 | apache-2.0 | 9dcfccc3fc5524c3c2647e66a8977c1aa1758957 | ulikoehler/UliEngineering | tests/Physics/TestNTC.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cPickle as pickle\nimport glob\nimport json\nimport math\nimport os\nimport sys\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scipy as sp\nimport scipy.io\nimport scipy.... | python | edit | 19 | 0 | mit | dabb6e7b3855d93df74d690607432e27b5d9c82f | escorciav/linux-utils,escorciav/linux-utils | ipython/profile/00_import_sciqnd.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test the checkers\"\"\"\nfrom nose.tools import ok_, eq_\n\nfrom preflyt import check\n\nCHECKERS = [\n {\"checker\": \"env\", \"name\": \"USER\"}\n]\n\nBAD_CHECKERS = [\n {\"checker\": \"env\", \"name\": \"USER1231342dhkfgjhk23... | python | edit | 1 | 2 | mit | 8ac492be603f958a29bbc6bb5215d79ec469d269 | humangeo/preflyt | tests/test_init.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom six import StringIO\nfrom six import string_types\nfrom six import integer_types\n\n\ndef _to_text(text, obj):\n if isinstance(obj, dict):\n for key in sorted(obj.keys()):\n _to_text(text, key)\n ... | python | edit | 1 | 6 | mit | 3ede075c812b116629c5f514596669b16c4784df | btimby/fulltext,btimby/fulltext | fulltext/backends/__json.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport copy\n\nclass Message(object):\n def __init__(self, backend, caller=None, text=None):\n self._backend = backend\n self.caller = caller\n self.text = text\... | python | edit | 1 | 2 | bsd-3-clause | 667f92e8686fd1eb004a7c608acb45c70a9dd2f0 | lsgunth/rapidsms,rapidsms/rapidsms-core-dev,dimagi/rapidsms-core-dev,ken-muturi/rapidsms,ehealthafrica-ci/rapidsms,catalpainternational/rapidsms,eHealthAfrica/rapidsms,dimagi/rapidsms-core-dev,caktus/rapidsms,catalpainternational/rapidsms,rapidsms/rapidsms-core-dev,lsgunth/rapidsms,ehealthafrica-ci/rapidsms,peterayeni/... | lib/rapidsms/message.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding:utf-8 -*-\n\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import with_statement\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom logbook import N... | python | edit | 1 | 5 | bsd-2-clause | 45ee803cad9b16351a2d02c7ce9d39a36f8f2480 | dag/stutuz | stutuz/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom experiment_config_lib import ControllerConfig\nfrom sts.control_flow import Fuzzer\nfrom sts.input_traces.input_logger import InputLogger\nfrom sts.invariant_checker import InvariantChecker\nfrom sts.simulation_state import SimulationC... | python | edit | 1 | 0 | apache-2.0 | 131fb74b0f399ad3abff5dcc2b09621cac1226e7 | ucb-sts/sts,jmiserez/sts,jmiserez/sts,ucb-sts/sts | config/nox_routing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.view... | python | edit | 1 | 0 | mit | da5db320bd96ff881be23c91f8f5d69505d67946 | Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2 | src/project_name/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport src\nimport resources.Constants as const\n\n\nclass TestAssignments(unittest.TestCase):\n\n string_file = ''\n int_file = ''\n\n @classmethod\n def setUpClass(cls):\n cls.string_file = src.main(\".... | python | edit | 1 | 1 | bsd-3-clause | ea453e4c050771ee96bd99f15e4f42449f28c7f2 | sky-uk/bslint | tests/TestAssignmentRegex.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 | 82daed35cb328590e710800672fc3524c226d166 | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | feder/letters/tests/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gdata.youtube.service import YouTubeService, YouTubeVideoQuery\nfrom django.utils.encoding import smart_str\nimport re\n\nclass YoutubeMusic:\n def __init__(self):\n self.service = YouTubeService()\n\n def search(self, art... | python | edit | 1 | 7 | mit | de9f9c07c6f1dde8d7ad314b6a6fb58a963e1558 | 6/GeoDJ,6/GeoDJ | geodj/youtube.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_seguro.products import Products\nfrom flask import current_app as app\n\n\nclass Cart:\n\n def __init__(self, cart_dict={}):\n if cart_dict == {}:\n self.total = 0\n self.subtotal = 0\n ... | python | edit | 1 | 4 | mit | 1f697a2c7bcf0f7769a9fc4f81be676ed5ee97c6 | rgcarrasqueira/python-pagseguro,vintasoftware/python-pagseguro,rochacbruno/python-pagseguro | examples/flask/flask_seguro/cart.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Convert browser bookmark export (NETSCAPE-Bookmark-file-1 format) to json\n#\nfrom argparse import ArgumentParser\nfrom bs4 import BeautifulSoup\nfrom datetime import datetime, timezone\nimport json\n\n\nparser =... | python | edit | 1 | 0 | mit | 1454b42049e94db896aab99e2dd1b286ca2d04e3 | jhh/netscape-bookmark-converter | convert-bookmarks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom can import Listener\nimport socket\n\nclass UDPSender(Listener):\n dataConvert = {\"0x600\": {\"String\":\"RPM:\",\n \"Slot\":0,\n \"Conversion\":1},\n \"0x60... | python | edit | 2 | 2 | mit | 22f3d6d6fdc3e5f07ead782828b406c9a27d0199 | TAURacing/BeagleDash | UDPSender.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.safestring import mark_safe\n\nfrom cyder.base.utils import classproperty\n\n\nclass BaseModel(models.Model):\n \"\"\"\n Base class for models to abstract some common features.\n\n * ... | python | edit | 2 | 4 | bsd-3-clause | 6267fa5d9a3ff2573dc33a23d3456942976b0b7e | OSU-Net/cyder,zeeman/cyder,drkitty/cyder,zeeman/cyder,OSU-Net/cyder,murrown/cyder,OSU-Net/cyder,murrown/cyder,murrown/cyder,drkitty/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,akeym/cyder,akeym/cyder,drkitty/cyder,zeeman/cyder,zeeman/cyder,akeym/cyder | cyder/base/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alias method named \"distance\""
},
{
"role": "assistant",
"content": "from .bycython import eval\n\n\ndef distance(*args, **kwargs):\n \"\"\"\"An alias to eval\"\"\"\n return eval(*args, **kwargs)\n\n\n__all__ = ('eval... | python | new_file | 1 | 1 | mit | 76c87d06efaac19350d870cd1c95229ed0a66c29 | aflc/editdistance,aflc/editdistance,aflc/editdistance | editdistance/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = 'Donne Martin'\nSITENAME = 'Donne Martin'\nSITEURL = ''\n\nPATH = 'content'\n\nTIMEZONE = 'America/New_York'\n\nDEFAULT_LANG = 'en'\n\n# F... | python | edit | 1 | 0 | mit | 5fbb4ff5d3427c8f4050fc5b75d4a6a2c15351c6 | donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io,donnemartin/outdated-donnemartin.github.io | pelicanconf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kombu import Connection, Exchange, Queue\nfrom flask import Flask\nimport os\n\napp = Flask(__name__)\napp.config.from_object(os.environ.get('SETTINGS'))\n\n@app.route(\"/getnextqueuemessage\")\n#Gets the next message from target queue... | python | edit | 1 | 3 | mit | deaedcef36238d59484611a63ac21d60707004d4 | LandRegistry/register-publisher,LandRegistry/register-publisher | Do_not_deploy/query_outgoing_queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom registration.models import RegistrationProfile\n\n\nclass RegistrationAdmin(admin.ModelAdmin):\n list_display = ('__unicode__', 'activation_key_expired')\n search_fields = ('user__username', 'u... | python | edit | 1 | 0 | bsd-3-clause | 94596f036270f8958afd84eb9788ce2b15f5cbd4 | rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch... | registration/admin.py | rejected_duplicate | Near-duplicate of sample 444 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n\tsphinxcontrib.openstreetmap\n\t===========================\n\n\tEmbed OpenStreetMap on your documentation.\n\n\t:copyright: Copyright 2015 HAYASHI Kentaro <<EMAIL>>\n\t:license: BSD, see LICENSE for detail... | python | edit | 2 | 2 | bsd-2-clause | 36cc1ecc2b64d5c31ea590dddbf9e12c71542c7d | kenhys/sphinxcontrib-openstreetmap,kenhys/sphinxcontrib-openstreetmap | sphinxcontrib/openstreetmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom robot.conf import Language\n\n\nclass Fi(Language):\n setting_headers = {'H 1'}\n variable_headers = {'H 2'}\n test_case_headers = {'H 3'}\n task_headers = {'H 4'}\n keyword_headers = {'H 5'}\n comment_headers = {'H 6... | python | edit | 1 | 0 | apache-2.0 | 4765a88535262df6373e4f8d2111032fc290da85 | robotframework/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,robotframework/robotframework,robotframework/robotframework | atest/testdata/parsing/custom-lang.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n====================\nBuild image pyramids\n====================\n\nThis example shows how to build image pyramids.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom skimage import data\nfrom skimage import img_... | python | edit | 3 | 0 | bsd-3-clause | 2206681a89346970b71ca8d0ed1ff60a861b2ff9 | chintak/scikit-image,paalge/scikit-image,keflavich/scikit-image,SamHames/scikit-image,jwiggins/scikit-image,bsipocz/scikit-image,keflavich/scikit-image,rjeli/scikit-image,vighneshbirodkar/scikit-image,SamHames/scikit-image,youprofit/scikit-image,chintak/scikit-image,dpshelio/scikit-image,Midafi/scikit-image,WarrenWecke... | doc/examples/plot_pyramid.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport warnings\n\nfrom traitlets import default\n\nfrom .labapp import LabApp\n\ntry:\n from jupyterhub.singleuser import SingleUserNotebookApp\nexcept ImportError:\n SingleUserLabApp = None\n raise ImportError('You mus... | python | edit | 3 | 1 | bsd-3-clause | fbdaeff6f01ffaf0ac4f9a0d0d962a19c2865b32 | jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab | jupyterlab/labhubapp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport pytest\n\n@pytest.fixture(scope=\"module\")\ndef augur_db():\n import augur\n augur_app = augur.Application()\n return augur_app['augur_db']()\n\n# def test_repoid(augur_db):\n# assert ghtorrent.repoid('rails'... | python | edit | 3 | 1 | mit | 041e1545c99681c8cf9e43d364877d1ff43342d0 | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | augur/datasources/augur_db/test_augur_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# XXX: newer mininet version also has MinimalTopo\nfrom mininet.topo import ( SingleSwitchTopo, LinearTopo,\n SingleSwitchReversedTopo )\nfrom mininet.topolib import TreeTopo\nfrom mininet.... | python | edit | 3 | 1 | apache-2.0 | 3d8ec94e61735b84c3b24b44d79fcd57611a93ee | ravel-net/ravel,ravel-net/ravel | mndeps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"The setup script.\"\"\"\n\nfrom setuptools import setup, find_packages # noqa: H301\n\nNAME = \"looker_sdk\"\nVERSION = \"0.1.3b20\"\nREQUIRES = [\n \"requests >= 2.22\",\n \"attrs >= 20.1.0\",\n \... | python | edit | 1 | 0 | mit | fc92c557232a3202e53c5d998183d91d5ed82809 | looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen | python/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport six\n\nfrom pyinfra import logger\n\n\nclass Config(object):\n '''\n The default/base configuration options for a pyinfra deploy.\n '''\n\n state = None\n\n # % of hosts which have to fail for all operations to stop\n ... | python | edit | 1 | 2 | mit | f9293d838a21f495ea9b56cbe0f6f75533360aed | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/api/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# third party\nfrom sqlalchemy import Boolean\nfrom sqlalchemy import Column\nfrom sqlalchemy import ForeignKey\nfrom sqlalchemy import Integer\nfrom sqlalchemy import String\n\n# relative\nfrom . import Base\n\n\nclass NodeRoute(Base):\n ... | python | edit | 1 | 0 | apache-2.0 | 7c3a3283b3da0c01da012bb823d781036d1847b6 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/src/syft/core/node/common/node_table/node_route.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django import forms\n\n\nclass GameForm(forms.Form):\n\n amount = forms.IntegerField()\n\n def __init__(self, *args, **kwargs):\n super(GameForm, self).__init__(*args, **kwargs)\n for name, field in self.fields.it... | python | edit | 1 | 4 | bsd-2-clause | 45c400e02fbeb5b455e27fef81e47e45f274eaec | stephenmcd/gamblor,stephenmcd/gamblor | core/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport platform\nimport sys\n\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = 'e4b283c22236560fd289fe59c03e50adf39e7c4b'\n\nARCH = {\n 'cygwin': '32bit'... | python | edit | 2 | 1 | mit | 099eb53d3c7a4be19fd79f11c9ccf52faff300d4 | setzer777/electron,dkfiresky/electron,carsonmcdonald/electron,davazp/electron,michaelchiche/electron,gerhardberger/electron,systembugtj/electron,renaesop/electron,mirrh/electron,bbondy/electron,subblue/electron,Andrey-Pavlov/electron,joaomoreno/atom-shell,bpasero/electron,hokein/atom-shell,bpasero/electron,benweissmann... | script/lib/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012-2020, Mark Peek <<EMAIL>>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n#\n# *** Do not modify - this file is autogenerated ***\n# Resource specification version: 18.6.0\n\n\nfrom . import AWSObject\... | python | edit | 16 | 0 | bsd-2-clause | ef72be28dc83ff2c73335c6eb13135cab8affe53 | cloudtools/troposphere,cloudtools/troposphere | troposphere/sso.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import get_object_or_404, render\nfrom django.http import HttpResponseRedirect, HttpResponse\n\nfrom .models import Playbook\n\ndef index(request):\n return \"200\"\n\n```\n\nApply this change: Fix return to use Htt... | python | edit | 6 | 1 | bsd-3-clause | 83d5cc3b4ffb4759e8e073d04299a55802df09a8 | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | src/ansible/views.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom similarity.nw_similarity import NWAlgorithm\n\n\nclass Test(unittest.TestCase):\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n def test_nw_algorithm(self):\n t = NWAlgorith... | python | edit | 4 | 1 | mit | 705e9ee8ebe1a1c590ccbec8eed9d18abbf8e914 | dpazel/tryinggithub | tests/similarity/test_new_similarity.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDefinition of the plugin.\n\"\"\"\nfrom django.utils.html import format_html\nfrom fluent_contents.extensions import ContentPlugin, plugin_pool, ContentItemForm\nfrom fluent_contents.plugins.text.models import TextItem\n\n\nclass Te... | python | edit | 1 | 2 | apache-2.0 | 224700aada7e7d80b4389b123ee00b5f14e88c99 | django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents | fluent_contents/plugins/text/content_plugins.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom optparse import make_option\n\nclass Command(BaseCommand):\n help = 'Fetch all registered imports'\n def handle(self, *test_labels, **options):\n from ella.imports.model... | python | edit | 3 | 2 | bsd-3-clause | e16c65ec8c774cc27f9f7aa43e88521c3854b6b7 | MichalMaM/ella,MichalMaM/ella,WhiskeyMedia/ella,whalerock/ella,ella/ella,whalerock/ella,WhiskeyMedia/ella,petrlosa/ella,petrlosa/ella,whalerock/ella | ella/imports/management/commands/fetchimports.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) Spyder Project Contributors\n#\n# Licensed under the terms of the MIT License\n# (see LICENSE.txt for details)\n# ----... | python | edit | 1 | 0 | mit | e2813d7c27079a259f542ff36383ec0aa2233a9e | spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal | spyder_terminal/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport time\n\n\nclass PeriodicFilter:\n \"\"\"\n Periodic Filter to help keep down clutter in the console.\n Simply add this filter to your logger and the logger will\n only print periodically.\n\n ... | python | edit | 1 | 2 | bsd-3-clause | 562fa35a036a43526b55546d97490b3f36001a18 | robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities | robotpy_ext/misc/periodic_filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import lru_cache\r\nfrom typing import List\r\nimport sys\r\n\r\nREGEX_TEXT = (\"(?<=[a-z0-9])(?=[A-Z])|\"\r\n \"(?<=[A-Z0-9])(?=[A-Z][a-z])|\"\r\n \"(?<=[0-9])(?=[a-zA-Z])|\"\r\n \"(?<=... | python | edit | 1 | 4 | mit | 231657e2bbc81b8299cc91fd24dcd7394f74b4ec | microsoft/dpu-utils,microsoft/dpu-utils | python/dpu_utils/codeutils/identifiersplitting.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .KEYNOTFOUND import KEYNOTFOUNDIN1\nfrom .dict_diff import dict_diff\n\ndef get_old_dict_values(old, new):\n\t# Returns the \"old\" value for two dicts.\n\tdiff = dict_diff(old, new)\n\n\treturn {key: diff[key][0] if diff[key][0] != KE... | python | edit | 1 | 3 | mit | 8b669c8e242bb3a66527edb004ea6feab8258168 | StoDevX/course-data-tools,StoDevX/course-data-tools | scripts/lib/get_old_dict_values.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, unicode_literals\n\nfrom changes.api.base import APIView\nfrom changes.constants import Status\nfrom changes.config import db\nfrom changes.jobs.sync_job_step import sync_job_step\nfrom chan... | python | edit | 1 | 3 | apache-2.0 | 9b720026722ce92a8c0e05aa041d6e861c5e4e82 | dropbox/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes | changes/api/jobstep_deallocate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.contrib import admin\nfrom django.conf import settings\n\nadmin.autodiscover()\nurlpatterns = patterns('',\n (r'^admin/(.*)', admin.site.root),\n (r'^', include('blangoblog.blango.u... | python | edit | 5 | 0 | bsd-3-clause | 22428bcdbb095b407a0845c35e06c8ace0653a44 | fiam/blangoblog,fiam/blangoblog,fiam/blangoblog | urls.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\napp.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')\ndb = SQLAlchemy(app)\n\nclass FoodMenu(... | python | edit | 1 | 1 | mit | 39dbbac659e9ae9c1bbad8a979cc99ef6eafaeff | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom slackbot.bot import respond_to\nfrom slackbot.bot import listen_to\nimport re\nimport urllib\n\n```\n\nApply this change: Add url_validator function and respond aciton to test url"
},
{
"role": "assistant",
"content": "from... | python | edit | 5 | 3 | mit | 760506e88d22d86be818017fb6075abe7af2a068 | KrzysztofSendor/dactyl | dactyl.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\n\nfrom ask import alexa\n\ndef lambda_handler(request_obj, context=None):\n return alexa.route_request(request_obj)\n\n@alexa.default\ndef default_handler(reque... | python | edit | 1 | 1 | mit | 2c8b60569d20a350b33f3c5e8ba00bdc3d9bbee4 | geoaxis/ask-sweden,geoaxis/ask-sweden | ask_sweden/lambda_function.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom django.core.urlresolvers import reverse\nfrom django.utils.encoding import iri_to_uri\n\nimport datetime\n\nfrom knights.library import Library\n\nregister = Library()\n\n\n@register.helper\ndef now(fmt):\n return datetime.datetim... | python | edit | 3 | 2 | mit | abd3daed5cd0c70d76bf8fa1cfdda93efcda3e70 | funkybob/knights-templater,funkybob/knights-templater | knights/compat/django.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django import forms\nfrom django.contrib.auth.forms import UserCreationForm\nfrom django.contrib.admin.widgets import FilteredSelectMultiple\nfrom django.contrib.auth.models import Group\n\nfro... | python | edit | 1 | 0 | apache-2.0 | 4db52d5c8a10460fb9ea4a701e953f790a720f83 | aaxelb/osf.io,Nesiehr/osf.io,erinspace/osf.io,brianjgeiger/osf.io,TomBaxter/osf.io,adlius/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,crcresearch/osf.io,brianjgeiger/osf.io,binoculars/osf.io,adlius/osf.io,laurenrevere/osf.io,mfraezz/osf.io,cslzchen/osf.io,caneruguz/osf.io,chrisseto/osf.io,felliot... | admin/common_auth/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012 Spil Games\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.apach... | python | edit | 1 | 0 | apache-2.0 | e5e83b75e250ee3c6d8084e23ee777d519293cb6 | spilgames/swprobe,spilgames/swprobe | swprobe/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport redis\n\n\nclass RedisPersist:\n _redis_connection = None\n\n def __init__(self, host=\"localhost\", port=6379, db=0):\n self._redis_connection = redis.StrictRedis(\n host=host,\n port=port,\n ... | python | edit | 1 | 3 | apache-2.0 | 689417cef23297e54b5f082e31539bd2381798bf | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | Persistence/RedisPersist.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 IBM Corporation\n# All rights reserved\n\n# This is the main application.\n# It should check for existing UDP socket to negotiate socket listen takeover\n# It will have three paths into it:\n# -Unix domain socket\n# -TL... | python | edit | 8 | 2 | apache-2.0 | c9762cb5362a7fdba6050f5044db00d34eae6edb | chenglch/confluent,jufm/confluent,chenglch/confluent,whowutwut/confluent,xcat2/confluent,jjohnson42/confluent,michaelfardu/thinkconfluent,jjohnson42/confluent,xcat2/confluent,chenglch/confluent,jjohnson42/confluent,jufm/confluent,whowutwut/confluent,michaelfardu/thinkconfluent,jufm/confluent,xcat2/confluent,chenglch/co... | confluent/main.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom django.db import connection\nfrom django.db.migrations.executor import MigrationExecutor\n\n\n@pytest.mark.django_db(transaction=True)\ndef test_workstation_group_migration():\n executor = MigrationExecutor(connection... | python | edit | 1 | 1 | apache-2.0 | 47c2936e65d00a08896b4e60060ff737b7a2f675 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | app/tests/workstations_tests/test_migrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##\n# Copyright (c) 2010 Sprymix Inc.\n# All rights reserved.\n#\n# See LICENSE for details.\n##\n\n\nfrom metamagic import app\nfrom metamagic.exceptions import MetamagicError\n\n\nclass UnsatisfiedRequirementError(MetamagicError):\n pa... | python | edit | 1 | 0 | apache-2.0 | 34bd55b33e865c65386f934c7ac0b89f3cc76485 | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/common/shell/reqs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nfrom unittest import TestCase\n\nfrom rule import PriceRule\nfrom stock import Stock\n\n\nclass TestPriceRule(TestCase):\n @classmethod\n def setUpClass(cls):\n goog = Stock(\"GOOG\")\n goo... | python | edit | 1 | 1 | mit | 631f9edec1574054ef5612b652b94397af141d7a | bsmukasa/stock_alerter | tests/test_rule.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport database as db\nfrom database.model import Team\nfrom geotools import simple_distance\nfrom geotools.routing import MapPoint\n\ntry:\n from uwsgidecorators import spool\nexcept ImportError as e:\n def spool(fn):\n def nu... | python | edit | 4 | 2 | bsd-3-clause | f25dde13d04e9c6eda28ac76444682e53accbdb3 | eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | src/webapp/tasks.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nINPUT_DECL_PATHS = [\n \"../../target/device/libio/export\"\n# \"../../../pia-sdk-repo/iolib/arduino/arduiPIA.h\"\n]\n\nAUTOGEN_TEST = 1\n\nif AUTOGEN_TEST == 1:\n INPUT_DECL_PATHS = [\n \"./testSuite/\"\n ]\n\n\nVERSION ... | python | edit | 1 | 0 | bsd-3-clause | d28bbd597ddbcbf516f490b5bc0511adb63a4be7 | ilc-opensource/io-js,ilc-opensource/io-js,ilc-opensource/io-js,ilc-opensource/io-js,ilc-opensource/io-js | utils/autogen/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import VERSION as DJANGO_VERSION\nfrom django.http import HttpResponse\n\nif DJANGO_VERSION >= (1, 6):\n from django.conf.urls import patterns, url\nelse:\n from django.conf.urls.defaults import patterns, url\n\n\nurlpatte... | python | edit | 1 | 0 | unlicense | c1f8d5817b8c94b422c0d454dcc0fa3c00e751b6 | j4mie/django-activelink | activelink/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nLift ckernels to their appropriate rank so they always consume the full array\narguments.\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport datashape\nfrom pykit.ir import transform, Op\n\n#------... | python | edit | 1 | 2 | bsd-3-clause | b219823af7188f968d7c52c5273148c510bd7454 | ChinaQuants/blaze,jdmcbr/blaze,xlhtc007/blaze,aterrel/blaze,FrancescAlted/blaze,mrocklin/blaze,maxalbert/blaze,alexmojaki/blaze,dwillmer/blaze,cowlicks/blaze,LiaoPan/blaze,jcrist/blaze,maxalbert/blaze,mrocklin/blaze,cowlicks/blaze,ChinaQuants/blaze,aterrel/blaze,scls19fr/blaze,mwiebe/blaze,FrancescAlted/blaze,nkhuyu/bl... | blaze/compute/air/frontend/ckernel_impls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nHarvester of pubmed for the SHARE notification service\n\"\"\"\n\n\nfrom __future__ import unicode_literals\n\nfrom scrapi.base import schemas\nfrom scrapi.base import helpers\nfrom scrapi.base import OAIHarvester\n\n\ndef oai_extra... | python | edit | 1 | 6 | apache-2.0 | f1e1df825b69c33913096af1cb6e20b7d2db72ce | CenterForOpenScience/scrapi,mehanig/scrapi,icereval/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,alexgarciac/scrapi,fabianvf/scrapi,felliott/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,ostwald/scrapi,erinspace/scrapi,fabianvf/scrapi,erinspace/scrapi | scrapi/harvesters/pubmedcentral.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .transition import Transition\n\n\nclass CircularBuffer(object):\n def __init__(self, capacity=100000):\n self.capacity = capacity\n self.memory = []\n self.position = 0\n\n def push(self, *args):\n if... | python | edit | 1 | 2 | mit | a9fb1bb437e27f0bcd5a382e82f100722d9f0688 | floringogianu/categorical-dqn | data_structures/circular_buffer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''Due to the needs arising from completing the project on time, I have defined redundant.py\nwhich will hold replacement modules as I migrate from file based application to lists only web application. This modules\nso far will offer the ca... | python | edit | 3 | 1 | mit | 52a6ea1e7dd4333b9db6a0bbd53b8ae0b39a1f6d | AndersonMasese/Myshop,AndersonMasese/Myshop,AndersonMasese/Myshop | Designs/redundant.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest some lldb platform commands.\n\"\"\"\n\nimport os, time\nimport unittest2\nimport lldb\nfrom lldbtest import *\n\nclass PlatformCommandTestCase(TestBase):\n\n mydir = \"platform\"\n\n def test_help_platform(self):\n ... | python | edit | 6 | 1 | apache-2.0 | 0cd8be8ce3b11fe9c2591591c12cad5b688e6d0e | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb | test/platform/TestPlatformCommand.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom django.conf import settings\nfrom django.utils.encoding import smart_bytes\n\nfrom pipeline.compilers import CompilerBase\nfrom pipeline.exceptions import CompilerError\n\n\nclass BrowserifyCompiler(CompilerBase):\n out... | python | edit | 1 | 4 | bsd-3-clause | cedac36d38ff0bf70abc1c9193948a288e858a01 | mythmon/kitsune,MikkCZ/kitsune,brittanystoroz/kitsune,anushbmx/kitsune,MikkCZ/kitsune,anushbmx/kitsune,safwanrahman/kitsune,brittanystoroz/kitsune,MikkCZ/kitsune,mozilla/kitsune,safwanrahman/kitsune,mythmon/kitsune,anushbmx/kitsune,mythmon/kitsune,safwanrahman/kitsune,mozilla/kitsune,brittanystoroz/kitsune,mythmon/kits... | kitsune/lib/pipeline_compilers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nVery basic implementation of an event loop\n==========================================\n\nThe eventloop is a singleton to schedule and run events.\n\nExports\n-------\n\n- ``EventLoop``: the basic eventloop\n\n\"\"\"\n\nimport que... | python | edit | 5 | 3 | mit | db14ed2c23b3838796e648faade2c73b786d61ff | waltermoreira/tartpy | tartpy/eventloop.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# regex below borrowed from https://github.com/roadhump/SublimeLinter-eslint\n# and is MIT-licensed from roadhump.\n# \n# Written by andrewdeandra... | python | edit | 1 | 0 | mit | 23f32962e136dae32b3165f15f8ef7e2d5319530 | Raynos/SublimeLinter-contrib-lint-trap | linter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport pandas as pd\nimport sys\nimport os\nfrom sklearn.externals import joblib\nfrom sklearn.ensemble import RandomForestClassifier\n\nscriptpath = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../'\nsys.path.appe... | python | edit | 2 | 0 | bsd-3-clause | 818e15028c4dd158fa93fe4bcd351255585c2f4f | parkerzf/kaggle-expedia,parkerzf/kaggle-expedia,parkerzf/kaggle-expedia | src/model/predict_rf_model.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\"\"\" Run the Skia bench_pictures executable.... | python | edit | 1 | 1 | bsd-3-clause | e5963987e678926ad8cdde93e2551d0516a7686b | Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Ti... | slave/skia_slave_scripts/android_bench_pictures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef YilmIndexVector(i, l, m):\n \"\"\"\n Compute the index of an 1D array of spherical harmonic coefficients\n corresponding to i, l, and m.\n\n Usage\n -----\n index = YilmIndexVector (i, l, m)\n\n Returns\n -------... | python | edit | 1 | 4 | bsd-3-clause | ad7507f795f465425e72fb6821115e395046b84d | SHTOOLS/SHTOOLS,MarkWieczorek/SHTOOLS,MarkWieczorek/SHTOOLS,SHTOOLS/SHTOOLS | pyshtools/shio/yilm_index_vector.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Test to see if openpty works. (But don't worry if it isn't available.)\n\nimport os, unittest\nfrom test.test_support import run_unittest, TestSkipped\n\nclass OpenptyTest(unittest.TestCase):\n def test(self):\n try:\n ... | python | edit | 2 | 2 | mit | d2fc123454bdf0089043ef3926798f3f79904c60 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_openpty.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nimport pickle\n\n# Check argument\nif len(sys.argv) != 2:\n print(\"%s filename\" % sys.argv[0])\n raise SystemExit(1)\n\n# Write tuples\nfile = open(sys.argv[1], \"wb\");\nline = []\nwhile True:\n ... | python | edit | 3 | 0 | bsd-2-clause | 97a490db75f0a4976199365c3f654ba8cdb9a781 | zzz0072/Python_Exercises,zzz0072/Python_Exercises | 01_Built-in_Types/tuple.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom TestStack.White.UIItems import TextBox\nfrom WhiteLibrary.keywords.librarycomponent import LibraryComponent\nfrom WhiteLibrary.keywords.robotlibcore import keyword\n\n\nclass TextBoxKeywords(LibraryComponent):\n @keyword\n def in... | python | edit | 1 | 1 | apache-2.0 | 00e4663940ed1d22e768b3de3d1c645c8649aecc | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary | src/WhiteLibrary/keywords/items/textbox.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, print_function\nimport sqlite3, os, random\n\n_select = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'\n_uncommon_select = 'select value from uncommons where key=?... | python | edit | 1 | 7 | unlicense | 56fca00d992c84e46e60fa8b9ea66eb9eadc7508 | rotated8/mgsv_names | mgsv_names.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils import timezone\nfrom django.contrib.auth.models import BaseUserManager\n\nfrom model_utils.managers import InheritanceQuerySet\n\nfrom .conf import settings\n\n\nclass UserManager(BaseUserManager):\n\n def _create_user... | python | edit | 1 | 2 | bsd-3-clause | 4e8dc0ca41ee1e21a75a3e803c3b2b223d9f14cb | mishbahr/django-users2,mishbahr/django-users2 | users/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2010 Inoi Oy\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, inclu... | python | edit | 2 | 0 | mit | 82c95e2fcb1d3879ac9b935c7c9b883c42acf26a | inoi/trombi | trombi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.protocols import amp\nfrom twisted.cred.error import UnauthorizedLogin\n\n# commands to server side\n\nclass Login(amp.Command):\n arguments = [(\"username\", amp.String()), (\"password\", amp.String())]\n response = []\n... | python | edit | 1 | 0 | mit | d629e7e1bb24e6ee7a0224b4929d538a23afaa43 | dripton/ampchat | commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Cloudbase Solutions Srl\n# 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 o... | python | edit | 1 | 1 | apache-2.0 | c26fc5da048bb1751bb6401dbdb8839f89d82c1e | mahak/nova,klmitch/nova,openstack/nova,klmitch/nova,klmitch/nova,mahak/nova,mahak/nova,klmitch/nova,openstack/nova,openstack/nova | nova/policies/server_diagnostics.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom ..base import Resource\nfrom ...utils import enforce_string_type\n\n\nclass State(Resource):\n\n _resource_name = 'states'\n\n _as_is_fields = ['id', 'href', 'name']\n _resource_field... | python | edit | 1 | 1 | mit | beeae2daf35da275d5f9e1ad01516c917319bf00 | gadventures/gapipy | gapipy/resources/geo/state.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport re\nimport argparse\n\ndef fix_fathatan(file_path):\n with open(file_path, 'r') as file:\n lines = file.readlines()\n\n new_lines = []\n for line in lines:\n new_lines.append(re.sub(r'اً... | python | edit | 1 | 2 | mit | c2798702a1f2b1dc40c10b481b9989f9a86c71b2 | AliOsm/arabic-text-diacritization | helpers/fix_fathatan.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .parts import Column\n\n\ndef BETWEEN(expr1, expr2, expr3):\n return Column('%s BETWEEN %s AND %s' % (_actual_n(expr1), _actual_n(expr2), _actual_n(expr3)))\n\n\ndef CAST(type1, type2):\n return Column('CAST(%s AS %s)' % (type1, ... | python | edit | 1 | 3 | bsd-3-clause | 1c86e9164d9df9cbb75b520b9700a5621a1116f9 | fuller-inc/bqx | bqx/_func.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\n\nclass UnitConversion():\n def __init__(self, coef):\n self.p = np.poly1d(coef)\n\n def machine_to_physics(self, machine_value):\n return self.p(machine_value)\n\n def physics_to_machine(self, p... | python | edit | 1 | 4 | apache-2.0 | f1a1272bebcc4edf9063c75d3fe29fdcb9e277eb | willrogers/pml,razvanvasile/RML,willrogers/pml | rml/unitconversion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport mothermayi.errors\nimport mothermayi.files\nimport subprocess\n\nLOGGER = logging.getLogger(__name__)\n\ndef plugin():\n return {\n 'name' : 'pylint',\n 'pre-commit' : pre_commit,\n }\n... | python | edit | 3 | 3 | mit | f8c6876f6a1567fb0967c12365ae061d44d6f3db | EliRibble/mothermayi-pylint | mmipylint/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nimport alabaster\n\n\n# Alabaster theme + mini-extension\nhtml_theme_path = [alabaster.get_path()]\nextensions = ['alabaster']\n# Paths relative to invoking conf.py - not this shared file\nhtml_static_path =... | python | edit | 1 | 0 | bsd-2-clause | 65010bed4885223be3ed424b4189de368d28080f | haridsv/fabric,cgvarela/fabric,ploxiln/fabric,tekapo/fabric,bitmonk/fabric,kmonsoor/fabric,amaniak/fabric,sdelements/fabric,likesxuqiang/fabric,TarasRudnyk/fabric,mathiasertl/fabric,tolbkni/fabric,pgroudas/fabric,SamuelMarks/fabric,jaraco/fabric,rbramwell/fabric,bspink/fabric,raimon49/fabric,kxxoling/fabric,qinrong/fab... | sites/shared_conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TestAccelerateSIMD.py\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors\n# Licensed under Apache License v2.0 with Runtime Library Exception\n#\n# ... | python | edit | 5 | 0 | apache-2.0 | cf0d928cffc86e7ba2a68a7e95c54c7e530d2da8 | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | packages/Python/lldbsuite/test/lang/swift/accelerate_simd/TestAccelerateSIMD.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nPACKAGE_NAME = \"ReviewBot\"\nVERSION = \"0.1\"\n\n\nsetup(name=PACKAGE_NAME,\n version=VERSION,\n description=\"ReviewBot, the automated code reviewer\",\n author=\"Steven MacLe... | python | edit | 1 | 0 | mit | 0a2dc53cd388f73064bb66e794e3af5f3e48a92f | reviewboard/ReviewBot,reviewboard/ReviewBot,reviewboard/ReviewBot,reviewboard/ReviewBot | bot/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\n\nfrom iwant_bot import start\n\n\ndef test_add():\n assert start.add_numbers(0, 0) == 0\n assert start.add_numbers(1, 1) == 2\n\n```\n\nApply this change: Remove the unused pytest import"
},
{
"role": "assist... | python | edit | 1 | 1 | mit | 5957999c52f939691cbe6b8dd5aa929980a24501 | kiwicom/iwant-bot | tests/unit/test_start.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\r\nfrom django.core.management import call_command\r\nfrom django.conf import settings\r\nfrom django.utils import timezone\r\n\r\nimport logging\r\nimport os\r\n\r\nfrom danceschool.core.... | python | edit | 1 | 4 | bsd-3-clause | e81b920ad19872306d6e18bc9f21c296bb2fd6ab | django-danceschool/django-danceschool,django-danceschool/django-danceschool,django-danceschool/django-danceschool | danceschool/backups/management/commands/backup_now.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import viewsets\n\nfrom books.models import BookPage\nfrom books.serializers import BookPageSerializer\n\n\nclass BookPageViewSet(viewsets.ModelViewSet):\n \"\"\"\n API endpoint that allows BookPages to be viewed o... | python | edit | 1 | 0 | mit | 3e98ed8801d380b6ab40156b1f20a1f9fe23a755 | Pepedou/Famas | books/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Commonly-used default transformers.\"\"\"\nfrom fuel.transformers import ScaleAndShift, Cast, SourcewiseTransformer\nfrom fuel.transformers.image import ImagesFromBytes\n\n\ndef uint8_pixels_to_floatX(which_sources):\n return (\n ... | python | edit | 1 | 4 | mit | b823233978f70d8e34a3653b309ee43b4b1e0c0d | udibr/fuel,markusnagel/fuel,vdumoulin/fuel,mila-udem/fuel,dmitriy-serdyuk/fuel,udibr/fuel,markusnagel/fuel,aalmah/fuel,vdumoulin/fuel,aalmah/fuel,capybaralet/fuel,janchorowski/fuel,mila-udem/fuel,dribnet/fuel,capybaralet/fuel,dmitriy-serdyuk/fuel,janchorowski/fuel,dribnet/fuel | fuel/transformers/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chargehound.resources import Disputes\n\napi_key = None\nhost = 'api.chargehound.com'\nbase_path = '/v1/'\ntimeout = 5\n\n__all__ = [api_key, host, Disputes, timeout]\n\n```\n\nApply this change: Set timeout to 60 seconds"
},
{
... | python | edit | 1 | 0 | mit | 261421a647fae9eb4df998c26740f7141a68c13d | chargehound/chargehound-python | chargehound/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update to dev version 0.14.1+dev20220804"
},
{
"role": "assistant",
"content": "\"\"\"The version number defined here is read automatically in setup.py.\"\"\"\n\n__version__ = \"0.14.1.dev20220804\"\n"
}
] | python | new_file | 1 | 0 | apache-2.0 | 0f018ec9bfd0c93d980b232af325be453c065632 | quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim | qsimcirq/_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework.permissions import BasePermission\n\n\nSAFE_METHODS = ['GET', 'HEAD', 'OPTIONS']\n\n\nclass OAuth2ScopePermission(BasePermission):\n \"\"\"\n Make sure request is authenticated and token has right scope set.\n \... | python | edit | 1 | 8 | bsd-2-clause | 1915cde046c1817c45317ad8ce882e807671fca3 | eofs/django-oauth-api,eofs/django-oauth-api | oauth_api/permissions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom ..models import Tag\nfrom ..utils import DetailView\nfrom ..views import (\n TagCreate, TagDelete, TagList, TagPageList,\n TagUpdate)\n\nurlpatterns = [\n url(r'^$',\n TagList.as_view... | python | edit | 1 | 0 | bsd-2-clause | afa6687c317191b77949ba246f3dcc0909c435f5 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/urls/tag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom scraper import search_CL\nfrom scraper import read_search_results\nfrom scraper import parse_source\nfrom scraper import extract_listings\nimport bs4\n\n\ndef test_search_CL():\n test_body, test_encoding = search_CL(minAsk=100, maxA... | python | edit | 1 | 2 | mit | eede55d9cd39c68ef03091614096e51d7df01336 | jefrailey/basic-scraper | test_scraper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport time\nimport requests\n\n\ndef save_google_translation(queue, source_text, client_id, client_secret, translate_from='et', translate_to='en'):\n translation = ''\n\n try:\n b... | python | edit | 2 | 2 | mit | 0e2270415b287cb643cff5023dcaacbcb2d5e3fc | ChameleonTartu/neurotolge,ChameleonTartu/neurotolge,ChameleonTartu/neurotolge | translators/google.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | python | edit | 1 | 1 | bsd-3-clause | 7b1d520278b8fe33b68103d26f9aa7bb945f6791 | bwhmather/cryptography,Ayrx/cryptography,bwhmather/cryptography,Lukasa/cryptography,Ayrx/cryptography,bwhmather/cryptography,kimvais/cryptography,skeuomorf/cryptography,dstufft/cryptography,kimvais/cryptography,Lukasa/cryptography,dstufft/cryptography,Ayrx/cryptography,skeuomorf/cryptography,Lukasa/cryptography,sholsap... | cryptography/hazmat/backends/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\nfrom inspect import getcallargs\n\nfrom timer import Timer\n\n\ndef bench(f):\n \"\"\"Times a function given specific arguments.\"\"\"\n\n # TODO mettre args (n_repeat, func) qui execute n_repeat fois et a... | python | edit | 1 | 2 | mit | 1c3c092afae1946e72a87cca8792bd012bee23e4 | ktbs/ktbs-bench,ktbs/ktbs-bench | ktbs_bench/utils/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 Red Hat, Inc.\n# Copyright 2013 IBM Corp.\n# 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 obt... | python | edit | 1 | 0 | apache-2.0 | 582c7183cab87b449acee5775deb12677a0b0cee | varunarya10/oslo.i18n,openstack/oslo.i18n | oslo_i18n/_i18n.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.