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": "Write python code for the following: Mark projects that have a bluebottle payout as not needing approval\n\nBB-9612 #resolve"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.6 on 2017-04-24 14:53\nfrom __future__ import unic... | python | new_file | 1 | 3 | bsd-3-clause | a65f897f441eb001bf825805c955ac52a6026a87 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/projects/migrations/0026_auto_20170424_1653.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for compute limits\n\nChange-Id: Ifb192d412081beadf15023343af71ab23ceba7a1"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this fi... | python | new_file | 1 | 1 | apache-2.0 | 43cd8e0e79b37b932e4942890af8b708f2e37482 | stackforge/python-openstacksdk,dudymas/python-openstacksdk,dtroyer/python-openstacksdk,mtougeron/python-openstacksdk,dudymas/python-openstacksdk,briancurtin/python-openstacksdk,briancurtin/python-openstacksdk,openstack/python-openstacksdk,mtougeron/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-ope... | openstack/tests/functional/compute/v2/test_limits.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for summarize_model.py"
},
{
"role": "assistant",
"content": "\"\"\"\nA unit test for the summarize_model.py script\n\"\"\"\nimport cPickle\nimport os\n\nfrom pylearn2.testing.skip import skip_if_no_matplotlib\nfrom... | python | new_file | 1 | 1 | bsd-3-clause | 82f920aa0538f189417621f32a532644282ca7f6 | msingh172/pylearn2,abergeron/pylearn2,nouiz/pylearn2,sandeepkbhat/pylearn2,alexjc/pylearn2,hantek/pylearn2,ashhher3/pylearn2,abergeron/pylearn2,se4u/pylearn2,Refefer/pylearn2,shiquanwang/pylearn2,ashhher3/pylearn2,w1kke/pylearn2,TNick/pylearn2,cosmoharrigan/pylearn2,fyffyt/pylearn2,fishcorn/pylearn2,fishcorn/pylearn2,g... | pylearn2/scripts/tests/test_summarize_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Rename 'tools' to 'rdtools' module directory."
},
{
"role": "assistant",
"content": "''' Energy Normalization Module\n\nThis module contains functions to help normalize AC energy output with measured\nirradiance in preparation fo... | python | new_file | 1 | 2 | mit | cda8afef07cf959989f5e46577d3ce6b19c9e105 | kwhanalytics/rdtools,kwhanalytics/rdtools | rdtools/energy_normalization.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python program (really a collection of functions) which will choose a set of name pairings for a christmas gift exchange."
},
{
"role": "assistant",
"content": "#! /usr/bin/python\n\n# vim: set ai sw=4:\n\nimport random\nimpo... | python | new_file | 18 | 4 | bsd-2-clause | 13db5fc93d2aec28ea8a52f32353e86d8f49c12e | tedzo/python_play | python/christmas_names/name_chooser.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for floatingip pools API's new policy rules\n\nRelated-blueprint: bp/secure-rbac-roles\nChange-Id: I3f4f668866a7d1dacb583a177e8475617a762bf7"
},
{
"role": "assistant",
"content": "# Copyright (c) 2021 Red Hat Inc.\n#\n#... | python | new_file | 1 | 1 | apache-2.0 | 6655f7d62347f96bf4fe8673faf26c0c3e2b2e0b | openstack/neutron,mahak/neutron,openstack/neutron,mahak/neutron,openstack/neutron,mahak/neutron | neutron/tests/unit/conf/policies/test_floatingip_pools.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to extract palette for the DOS version"
},
{
"role": "assistant",
"content": "import glob\nfrom PIL import Image\nfrom math import floor\npalette = [[0,0,0]];\n\ndef transform( pixel ):\n return [ 20 * ( pixel[ 0 ]... | python | new_file | 3 | 5 | bsd-2-clause | e93939c9b0aee674ed9003727a267f6844d8ece6 | TheFakeMontyOnTheRun/dungeons-of-noudar,TheFakeMontyOnTheRun/dungeons-of-noudar | DungeonsOfNoudar486/make_palette.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for earlier change to api models\n\nOops! Apparently I forgot to run makemigrations after a minor change to\nAPI models."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode... | python | new_file | 1 | 0 | bsd-3-clause | 363f93e1ea11fe99311df06d6dfcba76343f3c4e | unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api | django/sierra/api/migrations/0002_auto_20190517_1053.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for optional Python database API features which are not implemented"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom turbodbc import connect\n\n\ndsn = \"Exasol R&D test database\"\n\n\nclass ... | python | new_file | 1 | 1 | mit | 5fbf720c97d08144a3518c8995a3b76d2b923377 | blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc | python/turbodbc_test/test_cursor_unsupported_features.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD Network association_requests unit tests"
},
{
"role": "assistant",
"content": "\ndef test_send_association_request(client):\n result = client.post(\"/association-requests/request\", data={\"id\": \"54623156\", \"address\":... | python | new_file | 1 | 1 | apache-2.0 | 639143e3145682d776251f39f0a791f0c77e5169 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | apps/domain/tests/test_routes/test_association_requests.py | rejected_duplicate | Near-duplicate of sample 7182 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\ndef __getfilesystemencoding():\n '''\n Note: there's a copy of this method in interpreterInfo.py\n '''\n import sys\n try:\n ret = sys.getfilesystemencoding()\n if not ret:\n raise RuntimeError('Unabl... | python | edit | 1 | 6 | apache-2.0 | f81a2f9e3f1123ec474bce3278107a94c70e0dc3 | salguarnieri/intellij-community,ThiagoGarciaAlves/intellij-community,allotria/intellij-community,semonte/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,da1z/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,xfournet/intellij-community,salgu... | python/helpers/pydev/_pydev_bundle/_pydev_filesystem_encoding.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix column data type in vendors table"
},
{
"role": "assistant",
"content": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"\nBring vendors' start_date an... | python | new_file | 1 | 1 | apache-2.0 | 789bcb17da60c17e521d442c21dc6fe1aec28392 | plamut/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core | src/ggrc/migrations/versions/20170203150557_7471e16ebb76_fix_vendors_columns_data_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create code to plot Horizontal Illuminance."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n \nimport numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\n\n# This code plot the hor... | python | new_file | 3 | 0 | mit | bff3f017a889da1922355e05b598895f59d841de | sophiekovalevsky/Visible-Light-Communication | horizontalIlluminance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Twilio text message beacon\n\nThis beacon will poll a Twilio account for text messages\nand emit an event on Salt's event bus as texts are received."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\nBeacon ... | python | new_file | 5 | 10 | apache-2.0 | c5433454a14f4dd6c3d84735e920144914ca6f2d | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/beacons/twilio_txt_msg.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for 232 implement queue using stack."
},
{
"role": "assistant",
"content": "class Stack(object):\n def __init__(self):\n \"\"\"\n initialize your data structure here.\n \"\"\"\n self.__... | python | new_file | 1 | 1 | mit | a0fea14fe7fd5a938e0f2583dbd9dc6bb9040bc1 | comicxmz001/LeetCode,comicxmz001/LeetCode | Python/232_ImplementQueueUsingStack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple hybrid recommender from Zhou et. al"
},
{
"role": "assistant",
"content": "def predict(predictions_vector_0, predictions_vector_1, mixing_variable=0.5, num_partitions=30):\n \"\"\"Apply a simple linear hybrid reco... | python | new_file | 7 | 4 | apache-2.0 | 53c9b988d2ccda253080deaa35b70d814309a4aa | tiffanyj41/hermes,tiffanyj41/hermes,tiffanyj41/hermes,tiffanyj41/hermes | src/algorithms/simple_hybrid.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix old Briefs missing niceToHaveRequirements field\n\nThis was causing errors when suppliers applied to these Briefs\nand any copies of them."
},
{
"role": "assistant",
"content": "\"\"\"Adds missing 'niceToHaveRequirements' to ... | python | new_file | 1 | 3 | mit | 014010bec210bc4ebb7d24dbdd21a0cdf75bee2f | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/990_add_missing_nice_to_have_requirements_field.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for xforwardedfor middleware"
},
{
"role": "assistant",
"content": "\"\"\"Test the X-Forwarded-For middleware.\"\"\"\n\nfrom ..middleware.xforwardedfor import xforwardedfor\n\n\ndef get_response_method(thing):\n \"\"... | python | new_file | 1 | 1 | bsd-3-clause | 698273ac6863eeaa3963c84fac6a49a918cc261b | ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder | freelancefinder/freelancefinder/tests/test_xforwardedfor_middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Celery file to async tasks"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, unicode_literals\nimport os\nfrom celery import Celery\n\n# set the default Django settings module for the 'celery' pro... | python | new_file | 1 | 1 | mit | b7da0da12d74d111cff72e74ae487864c53fa808 | semorale/backend-test,semorale/backend-test,semorale/backend-test | django_backend_test/django_backend_test/celery.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Increase length of company field"
},
{
"role": "assistant",
"content": "# Generated by Django 3.2.7 on 2021-10-28 19:02\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies =... | python | new_file | 1 | 0 | mit | dd1d51ba29b2f3729431c1552fd955697d04a0f7 | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | museum_site/migrations/0004_alter_file_company.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [UPD] Add a script to add manually a new user"
},
{
"role": "assistant",
"content": "# !/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"Script to add a new user.\"\"\"\n\nimport os\nimport sys\n\nsys.path.append(os.path.ab... | python | new_file | 3 | 1 | mit | 81e3cc0800793b9e540066831b72ab6df3a1d358 | frapac/bibtex-browser,frapac/bibtex-browser,frapac/bibtex-browser | scripts/add_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check AWS instances register in mesos\n\nThis is a quick attempt to give us visibility of AWS resources that\ndon't end up registering in mesos.\n\nThis covers a lot of potential problems with the bootstrap process.\n\nThis could be better:\... | python | new_file | 3 | 5 | apache-2.0 | bb9e626b3d8d8d83aa3d0eb951b5610041ce6070 | somic/paasta,Yelp/paasta,Yelp/paasta,somic/paasta | paasta_tools/contrib/check_registered_slaves_aws.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove Duplicates From Sorted Array II"
},
{
"role": "assistant",
"content": "#Too many mistakes were made.\n#0. should use while loop instead of for.\n#1. messed up with index. maybe with the sleepy head at 3pm\nclass Solution:\... | python | new_file | 3 | 8 | mit | 0e562045ad47f55f799054dd29c51a465ac926a3 | sureleo/leetcode,sureleo/leetcode,lsingal/leetcode,sureleo/leetcode,lsingal/leetcode,lsingal/leetcode | python/array/RemoveDuplicatesFromSortedArrayII.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for unicode characters in Validate errors"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom pyxform.tests_v1.pyxform_test_case import PyxformTestCase\n\nclass ValidateUnicodeEx... | python | new_file | 1 | 1 | bsd-2-clause | b5abd635f5aee8c6a89aa51136e49913e41d256a | XLSForm/pyxform,XLSForm/pyxform | pyxform/tests_v1/test_validate_unicode_exception.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test fro add_items_to_message function."
},
{
"role": "assistant",
"content": "from django_logutils.utils import add_items_to_message\n\n\ndef test_add_items_to_message():\n msg = \"log message\"\n items = {'user': 'ben... | python | new_file | 1 | 1 | bsd-3-clause | 822ef2f1d182409d51da16c2b589603f1ef9e27f | jsmits/django-logutils,jsmits/django-logutils | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [jsk_2015_apc_common] Add bof object recognition test script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport cPickle as pickle\nimport gzip\nimport sys\n\nimport cv... | python | new_file | 3 | 0 | bsd-3-clause | c28127941ed88fdedc084c6227da3b921a5e15ab | pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc | jsk_apc2015_common/scripts/test_bof_object_recognition.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fuzz target for WebSocket parser."
},
{
"role": "assistant",
"content": "import sys\n\nimport atheris\n\n\nwith atheris.instrument_imports():\n from websockets.exceptions import PayloadTooBig, ProtocolError\n from webso... | python | new_file | 1 | 4 | bsd-3-clause | 5d1bad7ebb1121349d08260554368553c02d1a37 | aaugustin/websockets,aaugustin/websockets,aaugustin/websockets,aaugustin/websockets | fuzzing/fuzz_websocket_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add proper tests to importstring."
},
{
"role": "assistant",
"content": "\"\"\"Tests for IPython.utils.importstring.\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (C) 2013 ... | python | new_file | 1 | 1 | bsd-3-clause | 8ce76a8b2e0310b0adeceef60478ad7baeceba8c | ipython/ipython,ipython/ipython | IPython/utils/tests/test_importstring.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for changes to model"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.6 on 2016-05-28 14:11\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, mode... | python | new_file | 1 | 0 | bsd-3-clause | 632b5b3fedef17b908cb29d777b52b69d2127da1 | jrsupplee/django-activity-stream,jrsupplee/django-activity-stream | actstream/migrations/0003_auto_20160528_1411.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert video files captured with raspivid"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport time\nimport os\nimport glob\nimport sys\nimport shutil\n\ndef RPxLog(severity, message):\n\tprint time.time(), sev... | python | new_file | 2 | 1 | apache-2.0 | dfbff1c8e1e9acdf66da4caf7ace35fd0b2ce161 | RPxDrones/RPxCamera,RPxCopter/RPxCamera,RPxCopter/RPxCamera,RPxDrones/RPxCamera | RPxVideoConverter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for transaction proxy"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom aiohttp.test_utils import make_mocked_request\nfrom plone.server.browser import View\nfrom plone.server.transactions import Requ... | python | new_file | 1 | 1 | bsd-2-clause | 2459ddc77429b1a77de9e32ab551649a2abc2517 | plone/plone.server,plone/plone.server | src/plone.server/plone/server/tests/test_transactions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test assignment of permissions to roles"
},
{
"role": "assistant",
"content": "\"\"\"\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom byceps.services.authorization imp... | python | new_file | 1 | 2 | bsd-3-clause | 35c4696b87bd167dc9766a58391faf9b776305ad | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps | tests/services/authorization/test_permission_to_role_assignment.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to generate hashes for all streams that need them.\n\n(imported from commit b3a05e47dfe69b44f984185e360d79bf04f7885b)"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom django.core.managemen... | python | new_file | 1 | 2 | apache-2.0 | 639aac964e1c4bc311f4b3e8dd9a0c015f3c81c3 | luyifan/zulip,TigorC/zulip,Vallher/zulip,jphilipsen05/zulip,xuxiao/zulip,tiansiyuan/zulip,ufosky-server/zulip,tommyip/zulip,armooo/zulip,hj3938/zulip,praveenaki/zulip,kaiyuanheshang/zulip,Qgap/zulip,vabs22/zulip,babbage/zulip,arpitpanwar/zulip,suxinde2009/zulip,johnny9/zulip,Cheppers/zulip,littledogboy/zulip,hackerkid/... | zerver/management/commands/populate-stream-tokens.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to populate the Subset table"
},
{
"role": "assistant",
"content": "import os\nfrom models import db, Subset\n# importing from admin rather than db, because it needs app context\nfrom admin import app\n\n\nif __name__ ... | python | new_file | 2 | 0 | mit | 1b39f2427a1ba777968908344836fd597bcea428 | CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic | clic/web/fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to invalidate all of a particular variant.\n\nSigned-off-by: Chris Lamb <<EMAIL>>"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\n\nfrom ...utils import get_va... | python | new_file | 1 | 2 | bsd-3-clause | 36924c92d91c7e29743a4a7b799c3e87a92cf38e | lamby/django-yadt,thread/django-yadt | django_yadt/management/commands/yadt_invalidate_variant.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Replace the clumsy Makefile with proper command infrastructure\n\nSemantix now has a proper infrastructure for shell commands, complete\nwith argument passing and complex sub-commands. Every semantix-based\nproject (including semantix itsel... | python | new_file | 1 | 1 | mit | 1536dbee308527e2b8f7a3c734e1020b20e962f0 | sprymix/importkit | sx.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for `anaconda copy`"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n# Standard library imports\nimport json\nimport unittest\n\n# Local imports\nfrom binstar_client.scripts.cli import main... | python | new_file | 1 | 1 | bsd-3-clause | 92f14f351c3674531c011923443f8b3b528543d9 | Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client | binstar_client/tests/test_copy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a description to word lists."
},
{
"role": "assistant",
"content": "\"\"\"Add description to list\n\nRevision ID: 1d8e0b3b949\nRevises: 594033d136f\nCreate Date: 2014-07-20 13:37:41.064387\n\n\"\"\"\n\n# revision identifiers,... | python | new_file | 1 | 1 | mit | 4011063de1cc14fd758dd8537ebf10c8c1491149 | gmwils/cihui | migrations/versions/1d8e0b3b949_add_description_to_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test dropdown remove options."
},
{
"role": "assistant",
"content": "import json\n\nfrom dash import Dash, html, dcc, Output, Input\nfrom dash.exceptions import PreventUpdate\n\n\nsample_dropdown_options = [\n {\"label\": ... | python | new_file | null | null | mit | 94b7a913ca0d9ce5d4c58539954afef55d21c3a7 | plotly/dash,plotly/dash,plotly/dash,plotly/dash,plotly/dash | components/dash-core-components/tests/integration/dropdown/test_remove_option.py | rejected_code_smell | Internal duplication: ~88% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: Test for purge main entry point"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# FOGLAMP_BEGIN\n# See: http://foglamp.readthedocs.io/\n# FOGLAMP_END\n\n\"\"\" Test tasks/purge/__main__.py entry point\n\n\"\"\"\... | python | new_file | 1 | 1 | apache-2.0 | 7409b02842708c693695b473cca14546180a4484 | foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP,foglamp/FogLAMP | tests/unit/python/foglamp/tasks/purge/test_purge_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python wrapper for tf.contrib.hadoop.SequenceFileDataset\n\nSigned-off-by: Yong Tang <<EMAIL>>"
},
{
"role": "assistant",
"content": "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apac... | python | new_file | 3 | 1 | apache-2.0 | fa9f9a0f76c86bfabd2e63db2add2829a749f639 | hehongliang/tensorflow,dancingdan/tensorflow,aam-at/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,alsrgv/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow,Intel-Corporation/tensorflow,ageron/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,seanli9jan/tensorflow,kobejean/tensorflow,ppwwyyxx/tensorflow,davidz... | tensorflow/contrib/hadoop/python/ops/hadoop_dataset_ops.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add UMA 2.0 SCIM/Passport script"
},
{
"role": "assistant",
"content": "# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.\n# Copyright (c) 2017, Gluu\n#\n# Author: Jose Gonz... | python | new_file | 18 | 5 | mit | a9b8b3e059bdd5024fccb2efe134a3f98a89d830 | GluuFederation/community-edition-setup,GluuFederation/community-edition-setup,GluuFederation/community-edition-setup | static/extension/uma_rpt_policy/UmaClientAuthzRptPolicy.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add base celery operation task"
},
{
"role": "assistant",
"content": "from pipelines.models import Operation\nfrom polyaxon.celery_api import CeleryTask\n\n\nclass OperationTask(CeleryTask):\n \"\"\"Base operation celery task ... | python | new_file | 1 | 1 | apache-2.0 | e17ef12deb0d80f89f9791225f128bbad91667b2 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/pipelines/celery_task.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ScriptFields object used as parameter script_fields of Search object"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__author__ = 'Armando Guereca'\n\nclass ScriptFields:\n _interna... | python | new_file | 4 | 5 | bsd-3-clause | 269439513e2f9f84e89592565b20d9ff193fe210 | rookdev/pyes,jayzeng/pyes,mouadino/pyes,jayzeng/pyes,mouadino/pyes,aparo/pyes,HackLinux/pyes,aparo/pyes,haiwen/pyes,Fiedzia/pyes,rookdev/pyes,mavarick/pyes,aparo/pyes,HackLinux/pyes,haiwen/pyes,HackLinux/pyes,Fiedzia/pyes,jayzeng/pyes,mavarick/pyes,haiwen/pyes,mavarick/pyes,Fiedzia/pyes | pyes/scriptfields.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for EC lots"
},
{
"role": "assistant",
"content": "import unittest\nimport sys\n\nsys.path.append('../..') # TODO anybetter way?\n\nfrom ebroker.EasyClickLots import EasyClickLots\n\nclass TestConfig(unittest.TestCase):\... | python | new_file | 1 | 1 | mit | f5a6b3f36e676bddadd0c9f04678989c8fca019a | vjuranek/e-broker-client | test/unit/test_easy_click_lots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python expansion service entry point."
},
{
"role": "assistant",
"content": "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# ... | python | new_file | 1 | 1 | apache-2.0 | d13c21f2b0d6a0b72a3ba2f3e24d198d644737ec | robertwb/incubator-beam,chamikaramj/beam,chamikaramj/beam,lukecwik/incubator-beam,apache/beam,lukecwik/incubator-beam,robertwb/incubator-beam,robertwb/incubator-beam,chamikaramj/beam,apache/beam,lukecwik/incubator-beam,apache/beam,chamikaramj/beam,chamikaramj/beam,apache/beam,lukecwik/incubator-beam,robertwb/incubator-... | sdks/python/apache_beam/runners/portability/expansion_service_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove section name - migrate"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n ... | python | new_file | 3 | 0 | mit | a9a3d77c3969889dafaac5b6dd1c133f9510496f | DigitalMockingbird/EULAThingy,DigitalMockingbird/EULAThingy | eulathingy/thingys/migrations/0004_remove_thingysection_section_name.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for model app_name change in preceding commit"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaM... | python | new_file | 3 | 1 | bsd-2-clause | 067ccc7256d258a5b7b7a57beb26ed70488d1be2 | philipsouthwell/mezzanine-slideshows,philipsouthwell/mezzanine-slideshows,philipsouthwell/mezzanine-slideshows,adam494m/mezzanine-slideshows,adam494m/mezzanine-slideshows,adam494m/mezzanine-slideshows | mezzanine_slideshows/migrations/0003_auto__del_slideshow.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for setting contact-level backend ids in bulk"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom optparse import make_option\nfrom corehq.apps.sms.mixin impor... | python | new_file | 4 | 10 | bsd-3-clause | c13307bb4dd28b06bc1c4bb0c8182bed41a2e608 | dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | corehq/apps/sms/management/commands/set_backend_ids.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests to demonstrate bad Host header problem"
},
{
"role": "assistant",
"content": "import pytest\nimport requests\n\n\nclass TestRedirect:\n\n @pytest.mark.parametrize(\n 'path', ('/mesos_dns', '/net', '/exhibitor'... | python | new_file | 1 | 2 | apache-2.0 | 0f106ca30805a3541000f5129b203882ba7cfbb9 | dcos/dcos,GoelDeepak/dcos,kensipe/dcos,mesosphere-mergebot/dcos,kensipe/dcos,kensipe/dcos,dcos/dcos,dcos/dcos,mesosphere-mergebot/mergebot-test-dcos,dcos/dcos,GoelDeepak/dcos,mesosphere-mergebot/dcos,mesosphere-mergebot/mergebot-test-dcos,mesosphere-mergebot/mergebot-test-dcos,mesosphere-mergebot/dcos,GoelDeepak/dcos,d... | packages/adminrouter/extra/src/test-harness/tests/test_security.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first pass at BETS location dump"
},
{
"role": "assistant",
"content": "import csv\nfrom django.core.management.base import BaseCommand\nfrom corehq.apps.locations.models import SQLLocation\nfrom custom.enikshay.integrations.... | python | new_file | 2 | 4 | bsd-3-clause | bb8db2ef08b0431b173205f53a4431fcec3dc535 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/enikshay/management/commands/get_locations_for_bets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create bar charts with error bars for foj sensitivity scores."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# a bar plot with errorbars\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# extract column of t... | python | new_file | null | null | mit | 79ee7795135f9cba31aefdf9b752da24e98c6337 | Nodoka/Bioquality,Nodoka/Bioquality | graphing/classification_method_score_meandiffbar.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add Xcode link map analyzer"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# Copyright 2018 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in c... | python | new_file | 1 | 0 | apache-2.0 | a2f991625bc6de9895efb443175b59dfc12d1236 | mehrdada/grpc,sreecha/grpc,muxi/grpc,vjpai/grpc,grpc/grpc,pszemus/grpc,sreecha/grpc,firebase/grpc,murgatroid99/grpc,chrisdunelm/grpc,ncteisen/grpc,ctiller/grpc,firebase/grpc,jboeuf/grpc,ejona86/grpc,jboeuf/grpc,Vizerai/grpc,nicolasnoble/grpc,grpc/grpc,stanley-cheung/grpc,grpc/grpc,pszemus/grpc,stanley-cheung/grpc,jtatt... | src/objective-c/tests/analyze_link_map.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add custom stamp to add its-base revision to version number\n\nChange-Id: I87bacf25e25e58ee4c648963912056726cd297dc"
},
{
"role": "assistant",
"content": "import os\nimport sys\n\n# As this plugin is typically only sym-linked int... | python | new_file | 1 | 1 | apache-2.0 | e89997b998766a257ca9ce58b0528bd0b7504ed1 | GerritCodeReview/plugins_its-phabricator,GerritCodeReview/plugins_its-phabricator | tools/workspace_status_release.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add framework for example client"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport npyscreen\nimport curses\n\nclass EditorFormExample(npyscreen.FormMutt):\n MAIN_WIDGET_CLASS = npyscreen.BufferPager\n\n ... | python | new_file | 10 | 1 | mit | 7834829bf3d2d97814366ca62826c2c19fd9144e | mtearle/npyscreenreactor | EXAMPLE-npyscreenreactor-client.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 718. Maximum Length of Repeated Subarray\n\n718. Maximum Length of Repeated Subarray: https://leetcode.com/problems/maximum-length-of-repeated-subarray/"
},
{
"role": "assistant",
"content": "class Solution(ob... | python | new_file | 1 | 5 | apache-2.0 | 3fdd2de650c24933ae32eb07b85ede34165702fc | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/maximum-length-of-repeated-subarray.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add corporation flag in blueprints"
},
{
"role": "assistant",
"content": "\"\"\"add corporation flag\n\nRevision ID: d03236a0cda4\nRevises: 47e567919169\nCreate Date: 2017-04-12 13:21:03.482000\n\n\"\"\"\n\n# revision identifiers... | python | new_file | 1 | 1 | bsd-3-clause | 0ff59da2bd80d28002b3a963dee5bc48ad851ad8 | Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith | migrations/versions/d03236a0cda4_add_corporation_flag.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test in a new file"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom pycublas import *\nfrom ctypes import *\n\n#Test functions\nhandle = cublasHandle_t()\n\ndef Init():\n status = cublasCreate(byref(handl... | python | new_file | 11 | 1 | bsd-3-clause | 77a2ce5ffff72f6414fd11ea37a08048b81edf8b | Vrekrer/PycuBLAS | test.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 29"
},
{
"role": "assistant",
"content": "class Solution:\n \"\"\"\n @params s1, s2, s3: Three strings as description.\n @return: return True if s3 is formed by the interleaving of\n ... | python | new_file | 1 | 15 | mit | 247f303c2d5e60108fbd3054f012e6b24859dd26 | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Medium/029_Interleaving_String.py | rejected_complexity | Cyclomatic complexity too high: 15 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add REPL that evaluates code on various Python versions"
},
{
"role": "assistant",
"content": "\"\"\"A repl across hosts.\"\"\"\nimport ast\nimport sys\nimport readline\nimport traceback\nfrom io import StringIO\n\n\ndef read_stm... | python | new_file | 5 | 9 | apache-2.0 | 4e6028b528592a5b23ff13f40422a3d850e1fd44 | lordmauve/chopsticks,lordmauve/chopsticks | repl.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a sensor feedback sample"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#coding: utf-8\nimport sys,time\n\nj1,j2,j3,j5,j6 = 0,60,0,0,0\n\nwhile True:\n # \u001b$B%m%\\%C%H$N3QEY$NFI$_9~$_<~4|$O\u001b(B20ms\u... | python | new_file | 2 | 0 | mit | 8a7befd69d4a7b224e037b4eb8111853125a1105 | ryuichiueda/RobotDesign3,ryuichiueda/RobotDesign3,ryuichiueda/RobotDesign3,ryuichiueda/RobotDesign3,ryuichiueda/RobotDesign3 | code_sample/python/sensor_avoid.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ability for ExternalTaskSensor to wait on multiple runs of a task\n\nCurrently using the execution_date_fn parameter of the ExternalTaskSensor\nsensors only allows to wait for the completion of one given run of the\ntask the ExternalTask... | python | new_file | 3 | 0 | apache-2.0 | b1c02240b8c2b291d43c70100c517a6038a91de4 | yati-sagade/incubator-airflow,yati-sagade/incubator-airflow,yati-sagade/incubator-airflow,yati-sagade/incubator-airflow | tests/dags/test_external_task_sensor_fn_multiple_execution_dates_dags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove obsolete table from database"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.9 on 2018-01-26 00:19\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\nD... | python | new_file | 1 | 0 | mit | c7e5a46348b48e081b122f1e0f8a578b2bfaf05a | OpenHumans/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans | open_humans/migrations/0008_rm_ghost_illuminauyg_table.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Graph rendering"
},
{
"role": "assistant",
"content": "from django.contrib.contenttypes.models import ContentType\nfrom django.test import TestCase\n\nfrom dcim.models import Site\nfrom extras.choices import ExportT... | python | new_file | 1 | 1 | apache-2.0 | 123a58bf7d09c804eb502220278ef9e1346538cd | digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox | netbox/extras/tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [AC-8797] Add migration to use full gender spec"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2.24 on 2021-07-01 20:17\n\nfrom django.db import migrations\n\n\ndef update_criterion_specs(apps, schema_editor):\n ... | python | new_file | 1 | 1 | mit | 094deed52071e74225b8196079a34bda07230d39 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0063_update_gender_criteria_to_full_gender_spec.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create (beginnings of a) Python module for misc BatStack related functions.\n\nFirst method, read_chanmap, for reading plaintext files that specify\nchannel mappings, i.e. how local numbering maps to the global of an\nentire Array system.\n\... | python | new_file | 4 | 11 | bsd-3-clause | ea8dabdceec103fc9aa7f3da665a08340a42f931 | slivingston/BatStack,slivingston/BatStack,slivingston/BatStack,slivingston/BatStack,slivingston/BatStack | src/util/batstack.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple task to test integration of celery\n\nThis adds a very simple logging task that just dumps and argument out to\nthe log. This can be used to setup a periodic task that will show that\nall of the workers (worker, beat and celerycam... | python | new_file | 1 | 1 | mit | 4f663ff7a7ee05163e2cbd819412cfa76001dee1 | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | stagecraft/apps/collectors/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add data/settings fields to document/collection"
},
{
"role": "assistant",
"content": "# Generated by Django 3.1.8 on 2021-05-05 15:20\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n ... | python | new_file | 1 | 0 | mit | 7d9955c85bf48e57f1ed0a0e77a89df8bf95e6aa | fin/froide,fin/froide,fin/froide,fin/froide | froide/document/migrations/0025_auto_20210505_1720.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate visualization pairs for predicted labels"
},
{
"role": "assistant",
"content": "\"\"\"Generate visualization pairs (emotion label - concept type) for predicted\nlabels.\n\nInput: directory containing text f... | python | new_file | 2 | 0 | apache-2.0 | 91503c4cd8afcfdf483bf7dbd3090e2b57e7ae5c | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | predictions2visualization-pairs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for tidying up old values in progress fields"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.10 on 2018-03-28 07:50\nfrom __future__ import unicode_literals\n\nfrom django.... | python | new_file | 1 | 1 | mit | 0e2317d1b2af7b88f626cefa7a1e187c5823eef7 | DXCanas/kolibri,jonboiser/kolibri,lyw07/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,jonboiser/kolibri,DXCanas/kolibri,indirectlylit/kolibri,benjaoming/kolibri,lyw07/kolibri,christianmemije/kolibri,lyw07/kolibri,DXCanas/kolibri,DXCanas/kolibri,lyw07/kolibri,mrpau/kolibri,benjaom... | kolibri/logger/migrations/0004_tidy_progress_range.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights count black cells problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Count Black Cells Problem\n\nfrom fractions import gcd\n\n\ndef countBlackCells(m, n):\n # Manhattan dis... | python | new_file | 1 | 3 | mit | ab017e9bbf0ffd19d9d8e5a933989e9111f00e77 | HKuz/Test_Code | CodeFights/countBlackCells.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to denormalize channel and containers"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom opps.channels.models import Channel\nfrom opps.containers... | python | new_file | 3 | 3 | mit | e080c174e4430684856d8d5877c75fd15d5e0f48 | YACOWS/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,williamroot/opps,williamroot/opps | opps/core/management/commands/update_channel_denormalization.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write a function that print something n times including relatives spaces"
},
{
"role": "assistant",
"content": "# Write a function that print something n times\r\n# including relatives spaces\r\n\r\n\r\ndef pprint(wyp, ntimes):\r... | python | new_file | 2 | 1 | mit | 1e41ce969b3162797ed8a47a4e52d448550481ae | let42/python-course | src/functions/exercise6.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add complete test for javascript sourcemap resolving"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\nfrom __future__ import absolute_import\n\nimport os\nimport json\nimport responses\n\nfrom sentry.testutils import Tes... | python | new_file | 1 | 1 | bsd-3-clause | 7b098f1ca44aa7b149987cd2f16280e39a7d2040 | gencer/sentry,gencer/sentry,looker/sentry,beeftornado/sentry,mvaled/sentry,ifduyue/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry,gencer/sentry,ifduyue/sentry,looker/sentry,mvaled/sentry,gencer/sentry,mvaled/sentry,looker/sentry,ifduyue/sentry,beeftornado/sentry,beeftornado/sentry,gencer/sentry,mvaled/sentry,looker/... | tests/sentry/lang/javascript/test_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for conflict message from requirements.txt"
},
{
"role": "assistant",
"content": "from tests.lib import create_basic_wheel_for_package\n\n\ndef test_new_resolver_conflict_requirements_file(tmpdir, script):\n create_basic_... | python | new_file | 1 | 1 | mit | 906072a29277bc1727271ac121886e5158085d03 | pfmoore/pip,sbidoul/pip,pradyunsg/pip,pfmoore/pip,sbidoul/pip,pypa/pip,pypa/pip,pradyunsg/pip | tests/functional/test_new_resolver_errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [RM-11742] Add argparse tests for mds\n\nSigned-off-by: Travis Rhoden <<EMAIL>>"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom ceph_deploy.cli import get_parser\n\n\nclass TestParserMDS(object):\n\n def setup(sel... | python | new_file | 1 | 2 | mit | 477db3854ce527cb410c5814ae8dfab1e6bef35b | trhoden/ceph-deploy,Vicente-Cheng/ceph-deploy,shenhequnying/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,branto1/ceph-deploy,branto1/ceph-deploy,shenhequnying/ceph-deploy,isyippee/ceph-deploy,SUSE/ceph-deploy,SUSE/ceph-deploy,imzhulei/ceph-deploy,trhoden/ceph-deploy,zhouyuan/ceph-deploy,osynge/ceph-deploy,osynge/ceph-dep... | ceph_deploy/tests/parser/test_mds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Put internal paths in one place."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n\n# Copyright 2017 Eddie Antonio Santos <<EMAIL>>\n#\n# Licensed under the Apache License, Version 2.0 (the ... | python | new_file | 1 | 0 | apache-2.0 | b455d767cd8f9c57fad4f9bc4b322952512bf2c3 | naturalness/sensibility,naturalness/sensibility,naturalness/sensibility,naturalness/sensibility | sensibility/_paths.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Twitter. 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 License at\n#\n# h... | python | edit | 1 | 1 | apache-2.0 | 348536786d6194f0f23475427f96a5f5b69c0743 | tomncooper/heron,tomncooper/heron,lewiskan/heron,streamlio/heron,twitter/heron,ashvina/heron,mycFelix/heron,twitter/heron,huijunwu/heron,lucperkins/heron,tomncooper/heron,tomncooper/heron,lucperkins/heron,srkukarni/heron,objmagic/heron,lewiskan/heron,lewiskan/heron,ashvina/heron,lucperkins/heron,streamlio/heron,huijunw... | heron/tools/cli/src/python/version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add File with decorator functions"
},
{
"role": "assistant",
"content": "# from slave1 import Slave1\n# from slave2 import Slave2\n\nimport rocksdb\nimport encodings\n\n\n\n# class Replica:\n\n# def __init__(self):\n# ... | python | new_file | 3 | 1 | mit | 88245c20019ca92caeeb16c05583e9d60b4d7b7f | rimpybharot/CMPE273 | assignment2/Replicator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport inflection\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nsetup(\n name='inflection',\n version=inflection.__version__... | python | edit | 1 | 0 | mit | f1b4309cd515ac2c689026c10f025dff92c6504e | ascott1/inflection,SiviVuk/inflection,willbarton/inflection,panvagenas/inflection,jpvanhal/inflection | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to create reference output databases"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n\nimport os\n\nfrom cyclus_tools import run_cyclus\nfrom tests_list import sim_files\n\ndef main():\n \"\"\"Creates... | python | new_file | 1 | 1 | bsd-3-clause | dc9c71cdfdcfec88f90d83111d159a9926c2191f | gonuke/cycamore,jlittell/cycamore,gonuke/cycamore,rwcarlsen/cycamore,cyclus/cycaless,rwcarlsen/cycamore,Baaaaam/cyCLASS,Baaaaam/cyCLASS,rwcarlsen/cycamore,Baaaaam/cycamore,cyclus/cycaless,Baaaaam/cyBaM,jlittell/cycamore,gonuke/cycamore,Baaaaam/cyBaM,rwcarlsen/cycamore,Baaaaam/cyBaM,jlittell/cycamore,Baaaaam/cyBaM,gonuk... | tests/create_references.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a command to create provider migrations"
},
{
"role": "assistant",
"content": "import os\n\nfrom django.apps import apps\nfrom django.db.migrations.state import ProjectState\nfrom django.core.management.base import BaseComman... | python | new_file | 1 | 5 | apache-2.0 | e361aadf64ea10ec337c349e182608ab3a305dcf | laurenbarker/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,zamattiac/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,aaxelb/SHARE,laurenbarker/SHARE,zamattiac/SHARE,CenterForOpenScience/SHARE,zamattiac/SHARE,aaxelb/SHARE | share/management/commands/makeprovidermigrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"example.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_fro... | python | edit | 1 | 0 | apache-2.0 | b196d5e58c611508bbc0bf891752d6abf135b67d | texastribune/tt_app_templates,texastribune/tt_app_templates | generic/example/manage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nfrom setuptools import find_packages, setup\n\n\nVERSION = '2.0.dev0'\n\n\ninstall_requires = [\n 'django-local-settings>=1.0a10',\n 'stashward',\n]\n\nif sys.version_info[:2] < (3, 4):\n install_requires.append('enum... | python | edit | 1 | 0 | mit | 26450ba129b16d5a6c8a660e8df21c1d016903c4 | wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic server to go along with."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom socket import socket, AF_UNIX, SOCK_STREAM\nimport os\n\ns = socket(AF_UNIX, SOCK_STREAM)\ns.bind('/tmp/socket_lua_debug')\... | python | new_file | 2 | 0 | mit | 8cb59ab74717624f1f4acbacc496f9455d90a92c | laarmen/lua_debug,laarmen/lua_debug | ldb.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to recalculate the field"
},
{
"role": "assistant",
"content": "from django.conf import settings\nfrom django.core.management import BaseCommand, CommandError\nfrom django.utils import timezone\n\nfrom lega... | python | new_file | 1 | 7 | mit | ae928afd0752c9f66b3b6701f67502013f2869ca | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/legalaid/management/commands/recalculate_assigned_out_of_hours.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of the embed coverart plugin.\n\nThis plugin allows users to embed the cover into the audio file.\nProbaly still has a few bugs but it should work in most cases right\nnow."
},
{
"role": "assistant",
"content"... | python | new_file | 3 | 5 | mit | 0628d8df0eb59e1b47d8bc01cb9c3bd566829d6e | ruippeixotog/beets,dfc/beets,mried/beets,arabenjamin/beets,krig/beets,ibmibmibm/beets,jackwilsdon/beets,asteven/beets,sampsyo/beets,asteven/beets,Kraymer/beets,beetbox/beets,Andypsamp/CODfinalJUNIT,jackwilsdon/beets,Wen777/beets,krig/beets,swt30/beets,YetAnotherNerd/beets,shamangeorge/beets,artemutin/beets,drm00/beets,... | beetsplug/embedcoverart.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add class to raise app exceptions"
},
{
"role": "assistant",
"content": "import six\n\nclass AppError(Exception):\n \"\"\"App exception\"\"\"\n\n def __init__(self, reason, response=None):\n self.reason = six.text_ty... | python | new_file | 1 | 1 | mit | 69a07d161295e217324d28948b1d565e2170e636 | rebearteta/social-ideation,joausaga/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,joausaga/social-ideation,joausaga/social-ideation,rebearteta/social-ideation | app/error.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add placeholders for base classes"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport aardvark\nimport numpy as gpib\nimport scipy as serial\nimport socket\n\nclass Instrument(object):\... | python | new_file | 3 | 1 | bsd-3-clause | ff0fc074972adad68173a44866343156696660f3 | kitmonisit/microlab-instruments | microlab_instruments/base_classes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to find ccs record cases without delivery form"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport csv\n\nfrom django.core.manage... | python | new_file | 1 | 4 | bsd-3-clause | 4561811f536e887cb1fda331bee813ed313cbef8 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds/management/commands/find_cases_with_no_delivery.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add K Means clustering algorithm"
},
{
"role": "assistant",
"content": "import numpy as np\n\nclass KMeans(object):\n\tdef __init__(self, inputs, clusters):\n\t\tself.inputs = np.array(inputs)\n\t\tif self.inputs.ndim == 1:\n\t\t... | python | new_file | 1 | 3 | mit | 13fc24f18f0b86781aa96deb95d4d8fa2cfc1706 | prasanna08/MachineLearning | KMeans.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for /target post"
},
{
"role": "assistant",
"content": "from django.test import Client, TestCase\nfrom django.core.urlresolvers import reverse\nfrom breach.models import Target\nfrom breach.views import VictimListView\ni... | python | new_file | 3 | 1 | mit | 87ac04769baef5dd9e93cf72def19126012b94c7 | dionyziz/rupture,esarafianou/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dion... | backend/breach/tests/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use 'modified' field as default for 'updated'"
},
{
"role": "assistant",
"content": "from django.db import models, migrations\n\ndef set_updated(apps, schema_editor):\n Proposal = apps.get_model(\"proposal\", \"Proposal\")\n ... | python | new_file | 3 | 2 | mit | 2f34973ff41c868c6102f6faf6952f2ea87e7895 | codeforboston/cornerwise,codeforboston/cornerwise,cityofsomerville/cornerwise,codeforboston/cornerwise,cityofsomerville/citydash,cityofsomerville/citydash,cityofsomerville/cornerwise,codeforboston/cornerwise,cityofsomerville/citydash,cityofsomerville/cornerwise,cityofsomerville/citydash,cityofsomerville/cornerwise | server/proposal/migrations/0025_set_proposal_updated.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an interactive test script for exercising curses"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $\n#\n# Interactive test suite for the curses module.\n# T... | python | new_file | 1 | 3 | mit | acd5ab934394a8673439cafa01dba14b051b4250 | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/curses_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Feeder: Add the feeder role in the ROLES table\n\nChange-Id: I4c09e0a5e7d08975602a683f4cecbf993cdec4ba"
},
{
"role": "assistant",
"content": "#\n# Copyright (C) 2017 Red Hat, Inc\n#\n# Licensed under the Apache License, Version 2... | python | new_file | 1 | 1 | apache-2.0 | 4570ce14333ebc0bae3e09a59f28d7170cfc4621 | redhat-cip/dci-control-server,enovance/dci-control-server,redhat-cip/dci-control-server,enovance/dci-control-server | dci/alembic/versions/b58867f72568_add_feeder_role.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple script to generate plate labels"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python3\n\nimport argparse\nimport string\n\ndef main(args):\n rows = string.ascii_uppercase[:8]\n cols = range(1, 13)\n i... | python | new_file | 1 | 8 | apache-2.0 | 7502d1a9b41f7c6978ace6f48577900ec1bc8a3c | jgruselius/misc,jgruselius/misc,jgruselius/misc,jgruselius/misc,jgruselius/misc | Python/well_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for security group rule\n\nTests:\ntest_find\ntest_get\ntest_list\n\nChange-Id: If54342ec8c57b926a5217d888a43dcd98223bd69"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.... | python | new_file | 1 | 2 | apache-2.0 | cd735fe688840c94cb92562e3b96d51ec48afe44 | dudymas/python-openstacksdk,dudymas/python-openstacksdk,dtroyer/python-openstacksdk,dtroyer/python-openstacksdk,mtougeron/python-openstacksdk,stackforge/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,mtougeron/python-openstacksdk,openstack/python-opensta... | openstack/tests/functional/network/v2/test_security_group_rule.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom corehq.apps.groups.models import Group\nfrom corehq.pillows.mappings.group_mapping import GROUP_INDEX, GROUP_MAPPING\nfrom dimagi.utils.decorators.memoized import memoized\nfrom pillowtop.listener import AliasedElasticPillow\nfrom djan... | python | edit | 6 | 0 | bsd-3-clause | 43d5041c09caadd7bd67195ba7519e8ef006f506 | qedsoftware/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,gmi... | corehq/pillows/group.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for writing virus names to txt file"
},
{
"role": "assistant",
"content": "import json\n\nnames = list()\n\nwith open(\"viruses.json\", \"r\") as f: \n names = [virus[\"name\"] for virus in json.load(f)]\n\n\nnam... | python | new_file | 1 | 0 | mit | 661647cfe4d7c1229f1f719cddf42b6c052e4b79 | virtool/virtool-database | scripts/write_names.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for WonderfulBing class"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport os\nfrom os import path\n\nimport mock\nimport pytest\n\nf... | python | new_file | 1 | 2 | mit | 889a70cd8bb9d7e063a8248bab3de958e697d9ae | lord63/wonderful_bing | tests/test_wonderful_bing.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.