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\nfrom oauthlib.oauth2.draft25 import utils\nimport foauth.providers\n\n\ndef token_uri(service, token, r):\n params = [((u'access_token', token)), ((u'api_key', service.client_id))]\n r.url = utils.add_params_to_uri(r.url, params)\n ... | python | edit | 1 | 1 | bsd-3-clause | d7db5b38bd90502575c68d7fd5548cb64cd7447a | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/disqus.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom oscar.core.application import Application\n\nfrom systempay import views\n\n\nclass SystemPayApplication(Application):\n name = 'systempay' \n\n secure_redirect_view = views.SecureRedir... | python | edit | 1 | 1 | mit | 72ee9b82e9f91436aeeba144ad687435d349b85a | bastien34/django-oscar-systempay,dulaccc/django-oscar-systempay,bastien34/django-oscar-systempay | systempay/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom remotecv import pyres_tasks\nfrom remotecv.unique_queue import UniqueQueue\n\nfrom thumbor.detectors import BaseDetector\n\nclass QueuedDetector(BaseDetector):\n queue = UniqueQueue()\n\n def detect(self, callback):\n engi... | python | edit | 3 | 1 | mit | 52d65ff926a079b4e07e8bc0fda3e3c3fe8f9437 | fanhero/thumbor,fanhero/thumbor,fanhero/thumbor,fanhero/thumbor | thumbor/detectors/queued_detector/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Copyright (c) 2009 rPath, Inc.\n#\n# All Rights Reserved\n#\nfrom mint import amiperms\n\nclass AWSHandler(object):\n def __init__(self, cfg, db):\n self.db = db\n self.amiPerms = amiperms.AMIPermissionsManager(cfg, db... | python | edit | 1 | 1 | apache-2.0 | 92d25e86620fcdc415e94d5867cc22a95f88ca3a | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | mint/rest/db/awshandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Do not commit secrets to VCS.\n\n# Local environment variables will be loaded from `.env.local`.\n# Additional environment variables will be loaded from `.env.$DOTENV`.\n# Local settings will be imported from `project_settings_local.py`\n... | python | edit | 2 | 0 | mit | 3ebf7f1633a072cd09f006910660373527d335bb | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | project_template/project_settings.py | rejected_duplicate | Near-duplicate of sample 1904 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"User views.\"\"\"\nfrom flask import Blueprint, render_template\nfrom flask_login import login_required\n\nblueprint = Blueprint('user', __name__, url_prefix='/users', static_folder='../static')\n\n\n@blueprin... | python | edit | 1 | 1 | bsd-3-clause | 2de7427d06ff33bf8bdfe0424e07b3fb34621b07 | joeirimpan/shop,joeirimpan/shop,joeirimpan/shop | shop/user/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.http import HttpResponse, HttpResponseNotFound\n\n\ndef handle_ping(request, repo):\n return HttpResponse()\n\n\ndef handle_issues(request, repo):\n return HttpResponse... | python | edit | 1 | 6 | apache-2.0 | 43fd422599972f9385c9f3f9bc5a9a2e5947e0ea | Jucyio/Jucy,Jucyio/Jucy,Jucyio/Jucy | web/webhooks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"elmo URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app impor... | python | edit | 1 | 0 | mit | 15a8d73d38a1fb254bf38bdfc0c9ebd15b1af05e | StephenSwat/eve_lunar_mining_organiser,StephenSwat/eve_lunar_mining_organiser | elmo/elmo/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import ctask as task\n\n\n@task(help={\n 'module': \"Just runs tests/STRING.py.\",\n 'runner': \"Use STRING to run tests instead of 'spec'.\",\n 'opts': \"Extra flags for the test runner\",\n 'pty': \"Whether to run ... | python | edit | 1 | 4 | bsd-2-clause | 26c96aaa57c745840944c2aea5613ff861bb717f | singingwolfboy/invocations,pyinvoke/invocations,mrjmad/invocations | invocations/testing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom peewee import *\n\ndb = SqliteDatabase('sensors.db')\n\n\nclass Sensor(Model):\n name = CharField()\n value = CharField()\n timestamp = DateField()\n\n class Meta:\n database = db # This model uses the \"people.db\"... | python | edit | 7 | 2 | mit | 3204b2d5110a1a5cd16bad36ba5d5e916741fd2b | rrader/sens-o-matic,rrader/sens-o-matic,rrader/sens-o-matic | sensomatic/ui/persistence/models.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"test_void.py\n\nTest the parsing of VoID dump files.\n\n\"\"\"\n\nimport RDF\n\nfrom glharvest import util\n\n\ndef test_returns_none_if_the_registry_file_is_not_found():\n m = util.load_file_into_model(\"nonexistantvoidfile.ttl\")... | python | edit | 3 | 1 | apache-2.0 | 1028afcdc1e8e1027b10fe5254f5fe5b9499eddd | ec-geolink/glharvest,ec-geolink/glharvest,ec-geolink/glharvest | tests/test_void.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom var import *\nfrom ui_elements import *\nfrom gi.repository import Gtk\nfrom torctl import *\n\n# ORGANIZATION OF THESE LISTS:\n# 1. Main list for all the elements\n# 2. A sublist for each element, with the first being a label, and the... | python | edit | 15 | 0 | bsd-2-clause | 352cb871a86abd926842a0624475db1f2ee2c0ce | neelchauhan/TorNova,neelchauhan/TorGTK | TorGTK/list_elements.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cookiecutter.main import is_repo_url\n\n\ndef test_is_repo_url():\n \"\"\"Verify is_repo_url works.\"\"\"\n assert is_repo_url('gitolite@server:team/repo') is True\n assert is_repo_url('<EMAIL>:audreyr/cookiecutter.git') is Tr... | python | edit | 1 | 1 | bsd-3-clause | d5b231fbc5dd32ded78e4499a49872487533cda4 | willingc/cookiecutter,michaeljoseph/cookiecutter,luzfcb/cookiecutter,stevepiercy/cookiecutter,pjbull/cookiecutter,ramiroluz/cookiecutter,luzfcb/cookiecutter,stevepiercy/cookiecutter,michaeljoseph/cookiecutter,pjbull/cookiecutter,cguardia/cookiecutter,terryjbates/cookiecutter,Springerle/cookiecutter,hackebrot/cookiecutt... | tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nA collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.\n\"\"\"\nimport os\nfrom lxml import etree\n\nclass prep_kml():\n\n def __init__ (self, inputfile):\n self.inputfile = inputfile\n ... | python | edit | 1 | 1 | mit | 3f136f153cdc60c1dcc757a8a35ef116bb892a1c | AstunTechnology/Loader | python/prep_policekml.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis module implements the some simple utilitiy functions.\n\n.. :copyright: (c) 2016 by Jelte Fennema.\n :license: MIT, see License for more details.\n\"\"\"\n\nfrom llfuse import FUSEError\n\nfrom contextlib import contextmana... | python | edit | 1 | 4 | mit | e406def7737c3b4528ccb7345ba68ece61edcc84 | JelteF/easyfuse,JelteF/easyfuse | easyfuse/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n# SECRET_KEY and DATABASES needs to be defined before the base settings is imported.\nSECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q=='\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite... | python | edit | 2 | 0 | bsd-3-clause | edb07b507aa93ead278cecd168da83a4be68b2ba | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | bluebottle/settings/travis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCustom *xml4h* exceptions.\n\"\"\"\n\n\nclass BaseXml4hException(Exception):\n \"\"\"\n Base exception class for all non-standard exceptions raised by *xml4h*.\n \"\"\"\n pass\n\n\nclass FeatureUnavailableException(BaseX... | python | edit | 1 | 1 | mit | 939e5721300013b2977375f28897a6a573509112 | jmurty/xml4h,pipermerriam/xml4h,czardoz/xml4h | xml4h/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n__version__ = \"0.21.0rc5\"\nversion = tuple(__version__.split('.'))\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n\n```\n\nApply this change: Bump version 0.21.0rc5 --> 0.21.0rc6\n\nSigned-off-by: Jack... | python | edit | 1 | 0 | mit | 8eb740cf678d15b2c1c299580c1f60d37528f3be | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms.widgets import Widget\nfrom django.utils.safestring import mark_safe\n\n\nclass WidgetWithScript(Widget):\n def render_html(self, name, value, attrs):\n \"\"\"Render the HTML (non-JS) portion of the field markup\... | python | edit | 1 | 2 | bsd-3-clause | c7d522393930dabc1bb6997bbc2b450d043817e8 | FlipperPA/wagtail,nimasmi/wagtail,timorieber/wagtail,kaedroho/wagtail,wagtail/wagtail,takeflight/wagtail,zerolab/wagtail,kaedroho/wagtail,gasman/wagtail,timorieber/wagtail,zerolab/wagtail,wagtail/wagtail,mikedingjan/wagtail,jnns/wagtail,zerolab/wagtail,mixxorz/wagtail,nimasmi/wagtail,zerolab/wagtail,mixxorz/wagtail,wag... | wagtail/utils/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\nfrom lxml import etree\n\n\ndef validate_xml(xmlout):\n with open(os.path.join(os.path.dirname(__file__), 'pain.008.001.02.xsd'), 'rb') as schema_file:\n schema_xml = schema_file.read()\n schema_root = e... | python | edit | 1 | 1 | mit | 6835fa9e8978a081186008785bd2e11522372aa9 | raphaelm/python-sepadd,lutoma/python-sepadd | tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\n\"\"\"Jinja globals module for pybossa-discourse.\"\"\"\n\nfrom flask import Markup, request\nfrom . import discourse_client\n\n\nclass DiscourseGlobals(object):\n \"\"\"A class to implement Discourse Global varia... | python | edit | 1 | 4 | bsd-3-clause | 87f892731678049b5a706a36487982ebb9da3991 | alexandermendes/pybossa-discourse | pybossa_discourse/globals.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom corehq.apps.locations.models import Location\nfrom dimagi.utils.couch.database import iter_docs\nfrom datetime import datetime\n\nclass Command(BaseCommand):\n help = 'Populate la... | python | edit | 1 | 7 | bsd-3-clause | e6ca7ef801115d16d809c563b657c3a63e828fb1 | qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoft... | corehq/apps/locations/management/commands/location_last_modified.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import resolve\nfrom django.test import TestCase, RequestFactory\nimport unittest\n\nfrom landing.views import LandingView\n\nclass LandingPageTests(TestCase):\n def test_root_url_resolves_to_landing_page_vi... | python | edit | 4 | 1 | mit | f2b2927216c6392625d22fac4bcc6f9005ec51fb | XeryusTC/projman,XeryusTC/projman,XeryusTC/projman | landing/tests/test_views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# euler 009\n\n# A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,\n# a^2 + b^2 = c^2\n#\n# For example, 32 + 42 = 9 + 16 = 25 = 52.\n# \n# There exists exactly one Pythagorean triplet for which a + b + c = 1000... | python | edit | 1 | 0 | mit | f2f74f53fe8f5b4ac4cd728c4181b3a66b4e873d | josienb/project_euler,josienb/project_euler | euler009.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nVarious utilities\n\"\"\"\nimport pprint\n\ndef load_state(path):\n \"\"\"\n Load an n-puzzle state from a file into an array and return it.\n \"\"\"\n result = []\n with open(path) as f:\n for line in f:\n ... | python | edit | 2 | 6 | mit | 873b82225d287dcca9b9bc0e0c3746233d15d947 | bandrebandrebandre/npuzz | utilities.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mhvdb2.models import Payment, Entity\nimport re\nfrom datetime import datetime\nfrom peewee import DoesNotExist\n\n\ndef validate(amount, email, method, type, notes, reference):\n errors = []\n\n if not amount or not amount.isdig... | python | edit | 1 | 13 | mit | cf4015104cd8043024e55de4bab2ef598d6209a9 | makehackvoid/mhvdb2,makehackvoid/mhvdb2 | mhvdb2/resources/payments.py | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport functools\n\nfrom rollbar.contrib.asgi import ASGIApp\n\n\ndef async_test_func_wrapper(asyncfunc):\n @functools.wraps(asyncfunc)\n def wrapper(*args, **kwargs):\n try:\n loop = asyncio.get_runn... | python | edit | 1 | 3 | mit | 770bbf80a78d2f418e47ca2dc641c7dccbb86cac | rollbar/pyrollbar | rollbar/test/asgi_tests/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kombu import Exchange, Queue\nimport os\nBROKER_URL = os.environ['CELERY_BROKER']\nCELERY_RESULT_BACKEND='rpc://'\nCELERY_RESULT_PERSISTENT = True\nCELERY_DISABLE_RATE_LIMITS = True\nCELERY_TASK_SERIALIZER = 'json'\nCELERY_RESULT_SERIA... | python | edit | 1 | 0 | mit | 79c12316cf132acdb5e375ea30f1cc67d7fd11ed | TheHonestGene/thehonestgene-pipeline | thehonestgenepipeline/celeryconfig.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python2.7\n\nimport model\n\nclass ReportingYear(model.Model):\n\tpass\nReportingYear.init_model(\"reporting_years\", \"reporting_year\")\n\n```\n\nApply this change: Fix a bug in the ReportingYear initialization"
},
{
... | python | edit | 1 | 0 | bsd-3-clause | b6d29826932d92662a7cd14b6f54327c9e8d4c0f | UngaForskareStockholm/medlem2 | model/reporting_year.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport matplotlib\nfrom matplotlib import pyplot as plt\n\nfrom astropy.utils.decorators import wraps\n\nMPL_VERSION = matplotlib.__version__\n\nROOT = \"http://{server}/testing/astropy/2018-10-24T12:38:34.134556/{mpl_version}/\"\nIMAGE_REF... | python | edit | 1 | 1 | bsd-3-clause | 178474ceb7227313d039666db3c235c2ee18251e | pllim/astropy,StuartLittlefair/astropy,mhvk/astropy,stargaser/astropy,stargaser/astropy,mhvk/astropy,mhvk/astropy,saimn/astropy,aleksandr-bakanov/astropy,astropy/astropy,lpsinger/astropy,dhomeier/astropy,aleksandr-bakanov/astropy,MSeifert04/astropy,StuartLittlefair/astropy,saimn/astropy,bsipocz/astropy,dhomeier/astropy... | astropy/tests/image_tests.py | rejected_duplicate | Near-duplicate of sample 1820 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport socket\n\n\nclass Socket:\n\n\tTCP = 0\n\tUDP = 1\n\n\tdef __init__(self, type):\n\t\tif type == self.TCP:\n\t\t\tself.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)\n\t\telse:\n\t\t\tself.s = socket.sock... | python | edit | 1 | 2 | mit | 02d67008d0f0bdc205ca9168384c4a951c106a28 | Kinnay/NintendoClients | nintendo/common/transport.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- coding: utf-8 -*-\n\ndef getClientIP( req ):\n\t'''\n\tGet the client ip address\n\t'''\n\txForwardedFor=req.META.get('HTTP_X_FORWARDED_FOR')\n\tif xForwardedFor:\n\t\tip=xForwardedFor.split(',')[0]\n\telse:\n\t\tip=req.META.get('REMOT... | python | edit | 2 | 2 | apache-2.0 | 7a78525bb8cc6176dfbe348e5f95373c1d70628f | kensonman/webframe,kensonman/webframe,kensonman/webframe | functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom consts.notification_type import NotificationType\nfrom helpers.model_to_dict import ModelToDict\nfrom notifications.base_notification import BaseNotification\n\n\nclass MatchScoreNotification(BaseNotification):\n\n def __init__(self... | python | edit | 1 | 1 | mit | 60d8b38eac3c36bd754f5ed01aae6d3af1918adc | phil-lopreiato/the-blue-alliance,verycumbersome/the-blue-alliance,verycumbersome/the-blue-alliance,fangeugene/the-blue-alliance,nwalters512/the-blue-alliance,the-blue-alliance/the-blue-alliance,tsteward/the-blue-alliance,bdaroz/the-blue-alliance,phil-lopreiato/the-blue-alliance,synth3tk/the-blue-alliance,synth3tk/the-b... | notifications/match_score.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"EcoData Retriever Excel Functions\r\n\r\nThis module contains optional functions for importing data from Excel.\r\n\r\n\"\"\"\r\n\r\nclass Excel:\r\n @staticmethod\r\n def empty_cell(cell):\r\n \"\"\"Tests whether an exce... | python | edit | 1 | 3 | mit | c17aed93f3dd5a1a46dfb871268ebda4e56b1bee | davharris/retriever,goelakash/retriever,embaldridge/retriever,henrykironde/deletedret,davharris/retriever,goelakash/retriever,embaldridge/retriever,davharris/retriever,henrykironde/deletedret,embaldridge/retriever | lib/excel.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3.5\nimport os,time,asyncio,json\nfrom datetime import datetime\nfrom aiohttp import web\nimport logging;logging.basicConfig(level=logging.INFO)\nfrom tools.log import Log\nfrom tools.httptools import Middleware... | python | edit | 11 | 1 | mit | 1dd681517fd1831f3990caa043ea8220f5d1bb90 | free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog | app/app.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nimport azure.cli.main\n\nfrom azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush\n\ntry:\n try:\n if user_agrees_to_telemetry():\n init_telemetry()\n except Exception... | python | edit | 1 | 0 | mit | 545f688f0dd59df009e2392cbf27ef06865a4b89 | yugangw-msft/azure-cli,BurtBiel/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,BurtBiel/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure... | src/azure/cli/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update project version and other metadata from previous"
},
{
"role": "assistant",
"content": "# Project Version and Author Information\n__author__ = \"EUL Systems\"\n__copyright__ = \"Copyright 2010, Emory University General Lib... | python | new_file | 1 | 0 | apache-2.0 | fe34b3be69c119729febefd23f80a24203383f8a | emory-libraries/pidman,emory-libraries/pidman | pidman/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\nfrom django.contrib.auth.models import User\nfrom django.utils.safestring import mark_safe\nimport re\nimport urllib\n\nregister = template.Library()\n\nusername_re = re.compile('@[0-9a-zA-Z]+')\nhashtag_re = re... | python | edit | 2 | 3 | bsd-2-clause | 0ac28421fe8ed4234db13ebdbb95c700191ba042 | devfort/bugle,devfort/bugle,simonw/bugle_project,devfort/bugle,simonw/bugle_project | bugle_project/bugle/templatetags/bugle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom numpy.testing import *\n\ndef check_float_type(tp):\n for x in [0, 1,-1, 1e10, 1e20] :\n assert_equal(str(tp(x)), str(float(x)))\n\ndef test_float_types():\n \"\"\" Check formatting.\n\n This is ... | python | edit | 7 | 2 | bsd-3-clause | 73a375a3adb140c270444e886b3df842e0b28a86 | chiffa/numpy,gfyoung/numpy,ekalosak/numpy,hainm/numpy,sigma-random/numpy,GrimDerp/numpy,sonnyhu/numpy,embray/numpy,GaZ3ll3/numpy,nbeaver/numpy,dimasad/numpy,gmcastil/numpy,musically-ut/numpy,kirillzhuravlev/numpy,simongibbons/numpy,ContinuumIO/numpy,simongibbons/numpy,mindw/numpy,ogrisel/numpy,rgommers/numpy,pelson/num... | numpy/core/tests/test_print.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom twisted.words.protocols import irc\nfrom txircd.modbase import Command, Module\n\nclass PassCommand(Command, Module):\n\tdef onUse(self, user, params):\n\t\tif user.registered == 0:\n\t\t\tuser.sendMessage(irc.ERR_ALREADYREGISTRED, \":... | python | edit | 7 | 3 | bsd-3-clause | 5ec99974a6611cc5993bf56f3f0f4e299a89e29d | DesertBus/txircd,Heufneutje/txircd,ElementalAlchemist/txircd | txircd/modules/cmd_pass.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\rimport re\rimport os\r\rurl = \"https://www.autohome.com.cn/shanghai/\"\rurlBox = []\rdef catchURL(url):\r file = requests.get(url,timeout=2)\r data = file.content\r links = re.findall(r'(https?://[^\\s)\";]+\\.(\\... | python | edit | 3 | 4 | mit | bd3dad98976d5e02c4a941ae3c687174db78781d | zhaodjie/py_learning | src/WebCatch/catchLink.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\ndef ensure_trailing_slash(mystr):\n if not mystr.endswith('/'):\n mystr = mystr + '/'\n return mystr\n\n\ndef remove_trailing_slash(mystr):\n if mystr.endswith('/'):\n mystr = mystr[:-1]\n return mys... | python | edit | 1 | 2 | mit | c4a827f7ddfd6d43120253bd660e426840dc5cba | robotblake/pdsm | src/pdsm/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\nVPS_PROTOCOL = getattr(settings, 'OSCAR_SAGEPAY_VPS_PROTOCOL', '3.0')\nVENDOR = settings.OSCAR_SAGEPAY_VENDOR\n\nTEST_MODE = getattr(settings, 'OSCAR_SAGEPAY_TEST_MODE', True)\nif TEST_MODE:\n VPS_RE... | python | edit | 1 | 0 | bsd-3-clause | d0f4209f373d91a82339ddfc15445e84f4cf0ac8 | django-oscar/django-oscar-sagepay-direct | oscar_sagepay/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport qirest\n\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']\nautoclass_content = \"both\"\nautodoc_default_flags= ['members', 'show-inheritance']\nsource_suffix = '.rst'\nmaster_d... | python | edit | 3 | 2 | bsd-2-clause | aaa88075d4cf799509584de439f207476e092584 | ohsu-qin/qiprofile-rest,ohsu-qin/qirest | doc/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from test.support.os_helpers import FS_NONASCII\nexcept ImportError:\n from test.support import FS_NONASCII # noqa\n\n```\n\nApply this change: Use os_helper to fix ImportError in Python 3.10"
},
{
"role": "assistant",... | python | edit | 1 | 0 | apache-2.0 | 69c6759625c8faacd2ce5194c9845349c61dda7f | python/importlib_metadata | tests/py39compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file\n# for details. All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.... | python | edit | 2 | 2 | bsd-3-clause | 6de1083784d8a73e234dd14cabd17e7ee5852949 | dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/da... | tools/clean_output_directory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = ['process_pmc']\n\nimport logging\nimport requests\n\nfrom .processor import RlimspProcessor\n\n\nlogger = logging.getLogger(__name__)\n\n\nRLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/pmc'\n\n\n... | python | edit | 1 | 3 | bsd-2-clause | 377fa94c2963a9c2522164ff374431dbe836217e | sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,sorgerlab/indra,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra | indra/sources/rlimsp/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your opti... | python | edit | 1 | 2 | mit | 08247c2d4cb3cf1879b568697d7888728ebb1c3b | alacroix/ParsePy,milesrichardson/ParsePy,milesrichardson/ParsePy,alacroix/ParsePy | parse_rest/role.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\r\n@date 2013-5-9\r\n\r\n@author Hong-She Liang <<EMAIL>>\r\n'''\r\n\r\nimport sys\r\nimport os\r\n\r\n# Import the global logging unit, not our logging .\r\nglobal_logging = __import__('logging')\r\n\r\n\r\ndef load_default_config():\r... | python | edit | 1 | 8 | apache-2.0 | 6f3b0c997f7207279bf836edc94db1ac19d2ce1d | starofrainnight/rabird.core | src/rabird/core/logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom django_extensions.db.fields import (\n AutoSlugField, CreationDateTimeField, ModificationDateTimeField)\n\nfrom us_ignite.advertising import managers\n\n\nclass Advert(models.Model):\n PUBLISHED = ... | python | edit | 1 | 1 | bsd-3-clause | a35c2c4e3d332c8ee581608317c4496722fb9b77 | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/advertising/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# (C) Pywikibot team, 2014\n#\n# Distributed under the terms of the MIT license.\n#\n__version__ = '$Id$'\n\nfrom tests.utils import unittest\nfrom pywikibot import date\n\n\nclass TestDate(unittest.TestCase):\n... | python | edit | 1 | 5 | mit | 3409aa543b4f0a4c574afd7ff4fdd59d1bd8a4b0 | hasteur/g13bot_tools_new,smalyshev/pywikibot-core,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,npdoty/pywikibot,icyflame/batman,valhallasw/pywikibot-core,darthbhyrava/pywikibot-local,hasteur/g13bot_tools_new,xZise/pywikibot-core,npdoty/pywikibot,magul/pywikibot-core,happy5214/pywikibot-core,VcamX/pywikibot-core,... | tests/date_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom dotenv import load_dotenv, find_dotenv\n\nload_dotenv(find_dotenv())\n\nOPS_KEY = os.environ.get(\"OPS_KEY\")\nOPS_SECRET = os.environ.get(\"OPS_SECRET\")\nTWITTER_CONSUMER_ACCESS = os.environ['TWITTER_CONSUMER_ACCESS']\nT... | python | edit | 1 | 0 | mit | 8e900343312fa644a21e5b209b83431ced3c3020 | nestauk/inet | inet/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport django_tables2 as tables\n\nfrom fabric_bolt.core.mixins.tables import ActionsColumn, PaginateTable\n\nfrom fabric_bolt.web_hooks import models\n\n\nclass HookTable(PaginateTable):\n \"\"\"Table used to show the configurations\n\n... | python | edit | 1 | 0 | mit | a1b4526f48fbd9e7f48c8bb6bc1a4763cc710448 | worthwhile/fabric-bolt,jproffitt/fabric-bolt,gvangool/fabric-bolt,qdqmedia/fabric-bolt,damoguyan8844/fabric-bolt,qdqmedia/fabric-bolt,npardington/fabric-bolt,fabric-bolt/fabric-bolt,maximon93/fabric-bolt,leominov/fabric-bolt,lethe3000/fabric-bolt,worthwhile/fabric-bolt,maximon93/fabric-bolt,damoguyan8844/fabric-bolt,le... | fabric_bolt/web_hooks/tables.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\nimport logging\n\nfrom path_helpers import path\nfrom pip_helpers import install\n\n\nif __name__ == '__main__':\n logging.basicConfig(level=logging.INFO)\n logging.info(str(datetime.now()))\n require... | python | edit | 1 | 0 | bsd-3-clause | 114b3f3403e970943618e7096b0b898b8aa5589f | wheeler-microfluidics/microdrop | microdrop/core_plugins/electrode_controller_plugin/on_plugin_install.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom django import forms\n\n\nmac_pattern = re.compile(\"^[0-9a-f]{12}$\")\n\n\nclass MacAddrFormField(forms.CharField):\n def __init__(self, *args, **kwargs):\n kwargs['max_length'] = 17\n super(MacAddrFormField... | python | edit | 3 | 3 | bsd-3-clause | 5b7e2c7c4ad28634db9641a2b8c96f4d047ae503 | OSU-Net/arim,drkitty/arim,OSU-Net/arim,drkitty/arim,drkitty/arim,OSU-Net/arim | arim/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This package contains interface adapters for pandas.\n\nOn import, this package detects if pandas is installed. If it is installed,\nthen the contained modules are imported to register the pandas classes with\nGaia. If pandas is not... | python | edit | 1 | 0 | apache-2.0 | 08c2f9fe24b6ce7697bf725e70855e8d6861c370 | Kitware/romanesco,Kitware/romanesco,girder/girder_worker,girder/girder_worker,girder/girder_worker,Kitware/romanesco,Kitware/romanesco | pandas/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\ndef load_variables_from_env(prefix=\"XII_INTEGRATION_\"):\n length = len(prefix)\n vars = {}\n\n for var in filter(lambda x: x.startswith(prefix), os.environ):\n vars[var[length:]] = os.envi... | python | edit | 1 | 4 | apache-2.0 | 589534c52ceff1d4aabb8d72b779359ce2032827 | xii/xii,xii/xii | tests/integration/integration/runner.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 __future__ import absolute_import\n\nfrom reportlab.platypus import (\n Paragraph as BaseParagraph,\n Spacer,\n)\nfrom reportlab.lib.styles import ParagraphStyle, getSampleStyleSh... | python | edit | 2 | 5 | mit | 715a3c7005130b4fea8ac46132e2d2505f1901cf | cecedille1/PDF_generator | pdf_generator/styles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport argparse\nimport matplotlib.pyplot as plt\nfrom pylab import *\nfrom osta.osta import *\n\n############\n### MAIN ###\n############\nparser = argparse.ArgumentParser(formatter_class = argparse.RawTextHelpFormatte... | python | edit | 2 | 0 | bsd-3-clause | fedff2e76d8d96f1ea407f7a3a48aa8dc7a7e50a | justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools,justinccdev/opensimulator-tools | analysis/opensimulator-stats-analyzer/src/ostagraph.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nr\"\"\"\n\n============================================\nmsm - Markov state models (:mod:`pyemma.msm`)\n============================================\n\n.. currentmodule:: pyemma.msm\n\nUser-API\n--------\n\n.. autosummary::\n :toctree: ge... | python | edit | 8 | 0 | bsd-3-clause | d15bfddd59f0009852ff5f69a665c8858a5cdd40 | clonker/ci-tests | __init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nRevision ID: 0334_broadcast_message_number\nRevises: 0333_service_broadcast_provider\nCreate Date: 2020-12-04 15:06:22.544803\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nfrom sqlalchemy.dialects import postgresql\n... | python | edit | 1 | 1 | mit | ac3f56f4ed0826600b9adbbf8dfe3b99ce508ac6 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0334_broadcast_message_number.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility function for retrieving the active registration backend."
},
{
"role": "assistant",
"content": "from django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib im... | python | new_file | 4 | 3 | bsd-3-clause | 953ffccae266f123a3b50f260af259bed1d1d336 | lubosz/django-registration,lubosz/django-registration | registration/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for foamPy.\n\"\"\"\n\nfrom .core import *\nfrom .dictionaries import *\nfrom .types import *\nfrom .foil import *\n\n```\n\nApply this change: Add test for loading all torque and drag data"
},
{
"role": "assistant",
... | python | edit | 6 | 1 | mit | a27b03a89af6442dc8e1be3d310a8fc046a98ed4 | petebachant/foamPy,petebachant/foamPy,petebachant/foamPy | foampy/tests.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef filterTags(attrs):\n res = {}\n\n if 'NAMN' in attrs:\n res['name'] = attrs['NAMN']\n\n if 'TATNR' in attrs:\n res['ref:se:scb'] = attrs['TATNR']\n\n if attrs.get('BEF') is not None:\n bef = int(attrs.... | python | edit | 1 | 7 | bsd-3-clause | 9cfd402c8f95c016953eda752e1bd91302d6c8c0 | andpe/swegov-to-osm | translations/lantmateriet.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom xml.dom import minidom\nimport xml.etree.ElementTree as ET\nimport xmltodict\n\ndef add(k, parent=None, txt=None, attrs=None):\n if parent is None:\n handle = ET.Element(k)\n else:\n handle = ET.SubElem... | python | edit | 2 | 5 | mit | fba4fdf426b0a29ca06deb67587c2bd804adb017 | Schwarzschild/TBGXMLUtils | tbgxmlutils/xmlutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .hough_transform import *\nfrom .radon_transform import *\nfrom .finite_radon_transform import *\nfrom .integral import *\nfrom ._geometric import (warp, warp_coords, estimate_transform,\n SimilarityTransform, A... | python | edit | 22 | 0 | bsd-3-clause | f2d91d2c296e3662a1b656f0fdf5191665ff363b | youprofit/scikit-image,almarklein/scikit-image,keflavich/scikit-image,pratapvardhan/scikit-image,vighneshbirodkar/scikit-image,almarklein/scikit-image,almarklein/scikit-image,chriscrosscutler/scikit-image,ajaybhat/scikit-image,SamHames/scikit-image,oew1v07/scikit-image,vighneshbirodkar/scikit-image,youprofit/scikit-ima... | skimage/transform/__init__.py | rejected_lint | Too many lint violations: 22 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom marshmallow import fields\n\nfrom lemur.common.fields import ArrowDateTime\nfrom lemur.common.schema import LemurInputSchema, LemurOutputSchema\n\n\nclass DnsProvidersNestedOutputSchema(LemurOutputSchema):\n __envelope__ = False\n ... | python | edit | 1 | 0 | apache-2.0 | d7fc84f6e92cb2f6bc3006971258d655059f9fb1 | Netflix/lemur,Netflix/lemur,Netflix/lemur,Netflix/lemur | lemur/dns_providers/schemas.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom cms.models import CMSPlugin\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Plaintext(CMSPlugin):\n body = models.TextField(_('Plaintext'))\n\n def __unic... | python | edit | 1 | 1 | bsd-3-clause | 366937921cfb13fd83fb5964d0373be48e3c8564 | chschuermann/cmsplugin-plain-text,chschuermann/cmsplugin-plain-text | cmsplugin_plain_text/models.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 | rejected_duplicate | Near-duplicate of sample 3288 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.conf import settings\n\n\n\ntrans_app_label = _('Image')\nsettings.INSTALLED_APPS += ('thumbor',)\n\n```\n\nApply this change: Remove thumbor use ... | python | edit | 3 | 0 | mit | ccafafbd51422979ed93ed197135bf03b7d0be81 | YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,opps/opps,opps/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps | opps/images/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\nimport sys\n\n\ndf = pd.read_csv(sys.argv[1])\ndf.columns = [c.lower() for c in df.columns]\n\nfrom sqlalchemy import create_engine\nengine = create_engine('postgresql://pcawg_admin:pcawg@localhost:5432/germline_genotyp... | python | edit | 1 | 0 | mit | 13c968f9f345f58775750f1f83ca7881cee2755a | llevar/germline-regenotyper,llevar/germline-regenotyper | bootstrap/conf/salt/state/run-tracking-db/scripts/import_sample_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools\n\nfrom .handler import handler\nfrom .urls import load_urls, resolve\n\n\ndef WSGIApplication(app_settings):\n '''Create main application handler\n '''\n\n class Application(object):\n settings = app_settin... | python | edit | 1 | 4 | bsd-3-clause | 46de02b77c25c633b254dc81ed35da2443b287a9 | GrAndSE/lighty | lighty/wsgi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSimple test runner to separate out the functional tests and the unit tests.\n\"\"\"\nimport os\nimport subprocess\n\nPLATFORMS = ['bsd', 'linux', 'nt']\n\n# Detect what platform we are on\ntry:\n platform = os.uname()[0].lower()\... | python | edit | 3 | 3 | bsd-3-clause | cabf0004d6e7e3687cdd2ebe9aebeede01877e69 | jstnlef/pika,reddec/pika,pika/pika,Tarsbot/pika,Zephor5/pika,knowsis/pika,shinji-s/pika,fkarb/pika-python3,vitaly-krugl/pika,vrtsystems/pika,benjamin9999/pika,skftn/pika,renshawbay/pika-python3,hugoxia/pika,zixiliuyue/pika | tests/run_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (C) Datadog, Inc. 2010-2016\n# All rights reserved\n# Licensed under Simplified BSD License (see LICENSE)\nimport os\n\nimport pytest\n\nfrom .common import INSTANCE, HOST\nfrom datadog_checks.dev import docker_run, get_here, run_command\... | python | edit | 1 | 1 | bsd-3-clause | 30da968a43434088a7839941118e30d26683679e | DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras | storm/tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTop-level definition of the ``oep2`` commandline tool.\n\"\"\"\n\nimport click\n\nfrom . import explode_repos_yaml\nfrom .report import cli\n\n\ndef _cli():\n cli(auto_envvar_prefix=\"OEP2\")\n\n\n@click.group()\ndef cli():\n ... | python | edit | 1 | 1 | apache-2.0 | 3e913e4267fd7750516edcbed1aa687e0cbd17fe | edx/repo-tools,edx/repo-tools | edx_repo_tools/oep2/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport redis_collections\nimport threading\nimport time\nimport __main__\n\n\nclass RedisDict(redis_collections.Dict):\n def __init__(self, **kwargs):\n super().__init__(**kwargs)\n self.die = False\n self.thread = t... | python | edit | 1 | 3 | mit | 2479b4a51b733ce8ba989d8f01b48791492d9f21 | Thessia/Liara | cogs/utils/dataIO.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom staticgen.staticgen_pool import staticgen_pool\nfrom staticgen.staticgen_views import StaticgenView\n\nfrom .models import Post\n\n\nclass BlogPostListView(Staticgen... | python | edit | 1 | 1 | bsd-3-clause | 411decbdb193b28bb3060e02e81bfa29483e85a9 | mishbahr/staticgen-demo,mishbahr/staticgen-demo,mishbahr/staticgen-demo | staticgen_demo/blog/staticgen_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Patch ReSDK resources with analysis methods.\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom resdk.analysis.alignment import bowtie2, hisat2\nfrom resdk.analysis.chip_seq import macs, ... | python | edit | 1 | 0 | apache-2.0 | 6dc019f3495a940340668fd8039b7911db6273b7 | genialis/resolwe-bio-py | resdk/analysis/_register.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test neuropycon command line interface\"\"\"\n\n# Authors: Dmitrii Altukhov <<EMAIL>>\n#\n# License: BSD (3-clause)\n\nimport os\nimport os.path as op\nfrom ephypype.commands import neuropycon\nfrom click.testing import CliRunner\n\n\... | python | edit | 1 | 1 | bsd-3-clause | 9c39105f2dcb296590e895aaf35de5d4c3105ddb | neuropycon/ephypype | ephypype/commands/tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.conf import settings\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom opps.core.models import NotUserPublishable\n\n\nclass Logging(No... | python | edit | 1 | 1 | mit | 528edba420089249bd58c0621e06225db84e223f | jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps | opps/contrib/logging/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport click\nimport os\n\nfrom ..cli import cli_command\nfrom ..utils import load_file, template_string\n\n\n@cli_command('paas-manifest', max_apps=1)\n@click.option('--template', '-t', default='paas/manifest.j2',\n type=click... | python | edit | 1 | 3 | mit | 3e0fbefa021c4c97024da30963845b201ff35089 | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | dmaws/commands/paasmanifest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport logging.handlers\n\n\n# ######### Set up logging ##########\n# log.basicConfig(format=\"%(asctime)s - %(levelname)s: %(message)s\", level=log.DEBUG)\nlogger = logging.getLogger('bb_log')\nlogger.setLevel(logging.DEBUG... | python | edit | 1 | 0 | mit | f9c178e641fa27b6c0c2bf32a969c52ba17042bf | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | blockbuster/bb_logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright 2010 Hunter Freyer and Michael Kelly\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 ... | python | edit | 3 | 1 | apache-2.0 | fd951edbef26dcab2a4b89036811520b22e77fcf | hjfreyer/marry-fuck-kill,hjfreyer/marry-fuck-kill | marry-fuck-kill/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\n\nfrom timepiece import models as timepiece\nfrom timepiece.forms import QuickSearchForm\n\n\ndef timepiece_settings(request):\n default_famfamfam_url = settings.STATIC_URL + 'images/icons/'\n famfamf... | python | edit | 1 | 2 | mit | 47b031db83f5cb90f786029a6ffbdb7a599145db | gaga3966/django-timepiece,josesanch/django-timepiece,BocuStudio/django-timepiece,dannybrowne86/django-timepiece,josesanch/django-timepiece,BocuStudio/django-timepiece,gaga3966/django-timepiece,BocuStudio/django-timepiece,arbitrahj/django-timepiece,caktus/django-timepiece,arbitrahj/django-timepiece,gaga3966/django-timep... | timepiece/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import connection, models\nfrom django.db.models.expressions import RawSQL\n\n\ndef test_plain():\n cursor = connection.cursor()\n cursor.execute(\"some sql\") # $getSql=\"some sql\"\n\n\ndef test_context():\n with ... | python | edit | 1 | 1 | mit | 701b935564521d64cc35dc51753493f4dc2782f6 | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/library-tests/frameworks/django/SqlExecution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport RDF\nimport zope.interface\nimport interfaces \nimport rdf_helper\n\nclass Jurisdiction(object):\n zope.interface.implements(interfaces.IJurisdiction)\n def __init__(self, short_name):\n '''@param short_name can be e.g. ... | python | edit | 1 | 3 | mit | cd621061773b7eafcea9358c9b762663a070ccc5 | creativecommons/cc.license,creativecommons/cc.license | cc/license/jurisdiction.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n''' This script provides utils for python scripts in cameo.\n'''\n\nimport os\nimport sys\nimport subprocess\n\ndef TryAddDepotToolsToPythonPath():\n depot_tools = FindDepotToolsInPath()\n if depot_tools:\n sys... | python | edit | 1 | 4 | bsd-3-clause | 11f933e986dd9e2c62b852ca38a37f959c10145e | shaochangbin/crosswalk,rakuco/crosswalk,RafuCater/crosswalk,DonnaWuDongxia/crosswalk,tomatell/crosswalk,mrunalk/crosswalk,jpike88/crosswalk,dreamsxin/crosswalk,stonegithubs/crosswalk,weiyirong/crosswalk-1,siovene/crosswalk,baleboy/crosswalk,crosswalk-project/crosswalk,fujunwei/crosswalk,ZhengXinCN/crosswalk,minggangw/c... | tools/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django.db import models\n\n\nclass Pet(models.Model):\n name = models.CharField(max_length=30)\n\n\nclass Film(models.Model):\n reporters = models.ManyToManyField('Reporter',\n ... | python | edit | 1 | 1 | mit | 31eae0aee3a6ae9fa7abea312ff1ea843a98e853 | graphql-python/graphene,sjhewitt/graphene,Globegitter/graphene,sjhewitt/graphene,Globegitter/graphene,graphql-python/graphene | graphene/contrib/django/tests/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os import path\nfrom indra.tools.reading.read_files import read_files, get_readers\n\nfrom nose.plugins.attrib import attr\n\n\n@attr('slow', 'nonpublic')\ndef test_read_files():\n \"Test that the system can read files.\"\n # Cre... | python | edit | 1 | 5 | bsd-2-clause | b3413818bf651c13cef047132813fb26a185cd33 | johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,bgyori/indra,pvtodorov/indra,johnbachman/belpy,johnbachman/indra,johnbachman/indra,bgyori/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy | indra/tests/test_reading_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nimport pytest\n\n\nclass TestWebUI(object):\n def get_page(self, page):\n return requests.get('http://127.0.0.1' + page)\n\n pages = [\n {\n 'page': '/',\n 'matching_text': 'Diamond... | python | edit | 1 | 2 | mit | af05872aaf08a32ea7855b80153c0596835755bd | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/integration/test_webui.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .es_query import HQESQuery\nfrom . import filters\n\n\nclass DomainES(HQESQuery):\n index = 'domains'\n\n @property\n def builtin_filters(self):\n return [\n real_domains,\n commconnect_domains,\n ... | python | edit | 1 | 1 | bsd-3-clause | ca2b02d551e9bb4c8625ae79f7878892673fa731 | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq | corehq/apps/es/domains.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import AWSObject, AWSProperty, Tags\nfrom .compat import policytypes\n\n\nclass LifecyclePolicy(AWSProperty):\n props = {\n 'LifecyclePolicyText': (basestring, False),\n 'RegistryId': (basestring, False),\n }\n\n\... | python | edit | 8 | 0 | bsd-2-clause | 3fe0313d67857ec302cc20e0cdc30d658e41dd97 | cloudtools/troposphere,cloudtools/troposphere | troposphere/ecr.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom invoke import task, run\n\n\n@task\ndef makerelease(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(\"np... | python | edit | 1 | 3 | apache-2.0 | 9150618ca2a1c4b8917596547f73d9c1cc207fda | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | monkeys/release.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import ModelForm, widgets\n\nfrom .models import Fellow, Event, Expense, Blog\n\nclass FellowForm(ModelForm):\n class Meta:\n model = Fellow\n exclude = [\n \"inauguration_year\",\n ... | python | edit | 3 | 0 | bsd-3-clause | bdb78cd1bb13981a20ecb0cf9eb981d784c95b0e | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom scipy.ndimage.filters import uniform_filter\nfrom scipy.ndimage.fourier import fourier_gaussian\n\n\ndef bandpass(image, lshort, llong, threshold=1):\n \"\"\"Convolve with a Gaussian to remove short-wavelength no... | python | edit | 1 | 2 | bsd-3-clause | a16b51bb26761f8c4a30c06da4c711dac24ac3e0 | daniorerio/trackpy,daniorerio/trackpy | mr/preprocessing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Import intake to run driver discovery first and avoid circular import issues.\nimport intake\ndel intake\n\nimport warnings\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\nfrom .v1 import Broker, Header, ALL, temp, temp_con... | python | edit | 24 | 0 | bsd-3-clause | 8c2ad666266d4dbe8310007bd82dc907a288ee5a | ericdill/databroker,ericdill/databroker | databroker/__init__.py | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory\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.... | python | edit | 4 | 0 | apache-2.0 | e65ed7382c691d8ee19a22659ddb6deaa064e85b | OpenKMIP/PyKMIP,OpenKMIP/PyKMIP | kmip/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\nregister = template.Library()\n\ndef field_verbose_name(obj, field):\n \"\"\"Usage: {{ object|get_object_field }}\"\"\"\n\n return obj._meta.get_field(field).verbose_name\n\nregister.filter(field_verbose... | python | edit | 2 | 3 | bsd-2-clause | effa5f84fc93ced38ad9e5d3b0a16bea2d3914ef | makinacorpus/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,johan--/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-adm... | caminae/common/templatetags/field_verbose_name.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version_info__ = (1, 3, 0, 'dev')\n\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join([str(i) for i in __version_info__[:-1]])\nif __version_info__[-1] is not None:\n __version__ += ('-%s' %... | python | edit | 1 | 1 | apache-2.0 | ae42042d38d4f53a88a25cb4dc18ad86f23c0f28 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | derrida/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nSIMULATION_TIME_IN_SECONDS = 40\nDELTA_T = 0.1 # this is the sampling time\nSTEPS = int(SIMULATION_TIME_IN_SECONDS / DELTA_T)\nK_V = 0.90\nK_W = 0.90\nTRAJECTORY_TYPE = 'linear'\n\n```\n\nApply this change: Define sim... | python | edit | 1 | 0 | mit | 78ba73998168d8e723d1c62942b19dabfd9ab229 | bit0001/trajectory_tracking,bit0001/trajectory_tracking | src/constants.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.