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# -*- coding: utf-8 -*-\n\nfrom django.core.urlresolvers import reverse\nfrom django.views.generic import ListView, TemplateView, RedirectView\nfrom django.contrib import auth\n\nfrom bakery.cookies.models import Cookie\nfrom bakery.sociali... | python | edit | 1 | 1 | bsd-3-clause | 3412b0db76f77a4772cf76c7794fbe61b58f5a25 | muffins-on-dope/bakery,muffins-on-dope/bakery,muffins-on-dope/bakery | bakery/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef gcd(m, n):\n \"\"\"Greatest Common Divisor (GCD) by Euclid's Algorithm.\n\n Time complexity: O(m%n).\n \"\"\"\n while n != 0:\n m, n = n, m % n\n return m\n\n\ndef main():\n print(gcd(4, 2))\n print(gcd(2, 4)... | python | edit | 1 | 2 | bsd-2-clause | ce6a3a3833d498fa32a5317fd95e206cad9d5a83 | bowen0701/algorithms_data_structures | alg_gcd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright (c) 2001 actzero, inc. All rights reserved.\n\nimport sys\n\nsys.path.insert (1, '..')\n\nimport SOAP\n\nident = '$Id$'\n\nSoapEndpointURL\t\t= 'http://www.alanbushtrust.org.uk/soap/compositions.asp'\nMe... | python | edit | 2 | 0 | mit | fcd85a1b15ca8b82f892bba171c21f9a1b4f6e4a | acigna/pywez,acigna/pywez,acigna/pywez | SOAPpy/tests/alanbushTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nimport django\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"museum.settings\")\ndjango.setup()\n\nprint(\"NEW WOZZT TEST\")\n\nfrom museum_site.wozzt_queue import WoZZT_Queue # noqa: E402\n\n\ndef main():\n entry =... | python | edit | 1 | 2 | mit | 0b45ec48955f73a0e88422660af82ff6fd89333b | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | tools/crons/newwoz.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, print_function\n\nfrom virtualenv.__about__ import (\n __author__, __copyright__, __email__, __license__, __summary__, __title__,\n __uri__, __version__\n)\n\n\n__all__ = [\n \"__ti... | python | edit | 1 | 0 | mit | 38749a0033c2acc6c9fd8971749c68f93cb9c0db | ionelmc/virtualenv,ionelmc/virtualenv,ionelmc/virtualenv | virtualenv/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef argsort(x, /, *, axis=-1, descending=False, stable=True):\n from .. import argsort\n from .. import flip\n # Note: this keyword argument is different, and the default is different.\n kind = 'stable' if stable else 'quicksort... | python | edit | 1 | 3 | bsd-3-clause | e521b16844efc2853c0db9014098cb3e37f6eb04 | jakirkham/numpy,numpy/numpy,mhvk/numpy,seberg/numpy,pdebuyl/numpy,numpy/numpy,numpy/numpy,jakirkham/numpy,anntzer/numpy,charris/numpy,simongibbons/numpy,endolith/numpy,simongibbons/numpy,mhvk/numpy,seberg/numpy,mattip/numpy,mattip/numpy,jakirkham/numpy,mhvk/numpy,charris/numpy,seberg/numpy,simongibbons/numpy,pdebuyl/nu... | numpy/_array_api/_sorting_functions.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 | f57511df7de901f3694fa4225af458e192975299 | ajmarks/gymnast,ajmarks/gymnast | pdf_parser/pdf_types/compound_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Starbot Discord Project\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# ... | python | edit | 3 | 3 | apache-2.0 | ed89c92ac56e89648bf965ea3aa8963e840e3a5c | StarbotDiscord/Starbot,dhinakg/BitSTAR,StarbotDiscord/Starbot,dhinakg/BitSTAR | tests/test_excuses.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os.path\nimport shutil\n\nsql = \"\"\"\n-- Remove empty values from the milestone list\nDELETE FROM milestone WHERE COALESCE(name,'')='';\n\n-- Add a description column to the version table, and remove unnamed versions\nCREATE TEMP T... | python | edit | 1 | 4 | bsd-3-clause | 3d813e9960a44bfacd94551b95caf489b85ea3bb | exocad/exotrac,dafrito/trac-mirror,dokipen/trac,dokipen/trac,dokipen/trac,exocad/exotrac,exocad/exotrac,dafrito/trac-mirror,moreati/trac-gitsvn,moreati/trac-gitsvn,dafrito/trac-mirror,exocad/exotrac,moreati/trac-gitsvn,dafrito/trac-mirror,moreati/trac-gitsvn | trac/upgrades/db11.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2012 theo crevon\n#\n# See the file LICENSE for copying permission.\n\nfrom ConfigParser import ConfigParser\n\nfrom utils.snippets import items_to_dict\n\n\nclass Config(dict):\n \"\"\"\n Un... | python | edit | 1 | 3 | mit | ec15cfe29eb4f99725315d54c97d99d81e3b3ccc | oleiade/Elevator | elevator/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fanstatic import Library\nfrom fanstatic import Resource\nfrom kotti.resources import Image\nimport kotti.static as ks\n\n\nlib_kotti_site_gallery = Library('kotti_site_gallery', 'static')\nview_css = Resource(lib_kotti_site_gallery,\n... | python | edit | 1 | 1 | bsd-2-clause | f3cc2de83c88f01f7ec554ae6223132c284b4ad4 | Kotti/kotti_site_gallery,Kotti/kotti_site_gallery | kotti_site_gallery/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport time\n\nimport logging\nlog = logging.getLogger(__name__)\n\nclass TaskSchedule():\n\tdef __init__(self):\n\t\tself.tasks = []\n\t\tlog.debug(\"TaskSchedule created\")\n\n\tdef add(self, task, ttl_skew=0.8):\n\t\toffset = ((ttl_skew ... | python | edit | 1 | 3 | mit | a805d414557a14a8588b6e34a9fbb93cc87651df | crashlytics/riemann-sumd | lib/scheduler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\nimport glob\nimport getopt\n\ndef file_list(path):\n files = []\n\n if os.path.isfile(path):\n return [path]\n\n for f in os.listdir(path):\n new_dir = os.path.join(path, f)\n if o... | python | edit | 3 | 6 | apache-2.0 | 7fcccea5d7fdfb823d17f1db56f5ece42ef2fd8b | kans/zirgo,kans/zirgo,kans/zirgo | tools/bundle.py | rejected_duplicate | Near-duplicate of sample 61 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n#\n# records.py\n# csvdiff\n#\n\nimport csv\n\n\nclass InvalidKeyError(Exception):\n pass\n\n\ndef load(file_or_stream):\n istream = (open(file_or_stream)\n if not hasattr(file_or_stream, 'read... | python | edit | 1 | 4 | bsd-3-clause | b297ad6b4d52b688a1c50ffc2a5574d8061c5ce0 | larsyencken/csvdiff | csvdiff/records.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom argparse import Namespace\n\nimport mock\nimport pytest\n\nfrom kafka_utils.kafka_cluster_manager.cluster_info \\\n .partition_count_balancer import PartitionCountBalancer\nfrom kafka_utils... | python | edit | 1 | 1 | apache-2.0 | 54b147e59d1dfd4b65643a3f8a56098eb5a99451 | Yelp/kafka-utils,Yelp/kafka-utils | tests/kafka_cluster_manager/decommission_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thecure.resources import load_spritesheet_frame\nfrom thecure.sprites import Sprite\n\n\nclass Tile(Sprite):\n NAME = 'tile'\n WIDTH = 64\n HEIGHT = 64\n\n NEED_TICKS = False\n\n def __init__(self, filename, tile_offset)... | python | edit | 1 | 1 | mit | 159aea1c97b8e8de45802cace031e7206c3c8fec | chipx86/the-cure | thecure/sprites/tile.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport traceback\nfrom logging import Handler\n\nfrom slacker import Chat\n\n\nclass SlackLogHandler(Handler):\n def __init__(self, api_key, channel, stack_trace=False, username='Python logger', icon_url=None, icon_emoji=None):\n ... | python | edit | 1 | 4 | apache-2.0 | 550dee3e13a0ee80d0bd9338c281e51fefdcfdc8 | mathiasose/slacker_log_handler | slack_log_handler/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nVerseBot for reddit\nBy Matthieu Grieger\nparser.py\nCopyright (c) 2015 Matthieu Grieger (MIT License)\n\"\"\"\n\nfrom bs4 import BeautifulSoup\nfrom urllib.request import urlopen\n\nclass Parser:\n \"\"\" Parser class for BibleG... | python | edit | 1 | 4 | mit | a4c5782158e7d3fa696fc4532836355457f48cc0 | Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot | versebot/webparser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom txircd.modbase import Mode\n\nclass OperMode(Mode):\n def checkSet(self, target, param):\n return False # Should only be set by the OPER command; hence, reject any normal setting of the mode\n \n def checkWhoFilter(self... | python | edit | 2 | 3 | bsd-3-clause | 3aba7e7f654e492fb689b8030615658cae93c2d1 | Heufneutje/txircd,DesertBus/txircd,ElementalAlchemist/txircd | txircd/modules/umode_o.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/local/sabnzbd/env/bin/python\nimport os\nimport configobj\n\n\nconfig = configobj.ConfigObj('/usr/local/sabnzbd/var/config.ini')\nprotocol = 'https' if int(config['misc']['enable_https']) else 'http'\nport = int(config['misc']['https... | python | edit | 2 | 0 | bsd-3-clause | c3b0cc681b06ab5b8d64612d5c35fb27da56beeb | Decipher/spksrc,astroganga/spksrc,mjoe/spksrc,markbastiaans/spksrc,Decipher/spksrc,mreppen/spksrc,saschpe/spksrc,schumi2004/spksrc,hadess/spksrc,mirweb/spksrc,mirweb/spksrc,jdierkse/spksrc,adrien-delhorme/spksrc,sea3pea0/spksrc,thunfischbrot/spksrc,mirweb/spksrc,Foncekar/spksrc,thunfischbrot/spksrc,lysin/spksrc,hmflash... | spk/sabnzbd/src/app/sabnzbd.cgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2019 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 | 48dc53c5c92a49fca959a962434bee6c2810a0c8 | PAIR-code/what-if-tool,PAIR-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool,pair-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool,pair-code/what-if-tool,PAIR-code/what-if-tool,pair-code/what-if-tool | tensorboard_plugin_wit/pip_package/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport platform\nimport sys\n\nNODE_VERSION = 'v0.11.13'\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'\n\nARCH... | python | edit | 1 | 0 | mit | ed68bd18b88f349a7348006a2e14cdddbc993da7 | beni55/electron,gbn972/electron,chrisswk/electron,mrwizard82d1/electron,Andrey-Pavlov/electron,yan-foto/electron,roadev/electron,abhishekgahlot/electron,MaxWhere/electron,nicholasess/electron,Jonekee/electron,synaptek/electron,edulan/electron,tincan24/electron,faizalpribadi/electron,davazp/electron,tylergibson/electron... | script/lib/config.py | rejected_duplicate | Near-duplicate of sample 6588 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom .publisher import Publisher\nfrom .common import DEFAULT_PUB_PORT\nfrom .common import DEFAULT_HOST\nfrom .env import get_master_host\n\n\nclass JsonMultiplePublisher(object):\n\n '''publish multiple topics by one jso... | python | edit | 3 | 2 | apache-2.0 | 374bd4881e00c2605f28ea816fa94468a76f2621 | OTL/jps | jps/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom taggit.models import Tag, TaggedItem\n\n\nclass TaggedItemInline(admin.StackedInline):\n model = TaggedItem\n extra = 0\n\nclass TagAdmin(admin.ModelAdmin):\n inlines = [\n TaggedItem... | python | edit | 1 | 0 | bsd-3-clause | e7356e6ca1968d930f4fd348b48dcdd1cb9a02ab | theatlantic/django-taggit2,decibyte/django-taggit,theatlantic/django-taggit,decibyte/django-taggit,theatlantic/django-taggit,theatlantic/django-taggit2 | taggit/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\ndef generate_form(model):\n \"\"\"\n Generate a form from a model.\n\n Arguments:\n model -- A Django model.\n \"\"\"\n _model = model\n class Form(forms.ModelForm):\n class Meta:\n ... | python | edit | 1 | 6 | mit | 937a5e32c77ca57917d60a891616fbcf19ab19f9 | jgorset/django-respite,jgorset/django-respite,jgorset/django-respite | respite/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*-coding:utf8 -*-\nimport json\nimport requests\nimport time\nimport uuid\nimport datetime\nimport time\n\nids = [\"18576635456\", \"13512345432\"]\n\nurl1 = \"http://172.16.153.71:8059/federation/1.0/inference\"\n\nfor i in range(2):\n... | python | edit | 7 | 0 | apache-2.0 | a021f279341eb15c17597200d4bbe97a98034c54 | FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE | fate_flow/examples/test_inference.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom win_unc.sanitizors import sanitize_username, sanitize_unc_path\n\n\ndef is_valid_drive_letter(string):\n \"\"\"\n Drive letters are one character in length and between \"A\" and \"Z\". Case does not matter.\n \"\"\"\n retur... | python | edit | 1 | 4 | mit | c9392a6578b0894dff7a5407410e8892e9f3ae6d | nithinphilips/py_win_unc,CovenantEyes/py_win_unc | win_unc/validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.13 on 2018-03-04 23:14\nfrom __future__ import unicode_literals\nimport json\n\nfrom django.db import migrations\n\n\ndef populate_default(apps, schema_editor):\n ScriptParameter = apps.... | python | edit | 1 | 3 | bsd-3-clause | 1d13bd71ff105d540c3af166056cb0b8731a3417 | wooey/Wooey,wooey/Wooey,wooey/Wooey,wooey/Wooey | wooey/migrations/0037_populate-jsonfield.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport atexit\nimport os\nimport tempfile\n\ntmpdir = tempfile.TemporaryDirectory()\nos.environ.setdefault('DATA_DIR', tmpdir.name)\n\nfrom pretix.settings import * # NOQA\n\nDATA_DIR = tmpdir.name\nLOG_DIR = os.path.join(DATA_DIR, 'logs')... | python | edit | 1 | 0 | apache-2.0 | 28181d9bcf7aa597b88507871ffb31f4028eb67c | Flamacue/pretix,Flamacue/pretix,Flamacue/pretix,Flamacue/pretix | src/pretix/testutils/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pwgen import pwgen\nfrom re import findall\n\nimport vccs_client\n\n\ndef generate_password(settings, credential_id, email):\n \"\"\"\n Generate a new password credential and add it to the VCCS authentication backend.\n\n The ... | python | edit | 1 | 1 | bsd-3-clause | a3357cd4bb0859f480fa91f50604a2f129431096 | SUNET/eduid-signup,SUNET/eduid-signup,SUNET/eduid-signup | eduid_signup/vccs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport ioflo.app.run\nimport os\n\n\nclass Manager(object):\n '''\n Manage the main ioflo process\n '''\n def __init__(self):\n self.behaviors = ['rflo.config', 'rflo.roads']\n self.floscript = os.path.join(os.path... | python | edit | 1 | 1 | apache-2.0 | 81faa7704fb355dd16674d4ed089e0ced34c24c6 | thatch45/rflo | rflo/start.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom .onnx_ml_pb2 import * # noqa\nfrom .version import version as __version__ # no... | python | edit | 4 | 3 | apache-2.0 | fea2c0bc02a8323ad6c759ca63663499a538186e | onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx | onnx/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDjango middleware that enables the MDK.\n\nThis is old-style (Django <1.10) middleware. Please see\nhttps://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-middleware\nif you're using Django 1.10.\n\"\"\"\n\nimport ... | python | edit | 1 | 1 | apache-2.0 | da1a0f5e7ffcbe37cdee484b452b5376049dd1e5 | datawire/mdk,datawire/mdk,datawire/mdk,datawire/mdk | python/django.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ninstall_requires = [\n 'Dockets>=0.3.4,<0.4.0',\n 'boto>=2.26.0',\n]\n\ntest_requires = [\n 'nose>=1.3.0,<2.0.0',\n 'mock>=1.0.0,<2.0.0',\n 'redis>=2.10.0,<3.0.0',\n 'moto>=0.4.1',\n]\n\n```\n\nApply this change: Use new v... | python | edit | 1 | 0 | mit | c1efaefbe6a098e3f74bed20ff55a4307ec90ddd | gamechanger/deferrable | dynamic_requirements.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, queue, concurrent.futures\n\n\nclass ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):\n \"\"\"ThreadPoolExecutor which allows setting max. work queue size\"\"\"\n def __init__(self, max_workers=0, thread_name_pref... | python | edit | 1 | 5 | mit | f95aa5b36a354fe3cfd94b43d8f0f6346ec400de | xmikos/soapy_power,xmikos/soapy_power | soapypower/threadpool.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime\nimport sublime_plugin\n\nPANEL_NAME = \"SublimeLinter Messages\"\n\n\ndef plugin_unloaded():\n for window in sublime.windows():\n window.destroy_output_panel(PANEL_NAME)\n\n\nclass SublimeLinterDisplayPanelCommand(... | python | edit | 1 | 2 | mit | aed8a831bca72268ad9fbcd2f777d91af29d61b6 | SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3 | message_view.py | rejected_duplicate | Near-duplicate of sample 16435 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport io\nimport platform\nimport shlex\nimport subprocess\n\nfrom flask import Flask, request, send_file, send_from_directory\n\napp = Flask(__name__)\n\ntmp_dir = '/tmp/'\ntmp_filename = 'snapshot.jpg'\n\n@app.ro... | python | edit | 1 | 4 | bsd-3-clause | a56c744af8c1a96631d990c2a398aedcd24a78de | flebel/rtsp2snapshot | rtsp2snapshot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport factory\nimport factory.fuzzy\nfrom backend.images import models\n\n\nclass ImageSeriesFactory(factory.django.DjangoModelFactory):\n class Meta:\n model = models.ImageSeries\n\n patient_id = factory.Sequence(lambda n: \"... | python | edit | 1 | 0 | mit | 958bb725cce490ecf5d9f2052e739d2b1fe84b3d | vessemer/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic,vessemer/concept-to-clinic | interface/backend/images/factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport graphqlapi.utils as utils\nfrom graphql.parser import GraphQLParser\nfrom graphqlapi.interceptor import ExecuteBatch, TestDataSource\nfrom graphqlapi.exceptions import RequestException\n\n\ninterceptors = [\n ExecuteBatch(),\n ... | python | edit | 1 | 4 | apache-2.0 | b03ed6307bd1354b931cdd993361d0a40a1d6850 | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | api/init/graphqlapi/proxy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\nclass Category(models.Model):\n \"\"\"A category of resources.\"\"\"\n important = models.BooleanField(\n default=False,\n help_text=('categories marked important will be shown at the to... | python | edit | 1 | 1 | mit | 382a3f673c4d74f6ba2b8c4ccff9332445b76093 | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | chmvh_website/resources/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.contrib.auth.models import User\nfrom rest_framework import serializers\n\nfrom .models import Content, Tag\n\n\nclass TagSerializer(serializers.ModelSerializer):\n class Meta:\n model = Tag\n... | python | edit | 3 | 2 | mit | 969b2d322174392a85f6fa6fc92160cb18144594 | theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,pombredanne/django-bulbs,pombredanne/django-bulbs,theonion/django-bulbs | bulbs/content/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import Blueprint\n\npackages = Blueprint('packages', __name__)\n\n\nfrom . import views, models\nfrom utils import github_data\n\n\ndef post_get_single(result=None, **kw):\n result.update(result.pop(\"get_json\"))\n result.... | python | edit | 3 | 4 | bsd-2-clause | e0ddd80ea2d23f9b5fc32dd8a5ea13f9cb30da49 | NikhilKalige/atom-website,NikhilKalige/atom-website,NikhilKalige/atom-website | app/packages/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom local_settings import *\n\nsettings.DEBUG = False\n\nALLOWED_HOSTS = ['uchicagohvz.org']\n\n# Database\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgres... | python | edit | 5 | 0 | mit | b8ecb1e86fcbbda0f92314c90fb319c2c50fcf94 | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | uchicagohvz/production_settings.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom skimage._shared.utils import all_warnings, skimage_deprecation\nfrom numpy.testing import assert_warns\n\ndef import_filter():\n from skimage import filter as F\n assert('sobel' in dir(F))\n\ndef test_filter_import():\n with a... | python | edit | 3 | 1 | bsd-3-clause | 75080e6f0da4f699ef1eb89310847befeccfab40 | michaelaye/scikit-image,warmspringwinds/scikit-image,juliusbierk/scikit-image,michaelpacer/scikit-image,ofgulban/scikit-image,vighneshbirodkar/scikit-image,oew1v07/scikit-image,chriscrosscutler/scikit-image,pratapvardhan/scikit-image,robintw/scikit-image,paalge/scikit-image,vighneshbirodkar/scikit-image,youprofit/sciki... | skimage/filter/tests/test_filter_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom niimg_conversions import is_a_niimg, _get_shape, _repr_niimgs, \\\n copy_niimg, check_niimg, concat_niimgs, check_niimgs\n\nfrom numpy_conversions import as_ndarray\n\nfrom cache_mixin import CacheMixin\n\n\n```\n\nApply this ... | python | edit | 11 | 0 | bsd-3-clause | 14a0738ec836bd3369984835797f5002813b270a | abenicho/isvr | nilearn/_utils/__init__.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\nimport yaml\nfrom .process import CollectorProcess\n\n\ndef get_config(path):\n with open(path) as file:\n return yaml.load(file)\n\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument('... | python | edit | 1 | 4 | isc | 9bfe2dbd37fa18ed7915e82dc8dc8515d7fe9a76 | alfredhq/alfred-collector | alfred_collector/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .request import Request\nfrom .response import response\n\n\nclass Handler(object):\n '''\n Simple dispatcher class.\n '''\n def __init__(self, event, context):\n self.request = Request(event, context)\n\n def __c... | python | edit | 1 | 3 | bsd-3-clause | ed9294c7ab0abf574f076464274d83f1e39b53cd | funkybob/paws | paws/handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nimport turbasen\n\n@pytest.fixture\ndef configure_dev():\n turbasen.configure(ENDPOINT_URL='http://dev.nasjonalturbase.no/')\n\n@pytest.mark.skipif(turbasen.settings.Settings.API_KEY is None, reason=\"API key not set\")\... | python | edit | 1 | 1 | mit | 692fe65ca9d24286d10e542c5028924a22036362 | Turbasen/turbasen.py | tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os.path, nose, glob, sys\npackages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')]\nsys.path += packages\n\nnose.main()\n```\n\nApply this change: Allow Travis to load tests and use azure-storage... | python | edit | 1 | 0 | mit | 53e8c14d774131503dbdefe6528cd1e26adbf30b | Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,v-iam/azure-sdk-for-python,Azure/azure-sdk-for-python,AutorestCI/azure-sdk-for-python,lmazuel/azure-sdk-for-python,Azure/azure-sdk-for-python,SUSE/azure-sdk-for-python | azure_nosetests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nNormally, this files contains all necessary code to execute successfully the solution of the problem\nbut in this case (because this version is not stable) all code is in \"TFModel_backup.py\" file.\n\"\"\"\n\n\n```\n\nApply this ch... | python | edit | 7 | 0 | apache-2.0 | 23a8df19e272bf4a48d59629976fc0cd4a1b83eb | Gabvaztor/TFBoost | Settings/German_Signal/ModelConfiguration.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\nimport os\nfrom pathlib import Path\nfrom venv import EnvBuilder\n\nfrom tests.lib import PipTestEnvironment, TestData\n\n\ndef test_python_interpreter(\n script: PipTestEnvironment,\n tmpdir: Path,\n shared_data: Test... | python | edit | 1 | 1 | mit | b5afdd604831f985427880537d37eb7a35addaa1 | pfmoore/pip,pypa/pip,sbidoul/pip,pfmoore/pip,pradyunsg/pip,sbidoul/pip,pypa/pip,pradyunsg/pip | tests/functional/test_python_option.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCompatibility module.\n\nThis module contains duplicated code from Python itself or 3rd party\nextensions, which may be included for the following reasons:\n\n * compatibility\n * we may only need a small subset of the copied libr... | python | edit | 5 | 0 | bsd-3-clause | 4c986e7cedde18530745dca072e06659f1fb20a9 | endolith/numpy,numpy/numpy,numpy/numpy,mattip/numpy,endolith/numpy,mattip/numpy,mhvk/numpy,charris/numpy,charris/numpy,mattip/numpy,endolith/numpy,numpy/numpy,mhvk/numpy,mhvk/numpy,mhvk/numpy,charris/numpy,charris/numpy,endolith/numpy,mhvk/numpy,mattip/numpy,numpy/numpy | numpy/compat/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The device class used to represent a particular function of an accelerator\nelement.\n\nA physical element in an accelerator may have multiple devices: an example at\nDLS is a sextupole magnet that contains also horizontal and vertica... | python | edit | 1 | 1 | apache-2.0 | f3fcddaf7aa4e081322db6779ce2ad6d7e0db10a | willrogers/pytac,willrogers/pytac | pytac/device.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import MultiSelectField\nfrom swimlane.core.resources.usergroup import UserGroup\n\n\nclass UserGroupField(MultiSelectField):\n \"\"\"Manages getting/setting users from record User/Group fields\"\"\"\n\n field_type = 'Core.... | python | edit | 1 | 2 | mit | 532c201053ae271544270035423f690b4774794a | Swimlane/sw-python-client | swimlane/core/fields/usergroup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport utils\nfrom os import environ\nimport os.path\n\n\nMCDIR = environ.get(\"MCDIR\") or '/mcfs/data'\n\n\ndef for_uid(uidstr):\n pieces = uidstr.split('-')\n path = os.path.join(MCDIR, pieces[1][0:2], pieces[1][2:4])\n utils.mk... | python | edit | 1 | 1 | mit | 0707d920f37edb82d16ccabe1e8413ec16c47c0b | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/mcapi/mcdir.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom django.core.serializers.base import DeserializationError\nfrom django.core.serializers.json import (\n DjangoJSONEncoder, PythonDeserializer, Serializer as JsonSerializer)\nfrom prices import Money\n\nMONEY_TYPE = 'Mo... | python | edit | 1 | 5 | bsd-3-clause | f75a151b33635cad5604cb9d7f66fc043c4f972a | UITools/saleor,mociepka/saleor,UITools/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,mociepka/saleor,maferelo/saleor,mociepka/saleor,UITools/saleor | saleor/core/utils/json_serializer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport os\nimport sys\nimport socket\nfrom os import path\nfrom pkg_resources import *\n\nif not len(sys.argv) > 1:\n sys.exit('Usage: %s <map.xml>' % os.path.basename(sys.argv[0]))\n\nsys.path.insert(0,os.path.a... | python | edit | 2 | 0 | bsd-3-clause | 3e71356de442e47bcb96ea311295bb447fd23341 | mapnik/OGCServer,pbabik/OGCServer,pbabik/OGCServer | bin/ogcserver-local.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport connexion\nfrom fdp import config\n\ndef create_app(host, port, graph_endpoint=None):\n config.init_fairgraph(host, port, graph_endpoint)\n\n app = connexion.FlaskApp(__name__, specification_dir='openapi/', debug=True)\n opt... | python | edit | 1 | 1 | apache-2.0 | c3a689a1c1825058ddf7560dcbf3e8785b87b003 | NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint,NLeSC/ODEX-FAIRDataPoint | fdp/fdp.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2001,2002 Python Software Foundation\n# Author: <EMAIL> (Barry Warsaw)\n\n\"\"\"Various types of useful iterators and generators.\n\"\"\"\n\nimport sys\n\ntry:\n from email._compat22 import body_line_iterator, typed_subpa... | python | edit | 2 | 5 | mit | fb5c6d5288b6d69d16f917976ae068e9c52a6c7d | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/email/Iterators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"User models.\"\"\"\nimport datetime as dt\n\nfrom flask_login import UserMixin\n\nfrom myflaskapp.database import Column, Model, SurrogatePK, db, reference_col, relationship\nfrom myflaskapp.extensions import bcrypt\n\nclass Item(Surr... | python | edit | 7 | 0 | mit | b855dbde90bfd5842ad292f5f424957df02c2fe0 | terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python | myflaskapp/myflaskapp/item/models.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.contrib.admin.sites import AdminSite\nfrom billjobs.admin import UserAdmin\n\nclass EmailExportTestCase(TestCase):\n \"\"\" Tests for email account export \"\"\"\n\n def test_method_is_ava... | python | edit | 3 | 1 | mit | 8dbe3e9e418c120d59bb95aa6ff8fb3ab382aac2 | ioO/billjobs | billjobs/tests/tests_export_account_email.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.\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 Licen... | python | edit | 1 | 5 | apache-2.0 | cb22f18186262bffbfa78b47f1d6e7c2a060d5ff | SpamapS/gearhorn | gearhorn/cmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.syndication.views import Feed\n\nfrom .models import Post\nfrom .settings import (\n SYNDICATION_FEED_TITLE, SYNDICATION_FEED_LINK,\n SYNDICATION_FEED_DESCRIPTION, SYNDICATION_FEED_TYPE\n)\n\n\nclass LatestPostFeed... | python | edit | 1 | 2 | mit | 3020817d9edaa8b95c52ecd03f2c10e06f4fc5e7 | DemocracyClub/django-hermes,DemocracyClub/django-hermes | hermes/feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nModule for Kyokai routes.\n\"\"\"\nimport re\n\n\nclass Route(object):\n \"\"\"\n A route is simply a wrapped coroutine object for a request.\n\n It takes in a regular expression as a matcher, for the path, and a list of ac... | python | edit | 1 | 4 | mit | bc2d57bb36373eded3ae1cd82cd4b91bd5649b57 | SunDwarf/Kyoukai | kyokai/route.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport argparse\n\nfrom settings import HONEYPORT\n\n\"\"\"\nHere we define command line arguments.\n`port` stands for port, to listen on.\n`-v` to increase verbose of the server\n\"\"\"\n\n\ndef parse():\n parser = argparse.ArgumentPars... | python | edit | 3 | 1 | mit | 48bd50609fffb18dbab821522810ec587751434c | Zloool/manyfaced-honeypot | arguments.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom ipywidgets import DOMWidget\nfrom IPython.display import display\nfrom traitlets import Unicode, Bytes, Dict\nfrom .objects import Objects\nfrom .factory import Factory\nimport base64, json, zlib\n\n\nclass K3D(DOMWidget, Factory):\n ... | python | edit | 1 | 1 | mit | 6a68ef52ab9e762860087f701eee15e11786ca71 | K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter | k3d/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic test for models."
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom ..models import Tunnel\n\n\nclass TestModels(TestCase):\n def test_defaults(self):\n tunnel = Tunnel()\n s... | python | new_file | 1 | 1 | isc | a5898f8e5b2b25af472f1e2e5ce02626b86db5f2 | xoliver/tunneler,xoliver/tunneler | tunneler/tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Oxypanel\n# File: util/csrf.py\n# Desc: csrf protection!\n\nfrom uuid import uuid4\n\nfrom flask import session, abort, request, Markup\n\nimport config\nfrom app import app\n\n\n# Check all POST/PUT/DELETE's\n# 403 on failure\n@app.befor... | python | edit | 1 | 4 | mit | 111ea97340b600d24dd21316d55cf82fa3ece158 | oxyio/oxyio,oxyio/oxyio,oxyio/oxyio,oxyio/oxyio | util/csrf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nCopyright [2009-2014] 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 | 3 | 0 | apache-2.0 | 40db9d64d616d99ec2464aff6fe5960943584ac3 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/apiv1/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom functools import partial\n\n\nclass Library:\n '''\n Container for registering tags and filters\n '''\n def __init__(self):\n self.tags = {}\n self.filters = {}\n self.helpers = {}\n\n def tag(self, ... | python | edit | 1 | 3 | mit | 0a0d6b87aac75f298194b43cfcea67b0d1651a97 | funkybob/knights-templater,funkybob/knights-templater | knights/library.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2008-2009 ITA Software, 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:/... | python | edit | 1 | 0 | apache-2.0 | db8b5bb3b596609e06adf51ed7d72b97fc786ad5 | marineam/nagcat,marineam/nagcat,marineam/nagcat | python/nagcat/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file... | python | edit | 1 | 1 | apache-2.0 | d1171066141418b5ca0dd6a8b996a00cb9e45d00 | alfasin/st2,pixelrebel/st2,pixelrebel/st2,Plexxi/st2,StackStorm/st2,Itxaka/st2,tonybaloney/st2,armab/st2,punalpatel/st2,peak6/st2,Plexxi/st2,nzlosh/st2,Itxaka/st2,grengojbo/st2,tonybaloney/st2,armab/st2,pinterb/st2,punalpatel/st2,StackStorm/st2,tonybaloney/st2,Itxaka/st2,Plexxi/st2,jtopjian/st2,nzlosh/st2,peak6/st2,Ple... | st2common/st2common/transport/execution.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nimport sys\nimport os\nimport unittest\n\nimport libaur.printer as printer\nimport libaur.aur as aur\n\nclass PrinterBadInput(unittest.TestCase):\n def test_string_input_dlpkgs(self):\n '''download_pkg sh... | python | edit | 5 | 1 | mit | a962574f19673c17b033a50809040956a63970e5 | KaiSforza/pywer | test/pywertest.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nfrom autosklearn.pipeline.components.base import find_components, \\\n AutoSklearnClassificationAlgorithm\n\n\nclass TestBase(unittest.TestCase):\n\n def test_find_components(self):\n c = find_components('dum... | python | edit | 1 | 1 | bsd-3-clause | 5da30efc6cbbc58db60ba29643c56448b5a79e77 | automl/auto-sklearn,automl/auto-sklearn | test/test_pipeline/components/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.cache import patch_vary_headers\nfrom django.utils import translation\nfrom account.models import Account\n\nclass LocaleMiddleware(object):\n \"\"\"\n This is a very simple middleware that parses a request\n and ... | python | edit | 1 | 3 | mit | c56d9cded7190d524d3d4dbcd960a0b0fe8bf10c | alex/pinax,amarandon/pinax,amarandon/pinax,alex/pinax,alex/pinax,amarandon/pinax,amarandon/pinax | apps/local_apps/account/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom flask import request\nfrom markdown import Markdown\nfrom markdown.extensions import Extension\nfrom markdown.postprocessors import Postprocessor\n\n\ndef absolute_path_replacer(match):\n \"\"\"Correct the url in a rege... | python | edit | 1 | 2 | mit | 9f8f929b8fdc0ebfdb609621f4613d31b73639b0 | agdsn/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | sipa/utils/link_patch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom mock import patch\nimport logging\nimport congressbot\n\n\n@patch('congressbot.house_collection')\n@patch('congressbot.Reddit')\ndef test_feed_parse(reddit_mock, house_mock):\n house_mock.find_one.return_value = False\n congressb... | python | edit | 3 | 1 | unlicense | 5a4f52348d8174e9cb3c4c0b8bfe0baa50f70f31 | koshea/congressbot | tests/test_bot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat\n\nIf dnspython is present it causes socket.getaddrinfo() to be\nmonkeypatched wiht code that does not work with IPv6. To get\naround this, the EVENTLET_NO_GREENDNS environment variable\... | python | new_file | 1 | 0 | apache-2.0 | 4f31fb7962a241c13251994c8659595fa2e0693e | j-griffith/cinder,ge0rgi/cinder,openstack/cinder,j-griffith/cinder,eharney/cinder,Datera/cinder,Datera/cinder,phenoxim/cinder,mahak/cinder,openstack/cinder,phenoxim/cinder,mahak/cinder,eharney/cinder | cinder/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport unittest\n\nimport transpiler\n\nclass TestTranspiler:\n\n def test_transpiler_creates_files_without_format(self):\n try:\n os.remove(\"/tmp/auto_functions.cpp\")\n os.remove(\"/tmp/auto_fun... | python | edit | 3 | 2 | mit | e88a0a27a4960f6b41170cffa0809423987db888 | WesleyAC/lemonscript-transpiler,WesleyAC/lemonscript-transpiler,WesleyAC/lemonscript-transpiler | tests/test_transpiler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef getTableColumnLabel(c):\n label = ''\n while True:\n label += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[c % 26]\n if c <= 26:\n break\n c = int(c/26)\n return label\n\ndef parseTableColumnLabel(label):\n ret = 0\n for c in map(ord... | python | edit | 1 | 4 | mit | cddcc7e5735022c7a4faeee5331e7b80a6349406 | takumak/tuna,takumak/tuna | src/functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom unittest import TestCase\nfrom wtforms import TextField, validators\nfrom wtforms.ext.i18n.utils import get_translations\nfrom wtforms.ext.i18n import form as i18n_form\n\n\nclass I18NTest(Tes... | python | edit | 1 | 1 | bsd-3-clause | 22de9f9d45edbf5eddea2940549efc225c805f02 | Xender/wtforms,Aaron1992/wtforms,jmagnusson/wtforms,pawl/wtforms,cklein/wtforms,pawl/wtforms,crast/wtforms,hsum/wtforms,Aaron1992/wtforms,skytreader/wtforms,wtforms/wtforms,subyraman/wtforms | tests/ext_i18n.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport urllib\n\ndef url_decode(string, encoding='utf8'):\n return urllib.unquote(string)\n\ndef url_encode(string, encoding='utf8'):\n return urllib.urlencode(string)\n\n```\n\nApply this change: Fix URL decoding (need to use urllib.unqu... | python | edit | 1 | 1 | mit | 41a59d72049c8c33dc4531df3561186e3852c328 | adeel/pump | pack/util/codec.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy as np\nfrom jug import TaskGenerator\nimport ezplot\n\n\n__all__ = ['plot_stack']\n\n\n@TaskGenerator\ndef plot_stack(stack_results, problems=None, policies=None, name=''):\n problems = problems if problems is not None else ... | python | edit | 1 | 5 | bsd-2-clause | c4d4ba61d1948bebecfadd540a77603fc9dda204 | mwhoffman/benchfunk | benchfunk/core/plotters.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test function so tests can be run from within python terminal\n\nimport csympy\ncsympy.test()"
},
{
"role": "assistant",
"content": "from .lib.csympy_wrapper import (Symbol, Integer, sympify, SympifyError, Add,\n Mul, ... | python | new_file | 15 | 1 | mit | c970661c4525e0f3a9c77935ccfbef62742b18d4 | symengine/symengine.py,bjodah/symengine.py,bjodah/symengine.py,symengine/symengine.py,symengine/symengine.py,bjodah/symengine.py | csympy/__init__.py | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sublime, sublime_plugin\r\nimport os, string\r\nimport re\r\n\r\nfrom datetime import date\r\n\r\ntry:\r\n from MarkdownEditing.wiki_page import *\r\nexcept ImportError:\r\n from wiki_page import *\r\n\r\ntry:\r\n from Markd... | python | edit | 13 | 1 | mit | f0ed7130172a3c5c70c2147919b6e213f065c2c2 | SublimeText-Markdown/MarkdownEditing | open_journal.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis class is used in kaggle competitions\n\"\"\"\n\nimport json\n\nclass Settings():\n train_path = None\n test_path = None\n model_path = None\n submission_path = None\n string_train_path = \"TRAIN_DATA_PATH\"\n ... | python | edit | 1 | 1 | apache-2.0 | 2a99fc24fec47b741359e3118969ba0f4d874e41 | Gabvaztor/TFBoost | SettingsObject.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom bottle import get, route\nimport redis\nimport json\nfrom datetime import datetime\n\nRED = redis.ConnectionPool(host='redis_01',port=6379,db=0)\n#RED = redis.ConnectionPool(host='tuchfarber.com',port=6379,db=0)\nLENGTH_OF_PREG = 280\n... | python | edit | 4 | 4 | mit | ec032ab20de8d3f4d56d7d6901dd73c2bc2ada56 | tuchfarber/tony-hawkathon-2016,tuchfarber/tony-hawkathon-2016,tuchfarber/tony-hawkathon-2016 | back_end/api.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom .bacman import BacMan\n\n\nclass MySQL(BacMan):\n \"\"\"Take a snapshot of a MySQL DB.\"\"\"\n\n filename_prefix = os.environ.get('BACMAN_PREFIX', 'mysqldump')\n\n def get_command(self, path):\n command_str... | python | edit | 1 | 1 | bsd-3-clause | 60150d28ed815095cfe16bd7c7170fd4f47cf86e | willandskill/bacman | bacman/mysql.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom itertools import chain\nimport unittest\n\nfrom .test_runner import TestRunner\n\n\nclass UnittestRunner(TestRunner): # pylint:disable=no-init, too-few-public-methods\n \"\"\"A TestRunner using `unittest`'s discovery mechanisms.\n\... | python | edit | 1 | 2 | mit | fc350215a32586ac2233749924fa61078e8c780a | sixty-north/cosmic-ray | cosmic_ray/testing/unittest_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSimple wrapper class for a Basic GP.\n\"\"\"\n\n# future imports\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\n# global imports\nimport numpy as np\n\n# local impo... | python | edit | 3 | 6 | bsd-2-clause | c51cdb577a97817569deac68f5f07401eb99cf38 | mwhoffman/pygp | pygp/inference/basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PySide import QtGui, QtCore, QtWebKit\n\n\nclass Preview(QtWebKit.QWebView):\n\tdef __init__(self, parent=None):\n\t\tsuper(Preview, self).__init__(parent)\n\t\tself.load(QtCore.QUrl.fromLocalFile(\"/Users/audreyr/code/pydream-repos/rs... | python | edit | 3 | 1 | bsd-3-clause | fe07b97223dfffb789611b8b2cd043b628f8cef6 | techdragon/sphinx-gui,audreyr/sphinx-gui,techdragon/sphinx-gui,audreyr/sphinx-gui | preview.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom django.contrib.auth.models import User, Group\nfrom django.contrib import admin\n\nfrom gmmp.models import Monitor\nfrom forms.admin import (\n RadioSheetAdmin, TwitterSheetAdmin,... | python | edit | 6 | 3 | apache-2.0 | 7a2fd849a80db2407fb6c734c02c21a2a9b9a66e | Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp | forms/management/commands/assign_missing_perms.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom . import db\n\nclass Users(object):\n\n @classmethod\n def get_current(cls):\n return {\n 'data': {\n 'id': 1,\n 'type': 'user',\n 'name': 'Albert Sheu',\n ... | python | edit | 3 | 1 | mit | 41e426457c93fc5e0a785614c090a24aaf2e37f5 | flubstep/foxgami.com,flubstep/foxgami.com | py/foxgami/user.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Twitter delivery mechanism for botfriend.\"\"\"\nfrom nose.tools import set_trace\nimport tweepy\nfrom bot import Publisher\n\n\nclass TwitterPublisher(Publisher):\n def __init__(\n self, bot, full_config, kwargs\n ):... | python | edit | 8 | 4 | mit | b64e2c30b0b3da3b77295469fac944ae18d4e6dc | leonardr/botfriend | publish/twitter.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD CreateVMService at Device APP"
},
{
"role": "assistant",
"content": "from syft.core.node.device.device import Device\nfrom syft.grid.services.vm_management_service import CreateVMService\n\nnode = Device(name=\"om-device\")\n... | python | new_file | 1 | 0 | apache-2.0 | ce9f5551ec7173cc132eb1271e0fc2c1bbfaa7ce | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | apps/worker/src/main/core/node.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals, division\nfrom armet import utils\nfrom armet.http import request, response\n\n\nclass Request(request.Request):\n \"\"\"Implements the request abstraction... | python | edit | 1 | 1 | mit | 171b0c16698b47a6b0771f2ec2de01079c9a8041 | armet/python-armet | src/armet/connectors/cyclone/http.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport json\nimport urllib\n\ndef showsome(searchfor):\n query = urllib.urlencode({'q': searchfor})\n url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % query\n search_response = urllib.urlopen(url)... | python | edit | 8 | 2 | apache-2.0 | a4dc87b5a9b555f74efa9bfe2bd16af5340d1199 | phpsystems/code,phpsystems/code | googlesearch/googlesearch.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nGiven a config file, run a given workflow\n\"\"\"\n\nfrom percept.management.commands import BaseCommand\nfrom percept.utils.registry import registry, find_in_registry\nfrom percept.workflows.base import NaiveWorkflow\nfrom percept.... | python | edit | 5 | 2 | apache-2.0 | afb58da6ecc11a1c92d230bc2dcbb06464cc4f32 | VikParuchuri/percept,VikParuchuri/percept | percept/workflows/commands/run_flow.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand, CommandError\nfrom api import models\nfrom django.db.models import Count, Q\n\nclass Command(BaseCommand):\n can_import_settings = True\n\n def handle(self, *args, **options):\n\n ... | python | edit | 5 | 4 | apache-2.0 | 81756324744334de39a0b151d9acac9e24774b9d | rdsathene/SchoolIdolAPI,rdsathene/SchoolIdolAPI,laurenor/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,laurenor/SchoolIdolAPI,laurenor/SchoolIdolAPI,dburr/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI | api/management/commands/deleteuselessactivities.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef crop_corners(image, box=None, **kwargs):\n \"\"\"\n Crop corners to the selection defined by image_cropping\n\n `box` is a string of the format 'x1,y1,x2,y1' or a fo... | python | edit | 1 | 10 | bsd-3-clause | 1e45a5d781f426a383721b9c293f3d4b976fabed | henriquechehad/django-image-cropping,winzard/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping | image_cropping/thumbnail_processors.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.