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 os\nimport json\n\ndefault_conf = {\n 'reddit': {\n 'username': '',\n 'password': '',\n },\n 'twitter': {\n 'consumer_key': '',\n 'consumer_secret': '',\n 'access_token': '',\n 'acce... | python | edit | 2 | 1 | mit | bea8b07180e6e9b2c786dfe37e12e75090363a1c | r3m0t/TweetPoster,joealcorn/TweetPoster,tytek2012/TweetPoster,aperson/TweetPoster | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Commands for interacting with Elastic Search \"\"\"\n# pylint: disable=broad-except\n\nfrom os.path import join\n\nimport requests\n\nfrom lib.tools import TEST_FOLDER\n\n\ndef es_is_available():\n \"\"\" Test if Elastic Search is... | python | edit | 1 | 2 | mit | fdae17a50223c2f9b8ba4a665fc24726e2c2ce14 | matthewfranglen/postgres-elasticsearch-fdw | tests/lib/es_tools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport subprocess\nimport sys\nimport setup_util\nimport os\n\ndef start(args):\n try:\n subprocess.check_call(\"mvn clean package shade:shade\", shell=True, cwd=\"grizzly-jersey\")\n subprocess.Popen(\"java -jar target/grizzly-jerse... | python | edit | 4 | 3 | bsd-3-clause | 08fbfa49129a42821b128913e4aa9fbacf966f20 | yunspace/FrameworkBenchmarks,grob/FrameworkBenchmarks,herloct/FrameworkBenchmarks,Ocramius/FrameworkBenchmarks,nbrady-techempower/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,nkasvosve/FrameworkBenchmarks,grob/FrameworkBenchmarks,victorbriz/FrameworkBenchmarks,sxend/FrameworkBenchmarks,jet... | grizzly-jersey/setup.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 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 | c9b6cec70b2162b98d836f8100bc039f19fe23cb | googleapis/google-api-python-client,googleapis/google-api-python-client | googleapiclient/__init__.py | rejected_duplicate | Near-duplicate of sample 3094 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\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.apache.org/licenses/LICENSE-2.0\n#\n# U... | python | edit | 1 | 3 | apache-2.0 | 92d253fdce108162ab2ce05dd38da971ca42293d | rushiagr/keystone,jumpstarter-io/keystone,reeshupatel/demo,dstanek/keystone,idjaw/keystone,jonnary/keystone,vivekdhayaal/keystone,MaheshIBM/keystone,klmitch/keystone,rajalokan/keystone,rajalokan/keystone,nuxeh/keystone,ging/keystone,rushiagr/keystone,takeshineshiro/keystone,ilay09/keystone,nuxeh/keystone,roopali8/keyst... | keystone/contrib/kds/common/service.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\nimport sys\n\n\ndf = pd.read_csv(sys.argv[1])\ndf.columns = [c.lower() for c in df.columns]\n\nfrom sqlalchemy import create_engine\nengine = create_engine('postgresql://localhost:5432/germline_genotype_tracking')\n\ntr... | python | edit | 3 | 0 | mit | 30a2a16aff030235941eac3786cc49b42e0ed868 | llevar/germline-regenotyper,llevar/germline-regenotyper | bootstrap/conf/salt/state/run-tracking-db/scripts/import_sample_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport test.test_support, unittest\nimport os\n\nclass CodingTest(unittest.TestCase):\n def test_bad_coding(self):\n module_name = 'bad_coding'\n self.verify_bad_module(module_name)\n\n def test_bad_coding2(self):\n ... | python | edit | 1 | 1 | mit | 1096d0f13ebbc5900c21626a5caf6276b36229d8 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_coding.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\"); 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.apache.org/licenses/LICENSE-2.0... | python | edit | 1 | 1 | apache-2.0 | e40915461f9c371a56a364e1de27bcea05dc1a37 | mgeisler/satori,mgeisler/satori,lil-cain/satori,rackerlabs/satori,rackerlabs/satori,lil-cain/satori,lil-cain/satori,samstav/satori,samstav/satori,samstav/satori | satori/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\n\napp = Flask(__name__)\napp.config.from_object(\"config\")\n\n```\n\nApply this change: Use a env var to get config"
},
{
"role": "assistant",
"content": "import os\nfrom flask import Flask\n\napp = Fla... | python | edit | 1 | 0 | mit | c5a2c7e802d89ea17a7f0fd1a9194eaab8eaf61d | pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control | wcontrol/src/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAutomatic compilation of XIB files\n\"\"\"\nimport subprocess, os\nfrom py2app.decorators import converts\n\n@converts(suffix=\".xib\")\ndef convert_xib(source, destination, dry_run=0):\n destination = destination[:-4] + \".nib\"... | python | edit | 1 | 3 | mit | 7560bce01be5560395dd2373e979dbee086f3c21 | metachris/py2app,metachris/py2app,metachris/py2app,metachris/py2app | py2app/converters/nibfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom openerp import fields,models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fields.Date()\n duration = fields.Float(digits=(6,2)... | python | edit | 1 | 0 | apache-2.0 | 6b55f079d595700cd84d12d4f351e52614d291c5 | arogel/openacademy-project | openacademy/model/openacademy_session.py | rejected_duplicate | Near-duplicate of sample 178 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom paver.easy import *\n\n@task\ndef test(options):\n info(\"Running tests for Python 2\")\n sh('python2 tests.py')\n info(\"Running tests for Python 3\")\n sh('python3 tests.py')\n\n@task\ndef cover... | python | edit | 14 | 1 | mit | 960ce03fc6d861c8df8d7aef5042f71c101794ca | HaDiNet/ldapom | pavement.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import sudo, quiet\nfrom braid import package\nfrom pipes import quote\n\n\ndef install():\n package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])\n\n\ndef _runQuery(query):\n with quiet():\n return s... | python | edit | 1 | 2 | mit | 4286d2d6a685571c70a8f48c3cd6802d13c4acef | alex/braid,alex/braid | braid/postgres.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ..ditto.views import PaginatedListView\n\nfrom .models import Account, Photo, User\n\n\nclass Home(PaginatedListView):\n template_name = 'flickr/index.html'\n\n def get_context_data(self, **kwargs):\n context = super().get... | python | edit | 3 | 1 | mit | d358a759d86ce2a377e4fef84f20075bd0481d3b | philgyford/django-ditto,philgyford/django-ditto,philgyford/django-ditto | ditto/flickr/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom Instanssi.kompomaatti.models import Entry\n\n\nVALID_YOUTUBE_URLS = [\n # must handle various protocols in the video URL\n \"http://www.youtube.com/v/asdf123456\",\n \"https://www.youtube.com/... | python | edit | 1 | 2 | mit | f012d59f163a8b8a693dc894d211f077ae015d11 | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Instanssi/kompomaatti/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom consts.notification_type import NotificationType\nfrom helpers.model_to_dict import ModelToDict\nfrom notifications.base_notification import BaseNotification\n\n\nclass AllianceSelectionNotification(BaseNotification):\n\n def __init... | python | edit | 1 | 1 | mit | a3f1bd9b27bb605fe363a69a34a92862a1899da1 | jaredhasenklein/the-blue-alliance,synth3tk/the-blue-alliance,jaredhasenklein/the-blue-alliance,the-blue-alliance/the-blue-alliance,synth3tk/the-blue-alliance,bdaroz/the-blue-alliance,synth3tk/the-blue-alliance,tsteward/the-blue-alliance,jaredhasenklein/the-blue-alliance,jaredhasenklein/the-blue-alliance,the-blue-allian... | notifications/alliance_selections.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom sklearn.cross_validation import cross_val_score\nfrom sklearn.externals import joblib as pickle\n\nclass scorer(object):\n def __init__(self, model, descriptor_generator, model_opts = {}, desc_opts = {}):\n ... | python | edit | 8 | 3 | bsd-3-clause | 27c614b30eda339ca0c61f35e498be6456f2280f | mwojcikowski/opendrugdiscovery | scoring/__init__.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 3.2.4 on 2021-06-21 05:46\n\nfrom django.db import migrations, models\nimport django.utils.timezone\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"helusers\", \"0001_add_ad_groups\"),\n... | python | edit | 1 | 0 | bsd-2-clause | a28b2bc45b69503a8133b0df98ffa96d9aa4e229 | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/migrations/0002_add_oidcbackchannellogoutevent.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Define here the models for your scraped items\n#\n# See documentation in:\n# http://doc.scrapy.org/en/latest/topics/items.html\n\nimport scrapy\n\n\n\nclass MemberofParliament(scrapy.Item):\n\t\"\"\"\n\tData str... | python | edit | 1 | 0 | mit | a9ac098ec492739f37005c9bd6278105df0261c5 | mthipparthi/parliament-search | parliamentsearch/items.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport logging\nimport os\nimport sys\n\nfrom dbaas_zabbix.dbaas_api import DatabaseAsAServiceApi\nfrom dbaas_zabbix.provider_factory import ProviderFactory\nfrom pyzabbix import ZabbixAPI\n\n... | python | edit | 1 | 2 | bsd-3-clause | d9f035b6915a5290b7affe1853937d45214e07bc | globocom/dbaas-zabbix,globocom/dbaas-zabbix | dbaas_zabbix/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom microbit import *\n\nhands = Image.ALL_CLOCKS\n\n#A centre dot of brightness 2.\nticker_image = Image(\"2\\n\").crop(-2,-2,5,5)\n\n#Adjust these to taste\nMINUTE_BRIGHT = 0.1111\nHOUR_BRIGHT = 0.55555\n\n#Generate hands for 5 minute in... | python | edit | 5 | 4 | mit | 9b93ffa1662e99888c430e6deab01bd215055253 | JoeGlancy/micropython,JoeGlancy/micropython,JoeGlancy/micropython | examples/analog_watch.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make the array API constants into dimension 0 arrays\n\nThe spec does not actually specify whether these should be dimension 0 arrays\nor Python floats (which they are in NumPy). However, making them dimension 0\narrays is cleaner, and ensur... | python | new_file | 1 | 0 | mit | e6fa443412a909bc01e2dd8d9944ff3ddba35089 | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | numpy/_array_api/_constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport theano as _th\nimport numpy as _np\n\n\ndef create_param(shape, init, fan=None, name=None, type=_th.config.floatX):\n return _th.shared(init(shape, fan).astype(type), name=name)\n\n\ndef create_param_and_grad(shape, init, fan=None... | python | edit | 1 | 2 | mit | ee69971832120f4492e8f41abfbcb9c87e398d6a | yobibyte/DeepFried2,lucasb-eyer/DeepFried2,elPistolero/DeepFried2,Pandoro/DeepFried2 | DeepFried2/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\ncreate_or_update_free_sms_fragment_limit_schema = {\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"description\": \"POST annual billing schema\",\n \"type\": \"object\",\n \"titl... | python | edit | 1 | 4 | mit | d572c7228d4c4fb84530b8a33df7bd4596e01d8b | alphagov/notifications-api,alphagov/notifications-api | app/billing/billing_schemas.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015 EMC Corporation\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of th... | python | edit | 1 | 1 | apache-2.0 | 8b3ca76b980f126912de1bc8ffa067c199693eb3 | phenoxim/cinder,cloudbase/cinder,j-griffith/cinder,phenoxim/cinder,Nexenta/cinder,Datera/cinder,mahak/cinder,mahak/cinder,j-griffith/cinder,ge0rgi/cinder,Nexenta/cinder,openstack/cinder,cloudbase/cinder,eharney/cinder,eharney/cinder,Hybrid-Cloud/cinder,bswartz/cinder,NetApp/cinder,Hybrid-Cloud/cinder,Datera/cinder,open... | cinder/db/sqlalchemy/migrate_repo/versions/061_add_snapshot_id_timestamp_to_backups.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Addon utilities.\"\"\"\n# Copyright 2015 Solinea, Inc.\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... | python | edit | 1 | 1 | apache-2.0 | 7c68e3b00e7c66c0223617447e16a7159118d284 | slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server | goldstone/addons/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport lldb\nclass fooSynthProvider:\n def __init__(self, valobj, dict):\n self.valobj = valobj;\n self.int_type = valobj.GetType().GetBasicType(lldb.eBasicTypeInt)\n def num_children(self):\n return 3;\n ... | python | edit | 1 | 4 | apache-2.0 | 52bb18cf1249e3f48764a7ed4e9546439692c5cb | llvm-mirror/lldb,apple/swift-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 | packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.10 on 2016-08-22 23:41\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\ndef add_billing_address(apps, schema_editor):\n ''' Data migration add billing_addres... | python | edit | 1 | 2 | mit | 0fb7e8d901addc801fb9b99d744666f573f672d3 | ioO/billjobs | billjobs/migrations/0003_auto_20160822_2341.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\n\nregistry = {}\nbound_registry = {}\n\n\ndef register(cls):\n registry[cls.api_type] = cls\n return cls\n\n\ndef bind(parent=None, resource=None):\n def wrapper(endpointset):\n if ... | python | edit | 1 | 3 | mit | 8f2e1ef30a62c19fc91eed48adc38ecfcdbc37d6 | pinax/pinax-api | pinax/api/registry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# CLI frontend to Arris modem stat scraper library arris_scraper.py\n\nimport argparse\nimport arris_scraper\nimport json\nimport pprint\n\ndefault_url = 'http://192.168.100.1/cgi-bin/status_cgi'\n\nparser = argpars... | python | edit | 1 | 0 | mit | b2dd21b2240eec28881d6162f9e35b16df906219 | wolrah/arris_stats | arris_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sqlite3\n\nDB_FILENAME = 'citationhunt.sqlite3'\n\ndef init_db():\n return sqlite3.connect(DB_FILENAME)\n\ndef reset_db():\n db = init_db()\n\n with db:\n db.execute('''\n DROP TABLE categories\n '''... | python | edit | 1 | 1 | mit | 342d62a42bb4e1993bbe9d755e6daabcaffe4122 | eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt | chdb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import defaultdict\nimport traceback\n\n\nLINT_START = 'LINT_START'\nLINT_RESULT = 'LINT_RESULT'\nLINT_END = 'LINT_END'\n\n\nlisteners = defaultdict(set)\n\n\ndef subscribe(topic, fn):\n listeners[topic].add(fn)\n\n\ndef... | python | edit | 1 | 4 | mit | 83ea38ee5616b1637cc2d983d4518d83793c7b72 | SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3 | lint/events.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n========================================================\nSpatial Transformations (:mod:`scipy.spatial.transform`)\n========================================================\n\n.. currentmodule:: scipy.spatial.transform\n\nThis packa... | python | edit | 1 | 0 | bsd-3-clause | e6046cf33af1a4b1f16424740b5093ebd423842e | aarchiba/scipy,rgommers/scipy,mdhaber/scipy,grlee77/scipy,vigna/scipy,perimosocordiae/scipy,gertingold/scipy,anntzer/scipy,ilayn/scipy,anntzer/scipy,jamestwebber/scipy,person142/scipy,grlee77/scipy,gfyoung/scipy,e-q/scipy,perimosocordiae/scipy,matthew-brett/scipy,endolith/scipy,person142/scipy,scipy/scipy,jor-/scipy,il... | scipy/spatial/transform/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom .model import ModalityModel\nfrom .estimator import ModalityEstimator\nfrom .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\\\n MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot\n\n... | python | edit | 3 | 1 | bsd-3-clause | 8ebe0966c64f344b79c450782661f4c6cab6a312 | YeoLab/anchor,olgabot/modish,olgabot/anchor | modish/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport snapshot, sys\n\nif len(sys.argv) == 2:\n print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], \"\"))\nelse:\n print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], sys.argv[3]))\n\n```\n\nApply this... | python | edit | 1 | 0 | apache-2.0 | 1652b921fa2fadc936b346fc3de217cf97b0e476 | AerialX/rust-rt-minimal,fabricedesre/rust,emk/rust,erickt/rust,cllns/rust,j16r/rust,untitaker/rust,cllns/rust,miniupnp/rust,zachwick/rust,seanrivera/rust,aidancully/rust,achanda/rand,barosl/rust,pshc/rust,aidancully/rust,barosl/rust,kmcallister/rust,mdinger/rust,l0kod/rust,quornian/rust,fabricedesre/rust,LeoTestard/rus... | src/etc/make-snapshot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport functools\nimport logging\n\nimport redis\n\nimport config\n\n\n# Default options\n\nredis_opts = {\n 'host': 'localhost',\n 'port': 6379,\n 'db': 0,\n 'password': None\n}\nredis_conn = None\ncache_prefix = None\n\n\ndef ... | python | edit | 3 | 4 | apache-2.0 | e578c90cc542d3cf825645fa9376796a1e7c31f9 | dalvikchen/docker-registry,atyenoria/docker-registry,atyenoria/docker-registry,ewindisch/docker-registry,docker/docker-registry,ken-saka/docker-registry,wakermahmud/docker-registry,Carrotzpc/docker-registry,kireal/docker-registry,ewindisch/docker-registry,yuriyf/docker-registry,whuwxl/docker-registry,Haitianisgood/dock... | lib/cache.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nimport mne\n\nfrom my_settings import * \n\nsubject = sys.argv[1]\n\n# make source space\nsrc = mne.setup_source_space(subject, spacing='oct6',\n subjects_dir=subjects_dir,\... | python | edit | 5 | 0 | bsd-3-clause | 03977d24d5862373a881b7098bc78adc30fe8256 | MadsJensen/RP_scripts,MadsJensen/RP_scripts,MadsJensen/RP_scripts | make_src_bem.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport pyfds as fds\n\n\ndef test_acoustic_material():\n water = fds.AcousticMaterial(1500, 1000)\n water.bulk_viscosity = 1e-3\n water.shear_viscosity = 1e-3\n assert np.isclose(water.absorption_coef, 7e-3 /... | python | edit | 1 | 1 | bsd-3-clause | 5d8b217659fdd4a7248a60b430a24fe909bca805 | emtpb/pyfds | test/test_acoustics.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sqlite3 as sql\nimport os\nimport sys\nimport logging\nimport benchmark\n\n# bmVerify(['final_r7', 'final_r8'], filepath=\"/home/ysun/disambig/newcode/all/\", outdir = \"/home/ayu/results_v2/\")\n \n# Text Files\ntxt_file = '... | python | edit | 3 | 0 | bsd-2-clause | 859a82df7804f181ffc12052a4af59ab52a44560 | yngcan/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor | test/goldstandard/benchmark_confirm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport tkFileDialog\nimport joincsv\nimport os.path\nimport sys\n\nif __name__ == '__main__':\n filetypes=[(\"Spreadsheets\", \"*.csv\"),\n (\"Spreadsheets\", \"*.xls\"),\n (\"Spreadsheets\", \"*.xlsx\")]\n ... | python | edit | 1 | 0 | apache-2.0 | d436bcc20be8eb81960a53d442f699e42e2f9ea7 | peterSW/corow | src/tkjoincsv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nimport typer\nfrom typer.testing import CliRunner\n\nfrom first_steps import tutorial001 as mod\n\nrunner = CliRunner()\napp = typer.Typer()\napp.command()(mod.main)\n\n\... | python | edit | 1 | 2 | mit | f9d7f69d7e8ae1dceaba09ac4412438076261744 | tiangolo/typer,tiangolo/typer | tests/test_completion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Created By: Andrew Ryan DeFilippis\"\"\"\n\nprint('Lambda cold-start...')\n\nfrom json import dumps, loads\n\n\n# Disable 'testing_locally' when deploying to AWS Lambda\ntesting_locally = True\nverbose = True\n\n\nclass CWLogs(object)... | python | edit | 1 | 2 | apache-2.0 | 6c39f3504dad1cf918189fd46d9e8529a2fc9586 | andrewdefilippis/aws-lambda | Functions/template-python/lambda_function.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom molo.profiles.forms import RegistrationForm\nfrom molo.profiles.forms import EditProfileForm, ProfilePasswordChangeForm\n\n\ndef default_forms(request):\n return {\n 'registration_form': RegistrationForm(),\n 'edit_pro... | python | edit | 1 | 3 | bsd-2-clause | fa824cd22d47dd85d7ea067ff9063214e5517f94 | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | gem/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the list of test modules to test quickly.\n\nWe can now start tests with:\n\n python -m unittest tests\n\nassuming the BNET_API_KEY is defined."
},
{
"role": "assistant",
"content": "from test_character import *\nfrom test... | python | new_file | 9 | 0 | mit | 95bc5231f88b9f24d9f7f7200fe069884138e97a | PuckCh/battlenet | tests/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nForward-compatibility support for Python 2.4 and earlier\n\"\"\"\n\n# from jaraco.compat 1.2\ntry:\n from functools import wraps\nexcept ImportError:\n def wraps(func):\n \"Just return the function unwrapped\"\n ... | python | edit | 3 | 1 | mit | dcba8b90b84506a7325f8e576d10ccb8d2e9a415 | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/py24compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass BounceConfig(AppConfig):\n name = 'froide.bounce'\n verbose_name = _('Bounce')\n\n def ready(self):\n from froide.account ... | python | edit | 1 | 4 | mit | b1b1392d2f268a5c74fd21c826a3ea6387567cab | fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide | froide/bounce/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom numpy.testing import assert_almost_equal, assert_array_less\nimport numpy as np\n\nfrom poisson import BmiPoisson\n\n\ndef test_grid_initialize():\n model = BmiPoisson()\n model.initialize()\n\n assert_a... | python | edit | 4 | 2 | mit | 7b5850d1b89d34ff9a60c3862d18691961c86656 | mperignon/bmi-delta,mperignon/bmi-STM,mperignon/bmi-STM,mperignon/bmi-delta | poisson/tests/test_irf.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nmathdeck.loadproblem\n~~~~~~~~~~~~\n\nThis module loads a problem file as a module.\n\n:copyright: (c) 2015 by Patrick Spencer.\n:license: Apache 2.0, see ../LICENSE for more details.\n\n\"\"\"\n\nimport o... | python | edit | 3 | 4 | apache-2.0 | fa191537e15dd0729deb94aaa91dbb7fa9295e04 | patrickspencer/mathdeck,patrickspencer/mathdeck | mathdeck/loadproblem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nVERSION = \"0.5.3\"\n\nfrom setuptools import setup, find_packages\n\nclassifiers = [\n 'Intended Audience :: Developers',\n 'Intended Audience :: Science/Research',\n 'Natural Language :: English',\n 'Top... | python | edit | 1 | 0 | mit | 99359ed1485f9e5235f5b6c02f331a7e4d9d277b | LuminosoInsight/luminoso-api-client-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Manage resources here\n\nimport animation\n\nsounds = {}\nimages = {}\nanimations = {}\n\nloaded_resources = False\n\ndef load_resources():\n \"\"\"Fills the structure above with the resources for the game.\n \"\"\"\n if loaded_r... | python | edit | 6 | 3 | mit | eefa28f06620d568eda641b08c1caa9cff9a0c96 | vwood/pyweek2013 | resourcemanager.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nsuppressions = [\n [ \".*/multiarray/mapping\\.\", \"PyArray_MapIterReset\" ],\n\n # PyArray_Std trivially forwards to and appears to be superceded by\n # __New_PyArray_Std, which is exercised by the test framework.\n [ \".*/mul... | python | edit | 1 | 0 | bsd-3-clause | 6c4a2d6f80d7ee5f9c06c3d678bb86661c94a793 | numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor | tools/np_suppressions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport shelve\n\n\ndef test_shows_player_rating(browser, test_server, database_url):\n with shelve.open(database_url) as db:\n db.clear()\n db['p1'] = 1000\n\n app = ScoringApp(browser, test_server)\n app.visit('/')\n... | python | edit | 3 | 1 | bsd-2-clause | 9eec7f7f39dc7e1af6e78e4be8d01b50626a4eb5 | abele/whatsmyrank,abele/whatsmyrank | tests/acceptance/test_scoring.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport urllib2\nimport json\nimport argparse\n\n\ndef get_metric(host, port, metric):\n response = urllib2.urlopen(\n 'http://' + host + ':' + port + '/metrics/snapshot')\n... | python | edit | 3 | 2 | mit | 64ed32aa5e2e36ce58209b0e356f7482137a81f2 | zolech/zabbix-mesos-template | getMesosStats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('fparser',parent_package,top_path)\n return config\n\n```\n\nApply this change: Add log.config to ... | python | edit | 1 | 1 | bsd-3-clause | d0df78e9f660b138b5f79d6714312740ebcf1648 | pemryan/f2py,travellhyne/f2py,pearu/f2py,pemryan/f2py | fparser/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import transaction, connection\n\nclass TransactionMiddleware(object):\n def process_job(self, job):\n if not connection.in_atomic_block:\n transaction.set_autocommit(False)\n\n def process_result(self... | python | edit | 1 | 3 | bsd-3-clause | 093b08f6bd03bd938ae7b7a18297708faa353766 | thread/django-lightweight-queue,thread/django-lightweight-queue,prophile/django-lightweight-queue,prophile/django-lightweight-queue | django_lightweight_queue/middleware/transaction.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport csv\nfrom pymongo import MongoClient\n\nprint('Parsing topics')\ntopics = {}\nwith open('topics.csv', 'rb') as csvfile:\n reader = csv.reader(csvfile)\n for line in reader:\n if line[0] == 1:\n cont... | python | edit | 1 | 0 | mit | 1e66aba5a2c82b09a6485842948aad49c654efb4 | xenx/recommendation_system,xenx/recommendation_system | scripts/load_topics_to_mongodb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# 05.12.2005, c\nfrom __future__ import division, print_function, absolute_import\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n from numpy.distuti... | python | edit | 1 | 2 | bsd-3-clause | bdd842f55f3a234fefee4cd2a701fa23e07c3789 | scikit-umfpack/scikit-umfpack,scikit-umfpack/scikit-umfpack,rc/scikit-umfpack-rc,rc/scikit-umfpack,rc/scikit-umfpack,rc/scikit-umfpack-rc | scikits/umfpack/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTop-level Flask application for HXL Proxy\nDavid Megginson\nJanuary 2015\n\nLicense: Public Domain\nDocumentation: http://hxlstandard.org\n\"\"\"\n\nimport os\n\nimport requests_cache\nfrom flask import Flask, g, request\nfrom flask... | python | edit | 6 | 0 | unlicense | 0b1702314fca978db1d0475ff3bc14977e7675a2 | HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy | hxl_proxy/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\r\nimport json\r\n\r\n\r\nSCRIPT_PATH = os.path.dirname(__file__)\r\n\r\n\r\ndef getPreference():\r\n \"\"\" Load pref json data nad return as dict\"\"\"\r\n\r\n prefFile = open(os.path.join(SCRIPT_PATH, \"miExecPref.json\")... | python | edit | 1 | 3 | mit | aff0eba2c0f7f5a0c9bebbfc9402f04c2c9d6d11 | minoue/miExecutor | preference/miExecPref.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ns = \"taintedString\"\n\nif s.startswith(\"tainted\"): # $checks=s $branch=true\n pass\n\n```\n\nApply this change: Python: Test false negative from review"
},
{
"role": "assistant",
"content": "s = \"taintedString\"\n\nif s... | python | edit | 1 | 0 | mit | 2baed20067fed71987bf7582fa9c9a5e53a63cb5 | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/experimental/library-tests/frameworks/stdlib/SafeAccessCheck.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\n__all__ = []\n\nimport os\nimport sys\nimport warnings\nimport importlib\nfrom glob import glob\n\nfrom .framework.bmi_bridge import bmi_factory\nfrom .babel import setup_babel_environ\n\n\ndef impor... | python | edit | 1 | 0 | mit | 46ae5bbeab37f8e2fe14607c01e385d746c2d163 | csdms/pymt,csdms/coupling,csdms/coupling | pymt/components.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Get public registrations for staff members.\n\n python -m scripts.staff_public_regs\n\"\"\"\nfrom collections import defaultdict\nimport logging\n\nfrom modularodm import Q\n\nfrom website.models import Nod... | python | edit | 1 | 7 | apache-2.0 | cdcc0aa43025cace37fc1f51379928f0c1a8877d | billyhunt/osf.io,laurenrevere/osf.io,sloria/osf.io,brandonPurvis/osf.io,Ghalko/osf.io,chennan47/osf.io,emetsger/osf.io,hmoco/osf.io,icereval/osf.io,felliott/osf.io,DanielSBrown/osf.io,brianjgeiger/osf.io,DanielSBrown/osf.io,Nesiehr/osf.io,RomanZWang/osf.io,Johnetordoff/osf.io,alexschiller/osf.io,samchrisinger/osf.io,kc... | scripts/staff_public_regs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import defaultdict\nfrom .utils import get_value_from_accessor\n\nclass RoleBehaviour(object):\n ids = []\n object_accessors = {}\n\n def __init__(self, user, request):\n self.user = user\n self.reque... | python | edit | 2 | 5 | bsd-3-clause | 4307fa24a27a2c623836a7518e3aceb4546abcf6 | Scholr/scholr-roles | scholrroles/behaviour.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport exceptions\n\nclass BaseCacheModule(object):\n\n def get(self, key):\n raise exceptions.NotImplementedError\n\n def set(self, key, value):\n raise exceptions.NotImplementedError\n\n def keys(self):\n rai... | python | edit | 1 | 1 | mit | 533fb21586322c26fd9696213108d6a9e45ada64 | thaim/ansible,thaim/ansible | lib/ansible/cache/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pylearn2\nfrom pylearn2.utils.serial import load_train_file\nimport os\nfrom pylearn2.testing import no_debug_mode\nfrom theano import config\n\n@no_debug_mode\ndef test_train_example():\n \"\"\" tests that the grbm_smd example sc... | python | edit | 1 | 2 | bsd-3-clause | 2a0c8bdb74404556483cd60e7cb2f8e25559e500 | aalmah/pylearn2,TNick/pylearn2,shiquanwang/pylearn2,alexjc/pylearn2,fyffyt/pylearn2,bartvm/pylearn2,pkainz/pylearn2,lancezlin/pylearn2,pkainz/pylearn2,CIFASIS/pylearn2,daemonmaker/pylearn2,woozzu/pylearn2,ddboline/pylearn2,caidongyun/pylearn2,shiquanwang/pylearn2,mclaughlin6464/pylearn2,chrish42/pylearn,theoryno3/pylea... | pylearn2/scripts/tutorials/grbm_smd/test_grbm_smd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport unittest\n\nimport awacs.aws as aws\nimport awacs.s3 as s3\n\n\nclass TestConditions(unittest.TestCase):\n def test_for_all_values(self):\n c = aws.Condition(\n aws.ForAllValuesStringLike(\n ... | python | edit | 1 | 1 | bsd-2-clause | 135a97a58a95c04d2635fff68d2c080413f1d804 | cloudtools/awacs | tests/test_conditions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\r\n\r\n# Create your tests here.\r\n\r\nfrom django.test import TestCase\r\nfrom models import Story\r\n\r\n\r\nclass StoryMethodTests(TestCase):\r\n\r\n def test_ensure_story_is_inserted(self):\r\n\r\n ... | python | edit | 3 | 1 | apache-2.0 | c06e28dae894823c0ae5385e0f9c047ceab8561c | ITLabProject2016/internet_technology_lab_project,ITLabProject2016/internet_technology_lab_project,ITLabProject2016/internet_technology_lab_project | zombies/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCreated on 9 Nov 2016\n\n@author: Bruno Beloff (<EMAIL>)\n\"\"\"\n\nfrom scs_core.data.json import JSONify\nfrom scs_core.data.path_dict import PathDict\n\n\n# ------------------------------------------------------------------------... | python | edit | 1 | 2 | mit | d30eb17fbcc011291418373c1a89e508f8d1c7fe | south-coast-science/scs_core | scs_core/osio/client/topic_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#deletes wahji content\nimport os, shutil, platform\n\ndef rem(loc):\n\n\tos.chdir(loc)\n\t\n\tprint \"deleting content\"\n\t\t\n\t\"\"\"delete them folder and its contents\"\"\"\n\tshutil.rmtree(\"themes\")\n\n\t\"\"\"delete .wahji file\"\... | python | edit | 4 | 5 | mit | fc3cf6966f66f0929c48b1f24bede295fb3aec35 | mborn319/Wahji,mborn319/Wahji,mborn319/Wahji | Wahji-dev/setup/removeWahji.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.admin import StackedInline, TabularInline\nfrom django.template.defaultfilters import slugify\n\nclass OrderableInlineMixin(object):\n\n class Media:\n js = (\n 'js/jquery.browser.min.js',\n ... | python | edit | 3 | 1 | bsd-2-clause | 5fc699b89eae0c41923a813ac48281729c4d80b8 | frx0119/django-orderable-inlines,frx0119/django-orderable-inlines | orderable_inlines/inlines.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nTests for helper function for adding a target to a Vuforia database.\n\"\"\"\n\nimport io\n\nfrom vws import VWS\n\n\nclass TestSuccess:\n \"\"\"\n Tests for successfully adding a target.\n \"\"\"\n\n def test_add_target... | python | edit | 1 | 1 | mit | 6c578b67753e7a3fd646e5d91259b50c0b39bec6 | adamtheturtle/vws-python,adamtheturtle/vws-python | tests/test_add_target.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom intervals import Interval\n\n\nclass TestArithmeticOperators(object):\n def test_add_operator(self):\n assert Interval(1, 2) + Interval(1, 2) == Interval(2, 4)\n\n def test_sub_operator(self):\n assert Interval(1, 3... | python | edit | 1 | 1 | bsd-3-clause | 346ffdb3e3836e2931f838a6dd929a325da0d5e6 | kvesteri/intervals | tests/test_arithmetic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom talks.settings import *\n\nINSTALLED_APPS += ('django_nose',)\nTEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\nDEBUG = True\n\nRAVEN_CONFIG = {}\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n ... | python | edit | 3 | 0 | apache-2.0 | 09c3e765075b7207ca09116330496cf56472d099 | ox-it/talks.ox,ox-it/talks.ox,ox-it/talks.ox | talks/settings_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\n#!/usr/bin/env python\r\n\r\ndef configuration(parent_package='',top_path=None):\r\n from numpy.distutils.misc_util import Configuration\r\n\r\n config = Configuration('segment', parent_package, top_path)\r\n\r\n config.add_ext... | python | edit | 1 | 1 | bsd-3-clause | 9578081d1c6ce378687d605ba2350e08eddb6959 | jamestwebber/scipy,mdhaber/scipy,ChanderG/scipy,Kamp9/scipy,Stefan-Endres/scipy,rmcgibbo/scipy,gdooper/scipy,mtrbean/scipy,petebachant/scipy,matthewalbani/scipy,fredrikw/scipy,efiring/scipy,apbard/scipy,ales-erjavec/scipy,mikebenfield/scipy,Eric89GXL/scipy,Newman101/scipy,sriki18/scipy,andyfaff/scipy,Stefan-Endres/scip... | scipy/ndimage/segment/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.core.management import BaseCommand, CommandError\n\nfrom frontend.models import Measure\n\n\nclass Command(BaseCommand):\n def handle(self, measure_id, **options):\n if not measure_id.... | python | edit | 1 | 4 | mit | d72df78e0dea27ae93bde52e43cec360a963b32c | ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc | openprescribing/frontend/management/commands/delete_measure.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport yaml\nfrom performance_testing.errors import ConfigFileError, ConfigKeyError\nfrom performance_testing import web\nfrom datetime import datetime as date\nfrom time import time\n\n\nclass Tool:\n def __init__(self, confi... | python | edit | 6 | 3 | mit | b5a8e7b6926bf7224abed6bd335d62b3f1ad1fb1 | BakeCode/performance-testing,BakeCode/performance-testing | performance_testing/command_line.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import wraps\n\nfrom django.http import Http404\nfrom django.utils.decorators import available_attrs\n\nfrom waffle import is_active\n\n\ndef waffle(flag_name):\n def decorator(view):\n if flag_name.startswith('!'):... | python | edit | 1 | 3 | bsd-3-clause | fdc0bb75271b90a31072f79b95283e1156d50181 | isotoma/django-waffle,TwigWorld/django-waffle,rlr/django-waffle,webus/django-waffle,groovecoder/django-waffle,JeLoueMonCampingCar/django-waffle,crccheck/django-waffle,safarijv/django-waffle,paulcwatts/django-waffle,JeLoueMonCampingCar/django-waffle,11craft/django-waffle,festicket/django-waffle,styleseat/django-waffle,m... | waffle/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\r\n\"\"\"\r\n:Author Patrik Valkovic\r\n:Created 23.06.2017 16:39\r\n:Licence GNUv3\r\nPart of grammpy\r\n\r\n\"\"\"\r\n\r\nfrom unittest import TestCase, main\r\nfrom grammpy import Grammar\r\nfrom grammpy import Nont... | python | edit | 1 | 2 | mit | 737bf244f36b73a54b5b4f89f0c7e604d3f34b72 | PatrikValkovic/grammpy | tests/grammar_term-nonterm_test/NonterminalGetTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\nclass Object:\n \"\"\"Represents a generic Spectrum object\n \n Supported Operations:\n \n +-----------+--------------------------------------+\n | Operation | Description ... | python | edit | 1 | 2 | mit | e5b503d0e66f8422412d0cdeac4ba4f55f14e420 | treefroog/spectrum.py | spectrum/object.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport subprocess\nimport re\n\n\ndef test_runpy_invoke():\n \"\"\"\n Ensure honcho can also be invoked using runpy (python -m)\n \"\"\"\n cmd = [sys.executable, '-m', 'honcho', 'version']\n output = subprocess.ch... | python | edit | 1 | 1 | mit | 07cffdaa6e131c4f02c570de3925d6238656fc87 | nickstenning/honcho,nickstenning/honcho | tests/test_invocation.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xmlrpclib\nfrom socket import gaierror\n\nVERSION_OK = \"0.5.13\"\n\ntry:\n pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')\n VERSION_OK = pypi.package_releases('ricecooker')[0]\nexcept gaierror:\n pass\n\nVERSI... | python | edit | 1 | 0 | mit | dfc6b2d2d8cda75349dfab33d9639b5ea24cc520 | DXCanas/content-curation,DXCanas/content-curation,jayoshih/content-curation,jayoshih/content-curation,jayoshih/content-curation,jayoshih/content-curation,fle-internal/content-curation,fle-internal/content-curation,fle-internal/content-curation,fle-internal/content-curation,DXCanas/content-curation,DXCanas/content-curat... | contentcuration/contentcuration/ricecooker_versions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cassiopeia as cass\nfrom cassiopeia.core import Summoner\n\ndef test_cass():\n name = \"Kalturi\"\n\n runes = cass.get_runes()\n for rune in runes:\n if rune.tier == 3:\n print(rune.name)\n\n\nif __name__ =... | python | edit | 1 | 3 | mit | 14d51aa701dcc8d1d3f026af947c935abb0eabe3 | robrua/cassiopeia,10se1ucgo/cassiopeia,meraki-analytics/cassiopeia | examples/rune.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe :mod:`pambox.speech` module gather speech intelligibility\nmodels.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom .binauralsepsm import BinauralSepsm\nfrom .sepsm import Sepsm\nfrom .mrsepsm import MrSepsm\nfrom .sii im... | python | edit | 1 | 0 | bsd-3-clause | 5af4ef36ff7a56b34fc8d30df37c82a6837918e3 | achabotl/pambox | pambox/speech/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom django.conf import settings\nfrom django.conf.urls import url\nfrom django.core.management import execute_from_command_line\nfrom django.http import HttpResponse\n\nsettings.configure(\n DEBUG=True,\n ROOT_URLCONF=s... | python | edit | 1 | 1 | mit | 8b731102036583099bda475ec1a857b19ff18f80 | rnevius/minimal-django | minimal.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# The history of this repository has been rewritten to erase the vendor/ directory\n# Below is the md5sum and size of the file that was in the original commit\nbde0e3a3a15c9bbb8d96f4d8a370d8c7\n5753\n\n```\n\nApply this change: Drop eventle... | python | edit | null | null | mit | 5f4155201afa92f048f28b9cd53681a6bc7966ab | gratipay/aspen.py,gratipay/aspen.py | vendor/eventlet-0.9.15/eventlet/convenience.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.core_admin.views\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom ...services.brand import service as brand_service... | python | edit | 1 | 1 | bsd-3-clause | 9b19d366c7e1cf41ffc6af4eaed789995ddc5cc2 | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps | byceps/blueprints/core_admin/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy\n\nfrom chainer import function\nfrom chainer.utils import type_check\n\n\nclass Reshape(function.Function):\n type_check_prod = type_check.Variable(numpy.prod, 'prod')\n\n \"\"\"Reshapes an input array without copy.\"\"\... | python | edit | 1 | 1 | mit | e72c7fb4249895f2d6f4c9f36153786b75d5e8fa | kikusu/chainer,niboshi/chainer,sou81821/chainer,elviswf/chainer,anaruse/chainer,okuta/chainer,okuta/chainer,AlpacaDB/chainer,tkerola/chainer,ktnyt/chainer,wkentaro/chainer,chainer/chainer,woodshop/complex-chainer,jfsantos/chainer,keisuke-umezawa/chainer,yanweifu/chainer,truongdq/chainer,niboshi/chainer,aonotas/chainer,... | chainer/functions/reshape.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom etl import get_local_handles, ingest_feeds, CSV_ETL_CLASSES\nfrom local import LocalConfig\nfrom interface import Marcotti\n\n\nif __name__ == \"__main__\":\n settings = LocalConfig()\n marcotti = Marcotti(settings)\n with mar... | python | edit | 1 | 0 | mit | 46db910f9b9a150b785ea3b36a9e4f73db326d78 | soccermetrics/marcotti-mls | loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*- \nfrom stations.models import *\nfrom django.test import TestCase\nfrom datetime import datetime\nimport pytz\n\n\nclass TestBrands(TestCase):\n\tfixtures = [ 'initial_data.yaml', '*']\n\t\n\tdef setUp(self):\n\t\tse... | python | edit | 7 | 1 | mit | c6e10155743eb506c82fb578de180180eb5f1e69 | gersolar/solar_radiation_model,ahMarrone/solar_radiation_model,scottlittle/solar_radiation_model | imagedownloader/stations/tests/units/test_brands.py | rejected_lint | Too many lint violations: 7 | 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\nfrom collections import Counter\n\n# Complete the freqQuery function below.\ndef freqQuery(queries):\n output = []\n occurences = Counter()\n frequencies = C... | python | edit | 7 | 7 | mit | b81ace397887cb6d0fc7db21d623667223adbfbf | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/frequency_queries.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nimport os\nimport sys\n\nfrom pysuru import TsuruClient\n\n\nTSURU_TARGET = os.environ.get('TSURU_TARGET', None)\nTSURU_TOKEN = os.environ.get('TSURU_TOKEN', None)\n\nif not TSURU_TARGET or not TSURU_TOKEN:\n print('You ... | python | edit | 1 | 0 | mit | 6c54fc230e8c889a2351f20b524382a5c6e29d1c | rcmachado/pysuru | examples/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport pylab as pl\nimport sys\nimport timeit\nfrom pykalman import KalmanFilter\n\nN = int(sys.argv[1])\nrandom_state = np.random.RandomState(0)\ntransition_matrix = [[1, 0.01], [-0.01, 1]]\ntransition_offset = [0.0,0.0... | python | edit | 2 | 0 | mit | 9d0b1990b979de19939cc37cbefb86e1a0cd4e0f | wkearn/Kalman.jl,wkearn/Kalman.jl | test/perf/perf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport uuid\n\nfrom django.db import migrations\n\nimport waldur_core.core.fields\n\n\ndef gen_uuid(apps, schema_editor):\n InvoiceItem = apps.get_model('invoices', 'InvoiceItem')\n for row in InvoiceItem.objects.all():\n row.u... | python | edit | 1 | 2 | mit | b6ec3ba9efae7b6b291391b0333e80f2e9fc6fa0 | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_mastermind/invoices/migrations/0053_invoiceitem_uuid.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Print embeddable python library, as well as other libs it requires.\n# Will prefer static linkage unless invoked with \"shared\" argument.\n# JGG, 8/4/04\n\nimport sys, distutils.sysconfig\n\nstatic_link = 1\nnargs = len(sys.argv)\nif nar... | python | edit | 3 | 0 | apache-2.0 | 523ee893118413caa45e66869e9380f5e52f3402 | RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix | src/parser/python/print_libpython.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#from django.contrib import admin\nfrom .models import Post, Album, Link\n\nfrom opps.contrib import admin\n\nadmin.site.register(Post)\nadmin.site.register(Album)\nadmin.site.register(Link)\n\n```\n\nApply this cha... | python | edit | 12 | 0 | mit | 28627a41918be15037ba22e930a45d022e88388d | jeanmask/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,YACOWS/opps | opps/articles/adminx.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n\nfrom performanceplatform.collector.ga.core \\\n import create_client, query_documents_for, send_data\n\nfrom performanceplatform.collector.write import DataSe... | python | edit | 2 | 1 | mit | 413c3e9e8a093e3f336e27a663f347f5ea9866a6 | alphagov/performanceplatform-collector,alphagov/performanceplatform-collector,alphagov/performanceplatform-collector | performanceplatform/collector/ga/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n import uio as io\nexcept ImportError:\n import io\nimport sys\nif hasattr(sys, 'print_exception'):\n print_exception = sys.print_exception\nelse:\n import traceback\n print_exception = lambda e, f: traceback.print_exce... | python | edit | 9 | 4 | mit | e08395a35c37fa7f7c0311cc4c7a71537b8b4227 | henriknelson/micropython,AriZuu/micropython,AriZuu/micropython,micropython/micropython-esp32,micropython/micropython-esp32,PappaPeppar/micropython,MrSurly/micropython,MrSurly/micropython-esp32,infinnovation/micropython,trezor/micropython,micropython/micropython-esp32,lowRISC/micropython,torwag/micropython,PappaPeppar/m... | tests/misc/print_exception.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"\nContains helper functions common to all paasta commands or the client\n\"\"\"\n\n\nimport glob\nimport os\n\n# List of commands the paasta client can execute\nCMDS = None\n\n\ndef paasta_commands():\n \"\"\... | python | edit | 1 | 3 | apache-2.0 | 51cdd71cbcbcfd80105cc5ccb5b95f4d79dc593e | gstarnberger/paasta,Yelp/paasta,somic/paasta,Yelp/paasta,gstarnberger/paasta,somic/paasta | src/service_deployment_tools/paasta_cli/utils/cmd_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.db import models\n\nfrom . import widgets\n\nRICH_TEXT_DBFIELD_OVERRIDES = {\n models.TextField: {'widget': widgets.RichTextWidget},\n}\n\n\nclass BackboneFormMixin(object):\n class Media:\n ... | python | edit | 1 | 0 | apache-2.0 | 3f166b110d4e8623966ca29c71445973da4876f9 | armstrong/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband | armstrong/hatband/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ophyd import PVPositioner, EpicsSignal, EpicsSignalRO\nfrom ophyd import Component as C\nfrom ophyd.device import DeviceStatus\n\n\nclass CS700TemperatureController(PVPositioner):\n setpoint = C(EpicsSignal, 'T-SP')\n readback = ... | python | edit | 1 | 1 | bsd-2-clause | b57d5ecf56640c9d0a69b565006e2240662d6b46 | NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd | profile_collection/startup/11-temperature-controller.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.