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\"\"\"\nCopyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm\n\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 a... | python | edit | 3 | 2 | apache-2.0 | 71fef8b9696d79f7d6fd024320bc23ce1b7425f3 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/preferences/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Author: Taylor Smith <<EMAIL>>\n#\n# The SMRT module\n\nimport sys\nimport os\n\n__version__ = '0.1'\n\ntry:\n # this var is injected in the setup build to enable\n # the retrieval of the version number w... | python | edit | 7 | 0 | bsd-3-clause | c058bd887348340c91ae3633d341031569114131 | tgsmith61591/smrt,tgsmith61591/smrt | smrt/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nfrom kafka_info import __version__\n\n\nsetup(\n name=\"kafka_info\",\n version=__version__,\n author=\"Federico Giraud\",\n author_email=\"<EMAIL>\",\n description=\"Shows kafka cluster inform... | python | edit | 1 | 0 | apache-2.0 | 31bff8f5bbb7e7005a2de4f6f9ef8dad2e6663e5 | Yelp/kafka-utils,anthonysandrin/kafka-utils,Yelp/kafka-utils,anthonysandrin/kafka-utils | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\"Script to auto-generate our API docs.\n\"\"\"\n# stdlib imports\nimport os\n\n# local imports\nfrom apigen import ApiDocWriter\n\n#*****************************************************************************\ni... | python | edit | 2 | 0 | bsd-3-clause | 77ef9f4a7ccd51d7b070da31ff4c30768653bb7b | blakedewey/nipype,gerddie/nipype,FCP-INDI/nipype,rameshvs/nipype,blakedewey/nipype,satra/NiPypeold,FCP-INDI/nipype,FredLoney/nipype,arokem/nipype,dmordom/nipype,pearsonlab/nipype,pearsonlab/nipype,Leoniela/nipype,glatard/nipype,mick-d/nipype_source,mick-d/nipype,dmordom/nipype,arokem/nipype,carlohamalainen/nipype,mick-... | tools/build_modref_templates.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nfrom django_services import admin\nfrom ..models import Maintenance\nfrom ..service.maintenance import MaintenanceService\n\n\n\nclass MaintenanceAdmin(admin... | python | edit | 1 | 2 | bsd-3-clause | a06010fcb2f4424d085da1487a6666867a8cbf5b | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/maintenance/admin/maintenance.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nfrom mycroft.messagebus.message import Message\n\n\nclass AudioService():\n def __init__(self, emitter):\n self.emitter = emitter\n self.emitter.on('MycroftAudioServiceTrackInfoReply', self._track_info)\n ... | python | edit | 2 | 3 | apache-2.0 | 5c874677cc978e1cdd563a563d62bae162d3b7ac | aatchison/mycroft-core,MycroftAI/mycroft-core,MycroftAI/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,Dark5ide/mycroft-core,forslund/mycroft-core | mycroft/skills/audioservice.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a workaround for the AppConfig autodiscovery crashes with Django 3.2"
},
{
"role": "assistant",
"content": "def __getattr__(key):\n # Work around Django 3.2's autoloading of *.apps modules (AppConfig\n # autodiscovery)\... | python | new_file | 1 | 2 | bsd-3-clause | 5cd3b53f677fd6ab6e77bee5b7d42cf2ac85e47f | mjl/feincms,feincms/feincms,mjl/feincms,feincms/feincms,feincms/feincms,mjl/feincms | feincms/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport rethinkdb as r\n\nclass Commander:\n\n def process_message(self, message):\n return \"I got your message\"\n\n```\n\nApply this change: Add parsing for adding message"
},
{
"role": "assistant",
"content": "impor... | python | edit | 3 | 3 | mit | 65e4aba86730525a75e915fe61eb15b681817cc3 | henryfjordan/incident-commander | app/commander.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.conf import settings\n\n# Uncomment the next two lines to enable the admin:\nfrom django.contrib import admin\n\n\nfrom members import views\nadmin.autodiscover()\n\n\nurlpatt... | python | edit | 1 | 0 | mit | 8c01d9c3b7d1938e78a52a86dfb4d8536987c223 | Hackfmi/Diaphanum,Hackfmi/Diaphanum | hackfmi/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n@author: Ferdinand E. Silva\n@email: <EMAIL>\n@website: http://ferdinandsilva.com\n\"\"\"\nimport os\nfrom django.utils import simplejson as json\n\n\nclass qqFileUploader(object):\n\n def __init__(self, allowedExtensions=None, s... | python | edit | 1 | 4 | mit | 2af5eff46cbae0927aeee135c22304e108519659 | SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,FineUploader/fine-uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,SimonWaldherr/uploader,FineUploader/fine-uploader | server/python_django/file_uploader/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom astropy.table import Table\nfrom astropy.coordinates import ICRS, name_resolve\nfrom astropy import units as u\n\nTABLE_NAME = 'feder_object_list.csv'\nMAX_SEP = 5 # arcsec\n\n\ndef test_table_can_be_read_and_coords_good():\n objs ... | python | edit | 1 | 5 | bsd-2-clause | a220a62e4444e75974ad28915e7216a276f60c9c | mwcraig/feder-object-list | test_valid_object_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom machine import Pin\nfrom ds18x20 import DS18X20\nimport onewire\nimport time\nimport machine\nimport ujson\nimport urequests\n\ndef posttocloud(temperature):\n keystext = open(\"sparkfun_keys.json\").read()\n keys = ujson.loads(keyst... | python | edit | 1 | 2 | mit | 5761364149b3171521cb4f72f591dc5f5cbd77d6 | fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout | temp-sensor02/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nBOOK_PRICE = 8\n\n\ndef _group_price(size):\n discounts = [0, .05, .1, .2, .25]\n if not (0 < size <= 5):\n raise ValueError('size must be in 1..' + len(discounts))\n return 8 * size * (1 - discounts[size - 1])\n\n\ndef calc... | python | edit | 1 | 4 | mit | 926ddeb63f0366a59f14adbab5421ccb7f78f144 | N-Parsons/exercism-python,pheanex/xpython,jmluy/xpython,behrtam/xpython,exercism/xpython,smalley/python,exercism/xpython,exercism/python,N-Parsons/exercism-python,smalley/python,pheanex/xpython,jmluy/xpython,exercism/python,behrtam/xpython | exercises/book-store/example.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nversion='0.9.7'\n\nimport os\nsvn_version_file = os.path.join(os.path.dirname(__file__),\n 'core','__svn_version__.py')\nif os.path.isfile(svn_version_file):\n import imp\n svn = imp.load_module('numpy.c... | python | edit | 1 | 0 | bsd-3-clause | 2bbc289ce21365e18b04cb865328c494b75075fd | Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,efiring/numpy-work,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,chadnetzer/numpy... | numpy/version.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Tablib - DataFrame Support.\n\"\"\"\n\n\nimport sys\n\n\nif sys.version_info[0] > 2:\n from io import BytesIO\nelse:\n from cStringIO import StringIO as BytesIO\n\nfrom pandas import DataFrame\n\nimport tablib\n\nfrom tablib.co... | python | edit | 5 | 3 | mit | 7f1db4023f2310529822d721379b1019aaf320fc | kennethreitz/tablib | tablib/formats/_df.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.decorators import login_required\nfrom django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render\n\nfrom ... | python | edit | 1 | 3 | mit | 1118541b1cdea7f6079bb63d000ba54f69dfa119 | trimailov/finance,trimailov/finance,trimailov/finance | books/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport os\nimport sqlite3\nimport sys\nimport time\n\nif len(sys.argv) < 3:\n raise ValueError('Usage: %s \"Firstnam Lastname\" email@example.com' % sys.argv[0])\n\ndb = sqlite3.connect('/var/lib/zon-api/data.db')\na... | python | edit | 2 | 0 | bsd-3-clause | 1e01e66f23f7a2ca541a29d29658749f95352c41 | ZeitOnline/content-api,ZeitOnline/content-api | generate-key.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-11-01 09:03\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('spec... | python | edit | 1 | 0 | mit | 3b5c26db02a3b895af8c6da9ef9e5b79274a6857 | philgyford/django-spectator,philgyford/django-spectator,philgyford/django-spectator | spectator/core/migrations/0003_set_creator_slug.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python3\n\nimport argparse\n\nif __name__ == '__main__':\n\n # Boilerplate to allow running as script directly. Avoids error below:\n # SystemError: Parent module '' not loaded, cannot perform relative import\n # See htt... | python | edit | 1 | 0 | mit | 1443d24ad1548497b76eb9d90b5f79627cf81b0c | ronjouch/whoarder,rejuvyesh/whoarder,rejuvyesh/whoarder,ronjouch/whoarder | whoarder/whoarder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom .models import Release, Track, Comment\n\n\nclass CommentSerializer(serializers.ModelSerializer):\n class Meta:\n model = Comment\n fields = ('id', 'comment')\n\nclass TrackSeria... | python | edit | 1 | 0 | mit | 605443886582d13c2b45b19fad86854bf4e8ddbd | ThreeDRadio/playlists,ThreeDRadio/playlists,ThreeDRadio/playlists | backend/catalogue/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom djet.testcases import ViewTestCase\n\nfrom pgallery.views import TaggedPhotoListView\n\n\nclass TaggedPhotoListViewTestCase(ViewTestCase):\n view_class = TaggedPhotoListView\n\n def test... | python | edit | 1 | 1 | mit | f620dde75d65e1175829b524eec00d54e20bb2be | zsiciarz/django-pgallery,zsiciarz/django-pgallery | tests/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport os\nimport simplejson as json\n\nf = open(\"bootconf.json\", \"r\")\nvals_dict = json.load(f)\nf.close()\n\nos.putenv('DEBIAN_FRONTEND', 'noninteractive')\nos.putenv('TERM', 'dumb')\n\npassword=va... | python | edit | 4 | 0 | apache-2.0 | d88a6afddcc9ac90b1fb2327d4df4ece29f1c031 | buzztroll/cloudinit.d,nimbusproject/cloudinit.d,buzztroll/cloudinit.d,nimbusproject/cloudinit.d | docs/plans/wordpress/mysql_boot.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom .base import Base\n\n\nclass Source(Base):\n\n def __init__(self, vim):\n super().__init__(vim)\n\n self.name = 'vimtex_toc'\n self.kind = 'file'\n\n @staticmethod\n def format_n... | python | edit | 3 | 8 | mit | bd59db76bb81218d04224e44773eae9d3d9dfc21 | lervag/vimtex,Aster89/vimtex,Aster89/vimtex,kmarius/vimtex,lervag/vimtex,kmarius/vimtex | rplugin/python3/denite/source/toc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport rml.lattice\n\ndef test_create_lattice():\n l = rml.lattice.Lattice()\n assert(len(l)) == 0\n\ndef test_non_negative_lattice():\n l = rml.lattice.Lattice()\n assert(len(l)) >= 0\n\n```\n\nApply this change: Test simple la... | python | edit | null | null | apache-2.0 | 27a0165d45f52114ebb65d59cf8e4f84f3232881 | willrogers/pml,willrogers/pml,razvanvasile/RML | tests/test_lattice.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom setuptools import setup\n\nPACKAGE_VERSION = '0.3'\n\n\ndef version():\n if os.getenv('TRAVIS'):\n return os.getenv('TRAVIS_BUILD_NUMBER')\n else:\n import odintools\n\n return odintools.version(... | python | edit | 1 | 2 | apache-2.0 | 787ee9390fbf2ace59d2f8544b735feb6c895dda | odin-public/osaAPI | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add models to Admin Panel"
},
{
"role": "assistant",
"content": "from django.contrib import admin\nfrom game.models import *\n\nclass LocationAdmin(admin.ModelAdmin):\n model = Location\n\nadmin.site.register(Location, Locatio... | python | new_file | 6 | 0 | mit | 16bd36fe6fdcbd267413eabe1997337165775f28 | Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja | taOonja/game/admin.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom datetime import timedelta\nfrom twisted.internet.task import LoopingCall\n\nfrom moksha.hub.hub import MokshaHub\n\nlog = logging.getLogger('moksha.hub')\n\nclass DataStream(object):\n \"\"\" The parent DataStream ... | python | edit | 4 | 2 | apache-2.0 | d611341f95bc95fa3c3e42d7e830be1c2baea9b1 | ralphbean/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha | moksha/api/streams/datastream.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\nfrom enum import IntEnum\n\nimport yaml\n\nMemberFlag = IntEnum('MemberFlag', [\n 'digest',\n 'digest2',\n 'modPost',\n 'preapprove',\n 'noPost',\n 'diagnostic',\n 'moderator',\n ... | python | edit | 2 | 5 | mit | a50aeb81a588f8297f194d793cb8f8cf0e15a411 | ilg/LambdaMLM | lambda/list_member.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = '1.0.0.dev2'\n__author__ = 'D-Wave Systems Inc.'\n__authoremail__ = '<EMAIL>'\n__description__ = 'A shared API for binary quadratic model samplers.'\n\n```\n\nApply this change: Update verion 1.0.0.dev2 -> 1.0.0.dev3"
},
{... | python | edit | 1 | 0 | apache-2.0 | 73fb23af2db047c8012382c03abbf48f392f63b9 | oneklc/dimod,oneklc/dimod | dimod/package_info.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom dwitter.models import Dweet, Comment\nfrom django.contrib.auth.models import User\n\nclass UserSerializer(serializers.ModelSerializer):\n class Meta:\n model = User\n fields = ('pk', 'user... | python | edit | 1 | 1 | apache-2.0 | f5477c30cb9fdbbb250800d379458e641ef97fd4 | lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter | dwitter/serializers.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\n\"\"\"ActiveMaster definition.\"\"\"\n\nfrom config_bootstrap import Mast... | python | edit | 1 | 0 | bsd-3-clause | fd90fc7ce0c8a8070966e4a8273c69b8c13955d3 | eunchong/build,eunchong/build,eunchong/build,eunchong/build | masters/master.tryserver.webrtc/master_site_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Test for go.base.decorators.\"\"\"\n\nfrom go.vumitools.tests.helpers import djangotest_imports\n\nwith djangotest_imports(globals()):\n from go.base.tests.helpers import GoDjangoTestCase\n from go.base.decorators import render_... | python | edit | 1 | 2 | bsd-3-clause | 7e71e21734abb2b12e309ea37910c90f7b837651 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/base/tests/test_decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport sys\nimport os\n\nsys.path.insert(0, os.path.dirname(os.path.abspath('.')))\nimport youtube_dl_server as ydl_server\n\n# -- General configurat... | python | edit | 1 | 0 | unlicense | 4c9e18f39908e9b1a36989b3e4097ca458d94af4 | jaimeMF/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,jaimeMF/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,jaimeMF/youtube-dl-api-server | docs/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, sys\n\nsys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))\nimport glob\nimport fnmatch\nimport traceback\nimport logging\n\nimport numpy\nimport pytest\n\nimport lasio\n\ntest_dir = os.path.dirname(__file__)\n\negfn =... | python | edit | 8 | 1 | mit | 675c05bd685d550e3c46137f2f52dcdb125cefa0 | kwinkunks/lasio,kinverarity1/lasio,kinverarity1/las-reader | tests/test_speed.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Red Hat Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apach... | python | edit | 1 | 0 | apache-2.0 | 7b3267b2bae436e0580e2a229a64bd8d6a04bc1f | openstack/manila-ui,openstack/manila-ui,openstack/manila-ui | manila_ui/local/local_settings.d/_90_manila_shares.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pandas as pd\n\n\ndef _params_dict_to_dataframe(d):\n s = pd.Series(d)\n s.index.name = 'parameters'\n f = pd.DataFrame({'values': s})\n return f\n\n\ndef write_excel(filename, **kwargs):\n \"\"\"Write data tables to a... | python | edit | 1 | 4 | bsd-3-clause | b955c4bed4024681f41076977605111abe4577e4 | jni/skan | skan/io.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport rexviewer as r\nimport naali\nimport urllib2\n\nfrom componenthandler import DynamiccomponentHandler\n\nclass JavascriptHandler(DynamiccomponentHandler):\n GUINAME = \"Javascript Handler\"\n\n def __init__(self):\n... | python | edit | 5 | 5 | apache-2.0 | 798bd79ddc2e9b212a82a7a8455428b3d32cfab4 | BogusCurry/tundra,antont/tundra,pharos3d/tundra,antont/tundra,AlphaStaxLLC/tundra,jesterKing/naali,pharos3d/tundra,antont/tundra,pharos3d/tundra,BogusCurry/tundra,BogusCurry/tundra,antont/tundra,realXtend/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,jesterKing/naali,BogusCurry/tundra,pharos3d/tundra,antont/tundra,pharo... | bin/pymodules/apitest/jscomponent.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom boost.python import streambuf\nfrom dxtbx import read_uint16\nf = open('/Users/graeme/data/demo/insulin_1_001.img', 'rb')\nhdr = f.read(512)\nl = read_uint16(streambuf(f), 2304 * 2304)\nprint sum(l)\n\n```\n\nApply this change: Clean u... | python | edit | 2 | 0 | bsd-3-clause | 7615bfa2a58db373c3e102e7d0205f265d9c4d57 | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | dxtbx/tst_dxtbx.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport os.path\nimport configparser\nimport shutil\nimport subprocess\n\n# Setup\nprint(\"Setting up...\")\nif os.path.isfile(\"../halite.ini\"):\n shutil.copyfile(\"../halite.ini\", \"temp.ini\")\n\nshutil.copyfile(\"tests.in... | python | edit | 1 | 0 | mit | dc1cedc1720886dcc3c3bd3da02c7aff58e5eb90 | HaliteChallenge/Halite,lanyudhy/Halite-II,HaliteChallenge/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite-II,yangle/HaliteIO,yangle/HaliteIO,HaliteChallenge/Halite,lanyudhy/Halite-II,lanyudhy/Halite... | tests/runTests.py | rejected_duplicate | Near-duplicate of sample 2377 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom .. import idiokit, dns\n\nDEFAULT_XMPP_PORT = 5222\n\n\n@idiokit.stream\ndef _add_port_and_count(port):\n count = 0\n\n while True:\n try:\n family, ip = yield idiokit.n... | python | edit | 1 | 8 | mit | 463fa89c143cd4493ea3704f177c5aba0ebb2af7 | abusesa/idiokit | idiokit/xmpp/_resolve.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.core.management.base import BaseCommand\n\nfrom oscar.apps.customer.alerts import utils\n\nlogger = logging.getLogger(__name__)\n\n\nclass Command(BaseCo... | python | edit | 1 | 1 | bsd-3-clause | d9cdde787439d022e8c0504666cd4809a8243fe6 | ka7eh/django-oscar,pdonadeo/django-oscar,itbabu/django-oscar,anentropic/django-oscar,sasha0/django-oscar,michaelkuty/django-oscar,amirrpp/django-oscar,amirrpp/django-oscar,Idematica/django-oscar,jinnykoo/wuyisj,okfish/django-oscar,bschuon/django-oscar,MatthewWilkes/django-oscar,DrOctogon/unwash_ecom,manevant/django-osc... | oscar/management/commands/oscar_send_alerts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom genes.process.commands import run\nfrom genes.posix.traits import only_posix\n\n@only_posix()\ndef chgrp(path, group):\n run(['chgrp', group, path])\n\n\n@only_posix()\ndef chown(path, user):\n run(['chown'... | python | edit | 4 | 2 | mit | 23e1868aa9d0c0a6611914b0f648c46d329e00db | hatchery/genepool,hatchery/Genepool2 | genes/gnu_coreutils/commands.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\nimport textwrap\nimport binascii\nfrom veryprettytable import VeryPrettyTable\nfrom plugins import BasePlugin\n\n__author__ = 'peter'\n\n\nclass DecodeHexPlugin(BasePlugin):\n short_description = 'Decode hex string to enco... | python | edit | 4 | 3 | mit | 81b7089633b9d43b05566a1e23f93fb59678fe1e | Sakartu/stringinfo | plugins/unicode_plugin.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Any\n\nfrom ..assertions_is.booleans import __IsBool\nfrom ..assertions_is.collections import __IsCollections\nfrom ..assertions_is.dicts import __IsDicts\nfrom ..assertions_is.emptiness import __IsEmptiness\nfrom ..asser... | python | edit | 3 | 0 | mit | 50fa164c4b09845bfa262c2f6959a3c5dfd6f76b | csparpa/check | fluentcheck/classes/is_cls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nWSGI config for cellcounter project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-level variable\nnamed ``application``. Django's ``... | python | edit | 1 | 1 | mit | 887597d31dec7fe1f49402e44691c1e745d22968 | cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,oghm2/hackdayoxford,oghm2/hackdayoxford,haematologic/cellcounter,haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter | cellcounter/wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport re\n\nimport requests\nimport xmltodict\n\nfrom settings import goodreads_api_key\n\n\ndef get_goodreads_ids(comment_msg):\n # receives goodreads url\n # returns the id using regex\n regex = r'goodre... | python | edit | 1 | 5 | mit | 4c2dd9dd6dc0f9ff66a36a114c90897dab8da7e5 | avinassh/Reddit-GoodReads-Bot | goodreadsapi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport glob\nimport os.path\n\nimport pytest\n\nfrom scss import Scss\n\nHERE = os.path.join(os.path.split(__file__)[0], 'files')\n\n@pytest.mark.parametrize(\n ('scss_fn', 'css_fn'), [\n ... | python | edit | 1 | 1 | mit | 8f80099062a03fcf6be783f3e5260882f704ec22 | cpfair/pyScss,cpfair/pyScss,Kronuz/pyScss,hashamali/pyScss,hashamali/pyScss,Kronuz/pyScss,Kronuz/pyScss,hashamali/pyScss,Kronuz/pyScss,cpfair/pyScss | scss/tests/test_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\nfrom time import sleep\n\nclass APIQuerier:\n\n def __in... | python | edit | 1 | 4 | bsd-3-clause | 5d67def658f0b1bd206fdefe100d32269f1eb34e | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/api/uri/api_querier.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport re\nfrom xml.parsers.expat import ExpatError\n\nimport requests\nimport xmltodict\n\nfrom settings import goodreads_api_key\n\n\ndef get_goodreads_ids(comment_msg):\n # receives goodreads url\n # return... | python | edit | 1 | 5 | mit | 525bfce19f593cb598669cdf2eec46747a4b6952 | avinassh/Reddit-GoodReads-Bot | goodreadsapi.py | rejected_duplicate | Near-duplicate of sample 3710 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom enum import Enum, EnumMeta\nfrom functools import total_ordering\n\n\n\n\nclass _MultiValueMeta(EnumMeta):\n def __init__(self, cls, bases, classdict):\n # make sure we only have tuple values, not single values\n for m... | python | edit | 2 | 3 | mit | e8f2f1c9db328dd8116a44d9d934ecef3bc7fb5e | kissgyorgy/enum34-custom | enum34_custom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# WINC Firmware Update Script.\n#\n# This script updates the ATWINC1500 WiFi module firmware.\n# Copy the firmware image to uSD card before running this script.\n# NOTE: Firmware version 19.5.2 does NOT support ATWINC1500-MR210PA.\n\nimport... | python | edit | 1 | 0 | mit | 288127c575c7672e3a41d7ada360d56a4853f279 | openmv/openmv,openmv/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv | scripts/examples/14-WiFi-Shield/fw_update.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass BounceConfig(AppConfig):\n name = 'froide.bounce'\n verbose_name = _('Bounce')\n\n def ready(self):\n from ... | python | edit | 1 | 4 | mit | ad477285f4458145bca378b74dcb8cfe3abeaf06 | stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide | froide/bounce/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport transaction\n\nfrom sqlalchemy import engine_from_config\n\nfrom pyramid.paster import (\n get_appsettings,\n setup_logging,\n )\n\nfrom pyramid.scripts.common import parse_vars\n\nfrom ..models import... | python | edit | 1 | 2 | mit | 4160fd07d428e26c4de6aee280d948f5044f2c9e | matslindh/kimochi,matslindh/kimochi | kimochi/scripts/initializedb.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix py3 'relative' import error."
},
{
"role": "assistant",
"content": "from dooblr.transformers.influxdbclient import InfluxDBClient, InfluxDBClientError, DooblrInfluxDBError\n\n__all__ = [\"InfluxDBClient\", \"InfluxDBClientErr... | python | new_file | 1 | 0 | isc | b32900269b3f8c701702e74734ffe248c521fa73 | makerslocal/dooblr | dooblr/transformers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport sys\n\nfrom tests.utils import requires_python_version\n\n\nclass TestTreeTrace(unittest.TestCase):\n maxDiff = None\n\n @requires_python_version(3.5)\n def test_async_forbidden(self):\n def check(b... | python | edit | 3 | 2 | mit | 53ba55615fbd02e83212aecaa0c37d1887adfc73 | alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye | tests/test_tracer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Exhibition(models.Model):\n\ttitle = models.CharField( \"Название\", max_length=1024 )\n\tbegin = models.DateField( \"Дата начала\" )\n\tend = models.DateField( \"Дата окончания\" )\n\tshowroom = mode... | python | edit | 1 | 3 | mit | 80ff7429d3a68f99e66cd4cfae9478b3f34e435c | hombit/olgart,hombit/olgart,hombit/olgart,hombit/olgart | exhibitions/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport base32_crockford\nimport logging\n\nfrom django.db.models import F\nfrom django.http import Http404\nfrom django.http import HttpResponsePermanentRedirect\nfrom django.shortcuts import get_o... | python | edit | 1 | 3 | bsd-3-clause | 739a5a85a455105f01013b20762b1b493c4d5027 | jbittel/django-deflect | deflect/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport gitdir.host\n\nclass LocalHost(gitdir.host.Host):\n def __iter__(self):\n for repo_dir in sorted(self.dir.iterdir()):\n if repo_dir.is_dir():\n yield self.repo(repo_dir.name)\n\n def __repr__(se... | python | edit | 1 | 3 | mit | 21f08d30bf23056ea3e4fc9804715a57a8978c02 | fenhl/gitdir | gitdir/host/localhost.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom sphinx.ext.intersphinx import fetch_inventory\n\nURL = \"https://docs.python.org/{}/objects.inv\"\nPATH = \"isort/stdlibs/py{}.py\"\nVERSIONS = [(\"2\", \"7\"), (\"3\", \"5\"), (\"3\", \"6\"), (\"3\", \"7\"), ... | python | edit | 1 | 0 | mit | c8a0279d421c2837e4f7e4ef1eaf2cc9cb94210c | PyCQA/isort,PyCQA/isort | scripts/mkstdlibs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django_website.settings.www import *\n\nPREPEND_WWW = False\nAPPEND_SLASH = True\nTEMPLATE_CONTEXT_PROCESSORS += [\"django.core.context_processors.request\"]\nROOT_URLCONF = 'django_website.urls.docs'\nCACHE_MIDDLEWARE_KEY_PREFIX = 'dj... | python | edit | 6 | 0 | bsd-3-clause | 821f1ef9f7eae6d146248b5a212812fee4996cfd | khkaminska/djangoproject.com,relekang/djangoproject.com,rmoorman/djangoproject.com,rmoorman/djangoproject.com,khkaminska/djangoproject.com,hassanabidpk/djangoproject.com,alawnchen/djangoproject.com,khkaminska/djangoproject.com,relekang/djangoproject.com,nanuxbe/django,xavierdutreilh/djangoproject.com,vxvinh1511/djangop... | django_website/settings/docs.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Routes configuration\n\nThe more specific and detailed routes should be defined first so they\nmay take precedent over the more generic routes. For more information\nrefer to the routes manual at http://routes.groovie.org/docs/\n\"\"\... | python | edit | 1 | 1 | bsd-3-clause | 92aa388d1b58c0e88979d299cc8deabab811f926 | obeattie/pylons,obeattie/pylons | tests/test_webapps/filestotest/rest_routing.py | rejected_duplicate | Near-duplicate of sample 3201 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport coloredlogs\nimport logging.handlers\n\nfrom argparse import ArgumentParser\n\n\ndef get_args():\n\n parser = ArgumentParser()\n\n parser.add_argument(\n \"-H\", \"--host\",\n dest=\"host\",\n help=\"hostna... | python | edit | 1 | 2 | mit | 1a4e634c001e1734ae0a2a881624ab10073865cd | igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool | virtool/app_init.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom go.vumitools.conversation.definition import (\n ConversationDefinitionBase, ConversationAction)\n\n\nclass SendDialogueAction(ConversationAction):\n action_name = 'send_dialogue'\n action_display_name = 'Send Dialogue'\n\n ... | python | edit | 1 | 2 | bsd-3-clause | 2a8a50528a36525f37ea26dbccefd153d4cdcc8c | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/apps/dialogue/definition.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis hook is necessary for compatibility with Python2.7 versions of GDB\nsince they cannot directly cast to integer a gdb.Value object that is\nnot already an integer type.\n\"\"\"\nfr... | python | edit | 1 | 3 | mit | d0ec3ee9b974fb6956c32e8dfdd6d20ea4da7cff | pwndbg/pwndbg,cebrusfs/217gdb,cebrusfs/217gdb,pwndbg/pwndbg,cebrusfs/217gdb,chubbymaggie/pwndbg,disconnect3d/pwndbg,disconnect3d/pwndbg,pwndbg/pwndbg,0xddaa/pwndbg,zachriggle/pwndbg,0xddaa/pwndbg,disconnect3d/pwndbg,anthraxx/pwndbg,chubbymaggie/pwndbg,0xddaa/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,zachriggle/pwndbg,anth... | pwndbg/inthook.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 Hortonworks, 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://ww... | python | edit | 1 | 1 | apache-2.0 | caa4dcdcf7e936f352eea22513433d8f8deca2ab | openstack/sahara,esikachev/sahara-backup,ekasitk/sahara,henaras/sahara,egafford/sahara,tellesnobrega/sahara,ekasitk/sahara,egafford/sahara,henaras/sahara,zhangjunli177/sahara,zhangjunli177/sahara,esikachev/sahara-backup,esikachev/sahara-backup,openstack/sahara,henaras/sahara,ekasitk/sahara,crobby/sahara,crobby/sahara,c... | sahara/tests/unit/utils/test_hashabledict.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.13 on 2018-07-05 17:57\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.apps import apps\nfrom django.db.models import F\n\nfrom django.db.... | python | edit | 4 | 1 | apache-2.0 | 510afd0c93c333e86511fb6f6b9e96a434d54d00 | dhcrzf/zulip,zulip/zulip,zulip/zulip,showell/zulip,dhcrzf/zulip,hackerkid/zulip,jackrzhang/zulip,eeshangarg/zulip,tommyip/zulip,brainwane/zulip,tommyip/zulip,synicalsyntax/zulip,tommyip/zulip,shubhamdhama/zulip,rht/zulip,dhcrzf/zulip,timabbott/zulip,shubhamdhama/zulip,rht/zulip,brainwane/zulip,hackerkid/zulip,synicalsy... | zerver/migrations/0174_userprofile_delivery_email.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.test import TestCase\nfrom django.db import models\nfrom biopsy.models import Biopsy\n\nclass BiopsyTest(TestCase):\n\n\tdef biopy_test(self):\n\t\tbiopsy = Biopsy(\n\t\t\tclinical_information= \"clinica... | python | edit | 3 | 1 | mit | 286cba2b3e7cf323835acd07f1e3bb510d74bcb2 | msfernandes/anato-hub,msfernandes/anato-hub,msfernandes/anato-hub,msfernandes/anato-hub | biopsy/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pyb\n\nfrom mid.midiin import MidiIn\n\n\ndef midi_printer(msg):\n print(tuple(msg))\n\ndef loop(midiin):\n while True:\n midiin.poll()\n pyb.udelay(500)\n\nuart = py.UART(2, 31250)\nmidiin = MidiIn(uart, callback... | python | edit | 1 | 2 | mit | 3b47c9ec6950819b99588dcb29978d5cb8761cad | SpotlightKid/micropython-stm-lib | midi/examples/printmidiin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\n\nfrom .views import PostListView, PostDetailView\n\nurlpatterns = patterns('',\n url(r'(?P<pk>\\d+)/$', PostDetailView.as_view(), name='detail'),\n url(r'$', PostListView.as_view(), name='l... | python | edit | 1 | 0 | mit | b223107cbed5ea4c01b98c8e6abcebd1e380d04d | jazzband/django-embed-video,mpachas/django-embed-video,yetty/django-embed-video,mpachas/django-embed-video,jazzband/django-embed-video,yetty/django-embed-video | example_project/posts/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.db.models import Count\n\n\ndef delete_empty(apps, schema_editor):\n # We get the model from the versioned app regi... | python | edit | 3 | 2 | mit | 39da25f8d221605012c629b3d08478cfe858df36 | watchdogpolska/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl | poradnia/cases/migrations/0024_auto_20150809_2148.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Lises team\n@contact: <EMAIL>\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\n\n__author__ = 'Lises team'\n__version__ = '0.1'\n__email__ = '<EMAIL>'\n\n\nclass Sheldon():\n pass\n\n\... | python | edit | 8 | 1 | mit | a88f0ab8be669f573f2869617717653bb008e11b | lises/sheldon | sheldon/bot.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\nfrom __future__ import absolute_import\nimport unittest\n\nfrom . import unittest_neos\nfrom . import unittest_sedumi_writer\n\n\ndef main():\n \"\"\" The main function.\n \"\"\"\n loader = unittest.TestLoad... | python | edit | 2 | 1 | mit | 9a74f11d4adfafbddec2e86251ecef17c4196bf2 | TrishGillett/pysdpt3glue,discardthree/PySDPT3glue,TrishGillett/pysdpt3glue,discardthree/PySDPT3glue,TrishGillett/pysdpt3glue | tests/test_suite.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functions import print_message\nfrom osbrain.core import Proxy\n\n\npusher = Proxy('Pusher')\npuller = Proxy('Puller')\n\naddr = pusher.bind('push')\npuller.connect(addr, print_message)\n\npuller.run()\npusher.send(addr, 'Hello world!'... | python | edit | 1 | 0 | apache-2.0 | 46d64030c8724f016233703922cbc619eef2c179 | opensistemas-hub/osbrain | examples/push_pull/architect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport unittest\nfrom gtts.tokenizer.pre_processors import tone_marks, end_of_line, abbreviations, word_sub\n\n\nclass TestPreProcessors(unittest.TestCase):\n def test_tone_marks(self):\n _in = \"lorem!ips... | python | edit | 1 | 1 | mit | 171bbf488db643d01d6a58c9376ba85c200711d5 | pndurette/gTTS | gtts/tokenizer/tests/test_pre_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCreated on 1 févr. 2014\n\n@author: inso\n\"\"\"\nimport signal\nimport sys\nimport asyncio\n\nfrom quamash import QEventLoop\nfrom PyQt5.QtWidgets import QApplication\nfrom cutecoin.gui.mainwindow import MainWindow\nfrom cutecoin.c... | python | edit | 1 | 6 | mit | 40c15fb4300dfe729461e0bc09066f8176830188 | ucoin-io/cutecoin,ucoin-io/cutecoin,ucoin-io/cutecoin | src/cutecoin/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.cache import cache\n\n\nclass CachedModelMixin(object):\n \"\"\"\n Mixin to add cache expiration to a model.\n \"\"\"\n clear_cache_on_add = False\n\n def save(self, *args, **kwargs):\n is_new = not se... | python | edit | 1 | 4 | apache-2.0 | 6bd59ef149ec32f7d0a64ea2ad50a2729aceb6f5 | edoburu/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents | fluent_contents/models/mixins.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom buffs import *\n\n\nclass StatusEffectTests(unittest.TestCase):\n \"\"\"\n StatusEffect is the base class for buffs\n \"\"\"\n def test_init(self):\n test_name = 'testman'\n test_duration = ... | python | edit | 7 | 1 | mit | 91acec032abeb942bf90d6522a4d9d38ad624d46 | Enether/python_wow | tests/test_buffs.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\nimport setuptools\n\nversion = '3.3.0'\n\nsetuptools.setup(\n name=\"alerta-mailer\",\n version=version,\n description='Send emails from Alerta',\n url='https://github.com/alerta/alerta-contrib',\n li... | python | edit | 1 | 0 | mit | af3dd1da24754e32c8a75165ab90d5178e68a548 | msupino/alerta-contrib,msupino/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib | integrations/mailer/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport logging\n\nfrom .preflight import preflight_check\nfrom .notifier import notify\n\ndef configure_logging():\n logging.basicConfig(stream=sys.stdout, level=logging.INFO)\n logging.captureWarnings(True)\n\ndef main():... | python | edit | 2 | 5 | mit | c90fd7d026cdeeff7d073c1d15ff550cc937f961 | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/daemon.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nCreated on 24.04.2016\n\n@author: killian\n'''\nfrom objects import dddobject,DataObject\nfrom conversions import DddConversion\n\n\n@dddobject('datatype')\nclass DddDatatype(DataObject):\n def __init__(self,basetype='',conversion=N... | python | edit | 1 | 2 | mit | a8ec60daaee52603a1c3bab879a5eee9f0fd931b | toesus/ddd,Sauci/ddd,toesus/ddd,Sauci/ddd,Sauci/ddd | ddd/dataobjects/datatype.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\nimport mimetypes\nimport re\nfrom django.core.urlresolvers import reverse\n\n\ndef order_name(name):\n \"\"\"order_name -- Limit a text to 20 chars length, if necessary strips the\n middle of the text and substitute... | python | edit | 1 | 2 | mit | a1e90125199a12beaa132c4d1eba4c09be3f9ba0 | semitki/canales,semitki/canales,semitki/canales | fileupload/serialize.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport sys\nfrom pprint import pprint\nfrom lxml import etree\nimport html2text\n\nfrom wp_parser import WordpressXMLParser\nfrom hugo_printer import HugoPrinter\n\n\ndef main():\n wp_xml_parser = WordpressXMLPa... | python | edit | 5 | 1 | mit | 838895500f8046b06718c184a4e8b12b42add516 | hzmangel/wp2hugo | wp2hugo.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom rest_framework.authtoken.views import obtain_auth_token\nfrom rest_framework.routers import DefaultRouter\nfrom . import views\n\nrouter = DefaultRouter()\nro... | python | edit | null | null | mit | 9c35a41c6594d0ac482a558abf4772150c2a67e9 | lsst-sqre/qa-dashboard,lsst-sqre/qa-dashboard,lsst-sqre/qa-dashboard | squash/dashboard/urls.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom conans import ConanFile, CMake\n\nclass GrpccbConan(ConanFile):\n name = \"grpc_cb_core\"\n version = \"0.2\"\n license = \"Apache-2.0\"\n url = \"https://github.com/jinq0123/grpc_cb_core\"\n description = \"C++ gRPC cor... | python | edit | 1 | 1 | apache-2.0 | 95d9bb3a9500d80b5064c5fb4d5bd7b30406d1ae | jinq0123/grpc_cb_core,jinq0123/grpc_cb_core,jinq0123/grpc_cb_core | conanfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport six\n\nfrom sentry.api.serializers import Serializer, register, serialize\nfrom sentry.models import AuditLogEntry\n\n\n@register(AuditLogEntry)\nclass AuditLogEntrySerializer(Serializer):\n ... | python | edit | 1 | 9 | bsd-3-clause | 90ef9d9a8c5b02d32868da1236ea063f6abd7cd0 | ifduyue/sentry,ifduyue/sentry,mvaled/sentry,mvaled/sentry,looker/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry,gencer/sentry,gencer/sentry,ifduyue/sentry,mvaled/sentry,gencer/sentry,mvaled/sentry,looker/sentry,beeftornado/sentry,beeftornado/sentry,ifduyue/sentry,looker/sentry,gencer/sentry,gencer/sentry,beeftornado... | src/sentry/api/serializers/models/auditlogentry.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import run, sudo\nfrom fabric.contrib.files import append\n\nfrom fab_deploy.base import setup as base_setup\n\n\nclass JoyentMixin(object):\n\n def _set_profile(self):\n append('/etc/profile', 'CC=\"gcc -m64\"; ex... | python | edit | 1 | 2 | mit | 62f9608d50898d0a82e013d54454ed1edb004cff | ff0000/red-fab-deploy2,ff0000/red-fab-deploy2,ff0000/red-fab-deploy2 | fab_deploy/joyent/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom osmviz.manager import PILImageManager, OSMManager\nimport PIL.Image as Image\n\n\ndef test_pil():\n imgr = PILImageManager(\"RGB\")\n osm = OSMManager(image_manager=imgr)\n image, bnds = osm.createOSMImage((30, 35, -117, -112)... | python | edit | 1 | 1 | mit | cbb90d03b83a495b1c46514a583538f2cfc0d29c | hugovk/osmviz,hugovk/osmviz | test/functional/test_manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nREDIS_PORT = os.getenv('DBAAS_NOTIFICATION_BROKER_PORT', '6379')\nBROKER_URL = os.getenv(\n 'DBAAS_NOTIFICATION_BROKER_URL', 'redis://localhost:%s/0' % REDIS_PORT)\nCELERYD_TASK_TIME_LIMIT = 10800\nCELERY_TRACK_STARTED = Tru... | python | edit | 1 | 0 | bsd-3-clause | 9cc4ce152ba8d683db1371a963dae2621f1b8fc6 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/dbaas/celeryconfig.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom armstrong.dev.tasks import *\nfrom d51.django.virtualenv.base import VirtualEnvironment\nfrom fabric.api import task\n\n\nsettings = {\n 'DEBUG': True,\n 'INSTALLED_APPS': (\n 'django.contrib.admin',\n 'django.contr... | python | edit | 4 | 0 | apache-2.0 | a427fab365ff3404748cdf8fb70b4ff542e81922 | texastribune/armstrong.core.tt_sections,texastribune/armstrong.core.tt_sections,texastribune/armstrong.core.tt_sections,armstrong/armstrong.core.arm_sections,armstrong/armstrong.core.arm_sections | fabfile.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" module SimPEG.EM.NSEM.Utils\n\nCollection of utilities that are usefull for the NSEM problem\n\nNOTE: These utilities are not well test, use with care\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom .MT1Dsolutions import ge... | python | edit | 28 | 0 | mit | ec9b1f0ebda55e3e02e597e10ac28d62286b922f | simpeg/simpeg | SimPEG/EM/NSEM/Utils/__init__.py | rejected_lint | Too many lint violations: 28 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom tournamentcontrol.competition.signals.custom import match_forfeit # noqa\nfrom tournamentcontrol.competition.signals.ladders import ( # noqa\n changed_points_formula,\n scale_ladder_entry,\n t... | python | edit | 1 | 10 | bsd-3-clause | 3a470c02a1a171f876200258897d6e277a1aab91 | goodtune/vitriolic,goodtune/vitriolic,goodtune/vitriolic,goodtune/vitriolic | tournamentcontrol/competition/signals/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# MIT Licensed, Copyright (c) 2016 Ryan Scott Brown <<EMAIL>>\n\nfrom dotenv import load_dotenv, get_key, set_key, unset_key\n\ndef load_envs(path):\n \"\"\"Recursively load .env files starting from `path`\n\n ... | python | edit | 5 | 2 | mit | c30181eed55cc1f2af6da4ee8608f4f2052ceb38 | serverless/serverless-helpers-py | serverless_helpers/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2019-03-20 18:55\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('ac... | python | edit | 1 | 0 | mit | c083481eed1578551daab7ece2e34b3ff4aece82 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0044_add_sitetree_sidenav_toggle.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\n\nimport json\nfrom os import path\nfrom indra.util.kappa_util import im_json_to_graph\n\ndef test_kappy_influence_json_to_graph():\n ... | python | edit | 4 | 1 | bsd-2-clause | 7a68eaf67ce57be832e37922c52f1b8bc73a5e69 | pvtodorov/indra,bgyori/indra,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,bgyori/indra,johnbachman/indra,johnbachman/belpy,pvtodorov/indra,johnbachman/indra,johnbachman/belpy,johnbachman/indra,sorgerlab/indra,bgyori/indra,sorgerlab/belpy | indra/tests/test_kappa_util.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Use pytest_(un)configure to setup cache_directory"
},
{
"role": "assistant",
"content": "import tempfile\nimport shutil\n\nimport jedi\n\n\ncollect_ignore = [\"setup.py\"]\n\n\n# The following hooks (pytest_configure, pytest_unco... | python | new_file | 1 | 1 | mit | ee03f3ae0d0501568cec87d8d4d7114441c19776 | jonashaag/jedi,jonashaag/jedi,flurischt/jedi,WoLpH/jedi,tjwei/jedi,mfussenegger/jedi,mfussenegger/jedi,tjwei/jedi,dwillmer/jedi,WoLpH/jedi,flurischt/jedi,dwillmer/jedi | conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ntry:\n __import__('pkg_resources').declare_namespace(__name__)\nexcept ImportError:\n from pkgutil import extend_path\n __path__ = extend_path(__path__, __name__)\n\n```\n\nApply this change: Change to vanilla namespace package"
... | python | edit | 1 | 0 | apache-2.0 | e4d746ba6c5b842529c9dafb31a90bdd31fee687 | alphagov/performanceplatform-collector,alphagov/performanceplatform-collector,alphagov/performanceplatform-collector | performanceplatform/__init__.py | rejected_duplicate | Near-duplicate of sample 216 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# test setting the thread stack size\n#\n# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd\n\nimport sys\nimport _thread\n\n# different implementations have different minimum sizes\nif sys.implementation == 'micropyt... | python | edit | 1 | 1 | mit | 5b7789d519be7251c58b68879f013d5f3bf0c950 | mhoffma/micropython,HenrikSolver/micropython,ryannathans/micropython,dmazzella/micropython,mhoffma/micropython,PappaPeppar/micropython,MrSurly/micropython,tuc-osg/micropython,oopy/micropython,oopy/micropython,SHA2017-badge/micropython-esp32,AriZuu/micropython,toolmacher/micropython,redbear/micropython,mhoffma/micropyth... | tests/thread/thread_stacksize1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add proper formatting of logs in app init"
},
{
"role": "assistant",
"content": "import logging\n\nlogging.basicConfig(\n format='%(asctime)s %(levelname)-8s %(message)s',\n level=logging.INFO,\n datefmt='%Y-%m-%d %H:%M:... | python | new_file | 1 | 0 | mit | 27ffe13842cfd346c568a51299b8f2349daf32c0 | futuresimple/triggear | app/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport json\n\nimport py\n\nfrom fields import Namespace\n\nfrom pytest_benchmark.plugin import BenchmarkSession\n\n\nclass MockSession(BenchmarkSession):\n def __init__(self):\n self.histogram = True\n me =... | python | edit | 1 | 3 | bsd-2-clause | f7a9074f7096b820b5342108560b90efce619405 | thedrow/pytest-benchmark,aldanor/pytest-benchmark,SectorLabs/pytest-benchmark,ionelmc/pytest-benchmark | tests/test_histogram.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.urls import path\n\nfrom . import views\n\napp_name = \"users\"\nurlpatterns = [\n path(\"\", view=views.UserListView.as_view(), name=\"list\"),\n path(\"~redirect/\", view=views.UserRedirectView.as_view(), name=\"redirect... | python | edit | 1 | 0 | bsd-3-clause | 5b5ad0e4fc97f540fdbda459adaa1ccc68cf6712 | topwebmaster/cookiecutter-django,trungdong/cookiecutter-django,mistalaba/cookiecutter-django,ad-m/cookiecutter-django,luzfcb/cookiecutter-django,ryankanno/cookiecutter-django,trungdong/cookiecutter-django,mistalaba/cookiecutter-django,Parbhat/cookiecutter-django-foundation,Parbhat/cookiecutter-django-foundation,mistala... | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.