messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nfrom scipy.integrate import RK23, RK45, DOP853\nfrom scipy.integrate._ivp import dop853_coefficients\n\n\n@pytest.mark.parametrize(\"solver\", [RK23, RK45, DOP853... | python | edit | 1 | 1 | bsd-3-clause | b86d23b0302bb4d0efa2aa203883a78d3dcbf26e | jor-/scipy,zerothi/scipy,mdhaber/scipy,anntzer/scipy,ilayn/scipy,Eric89GXL/scipy,mdhaber/scipy,matthew-brett/scipy,endolith/scipy,jor-/scipy,anntzer/scipy,grlee77/scipy,vigna/scipy,mdhaber/scipy,andyfaff/scipy,aarchiba/scipy,aeklant/scipy,tylerjereddy/scipy,aeklant/scipy,andyfaff/scipy,perimosocordiae/scipy,tylerjeredd... | scipy/integrate/_ivp/tests/test_rk.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom pydirections.route_requester import DirectionsRequest\nfrom pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError\n\nclass TestOptionalParameters(unittest.TestCase):\n\trequester ... | python | edit | 1 | 1 | apache-2.0 | 5b516cd3e6363c4c995022c358fabeb0cc543115 | apranav19/pydirections | tests/test_route_requester.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport json\nimport rethinkdb as r\nimport sys\nimport optparse\n\nif __name__ == \"__main__\":\n parser = optparse.OptionParser()\n parser.add_option(\"-p\", \"--port\", dest=\"port\",\n ... | python | edit | 5 | 0 | mit | d9024e4db0489b141fec9b96913c94a5d583f086 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/mktemplate.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.db.models.signals import post_delete\n\nfrom wagtail.wagtailcore.models import Page\nfrom wagtail.wagtailcore.signals import page_published\n\nfrom wagtail.contrib.wagtailfrontendcache.utils import ... | python | edit | 1 | 4 | bsd-3-clause | f2cdd8eb42afb9db5465e062544631684cabd24f | Pennebaker/wagtail,chrxr/wagtail,jorge-marques/wagtail,jnns/wagtail,kurtw/wagtail,jorge-marques/wagtail,kaedroho/wagtail,WQuanfeng/wagtail,willcodefortea/wagtail,chimeno/wagtail,JoshBarr/wagtail,nimasmi/wagtail,zerolab/wagtail,torchbox/wagtail,kaedroho/wagtail,nutztherookie/wagtail,jorge-marques/wagtail,Klaudit/wagtail... | wagtail/contrib/wagtailfrontendcache/signal_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fractions import Fraction\nfrom math import sqrt\nfrom itertools import chain, cycle\n\nfrom typing import Generator, Iterable, List, Tuple\n\n\ndef convergent_sequence(generator: Iterable[int]) -> \\\n Generator[Fraction, None,... | python | edit | 4 | 2 | mit | 853d2907432a8d7fbedbed12ff28efbe520d4c80 | cryvate/project-euler,cryvate/project-euler | project_euler/library/number_theory/continued_fractions.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom data_importers.management.commands import BaseHalaroseCsvImporter\n\n\nclass Command(BaseHalaroseCsvImporter):\n council_id = \"CHT\"\n addresses_name = (\n \"2022-05-05/2022-02-25T12:48:35.558843/polling_station_export-20... | python | edit | 1 | 2 | bsd-3-clause | fd7027ae889d61949998ea02fbb56dbc8e6005a4 | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_importers/management/commands/import_cheltenham.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nRevision ID: 0311_populate_returned_letters\nRevises: 0310_returned_letters_table\nCreate Date: 2019-12-09 12:13:49.432993\n\n\"\"\"\nfrom alembic import op\n\nfrom app.dao.returned_letters_dao import insert_or_update_returned_let... | python | edit | 1 | 2 | mit | 606b2b6c84e9f9f67606a4d7e521cf4805855a98 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0311_populate_returned_letters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom config_secret import SecretConfig\n\n\nclass Config:\n SECRET_KEY = SecretConfig.SECRET_KEY\n\n # MongoDB config\n MONGO_DBNAME = SecretConfig.MONGO_DBNAME\n MONGO_HOST = SecretConfig.MONGO_HOST\n MONGO_PORT = SecretConf... | python | edit | 1 | 0 | mit | 038d33aa57a89d17a075109dd01eb682591e36ff | mingrammer/pyreportcard,mingrammer/pyreportcard | config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# vim : set fileencoding=utf-8 :\n \n#\n# mergeSegToCtm.py\n#\n# Enhance the Bck file by adding extra fields with the diarisation\n# information\n#\nimport sys\n\nwith open(sys.argv[1], 'r', encoding='iso-8859-1') as seg:... | python | edit | 1 | 0 | mit | 82239a844462e721c7034ec42cb4905662f4efb4 | SG-LIUM/SGL-SpeechWeb-Demo,SG-LIUM/SGL-SpeechWeb-Demo,bsalimi/speech-recognition-api,SG-LIUM/SGL-SpeechWeb-Demo,bsalimi/speech-recognition-api,bsalimi/speech-recognition-api,bsalimi/speech-recognition-api | bin/mergeSegToCtm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom base64 import b64encode\n\n\n# http://stackoverflow.com/a/4256027/212555\ndef del_none(o):\n \"\"\"\n Delete keys with the value ``None`` in a dictionary, recursively.\n\n This alters the input so you may wish t... | python | edit | 1 | 5 | bsd-2-clause | 20f6df95d302ea79d11208ada6218a2c99d397e3 | brendanlong/mpeg-ts-inspector,brendanlong/mpeg-ts-inspector | common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\nimport math\nimport itertools\n\n\nclass CryptoSquare:\n\n @classmethod\n def encode(cls, msg):\n if len(cls.normalize(msg)) == 0:\n return ''\n return ' '.join(cls.transpose_square(cls.squarify... | python | edit | 1 | 4 | mit | 36df41cf3f5345ab599b5a748562aec2af414239 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | python/crypto-square/crypto_square.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport hashlib\nfrom rest_framework.response import Response\n\n\ndef auto_logout(*args, **kwargs):\n \"\"\"Do not compare current user with new one\"\"\"\n return {'user': None}\n\n\ndef save_avatar(strategy, details, user=None, *arg... | python | edit | 1 | 10 | mit | 2425f5a3b0b3f465eec86de9873696611dfda04a | st4lk/django-rest-social-auth,st4lk/django-rest-social-auth,st4lk/django-rest-social-auth | example_project/users/social_pipeline.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding=utf-8\nfrom __future__ import unicode_literals\n\nimport socket\nfrom time import sleep\n\n\ndef mount(s, at, uuid=None, label=None, name=None):\n for name, value in ((b'uuid', uuid), (b'label', label), (b'name', name)):\n ... | python | edit | 2 | 3 | mit | ab83c8a51cb2950226a5ccf341ad4bd9774a6df4 | drkitty/arise | client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2020 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.... | python | edit | 1 | 1 | apache-2.0 | 044e55544529aa8eb3a755428d990f0400403687 | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-pl... | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\nimport eduid_IdP_html\n\n__author__ = 'ft'\n\n\nclass TestLoad_settings(TestCase):\n\n def test_load_settings(self):\n settings = eduid_IdP_html.load_settings()\n self.assertTrue(settings['g... | python | edit | 1 | 1 | bsd-3-clause | a014cd2184d4c9634c02d1cac9d1fd41fb3c6c37 | SUNET/eduid-IdP-html,SUNET/eduid-IdP-html,SUNET/eduid-IdP-html | eduid_IdP_html/tests/test_translation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\nimport pathlib\nfrom django.conf import settings\nfrom django.test import TestCase\n\n\nclass MakeMessagesCommandRunTestCase(TestCase):\n \"\"\"\n Sanity check to make sure makemessages runs to completi... | python | edit | 1 | 1 | mit | edc5564d4c3677dc8b545e9c9a6a51b481247eab | DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation | contentcuration/contentcuration/tests/test_makemessages.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bush.aws.session import create_session\n\n\nclass AWSBase:\n # USAGE = \"\"\n # SUB_COMMANDS = []\n\n def __init__(self, options, resource_name):\n self.name = resource_name\n self.options = options\n self... | python | edit | 1 | 2 | mit | 7e3dfe47598401f4d5b96a377927473bb8adc244 | okamos/bush | bush/aws/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom hackeriet.mqtt import MQTT\nfrom hackeriet.door import Doors\nimport threading, os, logging\n\nlogging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')\n\npiface = False\n\n# Determine if pifa... | python | edit | null | null | apache-2.0 | df8618c185108aa71e42da7d9569e16fb350b4c0 | hackeriet/pyhackeriet,hackeriet/pyhackeriet,hackeriet/nfcd,hackeriet/nfcd,hackeriet/pyhackeriet,hackeriet/nfcd | hackeriet/doorcontrold/__init__.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Host-only environment for Node.js.\"\"\"\n\nfrom pathlib import Path\n\nfrom foreman import define_parameter, decorate_rule\nfrom shipyard import install_packages\n\n\n(define_parameter('npm_prefix')\n .with_doc(\"\"\"Location host-on... | python | edit | 1 | 3 | mit | 3deffc39e1a489255272c35f7171b7e85942b108 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | shipyard/shipyard/host/node/build.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nBASE_URL = 'http://svenv.nl'\n\nREST_FRAMEWORK = {\n 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.OrderingFilter',),\n 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',\n 'PAGE_SIZE': 3,\n 'DEF... | python | edit | 1 | 0 | mit | 805f92a6aee1d9b9514818459809a5230fa7f7eb | svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app,svenvandescheur/svenv.nl-app | svenv/blog/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport unittest\nimport tarfile\n\ntry:\n\t# provide skipIf for Python 2.4-2.6\n\tskipIf = unittest.skipIf\nexcept AttributeError:\n\tdef skipIf(condition, reason):\n\t\tdef skipper(func):\n\t\t\tdef skip(*args, **kwargs):\n\t\t... | python | edit | 1 | 2 | mit | f678f5c1a197c504ae6703f3b4e5658f9e2db1f6 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/tests/py26compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ndebug = True\nport = 8000\nprocessor = 1\n\nsettings = None\n\napp_static_path = None\napp_template_path = None\n\n\n\n\n\n\n\n# \n# import other settings for different environment\n# \n\n... | python | edit | 4 | 0 | mit | 7a7ff71a4bfe6a14a820d8e90174ea168cb21fb2 | mywaiting/appstack,mywaiting/appstack | appstack/settings/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport webquery\nfrom lxml import etree\nimport inspect\nfrom expression import Expression\nfrom collections import defaultdict\n\n\nclass Parser(object):\n registry = defaultdict(dict)\n\n @classmethod\n def __init_subclass__(cls)... | python | edit | 1 | 3 | apache-2.0 | 7729c90679a74f268d7b0fd88c954fb583830794 | shiplu/webxpath | parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n##\n# Copyright (c) 2013 Sprymix Inc.\n# All rights reserved.\n#\n# See LICENSE for details.\n##\n\n\n# Import languages to register them\nfrom metamagic.utils.lang import yaml, python, javascript\n\n```\n\nApply this change: utils.lang.js:... | python | edit | 6 | 0 | mit | e50892a1155b9bd35e7b7cbf90646bac1b1724f6 | sprymix/importkit | importkit/languages.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTest the post methods.\n\"\"\"\n\n\ndef test_matrix_creation_endpoint(client):\n response = client.post('/matrix', {\n 'bibliography': '12312312',\n 'fields': 'title,description',\n })\n print(response.json())... | python | edit | 1 | 1 | mit | 126c58d78360e69c2d16a40f9396a8158844e2b1 | odarbelaeze/condor-api | tests/test_creators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#import PIL\nimport cairosvg\nfrom django.template import Template, Context\n\n\n\ndef make_svg(context):\n svg_tmpl = Template(\"\"\"\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n width=\"500\" height=\"600\" viewBox=\"0 0 500 4... | python | edit | 1 | 1 | mit | e94d39bf330312dc46697a689b56f7518ebd501c | mihow/footer,mihow/footer,mihow/footer,mihow/footer | footer/magic/images.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n# Complete the minimumBribes function below.\ndef minimumBribes(finalLine):\n if invalid(finalLine):\n return \"Too chaotic\"\n return bubbleSort(finalLi... | python | edit | 7 | 5 | mit | 57024104a5951d62ff8a87a281a6d232583dabed | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/new_year_chaos.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.util.templatefunctions\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nProvide and register custom template global functions.\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\n... | python | edit | 1 | 2 | bsd-3-clause | b77d078d096bb18cb02b6da0f7f00da33859bd88 | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/util/templatefunctions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom master import gatekeeper\nfrom master import master_utils\n\n# T... | python | edit | 1 | 1 | bsd-3-clause | 621858406aaa4d7deb9d8ec6b96459a6a7d25285 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | masters/master.chromium.webkit/master_gatekeeper_cfg.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\n\n\n_npeval_syms = {'__builtins__': None,\n 'exp': np.exp, 'log': np.log,\n 'sin': np.sin, 'asin': np.arcsin,\n 'cos': np.cos, 'acos': np.arccos,\n ... | python | edit | 1 | 2 | bsd-3-clause | 5c9bdb1260562f0623807ce9a5751d33c806374a | tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,Aerojspark/PyFR,iyer-arvind/PyFR,tjcorona/PyFR | pyfr/nputil.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test.client import Client\nfrom pytest_django.client import RequestFactory\n\npytest_plugins = ['pytester']\n\ndef test_params(testdir):\n testdir.makeconftest(\"\"\"\n import os, sys\n import pytest_django as p... | python | edit | 3 | 1 | bsd-3-clause | 4b172a9b2b9a9a70843bd41ad858d6f3120769b0 | ojake/pytest-django,pelme/pytest-django,hoh/pytest-django,thedrow/pytest-django,pombredanne/pytest_django,felixonmars/pytest-django,ktosiek/pytest-django,RonnyPfannschmidt/pytest_django,aptivate/pytest-django,davidszotten/pytest-django,reincubate/pytest-django,bforchhammer/pytest-django,tomviner/pytest-django,bfirsh/py... | tests/test_funcargs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom corehq.apps.fixtures.upload import upload_fixture_file\nfrom soil import DownloadBase\nfrom celery.task import task\n\n\n@task(serializer='pickle')\ndef f... | python | edit | 1 | 1 | bsd-3-clause | ee28fdc66fbb0f91821ff18ff219791bf5de8f4d | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/fixtures/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# A simple demo for working with SparkSQL and Tweets\nfrom pyspark import SparkContext, SparkConf\nfrom pyspark.sql import HiveContext, Row, IntegerType\nimport json\nimport sys\n\nif __name__ == \"__main__\":\n inputFile = sys.argv[1]\n... | python | edit | 5 | 0 | mit | 017aa00a7b1f7a4a8a95f9c41576d4595d4085af | DINESHKUMARMURUGAN/learning-spark,mohitsh/learning-spark,shimizust/learning-spark,JerryTseng/learning-spark,databricks/learning-spark,qingkaikong/learning-spark-examples,huixiang/learning-spark,qingkaikong/learning-spark-examples,obinsanni/learning-spark,bhagatsingh/learning-spark,holdenk/learning-spark-examples,NBSW/l... | src/python/SparkSQLTwitter.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom abc import ABCMeta, abstractmethod\n\nfrom gitfs import FuseMethodNotImplemented\nfrom gitfs.filesystems.passthrough import PassthroughFuse\n\nclass View(PassthroughFuse):\n __metaclass__ = ABCMeta\n\n def __init__(se... | python | edit | 4 | 2 | apache-2.0 | adf3a500e8ab8115520daa16bc008faeec7cfca9 | PressLabs/gitfs,PressLabs/gitfs,rowhit/gitfs,bussiere/gitfs,ksmaheshkumar/gitfs | gitfs/views/view.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:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import TestCase, main\nfrom grammpy import *\n\n\nclass TerminalAddingTest(TestCase):\n pass\n\... | python | edit | 4 | 1 | mit | de6ac0596b58fac2efc547fe6f81a48f4a06f527 | PatrikValkovic/grammpy | tests/grammar_creation_test/TerminalAdding.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..attribute_processor import AttributeProcessorError\nfrom .base_processor import BaseProcessor\n\n\nCONFIG_KEY_SCOPE = 'scope'\nCONFIG_DEFAULT_SCOPE = ''\n\n\nclass ScopeProcessor(BaseProcessor):\n def process(self, internal_data, ... | python | edit | 1 | 6 | apache-2.0 | 7755dda1449f6264d7d7fe57dc776c731ab22d84 | its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,SUNET/SATOSA,irtnog/SATOSA | src/satosa/micro_services/processors/scope_processor.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | python | edit | 1 | 0 | bsd-3-clause | a2871c774dd793f5264c1c530a36b10824c435db | Lukasa/cryptography,dstufft/cryptography,bwhmather/cryptography,skeuomorf/cryptography,Ayrx/cryptography,bwhmather/cryptography,bwhmather/cryptography,dstufft/cryptography,Lukasa/cryptography,skeuomorf/cryptography,Ayrx/cryptography,Lukasa/cryptography,Ayrx/cryptography,kimvais/cryptography,dstufft/cryptography,dstufft... | cryptography/bindings/openssl/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- encoding: utf-8 -*-\n\n__author__ = 'ray'\n__date__ = '3/2/15'\n\nfrom flask import make_response\n\n\ndef health_check():\n \"\"\"Return a dummy response\"\"\"\n response = make_response()\n response.headers['Content-Type'] ... | python | edit | 1 | 1 | mit | b43b555a7803c6afd50fe5992f455cc5d1ad5d86 | Kotaimen/stonemason,Kotaimen/stonemason | stonemason/service/tileserver/health/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom logging import getLogger\nfrom pkg_resources import get_distribution\n\nfrom django import apps\n\nlog = getLogger(__name__)\n\n\nclass AppConfig(apps.AppConfig):\n name = \"axes\"\n initialized = False\n\n @classmethod\n d... | python | edit | 1 | 6 | mit | ce846bf4eb3eb60c0e91a34d434ae5307e194c3a | jazzband/django-axes | axes/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Red Hat Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apach... | python | edit | 1 | 0 | apache-2.0 | 03caca6932384f08b06bbe5cb3ddc316b7ebf560 | openstack/manila-ui,openstack/manila-ui,openstack/manila-ui | manila_ui/local/local_settings.d/_90_manila_shares.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport numpy as np\nfrom bokeh.plotting import *\nfrom bokeh.objects import Range1d\n\nN = 1000\n\nx = np.linspace(0, 10, N)\ny = np.linspace(0, 10, N)\nxx, yy = np.meshgrid(x, y)\nd = np.sin(xx)*np.cos(yy)\n\noutput_file(\"image.html\", ... | python | edit | 5 | 0 | bsd-3-clause | 6ca27fba516ddc63ad6bae98b20e5f9a42b37451 | birdsarah/bokeh,srinathv/bokeh,justacec/bokeh,eteq/bokeh,saifrahmed/bokeh,eteq/bokeh,rothnic/bokeh,dennisobrien/bokeh,deeplook/bokeh,draperjames/bokeh,tacaswell/bokeh,daodaoliang/bokeh,abele/bokeh,abele/bokeh,phobson/bokeh,Karel-van-de-Plassche/bokeh,percyfal/bokeh,ericdill/bokeh,timsnyder/bokeh,CrazyGuo/bokeh,ptitjano... | examples/plotting/file/image.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom os.path import join, dirname, abspath\n\nfrom IPython.terminal.ipapp import TerminalIPythonApp\nfrom ipykernel.kernelapp import IPKernelApp\n\nhere = abspath(dirname(__file__))\noptions = join(here, 'source', '... | python | edit | 1 | 2 | bsd-3-clause | 32cc988e81bbbecf09f7e7a801e92c6cfc281e75 | ipython/ipython,ipython/ipython | docs/autogen_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.contrib import admin\n\nfrom .models import Question, Choice, Answer\n\nclass ChoiceInline(admin.TabularInline):\n model = Choice\n\nclass QuestionAdmin(admi... | python | edit | 1 | 3 | apache-2.0 | 0bb36aebdf0766c9244c6e317df89ddda86361b0 | gerard-/votingapp,gerard-/votingapp | polls/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom pythonforandroid.recipe import PythonRecipe\n\n\nclass PySDL2Recipe(PythonRecipe):\n version = '0.9.3'\n url = 'https://bitbucket.org/marcusva/py-sdl2/downloads/PySDL2-{version}.tar.gz'\n\n depends = ['sdl2']\n\n\nrecipe = P... | python | edit | 1 | 0 | mit | 4714f803b22eda26eb2fc867c1d9e2c7230bdd11 | kronenpj/python-for-android,rnixx/python-for-android,germn/python-for-android,PKRoma/python-for-android,germn/python-for-android,kivy/python-for-android,rnixx/python-for-android,rnixx/python-for-android,rnixx/python-for-android,PKRoma/python-for-android,kivy/python-for-android,germn/python-for-android,kronenpj/python-f... | pythonforandroid/recipes/pysdl2/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport fnmatch\nimport re\nfrom urllib.parse import urlparse\n\n# Hardcoded URL patterns where client is assumed to be embedded.\n#\n# Only the hostname and path are included in the pattern. The path must be\n# specified; use \"example.com/... | python | edit | 1 | 5 | bsd-2-clause | 77d264bd25e0556eb3680b845de22b62d2ebd3e6 | hypothesis/bouncer,hypothesis/bouncer,hypothesis/bouncer | bouncer/embed_detector.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom .test import *\n\nDATABASES = {\n \"default\": {\n \"ENGINE\": \"django.contrib.gis.db.backends.postgis\",\n \"NAME\": utils.get_env_setting(\"E2E_DB_NAME\"),\n \"USER\": ... | python | edit | 14 | 0 | mit | ab035185e2c2023280c29aa5239deac820ec873d | ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc | openprescribing/openprescribing/settings/e2etest.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport functools\nimport io\nfrom urllib.parse import quote\n\n\nfrom django.http import StreamingHttpResponse\n\n\ndef strip_generator(fn):\n @functools.wraps(fn)\n def inner(output, event, generator=False):\... | python | edit | 1 | 5 | mit | b6937405a9b85026f3e9cffc94fa65c87ee793c0 | jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu | kirppu/views/csv_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyinfra import inventory, state\n\nfrom pyinfra_docker import deploy_docker\nfrom pyinfra_etcd import deploy_etcd\nfrom pyinfra_kubernetes import deploy_kubernetes_master, deploy_kubernetes_node\n\nSUDO = True\nFAIL_PERCENT = 0\n\n\nde... | python | edit | 1 | 2 | mit | 04c8a36c5713e4279f8bf52fa45cdb03de721dbb | EDITD/pyinfra-kubernetes,EDITD/pyinfra-kubernetes | example/deploy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .types import ClientConfig\nfrom .typing import List, Callable, Optional, Type\nimport abc\n\n\nclass LanguageHandler(metaclass=abc.ABCMeta):\n on_start = None # type: Optional[Callable]\n on_initialized = None # type: Optional... | python | edit | 4 | 3 | mit | 10e65e9cb1496a8a6b570d27d4d3a9c3a3722016 | tomv564/LSP | plugin/core/handlers.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .affine import Affine\nfrom ... import describe\nfrom ...describe import Dimension, Synapses, Biases\n\n\n@describe.attributes(\n W=Synapses(\"Weights matrix\",\n lambda obj: (obj.nO, obj.nI),\n lambda W, ops: None)\n)... | python | edit | 4 | 2 | mit | 9c9fff8617a048a32cbff3fb72b3b3ba23476996 | spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc | thinc/neural/_classes/softmax.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\"\"\"\nReduced Gravity Shallow Water Model\nbased Matlab code by: Francois Primeau UC Irvine 2011\n\nKelsey Jordahl\n<EMAIL>\nTime-stamp: <Tue Apr 10 08:31:42 EDT 2012>\n\"\"\"\n\nfrom scipy.io.netcdf import netcdf_f... | python | edit | 3 | 1 | bsd-3-clause | db4ebbf2dcbef78b48038286a04c02366fcb2018 | kjordahl/swm | wind_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# RUN: rm -rf %t && mkdir -p %t\n# RUN: echo 'lit_config.load_config(config, \"%{inputs}/shared-output/lit.cfg\")' > %t/lit.site.cfg\n# RUN: %{lit} %t\n# RUN: FileCheck %s < %t/Output/Shared/SHARED.tmp\n# RUN: FileCheck -check-prefix=NEGATI... | python | edit | 1 | 0 | apache-2.0 | aae85883bb99ac15f6922506fa64c4492101b602 | apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llv... | utils/lit/tests/shared-output.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom energy_normalization import normalize_with_sapm\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n\n```\n\nApply this change: Add degradation module to init."
},
{
"role": "assist... | python | edit | 4 | 0 | mit | bea98b8228131d4228ba364c18ec89f4188c8a18 | kwhanalytics/rdtools,kwhanalytics/rdtools | rdtools/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\n\nfrom osf_tests.factories import PreprintFactory, PreprintProviderFactory\nfrom osf.models import PreprintService\nfrom nose.tools import * # PEP8 asserts\nimport mock\nimport pytest\nimport pytz\nimport requests\n\nfrom ... | python | edit | 7 | 1 | apache-2.0 | d413747e996326e62fdf942426f170f66d5acb7c | binoculars/osf.io,TomBaxter/osf.io,sloria/osf.io,adlius/osf.io,Johnetordoff/osf.io,mattclark/osf.io,adlius/osf.io,sloria/osf.io,HalcyonChimera/osf.io,adlius/osf.io,laurenrevere/osf.io,erinspace/osf.io,sloria/osf.io,binoculars/osf.io,mfraezz/osf.io,TomBaxter/osf.io,icereval/osf.io,Johnetordoff/osf.io,pattisdr/osf.io,crc... | osf_tests/test_preprint_summary.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\"\"\"\nConvert a keras model, saved with model.save(...) to a weights and\narchitecture component.\n\"\"\"\nimport argparse\n\ndef get_args():\n d = '(default: %(default)s)'\n parser = argparse.ArgumentParser(... | python | edit | 1 | 2 | mit | 25993238cb18212a2b83b2d6b0aa98939d38f192 | lwtnn/lwtnn,lwtnn/lwtnn,lwtnn/lwtnn | scripts/lwtnn-split-keras-network.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xlrd\nimport os\n\n\nbase_loader_error = 'The Loader class can only be used by extending it.'\n\n\nexcel_extensions = [\n '.xls',\n '.xlsx',\n]\n\n\nclass Loader(object):\n def __init__(self, file_info, autoload=True):\n ... | python | edit | 1 | 2 | mit | c12f040fe9b0bbc3e47aed8f942de04216251f51 | monokrome/django-drift | importer/loaders.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport sys\nimport json\nimport os\nimport jinja2\n\ndef render(tpl_path):\n path, filename = os.path.split(tpl_path)\n return jinja2.Environment(\n loader=jinja2.FileSystemLoader(path or './')\n ).... | python | edit | 3 | 2 | apache-2.0 | fe4ce6dfa26c60747b6024fa9f6d991aa3b95614 | Mbed-TLS/mbedtls,NXPmicro/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,NXPmicro/mbedtls,NXPmicro/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls | scripts/codegen_driverwrappers/generate_driver_wrappers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport argparse\nimport logging\nimport sys\n\nimport gym\nimport universe # register the universe environments\n\nfrom universe import wrappers\n\nlogger = logging.getLogger()\n\ndef main():\n parser = argparse.Ar... | python | edit | 3 | 5 | mit | a6ed56b37bba3f5abff73c297a8a20271d73cab2 | openai/universe,rht/universe | example/random-agent/random-agent.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport sys\nimport ast\n\nfrom lib.exceptions import CustomException\n\n\nclass StreamWriter(object):\n\n def run(self, stream):\n if stream.upper() == 'STDOUT':\n sys.stdout.wr... | python | edit | 1 | 4 | apache-2.0 | a4c5e9a970a297d59000468dde8423fa9db00c0f | StackStorm/st2tests,StackStorm/st2tests,StackStorm/st2tests | packs/fixtures/actions/scripts/streamwriter-script.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom core.models import Application as Image\n\nfrom api import permissions\nfrom api.v2.serializers.details import ImageSerializer\nfrom api.v2.views.base import AuthOptionalViewSet\nfrom api.v2.views.mixins import MultipleFieldLookup\n\n\... | python | edit | 1 | 1 | apache-2.0 | d2f166ec2f2eca547abab7b4f4e498f24f983948 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/views/image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import patch\n\nfrom django.test import TestCase\nfrom breach.sniffer import Sniffer\n\n\nclass SnifferTest(TestCase):\n def setUp(self):\n self.endpoint = 'http://localhost'\n self.sniffer = Sniffer(self.endpoint... | python | edit | 1 | 1 | mit | 7c6f1bfca63ea0db8e07156b5122d0986b9cd1a5 | dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,esarafi... | backend/breach/tests/test_sniffer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys, os\n\n# list of (packagename, filename)\n\nDEPENDENCIES = [\n ('zlib1g-dev / zlib-devel', '/usr/include/zlib.h'),\n ('g++ / gcc-c++', '/usr/bin/g++'),\n ('wget', '/usr/bin/wget'),\n ('libsqlite3-dev ... | python | edit | 2 | 4 | mit | ec91f28dfe4e1f48f7ff92f1fe499944aa366763 | abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper | tools/checkdependencies.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update : bind client Elevator class to package root"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__title__ = \"Elevator\"\n__author__ = \"Oleiade\"\n__license__ = \"BSD\"\n\n\nfrom clie... | python | new_file | 3 | 0 | mit | 47dc3c9af512b89525048564f32e71b012ed2f19 | oleiade/Elevator | elevator/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .factory import FactoryTask\nfrom .report import ReportTask\nfrom .sleep import SleepTask\n\n\n# Generic schema to reference a task ID\nTASKID_SCHEMA = {\n 'type': 'string',\n 'description': 'task_id'\n}\n\n```\n\nApply this chan... | python | edit | 5 | 0 | apache-2.0 | e615e2ebf3f364ba093c48d6fb0c988f0b97bc13 | gdraynz/nyuki,optiflows/nyuki,gdraynz/nyuki,optiflows/nyuki | nyuki/workflow/tasks/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsetup.py for Flask-Limiter\n\n\n\"\"\"\n__author__ = \"Ali-Akber Saifee\"\n__email__ = \"<EMAIL>\"\n__copyright__ = \"Copyright 2022, Ali-Akber Saifee\"\n\nfrom setuptools import setup, find_packages\nimport os\nimport versioneer\n\... | python | edit | 1 | 0 | mit | 9a31799534c16d592aa34ba3c46bdc3f43309a87 | alisaifee/flask-limiter,alisaifee/flask-limiter | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.views.generic import TemplateView\n\nurlpatterns = patterns('',\n # Examples:\n # url(r'^$', 'fbxnano.views.home', name='home'),\n # url(r'^blog/', include('blog.urls... | python | edit | 4 | 0 | mit | 564075cbb66c6e79a6225d7f678aea804075b966 | Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano | api/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#########\n# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved\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... | python | edit | 1 | 0 | apache-2.0 | a01e88ded4e7344bcc5249f5f3be67cc2a06a5a0 | cloudify-cosmo/tosca-vcloud-plugin,denismakogon/tosca-vcloud-plugin,kemiz/tosca-vcloud-plugin,vmware/tosca-vcloud-plugin | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport decimal\nimport msgpack\nfrom dateutil.parser import parse\n\nfrom rest_framework.parsers import BaseParser\nfrom rest_framework.exceptions import ParseError\n\n\nclass MessagePackDecoder(object):\n\n def decode(self, obj):\n ... | python | edit | 1 | 2 | bsd-3-clause | 62cee7d5a625bb3515eddaddbe940239a41ba31c | juanriaza/django-rest-framework-msgpack | rest_framework_msgpack/parsers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom django.utils.encoding import smart_str\nfrom geopy import geocoders\nfrom geopy.exc import GeocoderServiceError\n\nclass Error(Exception):\n pass\n\n\ndef google_v3(ad... | python | edit | 1 | 3 | mit | 4dfbe6ea079b32644c9086351f911ce1a2b2b0e1 | duixteam/django-easy-maps,kmike/django-easy-maps,Gonzasestopal/django-easy-maps,kmike/django-easy-maps,bashu/django-easy-maps,bashu/django-easy-maps,Gonzasestopal/django-easy-maps | easy_maps/geocode.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport markdown\nfrom mdx_embedly import EmbedlyExtension\n\n\ndef test_embedly():\n s = \"[https://github.com/yymm:embed]\"\n expected = \"\"\"\n<p>\n<a class=\"embedly-card\" href=\"https://github.com/yymm\">embed.ly</a>\n<script as... | python | edit | 1 | 1 | mit | 080cda37b93010232481c8fd6090a3909a086fe4 | yymm/mdx_embedly | tests/test_mdx_embedly.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add handling of which on Windows"
},
{
"role": "assistant",
"content": "# Convenience imports from pexpect\nfrom __future__ import absolute_import\nfrom pexpect import which as which_base, is_executable_file, EOF, TIMEOUT\nimport... | python | new_file | 6 | 10 | bsd-3-clause | 7dcd2c2aa1e2fd8f17e0b564f9b77375675ccd9a | Calysto/metakernel | metakernel/pexpect.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '0.4.0'\n\n# This list defines all the modules that will be loaded if a user invokes\n# from climLab import *\n\n# totally out of date!\n\n#__all__ = [\"constants\", \"thermo\", \"orbital_table\",\n# \"long_orbita... | python | edit | 24 | 0 | mit | 73ce10193c497fdffee178ab877d173287417047 | brian-rose/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab,cjcardinale/climlab | climlab/__init__.py | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"portinus\",\n version=\"1.0.10\",\n author=\"Justin Dray\",\n author_email=\"<EMAIL>\",\n url=\"https://github.com/justin8/portinus\",\n ... | python | edit | 1 | 0 | mit | ecf8b600868534e82056a83f9b86f27db8812e0f | justin8/portinus,justin8/portinus | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport asyncio\nimport threading\n\n\nclass Tasks:\n loop = asyncio.new_event_loop()\n\n @classmethod\n def _run(cls):\n try:\n cls.loop.run_forever()\n finally:\n cls.loop.close()\n\n @classm... | python | edit | 1 | 2 | apache-2.0 | c987ed375da13f53928157f14528bed0c148eeac | Charcoal-SE/SmokeDetector,Charcoal-SE/SmokeDetector | tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom construct import Flag\n\nclass TestFlag(unittest.TestCase):\n\n def test_parse(self):\n flag = Flag(\"flag\")\n self.assertTrue(flag.parse(\"\\x01\"))\n\n def test_parse_flipped(self):\n fl... | python | edit | 1 | 1 | mit | 2ad21d67ccde2e25ea5c6d64cdee36dbc6425cbc | riggs/construct,mosquito/construct,gkonstantyno/construct,MostAwesomeDude/construct,0000-bigtree/construct,riggs/construct,mosquito/construct,0000-bigtree/construct,gkonstantyno/construct,MostAwesomeDude/construct | construct/tests/test_mapping.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom redis import Redis\n\nfrom remotecv.result_store import BaseStore\nfrom remotecv.utils import logger\n\n\nclass ResultStore(BaseStore):\n\n WEEK = 604800\n redis_instance = None\n\n def __init__(self, config):\n super(R... | python | edit | 1 | 2 | mit | d2eb124651862d61f28519a5d9dc0ab1a0133fb7 | thumbor/remotecv | remotecv/result_store/redis_store.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom setuptools import find_packages, setup\n\nsetup(\n name='django-afip',\n description='AFIP integration for django',\n author='Hugo Osvaldo Barrera',\n author_email='<EMAIL>',\n url='https://gitl... | python | edit | 1 | 0 | isc | 0f4fa47d1460889dac184a139c3ae4af3ed21214 | hobarrera/django-afip,hobarrera/django-afip | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nURLconf for registration and activation, using django-registration's\none-step backend.\n\nIf the default behavior of these views is acceptable to you, simply\nuse a line like this in your root URLconf to set up the default URLs\nfo... | python | edit | 1 | 0 | bsd-3-clause | 3bd9214465547ff6cd0f7ed94edf8dacf10135b5 | dirtycoder/django-registration,ubernostrum/django-registration,myimages/django-registration,tdruez/django-registration,awakeup/django-registration | registration/backends/simple/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | python | edit | 1 | 0 | apache-2.0 | c5b130444e2061ae1c6bdf16ebc14d08817a8aea | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom website.util.permissions import reduce_permissions\n\nfrom admin.users.serializers import serialize_simple_node\n\n\ndef serialize_node(node):\n embargo = node.embargo\n if embargo is not None:\n embargo = n... | python | edit | 1 | 3 | apache-2.0 | a7830d85c6966732e46da63903c04234d8d16c39 | mattclark/osf.io,laurenrevere/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,mattclark/osf.io,caseyrollins/osf.io,chennan47/osf.io,adlius/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,hmoco/osf.io,CenterForOpenScience/osf.io,adlius/osf.io,chennan47/osf.io,hmoco/osf.io,caneruguz/osf.io,mfra... | admin/nodes/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n test_trackable\n ~~~~~~~~~~~~~~\n\n Trackable tests\n\"\"\"\n\nimport pytest\n\nfrom utils import authenticate, logout\n\npytestmark = pytest.mark.trackable()\n\n\ndef test_trackable_flag(app, clie... | python | edit | 1 | 1 | mit | d185407ac4caf5648ef4c12eab83fec81c307407 | pawl/flask-security,reustle/flask-security,jonafato/flask-security,asmodehn/flask-security,quokkaproject/flask-security,LeonhardPrintz/flask-security-fork,dommert/flask-security,LeonhardPrintz/flask-security-fork,fuhrysteve/flask-security,CodeSolid/flask-security,simright/flask-security,inveniosoftware/flask-security-f... | tests/test_trackable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'jgosmann'\n\nfrom matplotlib.cbook import iterable\n\nfrom prettyplotlib.utils import remove_chartjunk, maybe_get_ax\nfrom prettyplotlib.colors import set2\n\n\ndef eventplot(*args, **kwargs):\n ax, args, kwargs = maybe_get... | python | edit | 1 | 5 | mit | 670227590ceaf6eb52d56809f8bcc1b1f6ae6f7f | olgabot/prettyplotlib,olgabot/prettyplotlib | prettyplotlib/_eventplot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging as l\nimport argparse\n\nfrom ume.utils import (\n save_mat,\n dynamic_load,\n)\n\n\ndef parse_args():\n p = argparse.ArgumentParser(\n description='CLI interface UME')\n p.add_argu... | python | edit | 3 | 5 | mit | bc6001d6c25bdb5d83830e5a65fe5aea9fc1eb99 | smly/ume,smly/ume,smly/ume,smly/ume | ume/cmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\nimport pika\n\nfrom mettle.settings import get_settings\nfrom mettle.publisher import publish_event\n\n\ndef test_long_routing_key():\n settings = get_settings()\n conn = pika.BlockingConnection(pika.URLParameters(setti... | python | edit | 1 | 1 | mit | fd5387f1bb8ac99ed421c61fdff777316a4d3191 | yougov/mettle,yougov/mettle,yougov/mettle,yougov/mettle | tests/test_publisher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tests import ScraperTest\n\nfrom recipe_scrapers.template import Template\n\n\nclass TestTemplateScraper(ScraperTest):\n\n scraper_class = Template\n\n def test_host(self):\n self.assertEqual(\"example.com\", self.harveste... | python | edit | 1 | 1 | mit | 60c718564b8941d0d6fa684ee175f6bfe7c937cc | hhursev/recipe-scraper | templates/test_scraper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\nimport skyfield # to learn the version\n\nsetup(\n name='skyfield',\n version=skyfield.__version__,\n description=skyfield.__doc__,\n long_description=open('README.rst').read(),\n license='M... | python | edit | 1 | 0 | mit | be3f74bcd4d6fed5aaec3d8df62854a1078a1383 | exoanalytic/python-skyfield,skyfielders/python-skyfield,skyfielders/python-skyfield,ozialien/python-skyfield,GuidoBR/python-skyfield,exoanalytic/python-skyfield,ozialien/python-skyfield,GuidoBR/python-skyfield | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose.tools import istest, assert_equal\n\nfrom mammoth.raw_text import extract_raw_text_from_element\nfrom mammoth import documents\n\n\n@istest\ndef raw_text_of_text_element_is_value():\n assert_equal(\"Hello\", extract_raw_text_fr... | python | edit | 1 | 1 | bsd-2-clause | 822cc689ce44b1c43ac118b2a13c6d0024d2e194 | mwilliamson/python-mammoth | tests/raw_text_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom globus_cli.services.transfer import get_client as get_tc\nfrom tests.framework.cli_testcase import default_test_config\n\ntry:\n from mock import patch\nexcept ImportError:\n from unittest.mock import patch\n\n\ndef cleanup_bookm... | python | edit | 1 | 2 | apache-2.0 | 14c86e3c93bd5114b74c125fdb8213b22342c95c | globus/globus-cli,globus/globus-cli | tests/manual_cleanup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .. import idx\nimport os\n\ndef test__find_depth():\n yield check__find_depth, 9, 0\n yield check__find_depth, [1, 2], 1\n yield check__find_depth, [[1, 2], [3, 6, 2]], 2\n yield check__find_depth, [[[1,2], [2]]], 3\n\ndef ... | python | edit | 3 | 1 | mit | 6f8f449316a71dd284d2661d206d88d35c01ea54 | tmerr/trevornet | TrevorNet/tests/test_idx.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\n\nsetup(\n name='tangled.website',\n version='0.1.dev0',\n description='tangledframework.org',\n long_description=open('README.rst').read(),\n url='http://tangledframework.org/',\n download_... | python | edit | 1 | 0 | mit | 420644b26d0e355a5fa9d94d18555fbf7494deb6 | TangledWeb/tangled.website | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom hunting.level.map import LevelTile, LevelMap\n\n\nclass TestPathfinding(unittest.TestCase):\n def test_basic_diagonal(self):\n level_map = LevelMap()\n level_map.set_map([[LevelTile() for _ in range(... | python | edit | 1 | 4 | mit | 2daee974533d1510a17280cddb5a4dfc147338fa | MoyTW/RL_Arena_Experiment | tests/level/test_map.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nClasses and functions for writing IndicatorRecord objects with a record type of \"CE\" (Censys Record)\n\"\"\"\n\nfrom pivoteer.writer.core import CsvWriter\n\n\nclass CensysCsvWriter(CsvWriter):\n \"\"\"\n A CsvWriter impleme... | python | edit | 1 | 4 | mit | 6858e4a2e2047c906a3b8f69b7cd7b04a0cbf666 | gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID | pivoteer/writer/censys.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Transliterator(object):\n\n def __init__(self, mapping, invert=False):\n self.mapping = [\n (v, k) if invert else (k, v)\n for k, v in mapping.items()\n ]\n\n self._rules = sorted(\n ... | python | edit | 1 | 5 | mit | 315b581b9b0438389c7f4eb651d2893b805a2369 | malexer/SublimeTranslit | translit.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016 Renata Hodovan, Akos Kiss.\n#\n# Licensed under the BSD 3-Clause License\n# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.\n# This file may not be copied, modified, or distributed except\n# according to ... | python | edit | 1 | 2 | bsd-3-clause | 26dcd1ce43864de77c1cd26065c09cc2b4c4788e | akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator | tests/fuzzer/test_random_content.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom mtglib.constants import base_url, card_flags\n\nclass DescribeConstants(unittest.TestCase):\n\n def should_have_base_url(self):\n url = ('http://gatherer.wizards.com/Pages/Search/Default.aspx'\n ... | python | edit | 1 | 1 | mit | 90cbe055e9f0722de7619fbd777a10e2b95d63b3 | chigby/mtg,chigby/mtg | tests/constants_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTESTS is a dict with all you tests.\nKeys for this will be categories' names.\nEach test is dict with\n \"input\" -- input data for user function\n \"answer\" -- your right answer\n \"explanation\" -- not necessary key, it'... | python | edit | 1 | 0 | mit | 88e61076e3a130d3a8579996966aef2fd6ec43ef | cielavenir/checkio-task-painting-wall,cielavenir/checkio-task-painting-wall,cielavenir/checkio-task-painting-wall | verification/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nfrom setuptools import setup\n\n# Utility function to read the README file.\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name = 'voltha',\n v... | python | edit | 1 | 1 | apache-2.0 | 3ef9fc3c0f2c0210d41db1abb3ae4120fef298cf | opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha,opencord/voltha | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom decimal import Decimal as D, InvalidOperation\n\nfrom django import template\nfrom django.conf import settings\nfrom babel.numbers import format_currency\n\nregister = template.Library()\n\n\n@register.filter(name='currency')\ndef curr... | python | edit | 1 | 3 | bsd-3-clause | 646a248d59f835264729b48a0116d51089f6113e | lijoantony/django-oscar,faratro/django-oscar,michaelkuty/django-oscar,MatthewWilkes/django-oscar,django-oscar/django-oscar,dongguangming/django-oscar,taedori81/django-oscar,pasqualguerrero/django-oscar,marcoantoniooliveira/labweb,faratro/django-oscar,Jannes123/django-oscar,binarydud/django-oscar,Jannes123/django-oscar,... | oscar/templatetags/currency_filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function, division\n\nimport hashlib\nimport os\nimport json\n\n\nd = json.load(open(\"data/hashList.txt\"))\n\n\ndef generate_file_md5(filename, blocksize=2**20):\n m = hashlib.md5()\n with open(filename,... | python | edit | 3 | 3 | bsd-3-clause | 14bf00afda2fc052dec0ae1655ba6a14073761cd | berkeley-stat159/project-theta | data/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nconfig = {\n 'name' : 'Redis Grepper',\n 'description' : 'Perform regex searches through Redis values',\n 'auth... | python | edit | 1 | 0 | bsd-2-clause | ba9a0c496d5fb345b93f08e62dc095bc6c4d3d33 | igstan/redis-grep | setup.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.