messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Some configuration\npage_format = 'A4'\nnewPage(page_format)\n\n\nclass RegisterGlyph(object):\n \n def __init__(self, glyph):\n self.glyph = glyph\n print 'Registered', self.glyph.name\n self.proportion_ratio =... | python | edit | 3 | 1 | mit | 47b52333a74aeeb0ec2d7184455f70aa07633e62 | AlphabetType/DrawBot-Scripts | createGlyphsPDF.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import cd, run, task\n\ntry:\n import fabfile_local\n _pyflakes = fabfile_local\nexcept ImportError:\n pass\n\n@task\ndef update():\n with cd(\"~/vagrant-installers\"):\n run(\"git pull\")\n\n```\n\nApply ... | python | edit | 1 | 2 | mit | a0c656f89829ca18c383f1884e3186103b9e5fa6 | redhat-developer-tooling/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,mitchellh/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,chrisroberts/vagrant-installers,redhat-developer-tooling/vagrant... | fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add report file deployment to init"
},
{
"role": "assistant",
"content": "from .deploy_sql_script import DeploySqlScript, DeployOraclePackage\nfrom .deploy_report import DeployExceleratorReport, DeployReportFile\n"
}
] | python | new_file | 6 | 0 | mit | 1b3f97ff7bc219588b94a2346ac91f10203e44b9 | Empiria/matador | matador/commands/deployment/__init__.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.core.urlresolvers import reverse\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom cms.toolbar_pool import toolbar_pool\nfrom cms.toolbar_base import CMSToolbar\n\nfrom aldryn_blog import ... | python | edit | 1 | 5 | bsd-3-clause | b36f89088ab1270054140a3d3020960f23c9790b | aldryn/aldryn-blog,aldryn/aldryn-blog | aldryn_blog/cms_toolbar.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef form():\n\tdb.raw_log.uuid.default = uuid_generator()\n\tdb.raw_log.date.default = dbdate()\n\t#don't display form items that are part of table, but not facing end user\n\tdb.raw_log.uuid.readable = db.raw_log.uuid.writable = False\n\td... | python | edit | 2 | 4 | mit | 8d46e411b2e7091fc54c676665905da8ec6906f3 | tsunam/dotd_parser,tsunam/dotd_parser,tsunam/dotd_parser,tsunam/dotd_parser | controllers/dotd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/env/bin python\n\nimport RPi.GPIO as io\nimport requests\nimport sys\n\nclass Switch(object):\n def __init__(self, **kwargs):\n self.pin = kwargs[\"pin\"]\n io.setup(self.pin, io.IN)\n\n @property\n def is_on(s... | python | edit | 4 | 2 | mit | cab0f9ea3471cf88dd03da7a243ae55579b44b65 | madebymany/isthetoiletfree | client.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# OAuth app keys\nBOX_KEY = None\nBOX_SECRET = None\n\nBOX_AUTH_CSRF_TOKEN = 'box-auth-csrf-token'\n\n```\n\nApply this change: Add oauth endpoints to settings"
},
{
"role": "assistant",
"content": "# OAuth app keys\nBOX_KEY = N... | python | edit | 1 | 0 | apache-2.0 | 4a9d1a373b5a460f1e793dd94d0c248e81b75f40 | caneruguz/osf.io,GageGaskins/osf.io,GageGaskins/osf.io,ticklemepierce/osf.io,ticklemepierce/osf.io,kwierman/osf.io,samchrisinger/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,DanielSBrown/osf.io,zkraime/osf.io,MerlinZhang/osf.io,mfraezz/osf.io,pattisdr/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,asanfilip... | website/addons/box/settings/defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.config_defaults\n~~~~~~~~~~~~~~~~~~~~~~\n\nDefault configuration values\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nfrom datetime import timedelta\nfrom pat... | python | edit | 1 | 0 | bsd-3-clause | 7269322106911fcb1fb71160421fc3e011fbee1d | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/config_defaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nMain interface to BSE functionality\n'''\n\nfrom . import io\n\n\ndef get_basis_set(name):\n '''Reads a json basis set file given only the name\n\n The path to the basis set file is taken to be the 'data' directory\n in this p... | python | edit | 1 | 5 | bsd-3-clause | f60fe11653d71f278aa04e71a522a89fc86c284a | MOLSSI-BSE/basis_set_exchange | bse/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom django_rocket.models import Subscriber\n\n\nclass SubscriberAdmin(admin.ModelAdmin):\n list_display = ('email', 'created')\n date_hierarchy = ('created',)\n\n\nadmin.site.register(Subscriber, S... | python | edit | 1 | 0 | mit | acc6ae5fcdc7cc79b8e6ca76088080c3b73ed4f1 | mariocesar/django-rocket,mariocesar/django-rocket | django_rocket/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from setuptools import setup\n from setuptools import find_packages\n packages = find_packages()\nexcept ImportError:\n from distutils.core import setup\n import os\n packages = [x.strip('./').replace('/','.') for x... | python | edit | 1 | 0 | bsd-2-clause | 46e440168f66a5d599814d0e66771f6ce7a1ddc1 | angr/cle | setup.py | rejected_duplicate | Near-duplicate of sample 408 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport graphene\n\n\nclass Person(graphene.Interface):\n name = graphene.String()\n age = graphene.ID()\n\n\nclass Patron(Person):\n id = graphene.ID()\n\n\nclass Query(graphene.ObjectType):\n\n patron = graphene.Field(Patron)\n... | python | edit | 1 | 1 | mit | f3f210b523f1733e48bb6316ecbb15e198dd503c | sjhewitt/graphene,Globegitter/graphene,Globegitter/graphene,graphql-python/graphene,graphql-python/graphene,sjhewitt/graphene | examples/field_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef clean(record):\n if record.bibjson().get_journal_license():\n record.bibjson().remove_journal_license()\n return record\n\n```\n\nApply this change: Fix another typo in migration"
},
{
"role": "assistant",
"cont... | python | edit | 1 | 2 | apache-2.0 | c88789847a9bf604d897f4b469a3585347fef3f9 | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | portality/migrate/2819_clean_unused_license_data/operations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# php2python.py - Converts PHP to Python using codegen.py\n# Usage: php2python.py < input.php > output.py\n\nimport sys\nsys.path.append('..')\n\nfrom phply.phpparse import parser\nfrom phply import pythonast\n\nfro... | python | edit | 3 | 0 | bsd-3-clause | 12e044741e15534aad26238b50126d3b68f8a87d | LocutusOfBorg/phply,andresriancho/phply,t-ashula/phply | tools/php2python.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# License information goes here\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n# The line above will help with 2to3 support.\ndef most_recent_tag(tags,username=None):\n \"\"\... | python | edit | 1 | 5 | bsd-3-clause | abaa882aaa1b7e251d989d60391bd2e06801c2a2 | desihub/desiutil,desihub/desiutil | py/desiUtil/install/most_recent_tag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import *\nfrom models import GeneralPost\nfrom feeds import LatestPosts\n\npost_list = {\n 'queryset': GeneralPost.objects.all(),\n}\n\nfeeds = {\n 'all': LatestPosts,\n}\n\nurlpatterns = patterns('djang... | python | edit | 4 | 0 | bsd-3-clause | 0d7921b4dcf5e3b511fdb54fc30ebc0547b14d47 | svetlyak40wt/django-dzenlog | django_dzenlog/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport os\n\n\ndef readStatus(student):\n student = student.lower()\n\n if not os.path.exists(\"attachments\"):\n return\n\n if not os.path.exists(os.path.join(\"attachments\", stud... | python | edit | 4 | 4 | mit | 423dcb102fc2b7a1108a0b0fe1e116e8a5d451c9 | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem | netsecus/korrekturtools.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Mondegreens.\n\n---\nlayout: post\nsource: Garner's Modern American Usage\nsource_url: http://amzn.to/15wF76r\ntitle: mondegreens\ndate: 2014-06-10 12:31:19\ncategories: writing\n---\n\nPoin... | python | edit | 1 | 1 | bsd-3-clause | 63f40971f8bc4858b32b41595d14315d2261169f | jstewmon/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint | proselint/checks/garner/mondegreens.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import include, patterns, url\n\nfrom rest_framework_nested import routers\n\nfrom shopit_app.views import IndexView\nfrom authentication_app.views import AccountViewSet, LoginView\n\n... | python | edit | 3 | 0 | mit | b123001ea0d4fb475184727c39eafd5b46cc0964 | mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app | shopit_app/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .util import get_settings, load_local_settings, load_secret_key\nfrom . import base\n\nsettings = get_settings(base)\nload_local_settings(settings, \"local_settings\")\nload_secret_key(settings)\n\nif not settings[\"DEBUG\"] and settin... | python | edit | 1 | 0 | mit | bc7b1fc053150728095ec5d0a41611aa4d4ede45 | City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi | kerrokantasi/settings/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\n\nsetup(name='slacker',\n version='0.3.9',\n packages=['slacker'],\n description='Slack API client',\n author='Oktay Sancak',\n author_email='<EMAIL>',\n url='http://github.com/o... | python | edit | 1 | 0 | apache-2.0 | 082154a93a79e854be6bf55b34c7db3e4a27173f | BetterWorks/slacker,wkentaro/slacker,olasitarska/slacker,os/slacker,wasabi0522/slacker,kashyap32/slacker,STANAPO/slacker,techartorg/slacker,hreeder/slacker,dastergon/slacker | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport pytest\nimport requests\n\n\n@pytest.fixture\ndef url():\n return os.getenv(\"SITE\", \"http://localhost:5000\")\n\n\ndef test_post_images(expect, url):\n params = {\"key\": \"iw\", \"lines\": [\"test\", \"deployme... | python | edit | 1 | 1 | mit | c15174d9bd7728dd5d397e6de09291853e65ed4d | jacebrowning/memegen,jacebrowning/memegen | scripts/test_deployment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\npath = os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')\nsys.path.append(path)\nimport chromium_utils\n\nslaves = []\nfor master in chromium_utils.ListMasters():\n masterbase... | python | edit | 2 | 0 | bsd-3-clause | 7ea03c6ded823458d7159c05f89d99ee3c4a2e42 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/tools/botmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport config\nimport logging\nimport logging.handlers\n\n\n# ######### Set up logging ##########\n# log.basicConfig(format=\"%(asctime)s - %(levelname)s: %(message)s\", level=log.DEBUG)\nlogger = logging.getLogger('bb_log')\nlogger.setLeve... | python | edit | 1 | 0 | mit | 8ed7983859e2b7031b736b92b875040fa13fb39c | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | blockbuster/bb_logging.py | rejected_duplicate | Near-duplicate of sample 4405 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pagoda.cooper\n\n\nclass Base(object):\n def setUp(self):\n self.world = pagoda.cooper.World()\n\n\nclass TestMarkers(Base):\n def setUp(self):\n super(TestMarkers, self).setUp()\n self.markers = pagoda.coo... | python | edit | 1 | 1 | mit | 875e9df7d59cbf8d504696b1eb906f4da0ffabc2 | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda | test/cooper_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"accounts app unittests\n\n\"\"\"\nfrom django.test import TestCase\n\n\nclass WelcomePageTest(TestCase):\n def test_uses_welcome_template(self):\n response = self.client.get('/')\n self.assertTemplateUsed(response, 'a... | python | edit | 1 | 1 | mit | 74a5cad21fb726384ab53f2ca9b711cc8298bfb9 | randomic/aniauth-tdd,randomic/aniauth-tdd | accounts/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy\n\n\ndef import_climate_data(filepath, monthnr):\n ncols = 720\n nrows = 360\n digits = 5\n\n with open(filepath, 'r') as filein:\n lines = filein.readlines()\n line_n = 0\n grid_size = 0.50\n ... | python | edit | 3 | 8 | mit | 015d18ddcf26a875e20bffbb2d52646799da9cf4 | bartromgens/climatemaps,bartromgens/climatemaps,bartromgens/climatemaps | climatemaps/data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\nfrom base import BaseStep\nfrom logical.models import Database\n\n\nLOG = logging.getLogger(__name__)\n\n\nclass BuildDatabase(BaseStep):\n\n def __unicode__(self):\n return \"Creating logi... | python | edit | 5 | 6 | bsd-3-clause | 6f213f17fab236e1222f4e691015dfd867073ae2 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/workflow/steps/build_database.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conjureup import controllers, events, juju, utils\nfrom conjureup.app_config import app\nfrom conjureup.consts import cloud_types\n\nfrom .common import BaseCloudController\n\n\nclass CloudsController(BaseCloudController):\n def __c... | python | edit | 1 | 5 | mit | b3400070d47d95bfa2eeac3a9f696b8957d88128 | conjure-up/conjure-up,Ubuntu-Solutions-Engineering/conjure,ubuntu/conjure-up,Ubuntu-Solutions-Engineering/conjure,conjure-up/conjure-up,ubuntu/conjure-up | conjureup/controllers/clouds/tui.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"suorganizer URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n 1. Add an import: from my_app... | python | edit | 1 | 0 | bsd-2-clause | 79c8d40d8a47a4413540acac671345dd5faed46e | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | suorganizer/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"accounts app unittests\n\n\"\"\"\nfrom django.test import TestCase\nfrom django.contrib.auth import get_user_model\n\nfrom accounts.models import LoginToken\n\n\nTEST_EMAIL = 'newvisitor@example.com'\n\n\nclass WelcomePageTest(TestCas... | python | edit | 1 | 1 | mit | 5124e59cf6bb264da6d58043e068b63647685167 | randomic/aniauth-tdd,randomic/aniauth-tdd | accounts/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pycuda.autoinit\nimport pycuda.driver as drv\nimport numpy\nfrom scipy import misc\nfrom color_histogram_cuda_module import histogram_atomics, histogram_accum\n\ndef histogram(image_path, num_bins):\n image = misc.imread(image_pat... | python | edit | 3 | 1 | bsd-3-clause | 4456fbdb36b82608501107c4060825377a75c0bf | kwadraterry/GPGPU-LUT,kwadraterry/GPGPU-LUT,kwadraterry/GPGPU-LUT,kwadraterry/GPGPU-LUT,kwadraterry/GPGPU-LUT | ColorHistograms-python/color_histogram_cuda.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom .seqfile import findNextFile\n\nimport pgk_ressources as _pkg\n\n__version__ = _pkg.get_distribution(\"seqfile\").version\n\n__all__ = [ 'findNextFile' ]\n\n```\n\nApply this change: Fix typos in... | python | edit | 1 | 0 | mit | 127e53b4aa125163765b8fa762669e717badd07b | musically-ut/seqfile | seqfile/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\nfrom indra.databases import biogrid_client\nfrom indra.util import unicode_strs\nfrom nose.plugins.attrib import attr\nfrom indra.sour... | python | edit | 3 | 1 | bsd-2-clause | 6384fd52a4d271f0f3403ae613dd66cbeb217ddf | johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy | indra/tests/test_biogrid.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom IRCMessage import IRCMessage\r\nfrom IRCResponse import IRCResponse, ResponseType\r\nfrom Function import Function\r\nfrom GlobalVars import *\r\n\r\nimport re\r\n\r\nclass Instantiate(Function):\r\n Help = 'Responds to greetings an... | python | edit | 5 | 3 | mit | ee8f04c2e68eddad48db3907d1d5e4ecc5daa4a4 | MatthewCox/PyMoronBot,Heufneutje/PyMoronBot,DesertBot/DesertBot | Functions/Conversation.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom rest_framework.authtoken.models import Token\nfrom rest_framework.test import APIRequestFactory, APIClient\n\nclass TestAPIViews(TestCase):... | python | edit | 1 | 1 | mit | c9355e9ae6815b40dce72df9a9a8b1d8f169a8a3 | AlexandreProenca/backend-morandofloripa,AlexandreProenca/backend-morandofloripa,AlexandreProenca/backend-morandofloripa | tests/test_morando_floripa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy\n\n\ndef import_climate_data():\n ncols = 720\n nrows = 360\n digits = 5\n\n with open('./data/cloud/ccld6190.dat') as filein:\n lines = filein.readlines()\n line_n = 0\n grid_size = 0.50\n ... | python | edit | 3 | 8 | mit | ed69ace7f6065ec1b3dd2f2de3a0d5b56ac28366 | bartromgens/climatemaps,bartromgens/climatemaps,bartromgens/climatemaps | climatemaps/data.py | rejected_duplicate | Near-duplicate of sample 4515 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Add column for profile picture type to User\n\nRevision ID: f37d509e221c\nRevises: c997dc927fbc\nCreate Date: 2020-09-04 15:43:18.413156\n\"\"\"\n\nfrom enum import Enum\n\nimport sqlalchemy as sa\nfrom alembic import op\n\nfrom indic... | python | edit | 1 | 1 | mit | 25695e927fbbf46df385b4c68fa4d80b81283ace | pferreir/indico,indico/indico,pferreir/indico,indico/indico,indico/indico,DirkHoffmann/indico,ThiefMaster/indico,ThiefMaster/indico,ThiefMaster/indico,pferreir/indico,pferreir/indico,DirkHoffmann/indico,ThiefMaster/indico,indico/indico,DirkHoffmann/indico,DirkHoffmann/indico | indico/migrations/versions/20200904_1543_f37d509e221c_add_user_profile_picture_source_column.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ndef index():\n def GET():\n return locals()\n\n@request.restful()\ndef api():\n response.view = 'generic.json'\n def GET(resource,resource_id):\n if not resource=='study': raise HTTP(400)\n # retur... | python | edit | 5 | 2 | bsd-2-clause | aca17ff2fddd35bd50d78d62dc6dab7e47fb8e4e | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | controllers/default.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport json\ntry:\n import msgpack\nexcept ImportError:\n pass\n\nfrom decimal import Decimal\nfrom datetime import date, datetime, time\n\nclass Engine(object):\n # The list of content types we match\n CONTENT_TYPES = []\n ... | python | edit | 1 | 1 | bsd-3-clause | c6ef5bcac4d5daddac97ff30ff18645249928ac0 | MarkusH/django-nap,limbera/django-nap | nap/engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Data sources for kinetics\ndatabase(\n thermoLibraries = ['primaryThermoLibrary'],\n reactionLibraries = [], \n seedMechanisms = [],\n kineticsDepositories = 'default', \n #this section lists possible reaction families to ... | python | edit | 7 | 0 | mit | 98ca37ed174e281542df2f1026a298387845b524 | nickvandewiele/RMG-Py,nyee/RMG-Py,pierrelb/RMG-Py,chatelak/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py | rmgpy/tools/data/generate/input.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport RPi.GPIO as GPIO\nfrom time import sleep\n\ndef onoff(period, pin):\n \"\"\"Symmetric square wave, equal time on/off\"\"\"\n half_cycle = period / 2.0\n GPIO.output(pin, GPIO.HIGH)\n sleep(half_cycle)\n GPIO.output(pin... | python | edit | 1 | 2 | mit | ca06bf1d52cd51ccec178c98ad407bfe59f1ada1 | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | strobe.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\nfrom warnings import warn\n\nfrom django.forms import MultiValueField, DecimalField, ChoiceField\nfrom moneyed.classes import Money\n\nfrom .widgets import MoneyWidget, CURRENCY_CHOICES\n\n\n__all__ ... | python | edit | 3 | 3 | bsd-3-clause | 8cb680c7fbadfe6cfc245fe1eb1261a00c5ffd6d | recklessromeo/django-money,rescale/django-money,iXioN/django-money,AlexRiina/django-money,tsouvarev/django-money,iXioN/django-money,tsouvarev/django-money,recklessromeo/django-money | djmoney/forms/fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth import authenticate, login, logout\nfrom django.shortcuts import render, redirect\n\nfrom meetuppizza.forms import RegistrationForm\nfrom meetup.models import Meetup\nfrom meetup.services.meetup_service import Meetu... | python | edit | 7 | 2 | mit | f3d3c0ce81ba8717f5839b502e57d75ebbc1f6e7 | nicole-a-tesla/meetup.pizza,nicole-a-tesla/meetup.pizza | meetuppizza/views.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nimport easy_thumbnails\nfrom mediaman.models import ArtefactRepresentation\nimport os\n\n\nclass Command(BaseCommand):\n help = \"Generate thumbnails for Artefact Representations\"\n\n... | python | edit | 1 | 3 | bsd-3-clause | bdeb1196025c8f982390f0f298fa8b16b1883bce | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | mediaman/management/commands/generate_thumbs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Print a rosbag file.\n\"\"\"\n\nimport sys\nimport logging\n\nimport numpy as np\n\n# suppress logging warnings due to rospy\nlogging.basicConfig(filename='/dev/null')\nimport rosbag\n\n... | python | edit | 1 | 2 | bsd-2-clause | b583c5fb00d1ebfa0458a6233be85d8b56173abf | oliverlee/antlia | python/printbag.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Template of DbEngineComponent.\"\"\"\n\n__all__ = [\n 'make_db_engine_component',\n]\n\nimport logging\n\nimport garage.sql.sqlite\nfrom garage import components\nfrom garage.startups.logging import LoggingComponent\n\n\ndef make_d... | python | edit | 1 | 2 | mit | 8808fe8a4d3a8cf36a91fe69b2d1002eddc534a3 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/garage/garage/startups/sql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# views.py\n\nfrom django.shortcuts import render\n\nfrom wagtail.core.models import Page\nfrom wagtail.search.models import Query\n\n\ndef search(request):\n # Search\n search_query = request.GET.get(\"q\", None)\n if search_query... | python | edit | 1 | 4 | mit | 239e759eed720f884e492e47b82e64f25fdc215f | springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail | core/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nSeamless Polymorphic Inheritance for Django Models\n\nCopyright:\nThis code and affiliated files are (C) by Bert Constantin and individual contributors.\nPlease see LICENSE and AUTHORS for more information.\... | python | edit | 1 | 0 | bsd-3-clause | a91a04af6b95fa600a0b3ce74b5fffc07ecf590e | skirsdeda/django_polymorphic,skirsdeda/django_polymorphic,skirsdeda/django_polymorphic,chrisglass/django_polymorphic,chrisglass/django_polymorphic | polymorphic/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n#\n# Licensed under the Apache... | python | edit | 1 | 3 | apache-2.0 | c1acb68ef54309584816fbf5c93e38266accb2f0 | qwefi/nova,tanglei528/nova,houshengbo/nova_vmware_compute_driver,SUSE-Cloud/nova,gooddata/openstack-nova,gspilio/nova,TwinkleChawla/nova,felixma/nova,viggates/nova,TieWei/nova,varunarya10/nova_test_latest,Yusuke1987/openstack_template,eonpatapon/nova,ruslanloman/nova,petrutlucian94/nova_dev,fajoy/nova,gooddata/openstac... | nova/db/sqlalchemy/session.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom decimal import Decimal\n\nfrom django.conf import settings\nfrom django.core.mail import EmailMessage\n\nfrom celery.utils.log import get_task_logger\n\nfrom .csv_attach import CSVAttachmentWriter\nfrom .models import Transaction\nfrom... | python | edit | 2 | 4 | bsd-3-clause | 24ba796dde4ce414d7fe72ccf553f687e13039f4 | CorbanU/corban-shopify,CorbanU/corban-shopify | shopify/product/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Module, render_template, url_for, redirect, session, escape, request\n\nfrom muzicast.web.util import is_first_run\nfrom muzicast.meta import Track\n\nmain = Module(__name__)\n\ndef top_tracks(n):\n \"\"\"\n Returns ... | python | edit | 5 | 3 | mit | 6ea521e022a40a7abb7ed43b28907d7085bbf423 | nikhilm/muzicast,nikhilm/muzicast | muzicast/web/main.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic.list import ListView\nfrom django.views.generic.detail import DetailView\n\nfrom .models import Post\n\n\nclass PostListView(ListView):\n\n model = Post\n context_object_name = 'posts'\n\nclass PostDetailView... | python | edit | 1 | 1 | mit | d18ff30bbddde5049ffbe23bce19288c3c47e41b | rtrembecky/roots,tbabej/roots,rtrembecky/roots,tbabej/roots,matus-stehlik/roots,matus-stehlik/roots,matus-stehlik/glowing-batman,matus-stehlik/roots,matus-stehlik/glowing-batman,rtrembecky/roots,tbabej/roots | posts/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import timedelta\n\nfrom private import CELERY_BROKER_URL, CELERY_RESULT_BACKEND\n\nBROKER_URL = CELERY_BROKER_URL\nCELERY_RESULT_BACKEND = CELERY_RESULT_BACKEND\n\nCELERY_TIMEZONE = 'UTC'\n\nCELERY_INCLUDE = ['tasks.scraper_t... | python | edit | 1 | 0 | mit | 13fec51e6fa3f47d2f3669e789e9d432e092944a | Trinovantes/MyAnimeList-Cover-CSS-Generator,Trinovantes/MyAnimeList-Cover-CSS-Generator | celeryconfig.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\ndescription = 'New testament greek app for django.'\nlong_desc = open('README.rst').read()\n\nsetup(\n name='django-greekapp',\n version='0.0.1',\n url='https://github.com/honza/greekapp',\n insta... | python | edit | 1 | 0 | bsd-2-clause | 30fcfb5fec7933d69d9117be6219945406012ef5 | honza/greekapp,honza/greekapp,honza/greekapp | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"A virtual serial port data source.\"\"\"\nfrom __future__ import absolute_import\n\nimport logging\n\nfrom .base import BytestreamDataSource, DataSourceError\n\nLOG = logging.getLogger(__name__)\n\ntry:\n import serial\nexcept Impo... | python | edit | 1 | 4 | bsd-3-clause | 47faa5797e5d017848d695bc2ed960d6b8228bd8 | openxc/openxc-python,openxc/openxc-python,openxc/openxc-python | openxc/sources/serial.py | rejected_duplicate | Near-duplicate of sample 4476 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix import race condition on CI"
},
{
"role": "assistant",
"content": "# The main Flask application needs to imported before any of the database tests so that linkr.db\n# is defined before attempting to access any of the database... | python | new_file | 3 | 0 | mit | 02e718fb9dd82b252a5726a81eb3a70817d91a88 | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | test/backend/test_database/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nimport logging\nimport base64\nfrom flask import request, Response\nfrom oauthlib.common import to_unicode, bytes_type\n\nlog = logging.getLogger('flask_oauthlib')\n\n\ndef extract_params():\n \"\"\"Extract request par... | python | edit | 1 | 3 | bsd-3-clause | a31db91800630520c5b516493bddef76ba8b7edd | auerj/flask-oauthlib,auerj/flask-oauthlib,kevin1024/flask-oauthlib,stianpr/flask-oauthlib,CoreyHyllested/flask-oauthlib,lepture/flask-oauthlib,Ryan-K/flask-oauthlib,tonyseek/flask-oauthlib,RealGeeks/flask-oauthlib,adambard/flask-oauthlib,huxuan/flask-oauthlib,PyBossa/flask-oauthlib,Fleurer/flask-oauthlib,CoreyHyllested... | flask_oauthlib/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Andre Anjos <<EMAIL>>\n# Thu 23 Jun 20:22:28 2011 CEST\n# vim: set fileencoding=utf-8 :\n\n\"\"\"The db package contains simplified APIs to access data for various databases\nthat can be used in Biometry, Machine Le... | python | edit | 7 | 1 | bsd-3-clause | 412265731720b8df9630cbe1ec3bd307986137ad | bioidiap/bob.db.base | bob/db/base/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# wsgi_app.py\nimport sys, os\n\nfiledir = os.path.dirname(__file__)\nsys.path.append(os.path.join(filedir))\n\n#print sys.path\n\nos.environ[\"CELERY_LOADER\"] = \"django\"\nos.environ['DJANGO_SETTINGS_MODULE'] = 'settings'\nimport sys\npr... | python | edit | 2 | 0 | bsd-3-clause | efc0f438e894fa21ce32665ec26c19751ec2ce10 | unicefuganda/ureport,unicefuganda/ureport,unicefuganda/ureport,mbanje/ureport_uganda,mbanje/ureport_uganda | ureport_project/wsgi_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreated on Sep 27, 2013\n\n@author: dgamez\n'''\n\ndef run():\n t = lee_passwd ()\n \n for l in t:\n # print l\n e = l.split(\":\")\n user = e[0]\n shell = e[-1].rstrip(\"\\n\")\n print \"%s ->... | python | edit | 2 | 2 | bsd-2-clause | 3a073bb52224876b2424404a59df3c9e3d3fff89 | gamezdaniel/mswl-dt-2013,gamezdaniel/mswl-dt-2013 | lesson2/read_passwd/read_passwd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\nimport sys\nfrom time import time\n\n\nclass PID(object):\n\n def __init__(self):\n \"\"\"initizes value for the PID\"\"\"\n self.kd = 0\n self.ki = 0\n self.kp = 1\n self.previous_error = 0\n ... | python | edit | 4 | 1 | bsd-2-clause | 5b4c9cebd31e81f775d996ec9168b72d07142caa | deepakiam/bot,IEEERobotics/bot,IEEERobotics/bot,IEEERobotics/bot,deepakiam/bot,deepakiam/bot | follower/pid.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow 'Collection' & 'Q' to be imported from pkg"
},
{
"role": "assistant",
"content": "\"\"\"\n lookupy\n ~~~~~~~\n\n Lookupy is a Python library that provides a Django QuerySet like\n interface to query (select and filt... | python | new_file | 1 | 0 | mit | 8b4a3741e8e88ae854cc7c075f752bc7238d0875 | naiquevin/lookupy | lookupy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom . import model\nfrom . import routes\nfrom . import views\n\nMODELS = [model.AddonS3UserSettings, model.AddonS3NodeSettings, model.S3GuidFile]\nUSER_SETTINGS_MODEL = model.AddonS3UserSettings\nNODE_SETTINGS_MODEL = model.A... | python | edit | 1 | 0 | apache-2.0 | 5b9f0270aaa53a562ca65fa74769885621da4a8e | hmoco/osf.io,jmcarp/osf.io,abought/osf.io,amyshi188/osf.io,brandonPurvis/osf.io,sloria/osf.io,barbour-em/osf.io,lyndsysimon/osf.io,GageGaskins/osf.io,brandonPurvis/osf.io,HarryRybacki/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,wearpants/osf.io,TomBaxter/osf.io,samanehsan/osf.io,zachjanicki/osf.io,mluo613/osf.io,Zobai... | website/addons/s3/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyOmicron\nimport STS\n\n__all__=[\"pyOmicron\",\"STS\"]\n__version__ = 0.1\n\n```\n\nApply this change: Fix import for python 3"
},
{
"role": "assistant",
"content": "import pyOmicron\ntry:\n\timport STS\nexcept:\n\timpo... | python | edit | 1 | 0 | apache-2.0 | 69d3ec01ec3e9e9369b5c0425bc63cc7f2797b52 | scholi/pyOmicron | __init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom minion.twisted import MinionResource\nfrom twisted.application import strports\nfrom twisted.python import usage\nfrom twisted.python.filepath import FilePath\nfrom twisted.web import server\nf... | python | edit | 1 | 2 | mit | 5442facddbcf9b8adff247edcf3bd27a8fda2c10 | Julian/Great,Julian/Great,Julian/Great | great/tap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Union, Tuple, Any\n\nimport numpy as np\n\n# NOTE: `_StrLike` and `_BytesLike` are pointless, as `np.str_` and `np.bytes_`\n# are already subclasses of their builtin counterpart\n\n_CharLike = Union[str, bytes]\n\n_BoolLi... | python | edit | 1 | 0 | bsd-3-clause | 7f5392d2581e789917b8ba5352d821277d5de8ab | seberg/numpy,pdebuyl/numpy,mhvk/numpy,pbrod/numpy,madphysicist/numpy,endolith/numpy,mattip/numpy,simongibbons/numpy,numpy/numpy,endolith/numpy,jakirkham/numpy,rgommers/numpy,mattip/numpy,madphysicist/numpy,mhvk/numpy,jakirkham/numpy,pdebuyl/numpy,simongibbons/numpy,charris/numpy,simongibbons/numpy,anntzer/numpy,charris... | numpy/typing/_scalars.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 2.2.13 on 2020-10-25 18:35\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('workshops', '0220_event_public_status'),\n ]\n\n operations = ... | python | edit | 1 | 0 | mit | 216216df9e3b42766a755f63519c84fda2fcebe0 | swcarpentry/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,swcarpentry/amy,swcarpentry/amy | amy/workshops/migrations/0221_workshoprequest_rq_jobs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n#\n# Copyright 2017 Robot Garden, 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 Licens... | python | edit | 1 | 0 | apache-2.0 | 338a6e8da75a5b950949638b1a810510419450e9 | ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan | scripts/state_and_transition.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom src.dojo import Dojo\n\n\nclass TestCreateRoom (unittest.TestCase):\n def test_create_room_successfully(self):\n my_class_instance = Dojo()\n initial_room_count = len(my_class_instance.all_rooms)\n ... | python | edit | 1 | 1 | mit | beb224f23403e0f7e4676aca156420420fe3653f | EdwinKato/Space-Allocator,EdwinKato/Space-Allocator | tests/dojo_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2014, German Neuroinformatics Node (G-Node)\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted under the terms of the BSD License. See\n# LICENS... | python | edit | 1 | 0 | bsd-3-clause | 802626461779e4de34e7994c88ab698495dfca59 | stoewer/nixpy,stoewer/nixpy | docs/source/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ez_setup\nez_setup.use_setuptools()\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name = \"mobile-city-history\",\n version = \"1.0.0b2\",\n author = \"Jan-Christopher Pien\",\n author_email = \"<EMAIL>\",\n ... | python | edit | 1 | 0 | mit | a7f17a7fa3761126d6edb890f3420556f663b4c0 | fraunhoferfokus/mobile-city-memory,fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory,jessepeng/coburg-city-memory | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add more modules to __all__"
},
{
"role": "assistant",
"content": "__all__ = ['en_profile', 'functions', 'chem_parser']\n__version__ = '0.1.0'\n"
}
] | python | new_file | 4 | 0 | mit | 08113ee79785f394a1c5244cdb87bef9f7fc5ff3 | PytLab/catplot | catplot/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_classy import FlaskView\nfrom flask_user import current_user, login_required\nfrom ..models import CommentModel, PostModel\nfrom ..forms import CommentForm\n\n\nclass Comment(FlaskView):\n\n def get(self):\n pass\n\n ... | python | edit | 1 | 2 | mit | fe47651ddd32a5795dab28ca998230b042a70c59 | oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog | app/views/comment_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys;s='%s: lines %d, RaSa: %d'\ndef u(z):\n r=I=0;b=1\n for m in open(z):\n r+=1\n for k in m:\n if '{'==k:b+=1\n if ';'==k:I+=b\n if '}'==k:b-=1\n return(r,I)\nc=D=0\nfor z in sys.argv[1:]:\n r,I=u(z);c+=r;D+=I;print s%(z,r,... | python | edit | 3 | 6 | mit | fa1a383aa194f028e9aa6eb4ff474281dd7c5bfe | jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015,jketo/arcusysdevday2015 | team2/python/rasacalculator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix relative import for py3."
},
{
"role": "assistant",
"content": "from .spglib import get_version\n\n__version__ = \"%d.%d.%d\" % get_version()\n"
}
] | python | new_file | 1 | 0 | bsd-3-clause | 4254dcf349e79d077b68fc8ba09cf74c0cb008e2 | atztogo/spglib,atztogo/spglib,jochym/spglib,atztogo/spglib,jochym/spglib,atztogo/spglib,jochym/spglib,jochym/spglib,atztogo/spglib | pyspglib/pyspglib/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Module with code to be run before and after certain events during the testing.\"\"\"\nimport os\nfrom src.support import helpers\n\n\ndef before_all(_context):\n \"\"\"Perform the setup before the first event.\"\"\"\n if not hel... | python | edit | 1 | 2 | apache-2.0 | 5d6d2a02963cadd9b0a5c148fb6906fa63148052 | ldimaggi/fabric8-test,ldimaggi/fabric8-test,ldimaggi/fabric8-test,ldimaggi/fabric8-test,ldimaggi/fabric8-test,ldimaggi/fabric8-test | booster_bdd/features/environment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom corehq.apps.custom_data_fields.models import CustomDataFieldsDefinition, CustomDataField\nfrom corehq.apps.users.models import CommCareUser\nfrom corehq.apps.domain.models import Dom... | python | edit | 1 | 8 | bsd-3-clause | 53e89d0e7af03bd9f59a2e6bcbe6cdbfe8e8f50a | puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | corehq/apps/custom_data_fields/management/commands/convert_custom_user_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom dateutil.relativedelta import relativedelta\n\nfrom legalaid.models import Case\nfrom cla_butler.tasks import DeleteOldData\n\n\nclass FindAndDeleteCasesUsingCreationTime(DeleteOldDa... | python | edit | 1 | 4 | mit | 5b6026bac75ae906d55410c583ebe4a756232dd7 | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License ... | python | edit | 1 | 0 | apache-2.0 | eaa3d6094c92eb17f5074279a0c23ec363cddd1b | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/portal/models/secondary_structure.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nTest the MPS class\n\"\"\"\nimport unittest\nimport numpy as np\n\nimport parafermions as pf\n\nclass Test(unittest.TestCase):\n\n def test_pe_degeneracy(self):\n # should initialise with all zeros... | python | edit | 1 | 1 | bsd-2-clause | 7d8f291dea725c28e4d904a3195fde46a3418925 | nmoran/pf_resonances | parafermions/tests/test_peschel_emery.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\n\n\n# O(n^4) approach: generate all possible substrings and\n# compare each for equality.\n\ndef longest_duplicated_substring(string):\n \"\"\"Return the longest duplicated substring.\n\n Keyword A... | python | edit | 1 | 6 | mit | 75c48ecbac476fd751e55745cc2935c1dac1f138 | taylor-peterson/longest-duplicated-substring | longest_duplicated_substring.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim:ts=4:sts=4:sw=4:expandtab\nfrom setuptools import setup, find_packages\n\nsetup(name='satori.ars',\n packages=find_packages(),\n namespace_packages=[\n 'satori',\n ],\n install_requires=[\n 'setuptools',\n ... | python | edit | 1 | 0 | mit | 4de0da9c28351047b1de6f728da5e68d9e73b3fd | zielmicha/satori,zielmicha/satori,zielmicha/satori,zielmicha/satori,zielmicha/satori,zielmicha/satori,zielmicha/satori | satori.ars/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport fnmatch\nimport restructuredtext_lint\n\n\nDEFAULTS = {\n 'files': '*.rst',\n}\n\n\ndef make_message(error):\n return '%s %s:%s %s\\n' % (\n error.type, error.source, error.line, error.message,\n )\n\n\ndef... | python | edit | 1 | 4 | mit | 847a88c579118f8a0d528284ab3ea029ccca7215 | evvers/git-pre-commit-hook | git_pre_commit_hook/builtin_plugins/rst_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom nipype.interfaces.base import (BaseInterface, BaseInterfaceInputSpec, traits,\n InputMultiPath, File, Directory, TraitedSpec)\nfrom qipipe.staging.fix_dicom import fix_dicom_headers\n\nclass FixDicomInputSpec(BaseInterfac... | python | edit | 5 | 1 | bsd-2-clause | 07ea0d8ec5c65f0fc94dc29f8b03402c571d3a42 | ohsu-qin/qipipe | qipipe/interfaces/fix_dicom.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport unittest\nfrom dynd import nd, ndt\n\nclass TestGroupBy(unittest.TestCase):\n def test_immutable(self):\n a = nd.array([\n ('x', 0),\n ('y', 1),\n ('x', 2),\n ... | python | edit | 4 | 1 | bsd-2-clause | 87d1801fefcd048f60c944c28bfc005101c5704b | cpcloud/dynd-python,izaid/dynd-python,aterrel/dynd-python,michaelpacer/dynd-python,mwiebe/dynd-python,insertinterestingnamehere/dynd-python,aterrel/dynd-python,cpcloud/dynd-python,cpcloud/dynd-python,izaid/dynd-python,aterrel/dynd-python,mwiebe/dynd-python,michaelpacer/dynd-python,mwiebe/dynd-python,pombredanne/dynd-py... | dynd/tests/test_nd_groupby.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\nfrom fabric.api import env, run, sudo, task\nfrom fabric.context_managers import cd, prefix\nfrom fabric.contrib.project import rsync_project\n\nenv.use_ssh_config = True\nhome = '~/jarvis2'\n\n\n@task\ndef pull_cod... | python | edit | 1 | 2 | mit | e8f8407ee422375af07027af2846a95c9cfaad37 | Foxboron/Frank,Foxboron/Frank,mpolden/jarvis2,Foxboron/Frank,martinp/jarvis2,martinp/jarvis2,mpolden/jarvis2,mpolden/jarvis2,martinp/jarvis2 | fabfile.py | rejected_duplicate | Near-duplicate of sample 3874 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport src\nimport sys\nfrom io import StringIO\n\n\nclass TestConfigFileLoading(unittest.TestCase):\n\n filepath_prefix = ''\n\n @classmethod\n def setUpClass(cls):\n if sys.argv[0].endswith('nosetests'):\n... | python | edit | 1 | 2 | bsd-3-clause | 384cb60a488b03ac992c3496658c299f3393b807 | sky-uk/bslint | tests/TestConfigFileLoading.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 Nebula, 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... | python | edit | 1 | 4 | apache-2.0 | 345ccc9d503e6e55fe46d7813958c0081cc1cffe | Mirantis/mos-horizon,endorphinl/horizon,RudoCris/horizon,davidcusatis/horizon,Daniex/horizon,watonyweng/horizon,tqtran7/horizon,sandvine/horizon,openstack/horizon,mdavid/horizon,davidcusatis/horizon,maestro-hybrid-cloud/horizon,VaneCloud/horizon,CiscoSystems/avos,Dark-Hacker/horizon,luhanhan/horizon,RudoCris/horizon,fr... | openstack_dashboard/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom springfield_mongo.entities import Entity as MongoEntity\nfrom springfield_mongo import utils\nfrom springfield import fields\nfrom bson.objectid import ObjectId\n\n\n# This dummy class just used to have an extra attribute to verify dur... | python | edit | 1 | 1 | mit | 64fb250967775c690e1ae6a7c43c562f4c94438b | six8/springfield-mongo | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef handle(controller_slice):\n from core.models import ControllerSlice, Slice\n \n try:\n my_status_code = int(controller_slice.backend_status[0])\n try:\n his_status_code = int(controller_slice.slice.backe... | python | edit | 3 | 5 | apache-2.0 | 69ae2f5b825ae6a404d78120b60727b59dbbcbac | jermowery/xos,xmaruto/mcord,xmaruto/mcord,jermowery/xos,cboling/xos,jermowery/xos,cboling/xos,cboling/xos,jermowery/xos,xmaruto/mcord,xmaruto/mcord,cboling/xos,cboling/xos | xos/model_policies/model_policy_ControllerSlice.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom subprocess import call, check_call, check_output\nimport os.path\n\nfrom .fixtures import Fixture\n\n\n@Fixture.inside_container\nclass DepsTest(Fixture, unittest.TestCase):\n\n def test_install_deps(self):\n ... | python | edit | 1 | 2 | mit | daa5de8071bc0694115dce3d8cc1a3733e269910 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/ops/itests/test_deps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport dataproperty\nimport six\n\nfrom ._error import NetworkInterfaceNotFoundError\n\n\ndef verify_network_inter... | python | edit | 1 | 4 | mit | 7db970b508c9d7ea3d659fe8b2fa5a852f16abd1 | thombashi/tcconfig,thombashi/tcconfig | tcconfig/_common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nExtend the Python Grammar\n==============================\n\nThis example demonstrates how to use the `%extend` statement,\nto add new syntax to the example Python grammar.\n\n\"\"\"\n\nfrom lark.lark import Lark\nfrom python_parser... | python | edit | 1 | 0 | mit | d28eba4f9a62ca96bbfe5069f43864a6a71bea71 | lark-parser/lark | examples/advanced/extend_python.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport codecs\nfrom frameworkbenchmarks.models import DBSession\n\nif __name__ == \"__main__\":\n \"\"\"\n Initialize database\n \"\"\"\n with codecs.open('../config/create-postgres.sql', 'r', encoding='utf-8') as fp:\n s... | python | edit | 1 | 0 | bsd-3-clause | 053147c19acbf467bb0e044f2fb58304b759b72d | k-r-g/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,thousandsofthem/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,sxend/FrameworkBenchmarks,doom369/FrameworkBenchmarks,herloct/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,actframework/FrameworkBenchm... | frameworks/Python/pyramid/create_database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test Migration\n\nRevision ID: 132231d12fcd\nRevises: None\nCreate Date: 2013-04-27 11:09:23.896698\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '132231d12fcd'\ndown_revision = None\n\nfrom alembic import op\nimpo... | python | edit | 4 | 1 | bsd-2-clause | f3931dd3eecdfa6be81273007663d4983aad5180 | hasgeek/coaster | tests/alembic/versions/132231d12fcd_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport requests\nfrom flask import Flask, render_template\n\napp = Flask(__name__, instance_relative_config=True)\napp.config.from_pyfile(\"appconfig.py\")\n\nBBC_id= \"bbc-news\"\n\n@app.route(\"/\")\ndef index():\n r = requests.get(\n ... | python | edit | 1 | 2 | mit | 7c3edfb8971331c0058ce6426e10239f57cbfc97 | alchermd/headlines,alchermd/headlines | app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nversion = '0.4.2'\nsetup(\n name='sqlalchemy-vertica-python',\n version=version,\n description='Vertica dialect for sqlalchemy using vertica_python',\n long_description=open(\"README.rst\").read()... | python | edit | 1 | 0 | mit | 873572d6731d35647dca90b4aea4d7f26866f676 | LocusEnergy/sqlalchemy-vertica-python | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\nfrom pyglet.gl import *\n\ndef ptr(*args):\n return (GLfloat * len(args))(*args)\n\n@contextmanager\ndef gl_disable(*bits):\n glPushAttrib(GL_ENABLE_BIT)\n map(glDisable, bits)\n\n yield\n\... | python | edit | 21 | 1 | mit | da66b82b4a5d5c0b0bb716b05a8bfd2dae5e2f4c | vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah,vickenty/ookoobah | ookoobah/glutil.py | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas\n\n\ndef main():\n train_all = pandas.DataFrame.from_csv('train.csv')\n train = train_all[['Survived', 'Sex', 'Fare']]\n print(train)\n\n\nif __name__ == '__main__':\n main()\n\n```\n\nApply this change: Make predi... | python | edit | 1 | 1 | mit | 7ab9f281bf891e00d97278e3dba73eaeffe3799a | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | kaggle/titanic/categorical_and_scaler_prediction.py | rejected_duplicate | Near-duplicate of sample 1257 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.