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\"\"\"\nTest lldb-mi =library-loaded notifications.\n\"\"\"\n\nimport lldbmi_testcase\nfrom lldbtest import *\nimport unittest2\n\nclass MiLibraryLoadedTestCase(lldbmi_testcase.MiTestCaseBase):\n\n mydir = TestBase.compute_mydir(__file__... | python | edit | 6 | 1 | apache-2.0 | 38365839856658bcf870e286a27f0de784a255a2 | apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb | test/tools/lldb-mi/TestMiLibraryLoaded.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import BaseAccount\n\n\nclass WholeAccountSerializer(serializers.ModelSerializer):\n password = serializers.CharField(write_only=True, required=False)\n\n class Meta:\n model... | python | edit | 1 | 1 | mit | b2d1c701a0f74c569feb3f9e43ccc97366e5398d | slavpetroff/sweetshop,slavpetroff/sweetshop | backend/django/apps/accounts/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom copy import copy\n\nfrom unittest import TestCase\n\nfrom address_book import Person\n\n\nclass PersonTestCase(TestCase):\n\n def test_get_groups(self):\n pass\n\n def test_add_address(self):\n basic_address = ['Rus... | python | edit | 2 | 1 | mit | 16c71ce44836a3cea877475340cae7f96241fd5d | dizpers/python-address-book-assignment | tests/test_person.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.utils import translation\n\nfrom feincms.module.page.models import Page\n\n\ndef handler(... | python | edit | 1 | 2 | bsd-3-clause | abe1727600eb1c83c196f9b7bd72e58e4df89c57 | feincms/feincms,nickburlett/feincms,matthiask/django-content-editor,feincms/feincms,nickburlett/feincms,mjl/feincms,matthiask/feincms2-content,joshuajonah/feincms,joshuajonah/feincms,michaelkuty/feincms,hgrimelid/feincms,pjdelport/feincms,matthiask/feincms2-content,joshuajonah/feincms,nickburlett/feincms,feincms/feincm... | feincms/views/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.backends.postgresql_psycopg2.base import * # noqa\n\n\nclass DynamicTimezoneDatabaseWrapper(DatabaseWrapper):\n '''\n This exists to allow report generation SQL to set the time zone of the\n connection without inter... | python | edit | 2 | 1 | mit | c92d9c6da02dacdd91a21c3c5675940154c0e21a | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/reports/db/backend/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport factory\n\nfrom . import models\n\n\nclass ChannelFactory(factory.django.DjangoModelFactory):\n FACTORY_FOR = models.Channel\n\n\nclass VideoFactory(factory.django.DjangoModelFactory):\n FACTORY_FOR = models.Video\n\n```\n\nApp... | python | edit | 1 | 0 | apache-2.0 | 2811edf8908c680b80e6534444cdc48feba9af12 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/components/social/youtube/factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport logging\nimport os\nimport requests\n\nfrom jinja2 import Template\nfrom os.path import abspath, dirname, exists, join\n\nfrom .utils import run_cmd\n\nLOG = logging.getLogger(__name__)\n\n\nclass Framework(object):\n\n ... | python | edit | 7 | 1 | mit | eb4d278c061de82b0010eb40279e1dcd8408bd45 | rcbops-qa/test_runner | test_runner/frameworks.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nfrom subprocess import check_output as co\nfrom sys import exit\n\n# Actually run bin/mn rather than importing via python path\nversion = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )\nversion = version... | python | edit | 2 | 0 | bsd-3-clause | 8225105cf2e72560d8c53ec58c1b98683a613381 | mininet/mininet,mininet/mininet,mininet/mininet | util/versioncheck.py | rejected_duplicate | Near-duplicate of sample 1884 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\n\nfrom .scopes import get_userinfo_by_scopes\n\n\ndef process_id_token(payload, user, scope=None):\n if scope is None:\n # HACK: Steal the scope argument from the locals dictionary of\n # the caller, since i... | python | edit | 1 | 2 | mit | fb027f075c3745c5b14a5c611063d161a47f60e4 | mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo | oidc_apis/id_token.py | rejected_duplicate | Near-duplicate of sample 35 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef find_majority(sequence):\n item_counter = dict()\n\n for item in sequence:\n if item not in item_counter:\n item_counter[item] = 1\n else:\n item_counter[item] += 1\n\n for item, item_count i... | python | edit | 1 | 4 | mit | 65f069c82beea8e96bce780add4f6c3637a0d549 | mindm/2017Challenges,DakRomo/2017Challenges,DakRomo/2017Challenges,DakRomo/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,DakRomo/2017Challenges,erocs/2017Challenges,popcornanachronism/2017Challenges,popcornanachronism/2017Challenges,popcornanachr... | challenge_3/python/ning/challenge_3.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom builtins import object\nimport factory\n\nfrom django.contrib.auth.models import Group\n\nfrom bluebottle.members.models import Member\n\n\nclass BlueBottleUserFactory(factory.DjangoModelFactory):\n class Meta(object):\n mode... | python | edit | 1 | 2 | bsd-3-clause | 91fa1a8eec10b83aa5142d9519a3759b4e310cff | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/test/factory_models/accounts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# (c) Crown Owned Copyright, 2016. Dstl.\n\nfrom django.core.urlresolvers import reverse\n\nfrom django_webtest import WebTest\n\nclass KeycloakHeaderLandAtHome(WebTest):\n def test_auto_login_on_landing(self):\n headers = { 'KEYC... | python | edit | 1 | 1 | mit | 3750bc289685fc243788ee3330676ef7e4387234 | dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse | apps/accounts/tests/test_user_landing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 ARM Limited\n#\n# Licensed under the Apache License, Version 2.0\n# See LICENSE file for details.\n\n# standard library modules, , ,\nimport json\nimport os\nimport stat\nfrom collections import OrderedDict\n\n# provide rea... | python | edit | 1 | 1 | apache-2.0 | 895d51105cd51387e3ac5db595333ff794f3e2a7 | BlackstoneEngineering/yotta,autopulated/yotta,ARMmbed/yotta,stevenewey/yotta,ARMmbed/yotta,autopulated/yotta,ntoll/yotta,BlackstoneEngineering/yotta,stevenewey/yotta,eyeye/yotta,ntoll/yotta,eyeye/yotta | yotta/lib/ordered_json.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may ob... | python | edit | 1 | 1 | apache-2.0 | 4b6c27e02667fe6f5208b5b5dfa1f5dafe112c30 | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/export/search/chunk.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom account.models import Account, AnonymousAccount\n\ndef openid(request):\n return {'openid': request.openid}\n\ndef account(request):\n account = AnonymousAccount(request)\n if request.user.is_authenticated():\n try:\n... | python | edit | 1 | 3 | mit | 9e2d3ed154e977d38126f610f11a0df3a0141da1 | alex/pinax,amarandon/pinax,amarandon/pinax,amarandon/pinax,amarandon/pinax,alex/pinax,alex/pinax | apps/local_apps/account/context_processors.py | rejected_duplicate | Near-duplicate of sample 12226 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .gtags_def import GtagsBase\n\nclass Source(GtagsBase):\n\n def __init__(self, vim):\n super().__init__(vim)\n\n self.name = 'gtags_path'\n self.kind = 'file'\n\n @classmethod\n def get_search_flags(cls):\... | python | edit | 1 | 2 | mit | 4cd345aa9a6b642af60529a94f047cf32847e262 | ozelentok/denite-gtags | rplugin/python3/denite/source/gtags_path.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\n\ndef translate(translation_list):\n\n trans_dict = {\"merry\":\"god\", \"christmas\":\"jul\", \"and\":\"och\",\n \"happy\":\"gott\", \"new\":\"nytt\", \"year\":\"år\"}\n\n final_translation_list ... | python | edit | 1 | 3 | mit | 581285a6d887ab9beef3e2014db7f259109d1b5a | gravyboat/python-exercises | exercises/ex20.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import http\nfrom django.conf.urls import url\nfrom django.shortcuts import get_object_or_404\nfrom django.template.loader import render_to_string\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext... | python | edit | 1 | 2 | mit | cf0850e23b07c656bd2bc56c88f9119dc4142931 | matthiask/django-mooch,matthiask/django-mooch,matthiask/django-mooch | mooch/banktransfer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom django.views.generic.edit import FormView\nfrom .forms import SendClaimCodeForm\nfrom .models import Badge\n\nclass SendClaimCodeView(FormView):\n template_name = 'badgekit_webhooks/send_clai... | python | edit | 1 | 2 | mit | 71aa5a7d665a432b6a01ec08bfba92e50d7fc29d | tgs/django-badgekit-webhooks | badgekit_webhooks/claimcode_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nURLS = {\n}\n\n\nclass Plugins(object):\n \"\"\" This class provide plugin-related methods\n Plugin related REST endpoints:\n https://gerrit-review.googlesource.com/Documentation/rest-api-plugin.html\n ... | python | edit | 6 | 2 | apache-2.0 | b8ffeaa3274ead2c437526d507264af219929b61 | yumminhuang/gerrit.py | gerrit/plugins.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may ob... | python | edit | 1 | 1 | apache-2.0 | b569ce0ae444e43cf6a64dd034186877cc259e2d | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/export/ftp/fasta/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .schema import Schema, SchemaOpts\n\n__version__ = \"0.21.2\"\n__author__ = \"Steven Loria\"\n__license__ = \"MIT\"\n\n__all__ = (\"Schema\", \"SchemaOpts\")\n\n```\n\nApply this change: Remove unnecessary `__author__` and `__license__... | python | edit | 1 | 0 | mit | 1ffff2738c4ced2aedb8b63f5c729860aab1bac7 | marshmallow-code/marshmallow-jsonapi | marshmallow_jsonapi/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport sys\n\nimport requests\n\nfrom gratipay.utils import markdown\nfrom gratipay.utils.threaded_map import threaded_map\nfrom threading import Lock\n\n... | python | edit | 1 | 2 | mit | 9abcfcf971b053a5d3859faefc77a7622c00fc22 | gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com | gratipay/package_managers/readmes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport contextlib\nimport logging\nimport subprocess\n\nLOGGER = logging.getLogger(__name__)\n\ndef execute(command):\n LOGGER.debug(\"Executing %s\", ' '.join(command))\n proc = subprocess.Popen(command, stdout=subprocess.PIPE, stder... | python | edit | 1 | 2 | mit | 760ba24c1413d4a0b7f68d8ce2d6a30df8ad8e4a | EliRibble/mothermayi | mothermayi/git.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport morepath\nfrom webtest import TestApp as Client\nimport pytest\nfrom .fixtures import template\n\n\ndef setup_module(module):\n morepath.disable_implicit()\n\n\ndef test_template():\n config = morepath.setup()\n c... | python | edit | 3 | 1 | bsd-3-clause | fc7323ddb0b2700ad459a8016fe4e56d9ac8e352 | morepath/morepath,faassen/morepath,taschini/morepath | morepath/tests/test_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\ndef lonely_integer():\n\tpass\n\n\ndef main():\n\tpass\n\n\nif __name__ == '__main__':\n\tmain()\n\n```\n\nApply this change: ... | python | edit | 1 | 5 | bsd-2-clause | 91a9da3bb1dda73add2a3040d35c9c58f7b5b4a5 | bowen0701/algorithms_data_structures | alg_lonely_integer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove star imports to remove pyflakes errors"
},
{
"role": "assistant",
"content": "from .permission_checks import user_id_matches\nfrom .public import permission_check\nfrom .public import get_public_task_data\nfrom .retrieve i... | python | new_file | 7 | 0 | mit | 63130e4e438c34815bcd669d0088235140a62ced | safwanrahman/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,davidfischer/readthedocs.org,davidfischer/readthedocs.org,davidfischer/readthedocs.org,tddv/readthedocs.org,pombredanne/readthedocs.org,tddv/readthedocs.org,rtfd/readthedocs.org,safwanrahman/r... | readthedocs/core/utils/tasks/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: cinje\n\n: from cinje.std.html import link, div, span\n: from urllib.parse import urlencode, quote_plus\n\n: def letterscountsbar ctx, letterscountslist\n : try\n : selected_letter = ctx.selected_letter\n : except Att... | python | edit | null | null | mit | cca4f761ed39bd970c76c3b4ca581511bfe0130d | bmillham/djrq2,bmillham/djrq2,bmillham/djrq2 | web/app/djrq/templates/letterscountsbar.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nimport platform\n\nimport dataproperty\n\n\nclass PingTransmitter(object):\... | python | edit | 1 | 3 | mit | cecea26672d74a026383c08ebf26bc72ab2ee66c | thombashi/pingparsing,thombashi/pingparsing | pingparsing/_pingtransmitter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom junction.feedback import service\n\nfrom .. import factories\n\npytestmark = pytest.mark.django_db\n\n\ndef test_get_feedback_questions_without_conference():\n result = service.get_feedbac... | python | edit | 1 | 2 | mit | 238b92a561f9285f7030b1dae51a3ffeb3de579e | pythonindia/junction,ChillarAnand/junction,ChillarAnand/junction,pythonindia/junction,ChillarAnand/junction,ChillarAnand/junction,pythonindia/junction,pythonindia/junction | tests/integrations/test_feedback_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom prompt_toolkit.validation import Validator, ValidationError\n\n__all__ = (\n 'PythonValidator',\n)\n\n\nclass PythonValidator(Validator):\n \"\"\"\n Validation of Python input.\n\n ... | python | edit | 1 | 5 | bsd-3-clause | f96d2ceef6b15e397e82e310a3f369f61879a6d0 | jonathanslenders/ptpython | ptpython/validator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\n\nfrom puzzle.problems import problem\n\n\nclass ImageProblem(problem.Problem):\n def __init__(self, name: str, data: np.ndarray, *args, **kwargs) -> None:\n super(ImageProblem, self).__init__(name, data, *args, **kw... | python | edit | 1 | 3 | mit | 9db0f0430466b9d4d70c7803f7d39ecdeb85e375 | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | src/puzzle/problems/image/image_problem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# TOOL test-phenodata-output.py: \"Test phenodata output in Python\" () \n# OUTPUT phenodata.tsv\n# OUTPUT output.tsv\n\nwith open('output.tsv', 'w') as f:\n\tf.write('test\toutput\\n')\n\tf.write('test\toutput\\n')\n\nwith open('phenodata.... | python | edit | 1 | 0 | mit | 20c77152d1b81fd3ab42d9e563bb7170ef96906c | chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools | tools/misc/python/test-phenodata-output.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import apps\nfrom django.conf import settings\nfrom django.contrib.gis.gdal import SpatialReference\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.core.management import call_command\nfrom django.core... | python | edit | 1 | 3 | bsd-2-clause | a5dee47e46d3bdc70a4fecf23e35d7e56c4c3177 | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | geotrek/common/management/commands/migrate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2005 onwards University of Deusto\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as part of this dis... | python | edit | 1 | 2 | bsd-2-clause | 5455a7796ece5a8987ef99f70d469ed3770f6a76 | morelab/weblabdeusto,porduna/weblabdeusto,weblabdeusto/weblabdeusto,morelab/weblabdeusto,porduna/weblabdeusto,porduna/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,zstars/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,zstars/weblabdeusto,porduna/weblabdeusto,weblabdeusto/weblabdeusto,weblabdeusto/webla... | server/src/weblab/db/gateway.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os.path\n\nfrom django.http import HttpResponse\nfrom django.conf import settings\nfrom functools import wraps\nfrom bempy import ImmediateResponse\n\n\ndef returns_blocks(func):\n @wraps(func)\n def wr... | python | edit | 4 | 3 | bsd-3-clause | 127a6d65b46e94f7698ae9739c1770903068351a | svetlyak40wt/bempy,svetlyak40wt/bempy,svetlyak40wt/bempy | bempy/django/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom indra.sources import rlimsp\n\n\ndef test_simple_usage():\n rp = rlimsp.process_from_webservice('PMC3717945')\n stmts = rp.statements\n assert len(stmts) == 6, len(stmts)\n for s in stmts:\n assert len(s.evidence) ==... | python | edit | 1 | 2 | bsd-2-clause | 7e97a1d060dc903f1e6a0c3f9f777edebabb99f7 | pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,johnbachman/indra,bgyori/indra,sorgerlab/indra,bgyori/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/belpy,johnbachman/indra | indra/tests/test_rlimsp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport thread\n\nimport time\nfrom django.db import close_old_connections\n\n\nclass DatabaseConnectionMaintainer(object):\n def __init__(self):\n self.clients = set()\n # self.device_to_protocol = {}\n self.is_recen... | python | edit | 2 | 2 | bsd-3-clause | 6ed4aa25d5e7113df75a622f6e86e83e9ace1390 | weijia/djangoautoconf,weijia/djangoautoconf | djangoautoconf/cmd_handler_base/database_connection_maintainer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.services.news.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom dataclasses import dataclass\nfrom datetime i... | python | edit | null | null | bsd-3-clause | bf5518f2f181879141279d9322fe75f3163d438d | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/news/transfer/models.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding:utf-8 -*-\n\nfrom flask.ext.sqlalchemy import models_committed\nfrom gather.extensions import db, cache\n\n\nclass Node(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n name = db.Column(db.String(100), nullable... | python | edit | 4 | 1 | mit | d80c726fcf36a2dc439ce12717f9e88161501358 | whtsky/Gather,whtsky/Gather | gather/node/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport drogher\nfrom drogher.exceptions import InvalidBarcode\n\n\nclass TestDrogher:\n def test_barcode(self):\n shipper = drogher.barcode('1Z999AA10123456784')\n assert shipper.shipper == 'UPS'\n\n def... | python | edit | 1 | 1 | bsd-3-clause | 2c502a77ad18d34470e2be89ed1c7a38e6f3799d | jbittel/drogher | tests/test_drogher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom osf.models.user import OSFUser\nfrom framework.auth.core import get_user\nfrom django.contrib.auth.backends import ModelBackend\n\n# https://docs.djangoproject.com/en/1.8/topics/auth/customizing/\nclass ODMBackend(ModelBackend):\n\n ... | python | edit | 1 | 2 | apache-2.0 | 93081d423a73a6b16e5adfb94247ffec23ef667c | Johnetordoff/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io | api/base/authentication/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Prepare for next major release"
},
{
"role": "assistant",
"content": "__version__ = '2.0.0'\n__author__ = \"James Laska\"\n__author_email__ = \"<<EMAIL>>\"\n"
}
] | python | new_file | 1 | 0 | mit | 47ea8ca6034bfbb16e9049081b5158d9b01833fc | jlaska/pytest-ansible | pytest_ansible/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Databench module.\"\"\"\n\n__version__ = \"0.3.0\"\n\n# Need to make sure monkey.patch_all() is applied before any\n# 'import threading', but cannot raise error because building the Sphinx\n# documentation also suffers from this probl... | python | edit | 2 | 0 | mit | c2a0b4c99f515a6fafae85d72be9d54b3c92c0b3 | svenkreiss/databench,svenkreiss/databench,svenkreiss/databench,svenkreiss/databench | databench/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.admin.shop.order.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom flask_babel import lazy_gettext... | python | edit | 1 | 3 | bsd-3-clause | b771fd2a463266e1c80b1b4cccfe78d822c391a2 | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/admin/shop/order/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom bluebottle.organizations.models import Organization\nfrom bluebottle.utils.serializers import URLField\n\n\nclass OrganizationSerializer(serializers.ModelSerializer):\n class Meta:\n ... | python | edit | 1 | 0 | bsd-3-clause | 02140561a29a2b7fe50f7bf2402da566e60be641 | jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle | bluebottle/organizations/serializers.py | rejected_duplicate | Near-duplicate of sample 4747 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..base import ShopifyResource\nimport base64\nimport re\n\n\nclass Image(ShopifyResource):\n _prefix_source = \"/admin/products/$product_id/\"\n\n def __getattr__(self, name):\n if name in [\"pico\", \"icon\", \"thumb\", \... | python | edit | 1 | 2 | mit | 583ea6c1a234ab9d484b1e80e7f567d9a5d2fb71 | asiviero/shopify_python_api,SmileyJames/shopify_python_api,Shopify/shopify_python_api,metric-collective/shopify_python_api,gavinballard/shopify_python_api,ifnull/shopify_python_api | shopify/resources/image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom chainer.training.triggers import interval_trigger # NOQA\nfrom chainer.training.triggers import minmax_value_trigger # NOQA\n\n\n# import class and function\nfrom chainer.training.triggers.early_stopping_trigger import EarlyStoppingT... | python | edit | 1 | 0 | mit | dddf89e519e40ce118509dcb5823ad932fea88f8 | niboshi/chainer,wkentaro/chainer,ktnyt/chainer,keisuke-umezawa/chainer,jnishi/chainer,hvy/chainer,chainer/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,okuta/chainer,anaruse/chainer,keisuke-umezawa/chainer,tkerola/chainer,keisuke-umezawa/chainer,wkentaro/chainer,okuta/chainer,ktnyt/chainer,keisuke-umezawa/chaine... | chainer/training/triggers/__init__.py | rejected_duplicate | Near-duplicate of sample 14084 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom django.db.models.fields.related import ManyToManyField\nfrom rest_framework import filters\n\n\nclass JSONAPIFilterBackend(filters.DjangoFilterBackend):\n def filter_queryset(self, request, queryset, view):\n fil... | python | edit | 1 | 12 | mit | db4355ce0345df9dd23b937370f5f0d4cb2164e9 | ZeroCater/zc_common,ZeroCater/zc_common | zc_common/remote_resource/filters.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nsetup.py file for SWIG example\n\"\"\"\n\nfrom distutils.core import setup, Extension\nimport numpy.distutils.misc_util\nimport os\n\nos.environ['CC'] = 'g++'\n#os.environ['CXX'] = 'g++'\n#os.environ['CPP'] ... | python | edit | 1 | 0 | mit | b60fbc21271a7efa09d256debb17f583ec83fdf2 | kmdouglass/Micro-Manager,kmdouglass/Micro-Manager | MMCorePy_wrap/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n\"\"\" Our github hook receiving server. \"\"\"\n\nimport os\n\nfrom flask import Flask\nfrom flask_hookserver import Hooks\n\nfrom github import validate_review_request\nfrom slack import notify_reviewer\n\napp = Fl... | python | edit | 1 | 2 | mit | 5d70735ab4254509e1efed73be4eecf77629063e | DobaTech/github-review-slack-notifier | github_hook_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The manager for managing team.\"\"\"\nfrom apps.managers.score_mgr import score_mgr\nfrom apps.managers.team_mgr.models import Team\n\n\ndef team_members(team):\n \"\"\"Get the team members.\"\"\"\n return team.profile_set()\n\n... | python | edit | 1 | 2 | mit | a789f05ac157effabe3426611b3ea7e6cef5fb3d | jtakayama/makahiki-draft,yongwen/makahiki,jtakayama/makahiki-draft,jtakayama/ics691-setupbooster,yongwen/makahiki,jtakayama/ics691-setupbooster,yongwen/makahiki,yongwen/makahiki,jtakayama/makahiki-draft,jtakayama/makahiki-draft,jtakayama/ics691-setupbooster,csdl/makahiki,csdl/makahiki,csdl/makahiki,justinslee/Wai-Not-M... | makahiki/apps/managers/team_mgr/team_mgr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import Http404\n\nfrom .models import Organization\n\n\nclass OrganizationMiddleware(object):\n\n def process_request(self, request):\n try:\n request.organization = Organization.objects.get(\n ... | python | edit | 1 | 3 | mit | d3cb08d45af60aaf06757ad230a2a33bc3615543 | xobb1t/ddash2013,xobb1t/ddash2013 | apps/organizations/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nimport pytest\nimport pytz\n\nfrom todoman.model import Todo, VtodoWritter\n\n\ndef test_serialize_created_at(todo_factory):\n now = datetime.now(tz=pytz.UTC)\n todo = todo_factory(created_at=now)\n ... | python | edit | 1 | 1 | isc | ef7ac85615d9790525a6e5364105613905cae859 | pimutils/todoman,AnubhaAgrawal/todoman,Sakshisaraswat/todoman,hobarrera/todoman | tests/test_backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Script to change the UID of Users\n#\n# Author: Christoph Stoettner\n# E-Mail: <EMAIL>\n#\n# example: wsadmin.sh -lang jython -f changeUID.py file.csv\n#\n# Format of CSV-File:\n# uid;mailaddress\n#\nimport sys\nimport os\n\n# Check OS on... | python | edit | 4 | 0 | apache-2.0 | 8ae6cfd75d5dc6b775aa80dcc91874c3a9ee7758 | stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting | WebSphere/changeUID.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#------------------------------------------------------------------------------\n#\n# Copyright (c) 2008, Enthought, Inc.\n# All rights reserved.\n# \n# This software is provided without warranty under the terms of the BSD\n# license i... | python | edit | 1 | 0 | bsd-3-clause | 010444e37787582788268ccea860ae6bb97bd4b1 | burnpanck/traits,burnpanck/traits | enthought/traits/ui/editors/date_editor.py | rejected_duplicate | Near-duplicate of sample 11323 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http.response import JsonResponse\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic.base import View\n\nfrom corehq.apps.domain.decorators import login_and_domain_required\nfrom corehq.apps.locatio... | python | edit | 1 | 2 | bsd-3-clause | d7a434de8926162adeff6e6934dde7eb771baf8d | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/enikshay/reports/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import template\n\n\nregister = template.Library()\n\n\n@register.filter\ndef post_process_fieldsets(fieldset):\n \"\"\"\n Removes a few fields from FeinCMS admin inlines, those being\n ``id``, ``DELETE`` and ``ORDER`` ... | python | edit | 1 | 4 | bsd-3-clause | cbf4d85092232051cd7643d74e003b86f24ba571 | matthiask/django-content-editor,matthiask/feincms2-content,joshuajonah/feincms,matthiask/feincms2-content,matthiask/django-content-editor,mjl/feincms,feincms/feincms,nickburlett/feincms,mjl/feincms,nickburlett/feincms,feincms/feincms,pjdelport/feincms,pjdelport/feincms,mjl/feincms,nickburlett/feincms,michaelkuty/feincm... | feincms/templatetags/feincms_admin_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"empty message\n\nRevision ID: 0093_data_gov_uk\nRevises: 0092_add_inbound_provider\nCreate Date: 2017-06-05 16:15:17.744908\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '0093_data_gov_uk'\ndown_revision = '0092_ad... | python | edit | 4 | 1 | mit | 49dc93d0fd2ab58815d91aba8afc6796cf45ce98 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0093_data_gov_uk.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\n See LICENSE.txt file for copyright and license details.\n\"\"\"\nfrom flask import Flask\nfrom app import views\nimport sys\n\n\napp = Flask(__name__)\napp.config.from_object('config')\n\n\ndef adjust_syst... | python | edit | 1 | 0 | bsd-3-clause | c1f7544138990dc6dbb05090711d57e6fea36fb4 | laffra/pava,laffra/pava | pava/implementation/tests/__init__.py | rejected_duplicate | Near-duplicate of sample 3971 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nif 'imported' in locals():\n import imp\n import bpy\n imp.reload(blendergltf)\nelse:\n imported = True\n from . import blendergltf\n\n\nimport json\nimport math\n\nimport bpy\n\n\nclass BTFConverter:\n def convert(self, a... | python | edit | 6 | 3 | mit | cfd2312ae81dd79832d4b03717278a79bc8705d1 | Kupoman/BlenderRealtimeEngineAddon | brte/converters/btf.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom piper import build\nfrom piper.db import core as db\nfrom piper.cli import cmd_piper\nfrom piper.cli.cli import CLIBase\n\nimport mock\n\n\nclass TestEntry(object):\n @mock.patch('piper.cli.cmd_piper.CLIBase')\n def test_calls(se... | python | edit | 1 | 1 | mit | 4e135d1e40499f06b81d4ec3b427462c9b4ba2ee | thiderman/piper | test/cli/test_cmd_piper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'paulo'\n\nimport cv2\n\n\nclass OpenCVIntegration(object):\n\n\n @staticmethod\n def adaptive_threshold(filename_in, filename_out):\n img = cv2.imread(filename_in)\n img = cv2.cvtColor(img, cv2.COLOR_BGR2GR... | python | edit | 1 | 1 | mit | 2057b76908c8875fd58d3027a89e43584ee57025 | nfscan/ocr-process-service,nfscan/ocr-process-service,PauloMigAlmeida/ocr-process-service,PauloMigAlmeida/ocr-process-service | service/opencv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# MQTT Example.\n# This example shows how to use the MQTT library.\n#\n# 1) Copy the mqtt.py library to OpenMV storage.\n# 2) Install the mosquitto client on PC and run the following command:\n# mosquitto_sub -h test.mosquitto.org -t \"o... | python | edit | 1 | 0 | mit | e230837f473808b3c136862feefdd6660ebb77e8 | kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,openmv/openmv,openmv/openmv,kwagyeman/openmv | scripts/examples/14-WiFi-Shield/mqtt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .._util import TableOutput\nfrom ..commands import command, description, option\nfrom .._profile import Profile\n\n@command('resource group list')\n@description('List resource groups')\n# TODO: waiting on Python Azure SDK bug fixes\n#@... | python | edit | 5 | 1 | mit | 70be059480af2eaac8a0b7afdd91f7ca86b94c05 | yugangw-msft/azure-cli,yugangw-msft/azure-cli,BurtBiel/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,BurtBiel/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure... | src/azure/cli/commands/resourcegroup.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2011 OpenStack Foundation.\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 wi... | python | edit | 1 | 1 | apache-2.0 | 097d2b7b3de6593a0aac8e82418c0dcadc299542 | openstack/oslo.context,dims/oslo.context,varunarya10/oslo.context,yanheven/oslo.middleware,JioCloud/oslo.context,citrix-openstack-build/oslo.context | tests/unit/test_context.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tarfile\nimport os\nimport json\n\n\nclass Package(object):\n\n def __init__(self, path, mode='r'):\n self.path = path\n self.mode = mode\n self._tarfile = tarfile.open(path, mode=mode)\n\n\n```\n\nApply this ... | python | edit | 14 | 8 | bsd-3-clause | 56c3a5e4b29fb5f198f133e06e92ab5af72d62dd | groutr/conda-tools,groutr/conda-tools | conda_tools/package.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"This contains code for setting up parallel tempering calcs\"\"\"\n\n########################################################################\n# #\n# This script was ... | python | edit | 1 | 1 | apache-2.0 | 0562f34398041e6696f6e9bad56ea2a135968b77 | theavey/ParaTemp,theavey/ParaTemp | paratemp/sim_setup/pt_simulation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nName: Paul Briant\nDate: 11/29/16\nClass: Introduction to Python\nSession: 08\nAssignment: Circle Lab\n\nDescription:\nClasses for Circle Lab\n\"\"\"\n\nimport math\n\nclass Circle:\n def __init__(self, radius):\n \"\"\"\n... | python | edit | 1 | 1 | unlicense | 208c4d9e18301a85bca5d64a1e2abb95a6865fe9 | weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016 | students/psbriant/session08/circle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.db.models import signals\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom core.mixins import AuditableMixin\nfrom .invoice import Invoice\n\n\nclass Payment(AuditableMixin, models.Mo... | python | edit | 1 | 3 | bsd-3-clause | afdfcef3cf7f390dd0fc7eac0806272742ffa479 | ikcam/django-skeleton,ikcam/django-skeleton,ikcam/django-skeleton,ikcam/django-skeleton | core/models/payment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nmylang = 'test'\nfamily = 'wikipedia'\n\n\ncustom_path = os.path.expanduser('~/user-config.py')\nif os.path.exists(custom_path):\n with open(custom_path, 'rb') as f:\n exec(compile(f.read(), custom_path, 'exec'), glob... | python | edit | 3 | 0 | mit | 55a330149a05c456012f2570c2151a82ac8435b2 | yuvipanda/paws,yuvipanda/paws | images/singleuser/user-config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom tailor.utils import charformat\n\nclass MyTestCase(unittest.TestCase):\n\n def is_upper_camel_case_test_upper_camel_case_name(self):\n self.assertTrue(charformat.is_upper_camel_case('HelloWorld'))\n\n de... | python | edit | 1 | 1 | mit | 4dd488634aa030a8e9a1404e5fe026265dd07a75 | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | tailor/tests/utils/charformat_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: <EMAIL>\n# Maintained By: <EMAIL>\n\nMAX_USER_WAIT_SECONDS = 10\nM... | python | edit | 1 | 0 | apache-2.0 | e779a66c29ecb389b03357ca2e2ccb88752072b7 | j0gurt/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,AleksNeStu/... | test/selenium/src/lib/constants/ux.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nGeneral-purpose fixtures for vdirsyncer's testsuite.\n'''\nimport logging\nimport os\n\nimport click_log\n\nfrom hypothesis import HealthCheck, Verbosity, settings\n\nimport pytest\n\n\n@pytest.fixture(autouse=... | python | edit | 1 | 1 | mit | fc3e823b6bf1b5c7de62a55f4b5459bbc0c9a4c3 | hobarrera/vdirsyncer,untitaker/vdirsyncer,untitaker/vdirsyncer,untitaker/vdirsyncer,hobarrera/vdirsyncer | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport os.path\n\nLOGPATH = \"/var/log/nailgun\"\nLOGFILE = os.path.join(LOGPATH, \"nailgun.log\")\nLOGLEVEL = \"DEBUG\"\nCELERYLOGFILE = os.path.join(LOGPATH, \"celery.log\")\nCELERYLOGLEVEL = \"DEBUG\"\n\nPATH_TO_SSH_KEY = os.p... | python | edit | 1 | 0 | apache-2.0 | 82cc087e5dc39201444e19ce305a44aea8c4b3d1 | dancn/fuel-main-dev,koder-ua/nailgun-fcert,huntxu/fuel-web,SergK/fuel-main,dancn/fuel-main-dev,AnselZhangGit/fuel-main,huntxu/fuel-main,eayunstack/fuel-web,ddepaoli3/fuel-main-dev,nebril/fuel-web,eayunstack/fuel-main,zhaochao/fuel-main,Fiware/ops.Fuel-main-dev,Fiware/ops.Fuel-main-dev,prmtl/fuel-web,prmtl/fuel-web,nebr... | nailgun/nailgun/extrasettings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom django.conf import settings\nfrom django.contrib import admin\n\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n (r'^admin/', include(admin.site.urls)),\n url(r'^admin_tools/', includ... | python | edit | 1 | 0 | mit | cc3b82a943baf42f78b131d3218ad5eb748a11ce | husbas/django-admin-tools,husbas/django-admin-tools,husbas/django-admin-tools | test_proj/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\n\ntemplate = string.Template(\"\"\"#contrail-collector-marker-start\nlisten contrail-collector-stats :5938\n mode http\n stats enable\n stats uri /\n stats auth $__contrail_hap_user__:$__contrail_hap_passwd__\n\nfront... | python | edit | 1 | 0 | apache-2.0 | 32388a96b848629bf8f4b7d7ea832fca8c3dccd9 | Juniper/contrail-fabric-utils,Juniper/contrail-fabric-utils | fabfile/templates/collector_haproxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCompression filters\n\"\"\"\n\nfrom ..stream_filter import StreamFilter\n\nfrom io import BytesIO\nimport zlib\n\nclass LZWDecode(StreamFilter):\n \"\"\"LZW compression\"\"\"\n filter_name = 'LZWDecode'\n EOD = None... | python | edit | 1 | 5 | mit | 8c1ab6a774b380fdbb571818e68b375e25909bff | ajmarks/gymnast,ajmarks/gymnast | pdf_parser/filters/filters/lzw_and_flate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom echo.response import EchoResponse, EchoSimplePlainTextResponse\nfrom echo.tests import BaseEchoTestCase\n\n\nclass TestEchoSimplePlainTextResponse(BaseEchoTestCase):\n def test_populates_text_in_response(self):\n ... | python | edit | 1 | 1 | mit | f5faf9c90b2671f7d09e1a4f21c036737bd039ef | bunchesofdonald/django-echo | echo/tests/test_response.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#threadprivate supprimé, est ce que c'est grave?\ndef omp_parallel_copyin():\n sum = 0\n sum1 = 7\n num_threads = 0\n\n if 'omp parallel copyin(sum1) private(i)':\n 'omp for'\n for i in xrange(1, 1000):\n ... | python | edit | 2 | 4 | bsd-3-clause | d792f82ea6e59b0e998d023fdbc24b0829e2d0e7 | pbrunet/pythran,artas360/pythran,pbrunet/pythran,pombredanne/pythran,hainm/pythran,artas360/pythran,hainm/pythran,serge-sans-paille/pythran,hainm/pythran,pombredanne/pythran,artas360/pythran,serge-sans-paille/pythran,pombredanne/pythran,pbrunet/pythran | pythran/tests/openmp/omp_parallel_copyin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import patch\n\nfrom sms.tests.test_sms import GarfieldTwilioTestCase\nfrom sms.tests.test_sms import GarfieldTwilioTestClient\n\n\nclass GarfieldTestSimSmsCaseNewJohn(GarfieldTwilioTestCase):\n @patch('sms.tasks.save_sms_messa... | python | edit | 3 | 1 | mit | 0ba616bbd037a1c84f20221a95a623d853da9db9 | RobSpectre/garfield,RobSpectre/garfield | garfield/sims/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDjango-specific extensions\n\"\"\"\n\n\ndef site_url(url):\n \"\"\"\n Determine the server URL.\n \"\"\"\n base_url = 'http://%s' % socket.gethostname()\n\n if server.port is not 80:\n base_url += ':%d' % serve... | python | edit | 4 | 2 | mit | 83908d3d8d3de0db5f8af26155137bf382afa24a | infoxchange/lettuce_webdriver,infoxchange/lettuce_webdriver,aloetesting/aloe_webdriver,infoxchange/aloe_webdriver,koterpillar/aloe_webdriver,macndesign/lettuce_webdriver,ponsfrilus/lettuce_webdriver,aloetesting/aloe_webdriver,ponsfrilus/lettuce_webdriver,bbangert/lettuce_webdriver,aloetesting/aloe_webdriver,bbangert/le... | lettuce_webdriver/django.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\n\n\n>>> IC_FLAG[2]\narray([[1, 3],\n [1, 4]])\n\n\n>>> IC_FLAG[3]\narray([[1, 4, 6],\n [1, 5, 8],\n [1, 6, 9]])\n\n'''\n\n# For Python2 compatibility\nfrom __future__ import absolute_import\nfrom __future__ import div... | python | edit | 1 | 2 | mit | edd096abfa3c304b49fe94155a64fc2371a3084a | jfine2358/py-linhomy | py/linhomy/matrices.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as PD\n\n\nINFO_LINK = 'http://ds.iris.edu/files/earthscope/usarray/_US-MT-StationList.txt'\n\"\"\"Full URL link to USArray MT site information text file.\"\"\"\n\n\nHEADER = 'VNET\tNET\tSTA\tSITE DESCRIPTION\tLAT\tLON\tELEV\t... | python | edit | 1 | 1 | mit | 8c64757759e69f7aff84065db8da604dd43faded | butala/pyrsss | pyrsss/usarray/info.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport contextlib\nimport functools\nimport logging\nimport sys\n\nimport webob.exc\n\nLOG = logging.getLogger(__name__)\n\n\ndef http_success_code(code):\n \"\"\"Attaches response code to a method.\n\n This decorator associates a res... | python | edit | 1 | 0 | apache-2.0 | 39ea336297b0479abb29a70f831b2a02a01fcc18 | Bloomie/murano-agent,openstack/python-muranoclient,ativelkov/murano-api,sajuptpm/murano,NeCTAR-RC/murano,satish-avninetworks/murano,satish-avninetworks/murano,openstack/murano,openstack/murano-agent,openstack/murano-agent,telefonicaid/murano,satish-avninetworks/murano,DavidPurcell/murano_temp,openstack/murano-agent,ser... | portas/portas/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom git import Repo\nfrom git.exc import InvalidGitRepositoryError\nimport os\n\ndef reposearch(*folders):\n for folder in folders:\n for dir, subdirs, files in os.walk(folder):\n try:\n yield dict(vcs='... | python | edit | 1 | 4 | bsd-3-clause | fba4801ce64853db37af01b08e1533719425118d | gjcooper/repovisor,gjcooper/repovisor | repovisor/repovisor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django admin interface for `~builds.models.Build` and related models.\n\n\"\"\"\n\nfrom django.contrib import admin\nfrom readthedocs.builds.models import Build, VersionAlias, Version, BuildCommandResult\nfrom guardian.admin import Gu... | python | edit | 1 | 0 | mit | 57376590aec0db20a8046deaee86d035c8963a40 | tddv/readthedocs.org,espdev/readthedocs.org,espdev/readthedocs.org,davidfischer/readthedocs.org,safwanrahman/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,tddv/readthedocs.org,espdev/readthedocs.org,davidfischer/readthedocs.org,espdev/readthedocs.org,rtfd/readthedocs.org,espdev/readthedocs.org,david... | readthedocs/builds/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''Module to solve the algoritm question:\nGiven a string S, how to count how many permutations\nof S is in a longer string L, assuming, of course, that\npermutations of S must be in contagious blocks in L.\n\nI will solve it in O(len(L)) t... | python | edit | 1 | 2 | mit | 31ad44a9ea518a6ced7d1bd938cec1ee215fefac | nguyentu1602/pyexp | pyexp/string_permu_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom schematics.models import Model\nfrom schematics.types import IntType\n\nfrom hyp.adapters.schematics import SchematicsSerializerAdapter\n\n\nclass Post(object):\n def __init__(self):\n self.id = 1\n\n\nclass Simple(Model):\n ... | python | edit | 1 | 1 | mit | 2a3a5fba536877c0ba735244a986e49605ce3fc0 | kalasjocke/hyp | tests/test_schematics_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\"\"\"Created on Dec 16, 2014.\n\n@author: Katharina Eggensperger\n@projekt: AutoML2015\n\n\"\"\"\n\nfrom __future__ import print_function\nimport time\nimport unittest\n\nfrom autosklearn.util import StopWatch\n\... | python | edit | 1 | 2 | bsd-3-clause | 47269f733427fef34e4f43c2652eda79aa3e5e0d | automl/auto-sklearn,automl/auto-sklearn | test/test_util/test_StopWatch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Universe:\n def __init__(self, height=100000000, width=100000000):\n self.entities = []\n self.height = height\n self.width = width\n self.teams = []\n self.state = []\n \n def add(self, entity):\n self.entities... | python | edit | 2 | 5 | mit | f3763c417d745463361b054fd4ffa0ddf35833eb | cnlohr/bridgesim,cnlohr/bridgesim,cnlohr/bridgesim,cnlohr/bridgesim | src/server/Universe.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport __builtin__\n\nimport mock\nimport pytest\n\nfrom git_code_debt.list_metrics import color\nfrom git_code_debt.list_metrics import CYAN\nfrom git_code_debt.list_metrics import main\nfrom git_code_debt.list_metrics import NORMAL\n\n\... | python | edit | 1 | 2 | mit | 1667e4c28d969af615d028a4b828cc2c868957bc | Yelp/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt,ucarion/git-code-debt,ucarion/git-code-debt,Yelp/git-code-debt,ucarion/git-code-debt | tests/git_code_debt/list_metrics_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! -*- coding: koi8-r -*-\r\n\r\nimport unittest\r\nfrom test import test_support\r\n\r\nclass PEP263Test(unittest.TestCase):\r\n\r\n def test_pep263(self):\r\n self.assertEqual(\r\n u\"\".encode(\"utf-8\"),\r\n ... | python | edit | null | null | mit | 77f4fca43b1d4be85894ad565801d8a333008fdc | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_pep263.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function\nimport unittest\nfrom qtpy.QtWidgets import QApplication\nfrom addie.utilities.customtreeview import CustomizedTreeView\n\n\nclass CustomTreeViewTests(unittest.TestCase):\n def setU... | python | edit | 1 | 1 | mit | 14be519ba4bb09957865f1810c88c02f6b359c48 | neutrons/FastGR,neutrons/FastGR,neutrons/FastGR | tests/utilities/test_customtreeview.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin\nfrom django.contrib.auth.models import Group\n\nfrom .models import Editor\n\n\nclass ContributorMixin(admin.ModelAdmin):\n def save_model(self, request, ... | python | edit | 3 | 2 | apache-2.0 | 79d868ed68148b1e8f7c046b1ae9bb4b5a413c99 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/components/accounts/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom plasmapy.physics.dimensionless import (beta)\n\nimport astropy.units as u\n\nB = 1.0 * u.T\nn_i = 5e19 * u.m ** -3\nT_e = 1e6 * u.K\n\n\ndef test_beta():\n # Check that beta is dimensionless\n float(beta(T_e, n_i, B))\n\n```\n\nA... | python | edit | 2 | 1 | bsd-3-clause | d7b532e83b30e429a9c87b52799c30dda6c4628c | StanczakDominik/PlasmaPy | plasmapy/physics/tests/test_dimensionless.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime\nfrom sublime_plugin import ApplicationCommand\nfrom .mixin import UnitTestingMixin\nfrom .const import DONE_MESSAGE\n\ntry:\n from ColorSchemeUnit.lib.runner import ColorSchemeUnit\nexcept Exception:\n print('ColorSche... | python | edit | 5 | 6 | mit | a8c7a6d6cd87f057fbd03c41cec41dba35e6bdf6 | randy3k/UnitTesting,randy3k/UnitTesting,randy3k/UnitTesting,randy3k/UnitTesting | unittesting/test_color_scheme.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.translation import ugettext\nfrom social_auth.exceptions import AuthAlreadyAssociated\nfrom social_auth.backends.pipeline.associate import associate_by_email as super_associate_by_email\n\n\ndef associate_by_email(*args, *... | python | edit | 1 | 4 | mit | 4bfa6627b14c3e00e32b10a2806f02d4fafd6509 | brianray/chipy.org,agfor/chipy.org,bharathelangovan/chipy.org,tanyaschlusser/chipy.org,brianray/chipy.org,tanyaschlusser/chipy.org,bharathelangovan/chipy.org,chicagopython/chipy.org,agfor/chipy.org,bharathelangovan/chipy.org,chicagopython/chipy.org,tanyaschlusser/chipy.org,chicagopython/chipy.org,chicagopython/chipy.or... | chipy_org/libs/social_auth_pipelines.py | rejected_duplicate | Near-duplicate of sample 11561 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom bs4 import BeautifulSoup\n\nimport cfscrape\n\n\ndef nplstatus():\n scraper = cfscrape.create_scraper()\n data = scraper.get('http://npl.teamspeakusa.com/ts3npl.php').content\n soup = BeautifulSoup(data, 'html.par... | python | edit | 1 | 1 | mit | f0d629ae8b4568b2aceaf38779c8b07832e860b0 | Thor77/TeamspeakIRC | teamspeak_web_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport glob\nimport datetime\n\nfrom teamscale_client import TeamscaleClient\nfrom te... | python | edit | 4 | 0 | apache-2.0 | 02095500794565fc84aee8272bfece1b39bc270f | cqse/teamscale-client-python | examples/example_architecture_upload.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.