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\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n# The base domain name for this installation. Used to control linking to\n# sub-domains.\nSERVER_NAME = \"warehouse.loc... | python | edit | 1 | 0 | bsd-2-clause | 23e57facea49ebc093d1da7a9ae6857cd2c8dad7 | davidfischer/warehouse | warehouse/defaults.py | rejected_duplicate | Near-duplicate of sample 16133 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\n\nclass MyTestCase(unittest.TestCase):\n def test_something(self):\n self.assertEqual(True, False)\n\n\nif __name__ == '__main__':\n unittest.main()\n\n```\n\nApply this change: Add a basic unit test"
},
... | python | edit | 1 | 1 | mit | ff4e769102295280b9e5ad703c5b676f399df894 | jwergieluk/openfigi,jwergieluk/openfigi | test/test_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass RedisConnectionMock(object):\n \"\"\" Simple class to mock a dummy behaviour for Redis related functions \"\"\"\n\n def zscore(self, redis_prefix, day):\n pass\n\n def zincrby(self, redis_prefix, day, amount):\n ... | python | edit | 1 | 1 | bsd-3-clause | 443fe88d5a548033321232b866388ca92f8ef3d7 | CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/dataservices-api | server/lib/python/cartodb_services/cartodb_services/refactor/tools/redis_mock.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Google Inc.\n#\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n'''\nfind.py is a poor-man's emulation of `find $1 -name=$2` on Unix.\n\nCall python find.py <directo... | python | edit | 2 | 0 | bsd-3-clause | 22483d9ca6e393635ffdf371c35026f0e8ec429c | rubenvb/skia,ominux/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,vanish87/skia,tmpvar/skia.cc,pcwalton/skia,vanish87/skia,qrealka/skia-hc,ominux/skia,shahrzadmn/skia,google/skia,pcwalton/skia,nvoron23/skia,vanish87/skia,noselhq/skia,tmpvar/skia.cc,van... | gyp/find.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\n\nfrom axes.utils import reset\n\n\nclass Command(BaseCommand):\n help = (\"resets any lockouts or failed login records. If called with an \"\n \"IP, resets only for that IP... | python | edit | 1 | 5 | mit | 54902242c1e194f36ecc028c0c56c9a99e61eb6a | django-pci/django-axes,jazzband/django-axes | axes/management/commands/axes_reset.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns('',\n url(r'^imagr/', include('imagr.urls', namespace='imagr')),\n url(r'^admin/', include(admin.site.urls)),\n url(r'^... | python | edit | 1 | 0 | mit | a959468bf210869a3d770d58f2ebd3fe70c640ab | markableidinger/django_imagr | imagr_site/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tokens.andd import And\nfrom tokens.expression import Expression\nfrom tokens.iff import Iff\nfrom tokens.nop import Not\nfrom tokens.orr import Or\nfrom tokens.then import Then\nfrom tokens.variable import Variable\n\n\nclass TokenPar... | python | edit | 1 | 9 | mit | ddfeb1e9ef60e1913bf702e58cf4696cf7c98c6d | LonamiWebs/Py-Utils | logicmind/token_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Auto-launching using this: export PROMPT_COMMAND='/Users/putilin/client.py \"`fc -nl -1`\"'\n\nimport requests\nimport sys\nimport os\nimport re\n\nassert len(sys.argv) == 2\n\nhistory_output = sys.argv[1]\nm = re... | python | edit | 1 | 0 | mit | 5167ec5f2ba30e649e6fd9b2994995a6022bfda3 | elimohl/histsync,oxyzero/histsync,eleweek/histsync,elimohl/histsync,elimohl/histsync,oxyzero/histsync,eleweek/histsync,eleweek/histsync,elimohl/histsync,oxyzero/histsync,eleweek/histsync,oxyzero/histsync | client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2022 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens... | python | edit | 1 | 0 | apache-2.0 | 49113dcbcd6cd509b1d69075f78738f4ee9e9bb6 | tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimize... | tensorflow/compiler/mlir/quantization/tensorflow/python/representative_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to populate Base Tags on app startup"
},
{
"role": "assistant",
"content": "from api.models import BaseTag\n\nTAGS = {\n 'fairness': {\n 'color': '#bcf0ff',\n 'description': 'Fairness is ideas of justice, rights... | python | new_file | 2 | 2 | mit | 18a8a9e90ab0dd31ca1ee147f85d16d0cc7e6bc1 | haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server,haystack/eyebrowse-server | api/__init__.py | rejected_duplicate | Near-duplicate of sample 16478 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport signal\nimport sys\nfrom threading import Event\n\ndef GetInterruptEvent():\n e = Event()\n\n def signal_handler(signal, frame):\n print('You pressed Ctrl+C!')\n e.set()\n\n signal.signal(signal.SIGINT, signal_... | python | edit | 3 | 1 | mit | e8c1ba2c63a1ea66aa2c08e606ac0614e6854565 | rickbassham/videoencode,rickbassham/videoencode | interrupt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport pika\nimport json\nimport requests\nimport os\n\nRABBIT_MQ_SERVER = os.environ[\"RABBIT_MQ_SERVER\"]\nRABBIT_MQ_USER = os.environ[\"RABBIT_MQ_USER\"]\nRABBIT_MQ_PWD = os.environ[\"RABBIT_MQ_PWD\"]\n\ncredential... | python | edit | 3 | 1 | mit | 78ecac7c97445fd24a9d00f5fea671aab99d4c3b | observer-hackaton/monitor-notifier-slack | monitor-notifier-slack.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nFacilities for common time operations in UTC.\n\nInspired by the `utc project <https://pypi.org/project/utc>`_.\n\n>>> dt = now()\n>>> dt == fromtimestamp(dt.timestamp())\nTrue\n>>> dt.tzinfo\ndatetime.timezone.utc\n\n>>> from time ... | python | edit | 1 | 0 | mit | ada0aadf9558caba7cb94125f8a8104d2fde968c | jaraco/tempora | tempora/utc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License i... | python | edit | 1 | 3 | apache-2.0 | 174eb11bf4bdd65e269f0792ddcb1e589bca8b0d | boto/boto3 | boto3/compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom __future__ import absolute_import\n\nimport dask_distance._pycompat\n\n\ndef test_irange():\n r = dask_distance._pycompat.irange(5)\n\n assert not isinstance(r, list)\n\n ass... | python | edit | 1 | 1 | bsd-3-clause | 1fc1e160143b5a35741cf3fce9ced827a433d640 | jakirkham/dask-distance | tests/test__pycompat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\r\nimport threading\r\nimport collections\r\nimport itertools\r\nimport time\r\n\r\nimport zephyr\r\n\r\nclass DelayedRealTimeStream(threading.Thread):\r\n def __init__(self, signal_collector, callbacks, delay):\r\n threading.Thr... | python | edit | 1 | 5 | bsd-2-clause | 441cccc340afeb205da75762ce6e145215a858b3 | jpaalasm/zephyr-bt | src/zephyr/delayed_stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom opsbro.evaluater import export_evaluater_function\nfrom opsbro.gossip import gossiper\n\nFUNCTION_GROUP = 'gossip'\n\n\n@export_evaluater_function(function_group=FUNCTION_GROUP)\ndef is_in_group(group):\n \"\"\"**is_in_group(group)*... | python | edit | 1 | 1 | mit | 37dc483fd381aa14eddddb13c991bbf647bb747b | naparuba/kunai,naparuba/kunai,naparuba/opsbro,naparuba/kunai,naparuba/kunai,naparuba/kunai,naparuba/opsbro,naparuba/opsbro,naparuba/kunai,naparuba/opsbro | data/global-configuration/packs/core-functions/module/node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 Mirantis Inc.\n#\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the L... | python | edit | 1 | 0 | apache-2.0 | 343e3bd0e16df1106d82fa6087a7247dc67bb52b | JioCloud/oslo.concurrency,openstack/oslo.concurrency,varunarya10/oslo.concurrency | oslo_concurrency/_i18n.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport requests\nfrom Suchary.local_settings import GCM_API_KEY\nfrom api.models import Device\n\nURL = 'https://android.googleapis.com/gcm/send'\nHEADER = {'Authorization': 'key=' + GCM_API_KEY, 'Content-Type': 'application/js... | python | edit | 3 | 2 | mit | 2f0f560808e07c31ffb88e4b8c9d272536f58e5c | jchmura/suchary-django,jchmura/suchary-django,jchmura/suchary-django | api/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCommon set of functionality for picoAPI testing.\nFixtures defined within this file are available to all\nother testing modules.\n\"\"\"\n\nimport pytest\nimport api.common\nfrom pymongo import MongoClient\n\nmongo_addr = \"127.0.0.... | python | edit | 3 | 3 | mit | 05c6920ff6f2d9b617346d4cca59622fb14a8f2e | picoCTF/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF | picoCTF-web/api/tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Team\nfrom nucleus.admin import TeamMemberInline\n\n\nclass TeamAdmin(admin.ModelAdmin):\n inlines = (TeamMemberInline, )\n raw_id_fields = ('captain', 'creator', )\n list_dis... | python | edit | 1 | 2 | mit | d14c0aeba5304ba66649c9d6a0a9d144a9ef1e43 | prattl/wepickheroes,prattl/wepickheroes,prattl/wepickheroes,prattl/wepickheroes | api/teams/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\n\nfrom dynamic_fixtures.fixtures.runner import LoadFixtureRunner\n\n\nclass Command(BaseCommand):\n\n help_text = 'Load fixtures while keeping dependencies in mind.'\n args = '[app_... | python | edit | 1 | 5 | mit | a69bd95c2e732f22aac555884904bbe7d9d0a1b9 | Peter-Slump/django-factory-boy-fixtures,Peter-Slump/django-dynamic-fixtures | src/dynamic_fixtures/management/commands/load_dynamic_fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\n\nfrom app import db, bcrypt\nfrom app.utils.misc import make_code\n\n\ndef expiration_date():\n return datetime.now() + timedelta(days=1)\n\n\nclass User(db.Model):\n\n id = db.Column(db.Inte... | python | edit | 2 | 1 | mit | 30ebc069634673c6a3b52c7f4285c2ce3c88472a | projectweekend/Flask-PostgreSQL-API-Seed | app/users/models.py | rejected_duplicate | Near-duplicate of sample 14789 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\ndef appstats_should_record(env):\n from gae_mini_profiler.config import should_profile\n if should_profile():\n return True\n\ndef gae_mini_profiler_should_profile_production():\n from google.appengine.api import u... | python | edit | 3 | 1 | mit | 92a5d02b3e052fb0536e51aba043ff2f026c6484 | bbondy/brianbondy.gae,bbondy/brianbondy.gae,bbondy/brianbondy.gae,bbondy/brianbondy.gae | appengine_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\natmosphere service provider rest api.\n\n\"\"\"\n\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\n\nfrom authentication.decorators import api_auth_token_required\n\nfrom core.models.group imp... | python | edit | 1 | 2 | apache-2.0 | 8b5cfb11235d419d729a69a638a39489322fe547 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/provider.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom .models import Translation\nfrom .utils import get_cache_key\n\n\nclass LinguistMixin(object):\n\n def clear_translations_cache(self):\n self._linguist.clear()\n\n @property\n def language(self)... | python | edit | 1 | 3 | mit | c6229fc20f8bb37d185f90b032c0dc3817834256 | ulule/django-linguist | linguist/mixins.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path as path\n\nimport jinja2\n\nimport helpers\n\n\nlogger = helpers.get_logger(__name__)\n\n\nconf = helpers.get_conf()\n\n\ndef jinja2_templating(context):\n path_to_theme = path.join(conf[\"path_to_themes\"], conf[\"site_th... | python | edit | 1 | 2 | mit | 2ec685b6d7469fb69e34702caa706e20f7c7e75c | daGrevis/squirrel | jinja2_templating_for_squirrel/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom all_spark_cube_client import CubeClient\nfrom colors import *\n\nHOST='cube.ac'\nPORT=12345\n\n\ndef main():\n buffer = [orange for x in range(4096)]\n client = CubeClient(HOST, PORT)\n reps = 300\n while Tru... | python | edit | 2 | 4 | mit | e3e2b9b632a765927250782bab574767464b93b5 | chadharrington/all_spark_cube,chadharrington/all_spark_cube,chadharrington/all_spark_cube,chadharrington/all_spark_cube | software/clients/python_client/src/load_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport re\nimport uuid\nimport itertools as it\n\nfrom abc import ABCMeta, abstractmethod\n\nimport numpy as np\n\n\nclass BaseReader(object):\n __metaclass__ = ABCMeta\n\n @abstractmethod\n def __init__(... | python | edit | 1 | 2 | bsd-3-clause | 4604cf73a45e8bcecf38238366cfdac37cdb7897 | iyer-arvind/PyFR,tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,Aerojspark/PyFR,tjcorona/PyFR | pyfr/readers/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Pipeline utility functions.\"\"\"\n\nimport re\n\n_SSS_REGEX = '(\\w+\\d{2})/(session\\d{2})/(series\\d{3})'\n\"\"\"The subject/session/series regexp pattern.\"\"\"\n\ndef match_session_hierarchy(path):\n \"\"\"\n Matches the su... | python | edit | 1 | 2 | bsd-2-clause | 3a7428723c66010dec1d246beb63be371428d3fe | ohsu-qin/qipipe | qipipe/staging/staging_helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport re\nimport time\n\n\nclass TransportAsync:\n async def transport(self, connection):\n cmd = \"host:transport:{}\".format(self.serial)\n await connection.send(cmd)\n\n return connection\n\n a... | python | edit | 5 | 4 | mit | a512af54d5c843aa8f232a73dcfe79870341a8db | Swind/pure-python-adb,Swind/pure-python-adb | ppadb/command/transport_async/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom celery import Celery\nfrom celery.schedules import crontab\nfrom celery.task import periodic_task\nfrom celery.utils.log import get_task_logger\n\nfrom autoscaler.autoscaler import check_autoscaler\n\nlogger = get_task_... | python | edit | 3 | 1 | apache-2.0 | 3c90d8a317e3d5b001a9aa141cc86826bdefb3fa | ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server | autoscaler/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nUnit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).\n\"\"\"\nimport unittest\nfrom pyes.tests import ESTestCase\nimport pyes.e... | python | edit | 1 | 2 | bsd-3-clause | 81cf2085bb43742b722e833f8cec6e65e2906ec0 | jayzeng/pyes,Fiedzia/pyes,HackLinux/pyes,mavarick/pyes,haiwen/pyes,aparo/pyes,haiwen/pyes,aparo/pyes,aparo/pyes,jayzeng/pyes,Fiedzia/pyes,mavarick/pyes,mavarick/pyes,HackLinux/pyes,mouadino/pyes,rookdev/pyes,haiwen/pyes,rookdev/pyes,mouadino/pyes,HackLinux/pyes,Fiedzia/pyes,jayzeng/pyes | pyes/tests/errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016 Luke San Antonio Bialecki\n# All rights reserved.\n\nfrom functools import wraps\nfrom flask_jwt_extended import utils\nfrom flask_jwt_extended.utils import ctx_stack\nfrom flask_jwt_extended.exceptions import NoAuthori... | python | edit | 2 | 5 | mit | 6dfcee473ef860fe9abb4971baabf62f9f51e314 | lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend | inpassing/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# [START app]\nimport logging\n\nfrom firebase import firebase\nfrom flask import Flask, jsonify, request\nimport flask_cors\nfrom google.appengine.ext import ndb\nimport google.auth.transport.requests\nimport google.oauth2.id_token\nimport... | python | edit | 5 | 1 | apache-2.0 | 71df45002746b162e04a125403cad390accb949e | google/playhvz,google/playhvz,google/playhvz,google/playhvz,google/playhvz,google/playhvz,google/playhvz,google/playhvz | backend/main.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nimport os\nimport ctypes\nimport platform\n\nif platform.system() == 'Windows':\n lib32 = os.path.join(os.path.dirname(__file__), 'lib32')\n lib64 = os.path.join(os.pa... | python | edit | 5 | 0 | bsd-3-clause | 0aa6a648fff39b013f9b644d9a894db39706df43 | ampl/amplpy,ampl/amplpy,ampl/amplpy | amplpy/amplpython/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n from django.conf.urls import patterns, include\nexcept ImportError:\n from django.conf.urls.defaults import patterns, include\n\n\nurlpatterns = patterns(\n \"\",\n (r\"^\", include(\"pinax.{{ app_name }}.urls\")),\n)\n\n... | python | edit | 1 | 0 | mit | cb71bc8767fbc07a27df4049b95c7dacf5975c9d | pinax/pinax-starter-app | pinax/app_name/tests/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport time\nimport json\nimport requests\n\n\ndef get_timezone(lat, long):\n response = requests.get('https://maps.googleapis.com/maps/api/timezone/json', params={\n 'location': '{},{}'.format(lat, long),\n 'tim... | python | edit | 1 | 2 | mit | 895ca15591938f07f1e913b08726f991c2d9e964 | sevazhidkov/leonard | libs/googleapis.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException\n\n\ndef json_api_exception_handler(exc, context):\n \"\"\" Custom exception handler that returns errors object as an array \"\"\"\n\n # Import in... | python | edit | 1 | 9 | apache-2.0 | 28bacd5c3318aff52c0758ad97909ff08c7bfffb | asanfilippo7/osf.io,saradbowman/osf.io,acshi/osf.io,amyshi188/osf.io,HalcyonChimera/osf.io,brandonPurvis/osf.io,mattclark/osf.io,Nesiehr/osf.io,cwisecarver/osf.io,Johnetordoff/osf.io,abought/osf.io,monikagrabowska/osf.io,pattisdr/osf.io,pattisdr/osf.io,njantrania/osf.io,samchrisinger/osf.io,jnayak1/osf.io,cwisecarver/o... | api/base/exceptions.py | rejected_duplicate | Near-duplicate of sample 17561 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# VOEvent receiver.\n# John Swinbank, <<EMAIL>>, 2011-12.\n\n# Python standard library\nimport os\nimport anydbm\nimport datetime\nfrom contextlib import closing\nfrom threading import Lock\n\nclass IVORN_DB(object):\n # Using one big lo... | python | edit | 1 | 3 | bsd-2-clause | e43c1335bb48e8ba3321ddd9471ac04fd75a4250 | jdswinbank/Comet,jdswinbank/Comet | broker/ivorn_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom distutils.core import setup\n\nif __name__ == '__main__':\n setup(\n scripts=[\n 'byteyears.py',\n 'checkpyc.py',\n 'copytime.py',\n 'crlf.py',\n 'dutree.py',\n 'ftpmirror.py',\n ... | python | edit | 1 | 0 | mit | 7b50adc607f0e0e970c6f5793eadd9fb42027d0a | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Tools/scripts/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom itertools import islice\nimport unittest\nfrom shapely.geometry import Point\nfrom shapely.ops import unary_union\n\ndef halton(base):\n \"\"\"Returns an iterator over an infinite Halton sequence\"\"\"\n def value(index):\n ... | python | edit | 1 | 2 | bsd-3-clause | d6fc8cc0e0d50b23ba0d7ca6195bc530b2f8d1b9 | abali96/Shapely,jdmcbr/Shapely,jdmcbr/Shapely,abali96/Shapely,mouadino/Shapely,mouadino/Shapely,mindw/shapely,mindw/shapely | shapely/tests/test_unary_union.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nimport math\n\nfrom core import test_helper\n\n\n# Question 1\n# ----------\n# Using the datetime module return a datetime object with the year of 2015, the month of June, and the day of 1\ndef playing_with_dt():\n retur... | python | edit | 6 | 1 | mit | f40dd24af6788e7de7d06254850b83edb179b423 | infoscout/python-bootcamp-pv | bootcamp/lesson4.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Reads and parses a configuration file for the ILAMB BMI.\"\"\"\n\nfrom os.path import join\nimport yaml\n\n\nilamb_root_key = 'ilamb_root'\nmodel_root_key = 'model_root'\nmodels_key = 'models'\n\n\nclass Configuration(object):\n\n ... | python | edit | 1 | 4 | mit | 511aab30006a5fb4c7ff52bc2cd1a1e42551fad1 | permamodel/bmi-ilamb | bmi_ilamb/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport os\n\nfrom scout.demo import cnv_report_path\nfrom scout.commands import cli\n\n\ndef test_load_cnv_report(mock_app, case_obj):\n \"\"\"Testing the load delivery report cli command\"\"\"\n\n # Make sure... | python | edit | 1 | 1 | bsd-3-clause | e1d61d945300dde9cb5ac07228b7892b224a984c | Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout | tests/commands/load/test_load_cnv_report_cmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Generated by Django 3.1.6 on 2021-02-20 15:24\n\nfrom django.db import migrations\nfrom django.db.models import F\n\n\ndef calculate_taxrate(apps, schema_editor):\n '''\n Calculate the tax rate based on current totals for any Invoic... | python | edit | 1 | 1 | bsd-3-clause | 805f77ac20952c6015a26403041b9b7b3a543ab4 | django-danceschool/django-danceschool,django-danceschool/django-danceschool,django-danceschool/django-danceschool | danceschool/core/migrations/0041_invoiceitem_calculate_taxrate.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom organizer.models import Startup, Tag\n\n\n# Model Field Reference\n# https://docs.djangoproject.com/en/1.8/ref/models/fields/\n\n\nclass Post(models.Model):\n title = models.CharField(max_length=63)\n... | python | edit | 1 | 0 | bsd-2-clause | e9df4858631d9efdcb6a5b960c25f64cae875661 | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | blog/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.core.exceptions import ImproperlyConfigured\n\n\nclass DjangaeConfig(AppConfig):\n name = 'djangae'\n verbose_name = _(\"Djangae\"... | python | edit | 1 | 4 | bsd-3-clause | d45391429f01d5d4ea22e28bef39a2bb419df04f | potatolondon/djangae,grzes/djangae,kirberich/djangae,kirberich/djangae,kirberich/djangae,grzes/djangae,potatolondon/djangae,grzes/djangae | djangae/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\nfrom ..util import pypy, ensure_buffer\n\nPREFIX = '_buffer.extend(' if pypy else '__w(' \n\n\nclass Use(object):\n\t\"\"\"Consume the result of calling another template function, extending the local buffer.\n\t\n\tThis... | python | edit | 1 | 4 | mit | f213984ad3dfd8922578346baeeb97d60fab742a | marrow/cinje | cinje/inline/use.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division, print_function\nimport pytest\nimport numpy as np\nfrom pambox import auditory as aud\nimport scipy.io as sio\nfrom numpy.testing import assert_allclose\n\n\ndef test_lowpass_filtering_of_envelope():\n ma... | python | edit | 3 | 1 | bsd-3-clause | 45086d11fcdc071427e8c5a2ac909dceac2b43ec | achabotl/pambox | tests/test_auditory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport osgtest.library.core as core\nimport unittest\n\nclass TestStartCondorCron(unittest.TestCase):\n\n def test_01_start_condor_cron(self):\n core.config['condor-cron.lockfile'] = '/var/lock/subsys/condor-cron'\n ... | python | edit | 3 | 2 | apache-2.0 | a58a1f511e0dfb54ca5168180e9f191340f7afde | efajardo/osg-test,efajardo/osg-test | osgtest/tests/test_11_condor_cron.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.core.exceptions import ValidationError\n\n\nclass OrderedModel(models.Model):\n order = models.PositiveIntegerField(blank=True, unique=True)\n\n class Meta:\n abstract = True\n ordering = ['... | python | edit | 1 | 5 | bsd-3-clause | 08e2099f173bce115ba93c2b960bb1f09ef11269 | MagicSolutions/django-orderedmodel,MagicSolutions/django-orderedmodel,kirelagin/django-orderedmodel | models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\nfrom setuptools.extension import Extension\n\nimport buildtools\n\n\n# You might also need to set PKG_CONFIG_PATH=/path/to/lib/pkgconfig if\n# your capnp is installed in a non-default location\nCAPNP = buildtoo... | python | edit | 1 | 0 | mit | 9810935ce1e9b871659148630742bda888c71408 | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/capnp/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport importlib\n\n\ndef resolve_func(func_string):\n module_name, func_name = func_string.rsplit(\".\", 1)\n module = importlib.import_module(module_name)\n func = getattr(module, func_name)\n\n if not func:\n raise Imp... | python | edit | 1 | 5 | bsd-3-clause | 762d87014d87d986aa83703f216e5cd2b52ce2f3 | brinkframework/brink | brink/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom artgraph.plugins.plugin import Plugin\n\nclass InfoboxPlugin(Plugin):\n def __init__(self, node):\n self._node = node\n \n def get_nodes(self):\n from artgraph.node import Node, NodeTypes\n from artgra... | python | edit | 1 | 4 | mit | 77fbacc85450e77ada5ac2c9c5ecc581ea2b480c | dMaggot/ArtistGraph | src/artgraph/plugins/infobox.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import bbn\nimport auspex.config\nfrom auspex.log import logger\nfrom QGL import *\nChannelLibrary()\n\ndef pulse_marker(marker_name, length = 100e-9):\n \"\"\" Utility to generate a square pulse on a APS2 marker. Used for instanc... | python | edit | 7 | 1 | apache-2.0 | 6a8fadc2d607adaf89e6ea15fca65136fac651c6 | BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex | src/auspex/instruments/utils.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime_plugin\n\nfrom ..libs.global_vars import *\nfrom ..libs import cli\n\n\nclass TypescriptBuildCommand(sublime_plugin.WindowCommand):\n def run(self):\n if get_node_path() is None:\n print(\"Cannot found no... | python | edit | 9 | 4 | apache-2.0 | 17b9749f2a36499c74effc27ec442a4bb957e877 | fongandrew/TypeScript-Sublime-JSX-Plugin,Microsoft/TypeScript-Sublime-Plugin,fongandrew/TypeScript-Sublime-JSX-Plugin,zhengbli/TypeScript-Sublime-Plugin,kungfusheep/TypeScript-Sublime-Plugin,RyanCavanaugh/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,kungfusheep/TypeScript-Sublime-Plugin,RyanCavanaugh/Ty... | typescript/commands/build.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n url(r'^$', views.index, name='index'),\n url(r'^location$',views.location, name='location'),\n]\n\n```\n\nApply this change: Add id parameter to URL"
},
... | python | edit | 1 | 0 | mit | 8dcab3b18b603e520f12c3fd5a873a08f32d4a9a | legonigel/nnsave_backend,legonigel/nnsave_backend,legonigel/nnsave_backend,legonigel/nnsave_backend | nnsave_app/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom carrot.connection import BrokerConnection\n\n\nAMQP_HOST = os.environ.get('AMQP_HOST', \"localhost\")\nAMQP_PORT = os.environ.get('AMQP_PORT', 5672)\nAMQP_VHOST = os.environ.get('AMQP_VHOST', \"/\")\nAMQP_USER = os.environ... | python | edit | 1 | 1 | bsd-3-clause | 1e6aeb9c7b07313a9efe7cb0e1380f4f2219c7dc | ask/carrot,ask/carrot | tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom testdoc.finder import find_tests\n\n\nclass MockFinder(object):\n def __init__(self):\n self.log = []\n\n def got_module(self, module):\n self.log.append(('module', module))\n\n def got_test_cl... | python | edit | 1 | 1 | mit | fb0fa15ce9618aac58f45fee0ecda852f3b00ed6 | testing-cabal/testdoc | testdoc/tests/test_finder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom wtforms.validators import DataRequired, Optional\n\nfrom web.blueprints.facilities.forms import SelectRoomForm\nfrom web.form.fields.core import TextField, QuerySelectField, \\\n SelectMultipleField\nfrom web.form.fields.custom impo... | python | edit | 4 | 0 | apache-2.0 | a14fcec19471bffcb1dcbad1d0cff7100d0ef6bc | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | web/blueprints/host/forms.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nimport experiments\nimport db\n\napp = Flask(__name__)\n\nsession = db.init_db(drop_all=True)\n\n\n@app.route('/')\ndef index():\n return 'Index page'\n\n\n@app.route('/demo2')\ndef start():\n experiment = exp... | python | edit | 2 | 2 | mit | 75b4df9437ca277709e9b61fbb9aa5c20d96820e | jcpeterson/Dallinger,suchow/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,berkeley-cocosci/Wallace,berkeley-cocosci/Wallace,Dallinger/Dallinger,suchow/Wallace,jcpeterson/Dallinger,suchow/Wallace,jcpeterson/Dallinger,berkeley-cocosci/Wal... | wallace/app.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom django.db.models import get_models, get_app\n\n\ndef get_app_model(appname, suffix=\"\"):\n app_label = appname.split('.')[-1]\n models = [model for model in get_models(get_app(app_label))\n if (mo... | python | edit | 1 | 6 | mit | da01999b6adcb79955a416ce3b3de50769adfe34 | opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,williamroot/opps | opps/core/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom yacs.settings.base import settings\n\n__all__ = ['settings']\n\nwith settings as s:\n s.DEBUG = True\n\n s.MIDDLEWARE_CLASSES += (\n 'devserver.middleware.DevServerMiddleware',\n )\n\n @s.lazy_eval\n def debug_ins... | python | edit | 1 | 2 | mit | e7766ce068eabea30c81ba699c77ed2fe488d69d | JGrippo/YACS,jeffh/YACS,jeffh/YACS,JGrippo/YACS,jeffh/YACS,JGrippo/YACS,JGrippo/YACS,jeffh/YACS | yacs/settings/development.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom django.utils import timezone\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom django.contrib.auth import get_user_mo... | python | edit | 1 | 2 | mit | 1e3f60518402835336c16017b5ba172dc0ef6087 | jeanmask/opps,YACOWS/opps,opps/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps | opps/core/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport steel\nimport unittest\n\n\nclass BytesTests(unittest.TestCase):\n def test_encode(self):\n field = steel.Bytes(size=3)\n self.assertEqual(field.encode(b'abc'), b'abc')\n\n def test_decode(self):\n field = ... | python | edit | 1 | 1 | bsd-3-clause | 2f18718f2650c3f5a34748588839899d09cac588 | gulopine/steel-experiment | tests/fields/test_strings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: Braedy Kuzma\nfrom rest_framework import authentication\nfrom rest_framework import exceptions\nfrom ipware.ip import get_ip\n\nfrom .models import RemoteNode\n\nclass nodeToNodeBasicAuth(authentication.BaseAuthentication):\n d... | python | edit | 4 | 2 | apache-2.0 | 379be172944f8ae0111842e199470effd4afdaf5 | CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project | rest/authUtils.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"add account_pattern\n\nRevision ID: fb8d553a7268\nRevises: 28e56bf6f62c\nCreate Date: 2021-04-26 22:16:41.772282\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport pycroft\n\n\n# revision identifiers, used by Alembic.\... | python | edit | 3 | 1 | apache-2.0 | 2a763b32b4794e97d1ea7bf22ec39c1eeb559804 | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | pycroft/model/alembic/versions/fb8d553a7268_add_account_pattern.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nUnit tests for Topographica\n\n$Id$\n\"\"\"\n__version__='$Revision$'\n\n### JABALERT!\n###\n### Should change this to be like topo/patterns/__init__.py, i.e.\n### to automatically discover the test files. That way new tests\n### c... | python | edit | 6 | 1 | bsd-3-clause | a312348380a495c99c1be8adca331e2eec2d1720 | ioam/svn-history,ioam/svn-history,ioam/svn-history,ioam/svn-history,ioam/svn-history | topo/tests/__init__.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#\n# Dakota utility programs for converting output.\n#\n# Mark Piper (<EMAIL>)\n\nimport shutil\nfrom subprocess import check_call, CalledProcessError\nfrom dakota_utils.read import get_names\n\n\ndef has_interface_c... | python | edit | 1 | 2 | mit | 80448aa6664d13dd58ed42c06248ca4532431aab | mdpiper/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments,mdpiper/dakota-experiments,mcflugen/dakota-experiments | dakota_utils/convert.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .common import PdfType\n\nclass PdfArray(PdfType, list):\n def __init__(self, *args, **kwargs):\n PdfType.__init__(self)\n list.__init__(self, *args, **kwargs)\n\nclass PdfDict(PdfType, dict):\n def __init__(self, *... | python | edit | 1 | 3 | mit | dbb9792871d9b1d8f1678dbafeed760098547a28 | ajmarks/gymnast,ajmarks/gymnast | pdf_parser/pdf_types/compound_types.py | rejected_duplicate | Near-duplicate of sample 16514 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add docstring and imports to package."
},
{
"role": "assistant",
"content": "\"\"\"An API library with Python bindings for Exosite One Platform APIs.\"\"\"\n\n__version__ = '0.12.4'\n\nfrom .onep import OnepV1, DeferredRequests\n... | python | new_file | 5 | 0 | bsd-3-clause | d8502569f0e4c562294415242f096eefdf361ca0 | gavinsunde/pyonep,exosite-labs/pyonep,asolz/pyonep,asolz/pyonep,gavinsunde/pyonep,exosite-labs/pyonep | pyonep/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\n\nurlpatterns = patterns('',\n url(r'^$', 'contactmps.views.home', name='home'),\n url(r'^embed.html$', 'contactmps.views.embed', name='embed-inf... | python | edit | 1 | 0 | mit | 36f7cd5c57de123bbbd88d63fd6f47a8c54a41ec | OpenUpSA/contact-mps,OpenUpSA/contact-mps,OpenUpSA/contact-mps,OpenUpSA/contact-mps | contactmps/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom dogbot.bot import bot\nfrom dogbot.web import app\nfrom mongoengine import connect\nfrom config import config\nimport getopt\nimport sys\nimport threading\nfrom importlib import reload\nreload(threading)\n\n\ndef bot_main():\n print... | python | edit | 1 | 3 | apache-2.0 | 8de9c51eedaadc68cc64ca7f5763b48a6448dca3 | moondropx/dogbot,moondropx/dogbot | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.views.generic import ListView, DetailView\n\nfrom .models import Post\n\n\nclass PostListView(ListView):\n context_object_name = 'posts'\n model = Post\n template_name = 'hermes/post_list.html'\n \n def get_querys... | python | edit | 1 | 1 | mit | fb8cfa8eb7d088ebe11075bff42bea54c97e9c18 | emilian/django-hermes | hermes/views.py | rejected_duplicate | Near-duplicate of sample 19902 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" pywind module.\n\n For more information visit https://github.com/zathras777/pywind\n\n\"\"\"\n__version__ = '1.0.3'\n\n```\n\nApply this change: Move to next version number."
},
{
"role": "assistant",
"content": "\"\"\" p... | python | edit | 1 | 0 | unlicense | 7b8fe4aa426a8de24b5fc1a496b7b1eba92e7756 | zathras777/pywind,zathras777/pywind | pywind/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n pyvisa\n ~~~~~~\n\n Python wrapper of National Instrument (NI) Virtual Instruments Software\n Architecture library (VISA).\n\n This file is part of PyVISA.\n\n :copyright: (c) 2014 by the ... | python | edit | 2 | 0 | mit | 0be63749c039e16aa1fcc64cfd8227b50829254e | pyvisa/pyvisa,rubund/debian-pyvisa,MatthieuDartiailh/pyvisa,hgrecco/pyvisa | pyvisa/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Flask\nfrom flask.ext.bootstrap import Bootstrap\nfrom config import config\n\n\nbootstrap = Bootstrap()\n\n\ndef create_app(config_name):\n\n application = Flask(__name__)\n application.config['DEBUG'] = True\n a... | python | edit | 1 | 1 | mit | 51c9413eb1375ff191e03d38933a772923fa55cf | alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphag... | app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .core import Shotgun, ShotgunError\n\n# For API compatibility\nFault = ShotgunError\n\n```\n\nApply this change: Add TransportError to top-level package"
},
{
"role": "assistant",
"content": "from .core import Shotgun, Shot... | python | edit | 4 | 0 | bsd-3-clause | 6e9159b66cd791561a24bd935aaaab2a4ea6a6af | westernx/sgapi | sgapi/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Vigenère Cipher Dictionary Hacker\n# https://www.nostarch.com/crackingcodes/ (BSD Licensed)\n\nimport detectEnglish, vigenereCipher, pyperclip\n\n\ndef main():\n ciphertext = \"\"\"Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.\"\"\"\n h... | python | edit | 1 | 4 | mit | a90411116617096c73ba6d188322613a1b529a62 | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py | rejected_duplicate | Near-duplicate of sample 13307 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport tempfile\nimport subprocess\nimport shutil\nfrom docassemble.base.error import DAError\n#from docassemble.base.logger import logmessage\n\ndef pdf_to_pdfa(filename):\n outfile = tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=... | python | edit | 1 | 2 | mit | c69974ffabc0855db153b7f5a4af6105fae698f9 | jhpyle/docassemble,jhpyle/docassemble,jhpyle/docassemble,jhpyle/docassemble,jhpyle/docassemble | docassemble_base/docassemble/base/pdfa.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nProject\n\n:Authors:\n\tBerend Klein Haneveld\n\"\"\"\n\n\nclass Project(object):\n\t\"\"\"\n\tProject holds the basic information of a project for RegistrationShop\n\t\"\"\"\n\n\tdef __init__(self, title=None, fixedData=None, movin... | python | edit | 1 | 5 | mit | 884e7254bffcef4e5d3733b26f6eb0ea34b11da6 | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | core/project/Project.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport os\nimport sys\n\ndef save_na_results(folder_path=None):\n \"\"\"Move the results of a Neighborhood Algorithm run to a folder with metadata.\n \n This will copy all files with extensions of:\n npy, tx... | python | edit | 4 | 5 | bsd-2-clause | 6b07646f085de7f5eae2c0695584bce48f812b44 | cosmolab/cosmogenic | save_na_results.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys, os\nbindir = os.path.dirname(sys.argv[0])\nsys.path[0:0] = [ os.getcwd(), \"%s/.libs\" % os.getcwd(), \\\n \"%s/..\" % bindir, \"%s/../.libs\" % bindir ]\nimport unittest\nimport pool\nimport trac.versioncontrol... | python | edit | 1 | 1 | apache-2.0 | e68e03fe5e858e9c5c65788d2d1126b8bf37772b | wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion | subversion/bindings/swig/python/tests/run_all.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCopyright [2009-2019] 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 | 3c87312aa5605e2705257052d38a4c8fae705da3 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/sequence_search/settings.py | rejected_duplicate | Near-duplicate of sample 13555 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make some changes to the bci package file."
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport platform\nimport shutil\nimport inspect\n\n#\n#def machine():\n# \"\"\"Return type of machine.\"\"\"\n# if os.n... | python | new_file | 2 | 4 | bsd-3-clause | 79fb90779e5d85978cdb7dbb36f51baa96190f77 | NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock,NeuralProsthesisLab/unlock | bci/__init__.py | rejected_duplicate | Near-duplicate of sample 16896 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Commandline interaction with SGE cluster schedulers.\n\"\"\"\nimport re\nimport subprocess\n\n_jobid_pat = re.compile('Your job (?P<jobid>\\d+) \\(\"')\n\ndef submit_job(scheduler_args, command):\n \"\"\"Submit a job to the schedul... | python | edit | 1 | 9 | mit | 3b5f1749a8065bb9241d6a8ed77c047a05b3f6e2 | biocyberman/bcbio-nextgen,Cyberbio-Lab/bcbio-nextgen,mjafin/bcbio-nextgen,chapmanb/bcbio-nextgen,lpantano/bcbio-nextgen,fw1121/bcbio-nextgen,brainstorm/bcbio-nextgen,fw1121/bcbio-nextgen,elkingtonmcb/bcbio-nextgen,verdurin/bcbio-nextgen,mjafin/bcbio-nextgen,vladsaveliev/bcbio-nextgen,SciLifeLab/bcbio-nextgen,SciLifeLab... | bcbio/distributed/sge.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom tests.utils.targetdriver import TargetDriver, if_feature\nfrom tests.utils.testdriver import TestDriver\n\n\ndef get_services():\n return TargetDriver('rep1'), TestDriver('rep2')\n\n\n@pytest.fixture(autouse=True)\n... | python | edit | 1 | 1 | mit | 33aa691298ed5c306c3b32965b38c287e65e174a | onitu/onitu,onitu/onitu,onitu/onitu | tests/functional/driver/test_driver_del.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef merge(left, right):\r\n \"\"\"Merge sort merging function.\"\"\"\r\n\r\n left_index, right_index = 0, 0\r\n result = []\r\n while left_index < len(left) and right_index < len(right):\r\n if left[left_index] < right[ri... | python | edit | 2 | 4 | cc0-1.0 | 0e7939b0027cbc203505c636bc732d860b81e78d | manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,ZoranPandovski/al-go-rithms,arijitkar98/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,arijitkar98/al-go-rithms,manikTharaka/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski... | sort/merge_sort/python/merge_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version_info__ = {\n 'major': 2,\n 'minor': 0,\n 'micro': 25,\n 'releaselevel': 'beta',\n 'serial': 1\n}\n\ndef get_version(short=False):\n assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')\n vers ... | python | edit | 1 | 4 | bsd-2-clause | f5ad5a7cf1d33fdf0c709c0fece5bc712df6ec50 | murphyke/avocado,murphyke/avocado,murphyke/avocado,murphyke/avocado | avocado/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models import Count\n\nimport commonware.log\nimport cronjobs\n\nfrom groups.models import AUTO_COMPLETE_COUNT, Group\n\n\nlog = commonware.log.getLogger('m.cron')\n\n\n@cronjobs.register\ndef assign_autocomplete_to_groups():... | python | edit | 1 | 2 | bsd-3-clause | f2d8a622a492009eb3c44221dd322b1e12e62e6e | akarki15/mozillians,mozilla/mozillians,justinpotts/mozillians,hoosteeno/mozillians,mozilla/mozillians,chirilo/mozillians,fxa90id/mozillians,akatsoulas/mozillians,johngian/mozillians,anistark/mozillians,safwanrahman/mozillians,glogiotatidis/mozillians-new,glogiotatidis/mozillians-new,anistark/mozillians,hoosteeno/mozill... | apps/groups/cron.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import *\n\nimport views\n\nurlpatterns = patterns('',\n url(r'^(?P<event_id>[0-9]+)/$', views.checkin),\n)\n\n```\n\nApply this change: Add links to easy check-in in sadmin"
},
{
"role": "assistant",
"c... | python | edit | 4 | 0 | mit | b1f173fdbfb60e26a3923c7b024bc3e65e5abf80 | animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening,animekita/selvbetjening | selvbetjening/scheckin/now/urls.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom logical.models import Database\n\nfrom dbaas.celery import app\nfrom util.decorators import only_one\n\n\n@app.task\n@only_one(key=\"purgequarantinekey\", timeout=20)\ndef purge_quarantine():\n Database.purge_quarantine()\n retur... | python | edit | 1 | 5 | bsd-3-clause | 8ae5079a2963a356a6073a245305fff98fcc7461 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/logical/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass Instruction:\n def __init__(self,prev):\n self.prev = prev\n if prev:\n self.prev.next = self\n self.partner = None\n self.next = None\n def execute(self, node):\n return (self.next, node)\n\nclass LBracket(Instr... | python | edit | 1 | 2 | mit | a391b9d990c01cdf036bc92dd6bafc03bdd69b63 | Detry322/brainfuck-interpreter | instructions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric import task\n\nCODE_DIR = '~/django-projects/test-osale/foodbank-campaign/src'\n\n# for FreeBSD compatibility\nSHELL = '/bin/sh -c'\n\n@task\ndef deploy(c):\n c.shell = SHELL\n with c.cd(CODE_DIR):\n pull_changes(c)... | python | edit | 1 | 1 | mit | 10f7b7db3b7912c74ca0320ac70da425bd2718ed | mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign,mrts/foodbank-campaign | scripts/fabfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport json\nimport sys\nfrom ConfigParser import NoOptionError\n\nimport click\nfrom syncano_cli import LOG\n\nfrom .connection import create_connection\n\n\n@click.group()\... | python | edit | 1 | 7 | mit | d40ba3bcceb1dcc7338b689194cd7214d7b2d5ff | Syncano/syncano-cli,Syncano/syncano-cli,Syncano/syncano-cli | syncano_cli/execute/commands.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom django.test import TestCase\nfrom dj... | python | edit | 1 | 1 | mit | 5f89ad72905947ac47c3246a15fae99c15571435 | ErinCall/splinter_demo,ErinCall/splinter_demo | django/signups/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport codecs\nimport json\n\nfrom tools.cipher import salted_digest\n\n\nDATA_ENCODING = \"utf-8\"\nTRANSPORT_ENCODING = \"base64\"\nDUMMY_ENCODING = \"ascii\"\n\nDATA_DIGEST_SEPARATOR = \"-\"\n\n\ndef encode(data):\n dumped_data = json... | python | edit | 1 | 3 | apache-2.0 | bb85df8a9a8cecaf6f3db276347aa8f5f9b39d0c | alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games | bot/game/api/api_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''Test using a proxy.'''\n\n# External imports\nimport multiprocessing\nimport pytest\n\nfrom six.moves import socketserver, SimpleHTTPServer\nfrom six.moves.urllib.request import urlopen\n\n# Internal imports\nimp... | python | edit | 1 | 2 | mit | 4b6b5effc744583eb0227d14d0c5e324c50cf074 | kevin1024/vcrpy,kevin1024/vcrpy,graingert/vcrpy,graingert/vcrpy | tests/integration/test_proxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test the DigitalOcean backed ACME DNS Authentication Class.\"\"\"\n\nfrom acmednsauth.authenticate import Authenticate\nfrom mock import call\nimport pytest\n\n\n@pytest.fixture()\ndef create_environment(api_key, domain, fqdn, auth_to... | python | edit | 1 | 1 | apache-2.0 | e9ad33a12dcb3f678c2aa7a8bcc0339dcb88bd5b | Jitsusama/lets-do-dns | tests/unit/test_authenticate.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.