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#!/usr/bin/env python\nfrom absl.testing import absltest\n\nfrom grr_response_server import cronjobs\nfrom grr_response_server import server_startup\nfrom grr_response_server.rdfvalues import cronjobs as rdf_cronjobs\nfrom grr.test_lib impo... | python | edit | 3 | 2 | apache-2.0 | bdcef725ae19e8601d1969b61dba53133f5861c0 | google/grr,google/grr,google/grr,google/grr,google/grr,google/grr,google/grr | grr/server/grr_response_server/server_startup_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\ndef prim():\n\t\"\"\"Prim's Minimum Spanning Tree in weighted graph.\"\"\"\n\tpass\n\n\ndef main():\n\tpass\n\n\nif __name__ =... | python | edit | 2 | 1 | bsd-2-clause | b98dcfbff114b26475c327492e8fcd8fff17c902 | bowen0701/algorithms_data_structures | alg_prim_minimum_spanning_tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a setting NEXUS_USE_DJANGO_MEDIA_URL to easily use Django's MEDIA_URL for the nexus MEDIA_PREFIX.\n\nIf you want to make custom modifications to the nexus media it makes sense to have it under your own app's media folder and the NEXUS_US... | python | new_file | 1 | 0 | apache-2.0 | 44d6af63406e2f825c44238fd5bde0c49dde0620 | Raekkeri/nexus,graingert/nexus,graingert/nexus,disqus/nexus,YPlan/nexus,disqus/nexus,graingert/nexus,YPlan/nexus,brilliant-org/nexus,YPlan/nexus,roverdotcom/nexus,roverdotcom/nexus,disqus/nexus,brilliant-org/nexus,Raekkeri/nexus,blueprinthealth/nexus,roverdotcom/nexus,blueprinthealth/nexus,blueprinthealth/nexus,brillia... | nexus/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\ndef crop_corners(image, box=None, **kwargs):\n \"\"\"\n Crop corners to the selection defined by image_cropping\n \"\"\"\n\n if box and box[0] != '-':\n try:\n ... | python | edit | 2 | 10 | bsd-3-clause | ad2f413700c2cdf1a50562fb7d2e26e066778ff5 | henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping | image_cropping/thumbnail_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.contrib.contenttypes import generic\nfrom reversion.admin import VersionAdmin\n\nfrom . import models\n\n\nclass NodeAdmin(VersionAdmin):\n pass\n\n\nclass N... | python | edit | 4 | 0 | apache-2.0 | 0476093e01784c86138794261ca2e49a9b2e0cb5 | dmclain/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells | armstrong/core/arm_wells/admin.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pipelines.models import Operation\nfrom polyaxon.celery_api import CeleryTask\n\n\nclass OperationTask(CeleryTask):\n \"\"\"Base operation celery task with basic logging.\"\"\"\n _operation = None\n\n def run(self, *args, **kw... | python | edit | 1 | 1 | apache-2.0 | c5f9b9bc76f797156b73a2bb26b80ebf23d62fe4 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/pipelines/celery_task.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport logging\nimport socket\n\nimport requests\n\nlogger = logging.getLogger(__name__)\n\n\nclass APIWrapper(object):\n\n def __init__(self, options):\n self.token = options['hq_token']\n self.url... | python | edit | 1 | 2 | mit | 8fa346532068aadf510ebcc1ef795527f7b68597 | frigg/frigg-worker | frigg_worker/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\nimport cybox\nimport cybox.bindings.cybox_core as core_binding\nfrom cybox.common import VocabString, StructuredText, MeasureSource\... | python | edit | 1 | 0 | bsd-3-clause | caefc529d55f2b036f1b39688d8c27b3bd019d69 | CybOXProject/python-cybox | cybox/core/event.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import *\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/\n\nSECRET_KEY = 'CHANGE ME'\nDEBUG = True\n\n\n# Database\n# https://docs.django... | python | edit | 5 | 0 | bsd-2-clause | d5d8a20922e44bb4fb6b905729d13771c6eab592 | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | babybuddy/settings/development.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from django.conf import settings\nexcept ImportError:\n settings = None\n\nfrom client import StatsClient\n\n\n__all__ = ['StatsClient', 'statsd', 'VERSION']\n\nVERSION = (0, 1)\n\n\nif settings:\n host = getattr(settings, '... | python | edit | 1 | 0 | mit | c0e68d9e4fe18154deb412d5897702603883cc06 | Khan/pystatsd,wujuguang/pystatsd,deathowl/pystatsd,lyft/pystatsd,lyft/pystatsd,smarkets/pystatsd,jsocol/pystatsd,Khan/pystatsd | statsd/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nimport scipy.linalg as la\n\nfrom fsc.export import export\nfrom fsc.hdf5_io import subscribe_hdf5, SimpleHDF5Mapping\n\n\n@export\n@subscribe_hdf5('tbmodels.model', check_on_load=False)\nclass KdotpModel(SimpleHDF5Mappi... | python | edit | 1 | 2 | apache-2.0 | 250e720550a514457e5f698e80ed89e50abee482 | Z2PackDev/TBmodels,Z2PackDev/TBmodels | tbmodels/_kdotp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\nimport multiprocessing\n\nthreads = 4\n\ndev_null = \"/dev/null\"\ninput_dir = \"./convergence_inputs/\"\n\nlog_file = dev_null\n\ncall = \"nice -n 19 ionice -c2 -n7 ../build/main.x \"\ncall_end = \" >> \" + log_file... | python | edit | 1 | 0 | mit | 427f02c7f6c93e15d219d975d337a97d74a88b42 | kramer314/1d-vd-test,kramer314/1d-vd-test | convergence-tests/runall.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nsentry.templatetags.sentry_admin_helpers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\nfrom django import t... | python | edit | 1 | 2 | bsd-3-clause | 412084e5cd7d59d48bf889570f168759a5f4b775 | ifduyue/sentry,jean/sentry,chayapan/django-sentry,kevinlondon/sentry,songyi199111/sentry,BuildingLink/sentry,Kryz/sentry,wong2/sentry,drcapulet/sentry,korealerts1/sentry,felixbuenemann/sentry,drcapulet/sentry,Natim/sentry,NickPresta/sentry,ngonzalvez/sentry,looker/sentry,rdio/sentry,kevinlondon/sentry,beeftornado/sentr... | sentry/templatetags/sentry_admin_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom quickly.buttons.models import EmergencyButtonClient\n\n\nclass FamilyMember(models.Model):\n \"\"\"\n Model which defines families of the platform with authentication\n possibilities and a phone... | python | edit | 1 | 0 | mit | fce3dd3b08f2ff8500be4d694e9d384bd61b82ab | wearespindle/quickly.press,wearespindle/quickly.press,wearespindle/quickly.press | quickly/families/models.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 | d5b5421c95b1e2feb4646a42b5aca71a2280e30c | EdwinKato/Space-Allocator,EdwinKato/Space-Allocator | tests/dojo_test.py | rejected_duplicate | Near-duplicate of sample 4548 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nimport opentracing\nfrom .sensor import Sensor\nfrom .tracer import InstanaTracer\nfrom .options import Options\n\n# Import & initialize instrumentation\nfrom .instrumentation import urllib3\n\n\"\"\"... | python | edit | 3 | 0 | mit | 01e4b6c3cbd11058e3d60a635048998c24138ddb | instana/python-sensor,instana/python-sensor | instana/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\nimport subprocess\nimport datetime\n\nfrom check_for_meshes import check_mesh\n\n# tests to run\ntests = ['sphere_lspr.py', 'sphere_multiple_lspr.py']\n\n# specify CUDA device to use\nCUDA_DEVICE = '0'\n\nENV = os.en... | python | edit | 1 | 0 | bsd-3-clause | 65c5474936dca27023e45c1644fa2a9492e9a420 | barbagroup/pygbe,barbagroup/pygbe,barbagroup/pygbe | tests/convergence_tests/run_convergence_tests_lspr.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom unittest import main\n\nfrom test_core import *\nfrom test_lazy import *\n\n\nif __name__ == '__main__':\n main()\n\n```\n\nApply this change: Make running unit tests more friendly"
... | python | edit | 3 | 0 | mit | 591aaa938c22b797fc6bbeb5050ec489cc966a47 | CovenantEyes/py_stringlike | tests/run_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nimport unittest\n\nfrom six.moves import input\n\nfrom .config import *\nfrom tweepy import API, OAuthHandler\n\n\nclass TweepyAuthTests(unittest.TestCase):\n\n def testoauth(self):\n auth = OAuthHandler(oauth_consu... | python | edit | 6 | 1 | mit | 80b148f31b616ee85e63ddc524a6dd2910b5a467 | svven/tweepy,tweepy/tweepy | tests/test_auth.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport tornado.web\nimport os\nimport uuid\n\nclass UploadHandler(tornado.web.RequestHandler):\n def post(self):\n fileinfo = self.request.files['filearg'][0]\n print 'hi'\n print \"fileinfo ... | python | edit | null | null | mit | 811a94b477abae045fb8b840c33481ed8b1d8266 | santosfamilyfoundation/SantosCloud,santosfamilyfoundation/TrafficCloud,santosfamilyfoundation/TrafficCloud,santosfamilyfoundation/SantosCloud,santosfamilyfoundation/TrafficCloud,santosfamilyfoundation/SantosCloud,santosfamilyfoundation/SantosCloud | app/upload.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: <EMAIL>\n# Documentation: http://scripting101.stoeps.de\n#\n# Version: 2.0\n# Date: 2014-06-04\n#\n# License:... | python | edit | 2 | 0 | apache-2.0 | c614d5e636ad22c470ac730ceb292a10c9537c6b | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/doc/DataSources.py | rejected_duplicate | Near-duplicate of sample 18347 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add --regression command line option"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\n\nfrom dials.conftest import pytest_addoption, regression_data, run_in_tmpdir\n"
}
] | python | new_file | 5 | 0 | bsd-3-clause | b7a0653cdb2c20def38a687963763b75455ebbcb | xia2/i19 | conftest.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\n\nimport opensim as osim\n\ntest_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),\n 'tests')\n\n# Silence warning messages if mesh (.vtp) files cannot be found.\nosim.Mod... | python | edit | 1 | 1 | apache-2.0 | d2d03e89b0c89bc78c4087b5ad6a4f543301f927 | opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core | Bindings/Python/tests/test_component_interface.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom unittest import TestCase\n\n\nclass TestOneAll(TestCase):\n def test_whether_test_runs(self):\n self.assertTrue(True)\n\n```\n\nApply this change: Test suite is taking shape. :)"
},
{
"role": ... | python | edit | 1 | 1 | mit | 2d908f812a0cfeab18e36733ec3380e507865c20 | leandigo/pyoneall | tests/test_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom IPython.nbconvert.preprocessors import Preprocessor\nfrom IPython.nbformat.current import read as read_nb\nfrom IPython.utils.traitlets import Unicode\n\n\nclass IncludeHeaderFooter(Preprocessor):\n \"\"\"A preprocessor for adding h... | python | edit | 1 | 3 | bsd-3-clause | 7873996d49ad32984465086623a3f6537eae11af | jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,MatKallada/nbgrader,ellisonbg/nbgrader,modulexcite/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,jdfreder/nbgrader,jd... | nbgrader/preprocessors/headerfooter.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom boto.dynamodb2.layer1 import DynamoDBConnection\n\nfrom .model import Model\n\n\ndef patch_dynamodb_connection(**kwargs):\n \"\"\":class:`boto.dynamodb2.layer1.DynamoDBConnection` patcher.\n\n It partially applies the keyword arg... | python | edit | 1 | 3 | mit | 61c4b0952e198fd5335f110349b4cc3fe840a02f | teddychoi/BynamoDB | bynamodb/patcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUpdate User.comments_viewed_timestamp field & comments model.\nAccompanies https://github.com/CenterForOpenScience/osf.io/pull/1762\n\"\"\"\nfrom modularodm import Q\nfrom framework.auth.core import User\nfrom website.models import ... | python | edit | 1 | 4 | apache-2.0 | ad8a68744c9c844af6e093954b9f50cfc355920a | chennan47/osf.io,RomanZWang/osf.io,kch8qx/osf.io,amyshi188/osf.io,billyhunt/osf.io,zamattiac/osf.io,abought/osf.io,GageGaskins/osf.io,brandonPurvis/osf.io,zamattiac/osf.io,zachjanicki/osf.io,acshi/osf.io,brianjgeiger/osf.io,DanielSBrown/osf.io,TomHeatwole/osf.io,KAsante95/osf.io,chrisseto/osf.io,billyhunt/osf.io,crcres... | scripts/update_comments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# importing modules/ libraries\nimport pandas as pd\nimport numpy as np\n\norders_prior_df = pd.read_csv('Data/orders_prior_sample.csv')\n\norder_products_prior_df = pd.read_csv('Data/order_products_prior_sample.csv')\n\ngrouped = order_pro... | python | edit | 1 | 2 | mit | 6dfbbba5abf380e3f47f9190a864faa13cf1599d | rjegankumar/instacart_prediction_model | data_preparation.py | rejected_duplicate | Near-duplicate of sample 17560 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport PIL.Image\nimport PIL.ImageMath\nimport urllib.request\nfrom io import BytesIO\n\n\ndef load_img_url(url):\n req = urllib.request.urlopen(url)\n data = BytesIO(req.read())\n return PIL.Image.open(data)\n\n\ndef load_img_file... | python | edit | 1 | 7 | mit | a9cc67b9defeffc76091bd204f230a431db80196 | asavonic/traftrack | traftrack/image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nimport django\n\nfrom django.conf import settings\n\n\nDEFAULT_SETTINGS = dict(\n INSTALLED_APPS=[\n \"django.contrib.auth\",\n \"django.contrib.contenttypes\",\n \"dja... | python | edit | 1 | 6 | mit | 33fa3d886742b440945fa80eaa5a8da9950f1181 | tgs/django-badgekit-webhooks | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python2.7\n\nimport requests\n\n\nclass Slackbot(object):\n\n def __init__(self, slack_name, token):\n self.slack_name = slack_name\n self.token = token\n assert self.token, \"Token should not be blan... | python | edit | 1 | 2 | apache-2.0 | fe4cc596e65f6dc5ec7f99d40f7346143b695633 | TheConnMan/destalinator,royrapoport/destalinator,randsleadershipslack/destalinator,royrapoport/destalinator,TheConnMan/destalinator,randsleadershipslack/destalinator,underarmour/destalinator | slackbot.py | rejected_duplicate | Near-duplicate of sample 4600 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.timezone import now\n\nclass Reading(models.Model):\n # Authenticating on user\n owner = models.ForeignKey('auth.User', related_name='api',\n default='')\n\n... | python | edit | 4 | 1 | bsd-3-clause | b4712e75655108d396e5a4ee9b274b34c338e5b9 | codefornigeria/dustduino-server,developmentseed/dustduino-server,codefornigeria/dustduino-server,codefornigeria/dustduino-server,developmentseed/dustduino-server,developmentseed/dustduino-server | api/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sorted_nearest.src.sorted_nearest import (nearest_previous_nonoverlapping,\n nearest_next_nonoverlapping,\n nearest_nonoverlapping,\n ... | python | edit | 7 | 0 | bsd-3-clause | 63c72bab549ae2c5aaa6370aebe10cce1e14effe | pyranges/sorted_nearest,pyranges/sorted_nearest,pyranges/sorted_nearest | sorted_nearest/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n#\n# Replaces the extension \".la\" with \".so\" in the library URI in all \n# \".cca\" files in %{buildroot}%{_datadir}/cca.\n#\n# Mark Piper (<EMAIL>)\n\nimport os\nimport sys\nimport glob\nfrom subprocess import c... | python | edit | 1 | 0 | mit | 7698d7256f7a88b02b3dd02b411532cb4a6a46aa | csdms/rpm_tools,csdms/rpm_tools | cmi/modify_uri.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport threading\n\nfrom flask import Flask\n\nfrom users import users\n\napi = Flask(__name__)\nlock = threading.Lock()\n\nuser_num = 0\n\n@api.route('/')\ndef index():\n return 'Rackspace User Management'\n\n@api.route('/user')\ndef ge... | python | edit | 1 | 2 | mit | da9a8811669daba4b89ceb0bec30787ff5efe8d0 | everett-toews/rackspace-user-management | rum/rum.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.views.generic import View\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.http import HttpResponse\n\ntry:\n from django.http import StreamingHttpResponse as HttpResponse\nexcept ... | python | edit | 1 | 3 | bsd-3-clause | 1eedac5229e5a9128c4fbc09f7d7b97a3859e9b9 | chadmiller/django-sse,niwinz/django-sse,chadmiller/django-sse | django_sse/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, url, include\nfrom piston.resource import Resource\n\nfrom .views import (CreateRepoView, UpdatePasswordView,\n ListSubmissionView, SubmitView)\nfrom .api_handlers import Re... | python | edit | 1 | 0 | bsd-3-clause | 30b4003b22ab12bcc83013c63903dad7e36a5374 | siggame/webserver,siggame/webserver,siggame/webserver | webserver/codemanagement/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# This file is part of the pymfony package.\n#\n# (c) Alexandre Quercia <<EMAIL>>\n#\n# For the full copyright and license information, please view the LICENSE\n# file that was distributed with this source code.\n\n... | python | edit | 1 | 1 | mit | 44b709f57dfaa12f158caf32c2032f1455443298 | pymfony/system | serializer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n\"\"\"\n\n\n\"\"\"\n\nfrom ..analytic_signal import analytic_signal\n\nimport numpy as np\n\n\ndef cos(data, fb=None, fs=None, pairs=None):\n \"\"\"\n\n \"\"\"\n n_samples, n_rois = np.shape(data)\n\n X = None\n if fb is n... | python | edit | 1 | 5 | bsd-3-clause | 7106317db23165220754f1cf45e7a8d30a9a76db | makism/dyfunconn | dyfunconn/fc/cos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass OutputHandler(object):\n def __init__(self, connection):\n self.connection = connection\n\n def cmdNICK(self, nick):\n self.connection.sendMessage(\"NICK\", nick)\n\n def cmdUSER(self, ident, gecos):\n # ... | python | edit | 1 | 1 | mit | fa66f44cf9783e790a2758b255ad740e712dc667 | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | heufybot/output.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport dj_database_url\n\nfrom .common import *\n\nSECRET_KEY = '4ln7qg*67amc&7-h^=^0%ml_s(w4y_fy4uybib%j(v(46-x0i2'\nDEBUG = False\nALLOWED_HOSTS = ['*']\n\ndb_from_env = dj_database_url.config(conn_max_age=500)\nDATABASES['default'].updat... | python | edit | 3 | 0 | mit | 4ddfb4bfb9e1f6a94c5914296aa878d495929636 | avinassh/nightreads,avinassh/nightreads | nightreads/settings/heroku.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Keeps track of karma counts.\n@package ppbot\n\n@syntax .karma <item>\n\"\"\"\nimport re\n\nfrom modules import *\n\nclass Karmamod(Module):\n\n def __init__(self, *args, **kwargs):\n \"\"\"Constructor\"\"\"\n\n Modul... | python | edit | 6 | 3 | mit | 006f957d8b6d747ad701d7b39a411df8f562f17f | billyvg/piebot | modules/karmamod.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom cookiecutter.main import is_repo_url\n\n\ndef test_is_repo_url():\n \"\"\"Verify is_repo_url works.\"\"\"\n assert is_repo_url('gitolite@server:team/repo') is True\n assert is_repo_url('<EMAIL>:audreyr/cookiecutter.git') is Tr... | python | edit | 1 | 1 | bsd-3-clause | 85814828d2caedd8612db6ce0ecec92025a34330 | michaeljoseph/cookiecutter,Springerle/cookiecutter,Springerle/cookiecutter,venumech/cookiecutter,cguardia/cookiecutter,luzfcb/cookiecutter,pjbull/cookiecutter,agconti/cookiecutter,willingc/cookiecutter,audreyr/cookiecutter,audreyr/cookiecutter,venumech/cookiecutter,takeflight/cookiecutter,dajose/cookiecutter,takeflight... | tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import render\nfrom django.http import JsonResponse\nimport common.render\nfrom common.settings import get_page_config\n\n\ndef form(request):\n ''' The signup form webpage '''\n context = get_page_config(title='... | python | edit | 4 | 6 | mit | a4d1659197c0c3da706065d5362fd3b060223c87 | NicolasKiely/Robit-Tracker,NicolasKiely/Robit-Tracker,NicolasKiely/Robit-Tracker | newaccount/views.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.core.urlresolvers import reverse\nfrom django.views.generic.base import RedirectView\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns(\n ... | python | edit | 1 | 0 | bsd-3-clause | a2826203584c6f42b8e48a9eb9285d3a90983b98 | praekelt/go-rts-zambia | rts/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# htt... | python | edit | 1 | 2 | apache-2.0 | 1e562decdc03295dec4cb37d26162e5d9aa31079 | JianyuWang/neutron,SmartInfrastructures/neutron,eayunstack/neutron,skyddv/neutron,MaximNevrov/neutron,watonyweng/neutron,gkotton/neutron,openstack/neutron,mandeepdhami/neutron,glove747/liberty-neutron,projectcalico/calico-neutron,SamYaple/neutron,takeshineshiro/neutron,dims/neutron,watonyweng/neutron,miyakz1192/neutron... | neutron/tests/common/agents/l3_agent.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom planterbox import (\n step,\n hook,\n)\n\n\nhooks_run = set()\n\n\n@hook('before', 'feature')\ndef before_feature_hook(feature_suite):\n global hooks_run\n hooks_run.add(('before', 'feature'))\n\n\n@hook('before', 'scenario... | python | edit | 1 | 1 | mit | b4a2214d84884148760623eb655ac9e538b27370 | npilon/planterbox | planterbox/tests/test_hooks/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport unittest\nimport yv_suggest.open as yvs\nimport inspect\n\nclass OpenTestCase(unittest.TestCase):\n '''test the handling of Bible reference URLs'''\n\n def test_url(self):\n '''should build correct... | python | edit | 1 | 1 | mit | 0de3f3380eda3ed541fbf37243e13243a5ad6e1e | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/test_open.py | rejected_duplicate | Near-duplicate of sample 13470 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement flow table modifications classes and enums"
},
{
"role": "assistant",
"content": "\"\"\"Modifications to the flow table from the controller\"\"\"\n\n# System imports\nimport enum\n\n# Third-party imports\n\n# Local sour... | python | new_file | 1 | 1 | mit | f8464d93ab56f7b8d46e430de4fe9b019117da4c | cemsbr/python-openflow,kytos/python-openflow | ofp/v0x01/controller2switch/flow_mod.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom conf_site.reviews.models import (\n ProposalFeedback,\n ProposalNotification,\n ProposalResult,\n ProposalVote,\n)\n\n\nclass ProposalInline(admin.StackedInline):\n model = ProposalNot... | python | edit | 1 | 0 | mit | 07ef73f98e85919863af43f9c50bde85a143660d | pydata/conf_site,pydata/conf_site,pydata/conf_site | conf_site/reviews/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\nplatedir = 'J:\\\\hte_jcap_app_proto\\\\plate'\nmapdir = 'J:\\\\hte_jcap_app_proto\\\\map'\nrundir = 'C:\\\\INST\\\\RUNS'\nstagx_min = 0\nstagx_max = 101.9\nstagy_min = 0\nstagy_max = 100\n\n```\n\nApply this change: Update x and y stage... | python | edit | 1 | 0 | mit | a66c6d3b9c3453f4ea5a4352de17bb83c75776a5 | dngv/JCAPOrbisAlign | settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport csv\nimport os\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\ndef load_db():\n with open(os.path.join(HERE, 'The_Haiti_Earthquake_Database.csv')) as f:\n reader = csv.DictReader(f)\n for elt in reader:\n... | python | edit | 2 | 3 | mit | 229d1f1611f7372e43ae5f638b9fcb15fe395432 | DesignSafe-CI/adama_example | notebooks/demo/services/common/tools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm.scoping import scoped_session\nfrom sqlalchemy.pool import NullPool\n\nDB_URL =... | python | edit | 2 | 0 | apache-2.0 | 70aa7af1a5da51813a09da4f9671e293c4a01d91 | LREN-CHUV/data-factory-airflow-dags,LREN-CHUV/airflow-mri-preprocessing-dags,LREN-CHUV/data-factory-airflow-dags,LREN-CHUV/airflow-mri-preprocessing-dags | util/connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Stdlib imports\nfrom datetime import datetime\nfrom pytz import timezone\n\n# Core Django imports\nfrom django.utils.timezone import utc\n\n# Imports from app\nfrom sync_center.models import Map, KML\n\n\ndef get_update_id_list(model_name... | python | edit | 3 | 6 | mit | 6934b792deaad42eb8ab856d1e0420b9a88a8c41 | CMUPracticum/TrailScribe,CMUPracticum/TrailScribeServer,CMUPracticum/TrailScribe,CMUPracticum/TrailScribeServer,CMUPracticum/TrailScribe | utility/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mythril.laser.ethereum.transaction as transaction\nfrom mythril.ether import util\nimport mythril.laser.ethereum.svm as svm\nfrom mythril.disassembler.disassembly import Disassembly\nfrom datetime import datetime\nfrom mythril.ether.... | python | edit | 1 | 3 | mit | ff65853def5bf1044fe457362f85b8aecca66152 | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | tests/laser/transaction/create.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nimport wiki\n\nPROJECT_ROOT_DIRECTORY = os.path.dirname(globals()['__file__'])\nDJANGO_WIKI_STATIC = os.path.join(os.path.dirname(wiki.__file__), 'static')\n\n# This whole file is essentially just a big ugly hack.\n#... | python | edit | 1 | 1 | mit | 5b5f891b6ee714966eefed1adfbd366eb078210f | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | webpack_resolve.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2011 Google 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 at\n#\n# http://www.apache... | python | edit | 1 | 0 | apache-2.0 | d41d0c15661be517d761e7d6bae2be17495b0f6e | natduca/trace_event_viewer,natduca/trace_event_viewer,natduca/trace_event_viewer | src/deps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nimport pytest\n\nfrom pre_commit.clientlib.validate_manifest import additional_manifest_check\nfrom pre_commit.clientlib.validate_manifest import InvalidManifestError\nfrom pre_commit.clientlib.validate_manifest import run\n\n\ndef test_r... | python | edit | 1 | 2 | mit | fdf05b0fa93c350d2cd030e451b0e26ed7393209 | chriskuehl/pre-commit,pre-commit/pre-commit,philipgian/pre-commit,beni55/pre-commit,Lucas-C/pre-commit,barrysteyn/pre-commit,Lucas-C/pre-commit,Lucas-C/pre-commit,dnephin/pre-commit,philipgian/pre-commit,dnephin/pre-commit,Teino1978-Corp/pre-commit,philipgian/pre-commit,chriskuehl/pre-commit,chriskuehl/pre-commit-1,dne... | tests/clientlib/validate_manifest_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT\n# All rights reserved. This work is under a BSD license, see LICENSE.TXT.\n\nfrom jenkinsflow.flow import serial\nfrom .framework import mock_api\n\n\ndef test_multiple_invocat... | python | edit | 1 | 1 | bsd-3-clause | 8a534a9927ac0050b3182243c2b8bbf59127549e | lechat/jenkinsflow,lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow | test/multiple_invocations_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nclass Channel(object):\n def __init__(self, name, branch, position, cate... | python | edit | 1 | 1 | bsd-3-clause | 70ef413e0e43103877fc94cdfebd11002e6cbcbd | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/master/factory/dart/channels.py | rejected_duplicate | Near-duplicate of sample 18080 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nclass Channel(object):\n def __init__(self, name, branch, position, cate... | python | edit | 1 | 1 | bsd-3-clause | 8da5356b2a08679cbf61cff21db2068980866701 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/master/factory/dart/channels.py | rejected_duplicate | Near-duplicate of sample 3077 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile, CMake\n\n\nclass EsappConan(ConanFile):\n\n name = 'esapp'\n version = '0.4.1'\n url = 'https://github.com/jason2506/esapp'\n license = 'BSD 3-Clause'\n author = 'Chi-En Wu'\n\n requires = 'de... | python | edit | 1 | 1 | bsd-3-clause | 77e4fb7ef74bcfd58b548cca8ec9898eb936e7ef | jason2506/esapp,jason2506/esapp | conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"EVELink - Python bindings for the EVE API.\"\"\"\n\nimport logging\n\nfrom evelink import account\nfrom evelink import api\nfrom evelink import char\nfrom evelink import constants\nfrom evelink import corp\nfrom evelink import eve\nfr... | python | edit | 2 | 1 | mit | fc7db2a55ad3f612ac6ef01cfa57ce03040708a5 | zigdon/evelink,FashtimeDotCom/evelink,bastianh/evelink,ayust/evelink,Morloth1274/EVE-Online-POCO-manager | evelink/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import BaseImporter\n\n\nclass MembershipImporter(BaseImporter):\n _type = 'membership'\n\n def __init__(self, jurisdiction_id, person_importer, org_importer):\n super(MembershipImporter, self).__init__(jurisdiction_... | python | edit | 1 | 2 | bsd-3-clause | ba93ea71b87c95f4d52c85ae652496ebfb012e1f | datamade/pupa,datamade/pupa,rshorey/pupa,mileswwatkins/pupa,rshorey/pupa,mileswwatkins/pupa,opencivicdata/pupa,influence-usa/pupa,influence-usa/pupa,opencivicdata/pupa | pupa/importers/memberships.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport cProfile\n\nfrom . import AsciiData, BinaryData\n\ndef parsefile(name):\n with open(name) as infile:\n if name.endswith('.asc'):\n data = AsciiData(infile.read())\n else:\n data = Bi... | python | edit | 1 | 3 | bsd-3-clause | 441da7a34058733c298c81dbd97a35fca6e538e0 | toofishes/python-pgpdump | pgpdump/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom ...language import Language\nfrom ...attrs import LANG\nfrom ...fr.language_data import TOKENIZER_EXCEPTIONS, STOP_WORDS\nfrom ...language_data.punctuation import TOKENIZER_IN... | python | edit | 1 | 2 | mit | 0aaa546435a261a03e27fee53a3c5f334cca6b66 | raphael0202/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/spaCy,recognai/spaCy,banglakit/spaCy,banglakit/spaCy,raphael0202/spaCy,recognai/spaCy,recognai/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,oroszgy/spaCy.hu,explosion/spaCy,Gregory-Howard/spaCy,spacy-io/spaCy,banglakit/spaCy,banglakit/spaCy,explosion/sp... | spacy/tests/regression/test_issue768.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass DockerStartError(Exception):\n pass\n\n\nclass NotNamedParameterFound(Exception):\n pass\n\n\nclass SplashError(Exception):\n def __init__(self, msg):\n self.msg = 'Splash error: {}'.format(msg)\n super().__init... | python | edit | 1 | 1 | mit | 46df020f5f349ac02c509e334ffd7e1f5970915b | spectresearch/detectem | detectem/exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url, include\nfrom django.utils.translation import ugettext as _\n\nfrom .views import (\n RealmView,\n EntityDetailView,\n EntityNetworkView,\n)\n\nentity_urls = [\n url(r'^$', RealmView.a... | python | edit | 4 | 0 | mit | 6f2db6743f431019a46a2b977cb17dd6f0622fbd | correctiv/django-yolodex,correctiv/django-yolodex,correctiv/django-yolodex | yolodex/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom prompt_toolkit.buffer import Buffer\nfrom prompt_toolkit.filters import Condition\n\nclass CLIBuffer(Buffer):\n def __init__(self, always_multiline, *args, **kwargs):\n self.always_multiline = always_multiline\n\n @Con... | python | edit | 1 | 9 | bsd-3-clause | 8b87a55a03422cc499b2f7cc168bcc0c15c0ae42 | j-bennet/mycli,jinstrive/mycli,mdsrosa/mycli,evook/mycli,shoma/mycli,chenpingzhao/mycli,mdsrosa/mycli,D-e-e-m-o/mycli,evook/mycli,jinstrive/mycli,martijnengler/mycli,webwlsong/mycli,webwlsong/mycli,oguzy/mycli,suzukaze/mycli,oguzy/mycli,danieljwest/mycli,MnO2/rediscli,danieljwest/mycli,martijnengler/mycli,D-e-e-m-o/myc... | mycli/clibuffer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport inspect\nimport pkgutil\n\nimport Orange\nfrom Orange.data import Table\nfrom Orange.regression import Learner\n\n\nclass RegressionLearnersTest(unittest.TestCase):\n def all_learners(self):\n regression_mo... | python | edit | 3 | 6 | bsd-2-clause | 9af4f3bc2ddc07e47f311ae51e20e3f99733ea35 | qPCR4vir/orange3,marinkaz/orange3,cheral/orange3,kwikadi/orange3,kwikadi/orange3,kwikadi/orange3,marinkaz/orange3,qPCR4vir/orange3,cheral/orange3,marinkaz/orange3,cheral/orange3,marinkaz/orange3,marinkaz/orange3,qPCR4vir/orange3,cheral/orange3,qPCR4vir/orange3,kwikadi/orange3,kwikadi/orange3,qPCR4vir/orange3,cheral/ora... | Orange/tests/test_regression.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom os.path import sep\n\n\nKEY = 'go'\nLABEL = 'Go'\n\nDEPENDENCIES = ['go']\nTEMP_DIR = 'go'\nSUFFIX = 'go'\n\n# go build -o tmp/estimator tmp/estimator.go\nCMD_COMPILE = 'go build -o {dest_dir}' + sep + '{dest... | python | edit | 1 | 0 | bsd-3-clause | cf2ae3c36c18ac00092736e076be0c4c09df6958 | nok/sklearn-porter | sklearn_porter/language/go.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use ... | python | edit | 1 | 0 | mit | bbe86b97f38a3c99e8271a5f167223a965ef1ff0 | numberly/thingy | docs/conf.py | rejected_duplicate | Near-duplicate of sample 13627 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make the quantum top-level a namespace package.\n\nChange-Id: I8fa596dedcc72fcec73972f6bf158e53c17b7e6d"
},
{
"role": "assistant",
"content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2011 OpenStack LLC\n# All R... | python | new_file | 2 | 0 | apache-2.0 | f268b5e62ca8bbf1712225d4c8d6d38580f38fba | netscaler/neutron,mahak/neutron,miyakz1192/neutron,takeshineshiro/neutron,NeCTAR-RC/neutron,apporc/neutron,klmitch/neutron,JioCloud/neutron,skyddv/neutron,swdream/neutron,rossella/neutron,CiscoSystems/quantum,CiscoSystems/QL3Proto,aristanetworks/arista-ovs-quantum,psiwczak/quantum,eayunstack/neutron,liqin75/vse-vpnaas-... | quantum/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"rippl URL Configuration\"\"\"\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.views.generic import TemplateView\nfrom .registration.forms import RecaptchaRegView\n\nurlpatterns = [\n url(r'... | python | edit | 1 | 0 | mit | 73a4aca6e9c0c4c9ef53e498319bf754c6bb8edb | gnmerritt/dailyrippl,gnmerritt/dailyrippl,gnmerritt/dailyrippl,gnmerritt/dailyrippl | rippl/rippl/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n#\n# Add a singleton feature to the misc column of all tokens of a certain form.\n#\n# Format\n# add_misc_features.py filename > transform.conll\n#\n\nimport argparse\n\nimport pyconll\n\nparser = argparse.Argumen... | python | edit | 1 | 0 | mit | b02d7e1e288eeaf38cfc299765f4c940bad5ea36 | pyconll/pyconll,pyconll/pyconll | examples/add_misc_features.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import packet as p\n\nclass Tracker:\n def __init__(self):\n self.objects = {}\n\n def update_object(self, record):\n try:\n oid = record['object']\n except KeyError:\n return\n ... | python | edit | 1 | 4 | mit | 26a53141e844c11e7ff904af2620b7ee125b011d | prophile/libdiana | diana/tracking.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport yaml\n\n\nclass ChannelFilter(object):\n def __init__(self, path=None):\n if path is None:\n path = os.path.join(os.path.dirname(__file__), 'channels.yaml')\n with open(... | python | edit | 1 | 5 | mit | 1b9d453f6fe0d2128849f98922f082d6ccfbee69 | wikimedia/labs-tools-wikibugs2,wikimedia/labs-tools-wikibugs2 | channelfilter.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 deepzoom\n\n# Specify your source image\nSOURCE = \"helloworld.jpg\"\n\n# Create Deep Zoom Image creator with weird parameters\ncreator = deepzoom.ImageCreator(tile_size=512, tile_ove... | python | edit | 1 | 0 | bsd-3-clause | f17da7465592eede8be261ed3f997881f596ef18 | uekeueke/deepzoom.py,edsilv/deepzoom.py,uekeueke/deepzoom.py,edsilv/deepzoom.py | examples/helloworld/helloworld.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016 Renata Hodovan, Akos Kiss.\n#\n# Licensed under the BSD 3-Clause License\n# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.\n# This file may not be copied, modified, or distributed except\n# according to ... | python | edit | 1 | 5 | bsd-3-clause | 7ca4b1652dc5fa35bbacc2d587addacc9ce9da83 | renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator | fuzzinator/call_job.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom os.path import dirname, abspath\n\nsys.path.insert(0, dirname(dirname(abspath(__file__))))\n\nfrom django.conf import settings\n\nsettings.configure()\n\nproject = 'django-slack'\nversion = ''\nrelease = ''\ncopyright = '... | python | edit | 1 | 0 | bsd-3-clause | 089b1c3ab27bb5d3c343d7787a357c49ff56bfc8 | lamby/django-slack | docs/conf.py | rejected_duplicate | Near-duplicate of sample 12100 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nraven.core.processors\n~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\nclass Processor(object):\n def __init__(self, client)... | python | edit | 1 | 8 | bsd-3-clause | 94e822e67f3550710347f563ae1d32e301d2e08b | smarkets/raven-python,patrys/opbeat_python,ronaldevers/raven-python,ronaldevers/raven-python,recht/raven-python,danriti/raven-python,lepture/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,nikolas/raven-python,akalipetis/raven-python,johansteffner/raven-python,beniwohli/apm-agent-python,dbravender/raven-pytho... | raven/processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"cg.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_com... | python | edit | 1 | 0 | mit | 8dc4245db8e64fd5024e1d6fe0bc1b230b2dce85 | pramodliv1/conceptgrapher,pramodliv1/conceptgrapher,pramodliv1/conceptgrapher | server/cg/manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport cv2\nfrom base_camera import BaseCamera\n\n\nclass Camera(BaseCamera):\n video_source = 0\n\n @staticmethod\n def set_video_source(source):\n Camera.video_source = source\n\n @staticmethod\n def frames():\n ... | python | edit | 1 | 3 | mit | 26e0d89e5178fb05b95f56cbef58ac37bfa6f1d9 | miguelgrinberg/flask-video-streaming,miguelgrinberg/flask-video-streaming | camera_opencv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nfrom flask import Blueprint, render_template\nfrom sqlalchemy import and_\n\nfrom models import Event\n\nblueprint = Blueprint(\"base\", __name__)\n\n\n@blueprint.route(\"/\")\ndef index():\n u... | python | edit | 3 | 2 | mit | f034f69a24cd2a4048e23c54c73badd0674eb1aa | saseumn/website,saseumn/website | views/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django import get_version\nfrom django.conf import settings\n\n\ndef pytest_report_header(config):\n return 'django: ' + get_version()\n\n\ndef pytest_configure():\n if not settings.configured:\n os.environ['D... | python | edit | 1 | 2 | apache-2.0 | 3f48d0fb0e44d35f29990c0d32c032ecee8fbe65 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport re\n\nfrom imap import EmailCheckError, EmailServer\nfrom postgresql import DatabaseServer\n\n\nCSV_FOLDER = os.getcwd()\n\n# Restrict emails by sender.\nEMAIL_FROM = 'sender@example.com'\n\n# Restrict emails by subject.\n... | python | edit | 3 | 1 | mit | eda35123356edd20b361aa2f1d1f20cc7b922e39 | AustralianAntarcticDataCentre/save_emails_to_files,AustralianAntarcticDataCentre/save_emails_to_files | settings_example.py | rejected_duplicate | Near-duplicate of sample 11560 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom collections import namedtuple\n\nimport pbr.version\n\n\n__version__ = pbr.version.VersionInfo('instabrade').version_string()\n\nPageID = namedtuple(\"PageID\", \"name css_path attr attr_value\... | python | edit | 1 | 0 | mit | 020d6e2bff5975aad79833bdf28c6a791e7953d1 | levi-rs/instabrade | instabrade/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import TemplateView\n\n\nclass ResponsiveTestView(TemplateView):\n template_name = \"responsive_design_helper/%s.html\"\n\n def get_template_names(self, **kwargs):\n t = self.kwargs.get('type', 'all') ... | python | edit | 1 | 2 | apache-2.0 | 8a663ecc384a1b0d43f554b894571103348ad7ab | tswicegood/django-responsive-design-helper,tswicegood/django-responsive-design-helper | responsive_design_helper/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nProxy Server \"Phone Book\".\n\nSimplify running browser tests through a proxy server\nby adding your frequently-used proxies here.\n\nNow you can do something like this on the command line:\n\"pytest SOME_TEST.py --proxy=proxy1\"\n... | python | edit | 1 | 0 | mit | 005ac5832a4992c2d1091505c2be10ae6ad34ef5 | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | seleniumbase/config/proxy_list.py | rejected_duplicate | Near-duplicate of sample 1400 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPClient\nfrom tornado.httputil import url_concat\nimport datetime\nimport hashlib\nimport hmac\n\n\nclass SQSRequest(HTTPRequest):\n \"\"\"SQS AWS Adapter for Tornado HTTP r... | python | edit | 13 | 2 | mit | 438d78058951179f947480b0340752fa9b372a9d | MA3STR0/AsyncAWS | sqs.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass PageQuerySet(models.QuerySet):\n\n def published(self):\n return self.filter(is_published=True)\n\n```\n\nApply this change: Add fragment_keys method to PageQuerySet"
},
{
"role": "a... | python | edit | 1 | 1 | mit | d5c65f6ac2cdae3310f41efb9ab0a6d5cae63357 | funkybob/kopytka,funkybob/kopytka,funkybob/kopytka | kopytka/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport timeit\n\ndef insertion(_list):\n '''Sorts a list via the insertion method.'''\n if type(_list) is not list:\n raise TypeError('Entire list must be numbers')\n for i in range(1, len(_list)):\n\n key = _list[i]\... | python | edit | 7 | 6 | mit | cf2615c2488198bd9f904a4e65ac4fc0e0d6c475 | bm5w/second_dataS | insertion.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe FVCOM Python toolbox (PyFVCOM)\n\n\"\"\"\n\n__version__ = '2.0.0'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave']\n__license__ = 'MIT'\n__maintainer__ = 'Pierre Cazenave'\n__email__ = '<EMAIL>'\n\nimport inspe... | python | edit | 18 | 0 | mit | fcad1fa7187fe81d80b8861df2851402be01b667 | pwcazenave/PyFVCOM | PyFVCOM/__init__.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThe FVCOM Python toolbox (PyFVCOM)\n\n\"\"\"\n\n__version__ = '1.6.2'\n__author__ = 'Pierre Cazenave'\n__credits__ = ['Pierre Cazenave']\n__license__ = 'MIT'\n__maintainer__ = 'Pierre Cazenave'\n__email__ = '<EMAIL>'\n\nimport inspe... | python | edit | 19 | 0 | mit | 4bf7f15896677b1ffb5678710086e13ff0c3e094 | pwcazenave/PyFVCOM | PyFVCOM/__init__.py | rejected_lint | Too many lint violations: 19 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2013 OpenStack Foundation.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance wi... | python | edit | 1 | 3 | apache-2.0 | 1766a5acc5c948288b4cd81c62d0c1507c55f727 | petrutlucian94/cinder,Paul-Ezell/cinder-1,CloudServer/cinder,Datera/cinder,nikesh-mahalka/cinder,alex8866/cinder,j-griffith/cinder,cloudbase/cinder,openstack/cinder,julianwang/cinder,redhat-openstack/cinder,tlakshman26/cinder-bug-fix-volume-conversion-full,Akrog/cinder,Hybrid-Cloud/cinder,CloudServer/cinder,tlakshman26... | cinder/brick/initiator/host_driver.py | rejected_duplicate | Near-duplicate of sample 2412 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from io import StringIO\nexcept ImportError:\n from StringIO import StringIO\n\ntry:\n FileNotFoundError = FileNotFoundError\nexcept NameError:\n FileNotFoundError = IOError\n\ntry:\n from contextlib import redirect_st... | python | edit | 1 | 2 | mit | d7157d2999a4d9a8f624c3b509726b49d9193a01 | EmilStenstrom/conllu | conllu/compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2015 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 ... | python | edit | 1 | 3 | apache-2.0 | f0b27af3cc09808146442c94df7c76127776acf8 | GoogleCloudPlatform/gsutil,GoogleCloudPlatform/gsutil,fishjord/gsutil,BrandonY/gsutil | gslib/devshell_auth_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# Plot.py -- Plotting function for Ginga FITS viewer.\n#\n# Eric Jeschke (<EMAIL>)\n#\n# Copyright (c) Eric R. Jeschke. All rights reserved.\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.t... | python | edit | 6 | 1 | bsd-3-clause | 3ac6f578397235e8eda686fe3589cda780af53d5 | stscieisenhamer/ginga,ejeschke/ginga,sosey/ginga,Cadair/ginga,rupak0577/ginga,eteq/ginga,rajul/ginga,ejeschke/ginga,pllim/ginga,ejeschke/ginga,sosey/ginga,naojsoft/ginga,naojsoft/ginga,Cadair/ginga,rupak0577/ginga,rajul/ginga,eteq/ginga,stscieisenhamer/ginga,rupak0577/ginga,pllim/ginga,sosey/ginga,stscieisenhamer/ginga... | ginga/qtw/Plot.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Codethink Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apac... | python | edit | 1 | 3 | apache-2.0 | 8ccbddffc2c41cbe623439c76cfde7097f5fa801 | ssssam/nightbus,ssssam/nightbus | nighttrain/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 25 15:19:55 2017\n\n@author: vostok\n\"\"\"\n\nimport os\nimport tempfile\nfrom astropy.io import fits\n\ndef extract_stars(input_array):\n (infilehandle, infilepath) = tempfile.mkstemp... | python | edit | 1 | 2 | mit | c6cf2fbe34f536f4c2f25e7359c6cdf1d05a55cb | lkangas/python-tycho2 | image_analysis.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.