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: Add smoke test of the yamlicious command."
},
{
"role": "assistant",
"content": "import io\nimport subprocess\nimport unittest\nimport yaml\n\n\nclass Command(unittest.TestCase):\n\n stdin = u''\n expected = {}\n\n def runTest... | python | new_file | 3 | 1 | bsd-2-clause | d487881f0a4483ddc489a47843e8fa5afb0b97bc | derrley/yamlicious,derrley/yamlicious | test/test_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add backwards compatible Distributed Joblib hook\n\nDepending on the versions of Distributed, Joblib, and scikit-learn,\nthere are different strategies for registering the Joblib backend. Try\ngoing with the standard Distributed technique fi... | python | new_file | 5 | 0 | apache-2.0 | b2dfa7ea44a0b9e061ffbb346fe9196ba96c2a44 | nanshe-org/nanshe_workflow,DudLab/nanshe_workflow | nanshe_workflow/_reg_joblib.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 40"
},
{
"role": "assistant",
"content": "class MyQueue:\n\n def __init__(self):\n self.stack1 = []\n self.stack2 = []\n\n def push(self, element):\n # write your code ... | python | new_file | 1 | 4 | mit | 58cd27f4daa921a63d0a80c31f5ff1bf73cb1992 | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Medium/040_Implement_Queue_by_Two_Stacks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add shot attempt item class definition"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport uuid\n\nfrom db.common import Base\nfrom db.specific_event import SpecificEvent\n\n\nclass Sho... | python | new_file | 1 | 3 | mit | a88ec15ba8c738c9f672373a3ca59b92ac2594ba | leaffan/pynhldb | db/shot_attempt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for old upsert syntax"
},
{
"role": "assistant",
"content": "from django.db import models\n\nfrom psqlextra import HStoreField\nfrom psqlextra.query import ConflictAction\n\nfrom .fake_model import get_fake_model\n\n\nde... | python | new_file | 3 | 1 | mit | e7299524720b4c30cfe4e8ebbc27eaed18d885b4 | SectorLabs/django-postgres-extra | tests/test_upsert.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for byte string fix\n\nChanging the `PhoneDevice.key` default requires a model state migration.\n\nSee: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix)"
},
{
"role": "assistant",
"content": "from djan... | python | new_file | 1 | 0 | mit | 4918c909a23479be344eb52c40e1461fa94bd330 | Bouke/django-two-factor-auth,Bouke/django-two-factor-auth | two_factor/migrations/0006_phonedevice_key_default.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create view for repeater tx and repater rx"
},
{
"role": "assistant",
"content": "from django.db import connection\n\ndef create_repeater_tx_view():\n \"\"\"\n \"\"\"\n from django.db import connection\n cursor = conn... | python | new_file | 5 | 1 | bsd-3-clause | a22355b129538cf7a7e5184c02f392952cd0b623 | ropable/resource_tracking,ropable/resource_tracking,ropable/resource_tracking | radio/sqlviews.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for zoom mode"
},
{
"role": "assistant",
"content": "from PyQt4 import QtCore\nfrom PyQt4 import QtGui\nfrom PyQt4.QtTest import QTest\nfrom pyqode.core import frontend, style\nfrom pyqode.core.frontend import modes\n\n... | python | new_file | 3 | 1 | mit | b5de0f73962d770ef9325619ae724768da581014 | pyQode/pyqode.core,pyQode/pyqode.core,zwadar/pyqode.core | test/test_frontend/test_modes/test_zoom.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for spiral scan"
},
{
"role": "assistant",
"content": "from __future__ import division\nimport numpy as np\nfrom acq4.devices.Scanner.scan_program.spiral import SpiralScan\n\n\ndef test_spiral():\n r1 = 10e-6\n ... | python | new_file | 1 | 1 | mit | cee38843bcf4c628b1c1adc6014dbae7ad2e60c0 | acq4/acq4,mgraupe/acq4,campagnola/acq4,meganbkratz/acq4,meganbkratz/acq4,acq4/acq4,acq4/acq4,mgraupe/acq4,tropp/acq4,mgraupe/acq4,meganbkratz/acq4,pbmanis/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,mgraupe/acq4,campagnola/acq4,tropp/acq4,campagnola/acq4,pbmanis/acq4,tropp/acq4,campagnola/acq4,meganbkratz/acq4,tropp/acq4,... | acq4/devices/Scanner/scan_program/tests/test_spiral.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Populate Nxt Ptr in each node REC"
},
{
"role": "assistant",
"content": "# Definition for binary tree with next pointer.\n# class TreeLinkNode(object):\n# def __init__(self, x):\n# self.val = x\n# self.... | python | new_file | 1 | 3 | mit | 68eea54f3147decd466be16cccc03ab5ec8504bb | Chasego/codirit,cc13ny/Allin,cc13ny/Allin,cc13ny/algo,Chasego/codi,cc13ny/algo,Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/codirit,Chasego/codirit,Chasego/codi,cc13ny/algo,cc13ny/Allin,Chasego/cod,Chasego/cod,Chasego/codi,Chasego/codi,Chasego/cod,cc13ny/Allin,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/cod,Chaseg... | leetcode/116-Populating-Next-Right-Pointers-in-Each-Node/PopulNxtRhtPnterinEachNode_001_rec.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for 'deprecated' decorator with functions and methods."
},
{
"role": "assistant",
"content": "#------------------------------------------------------------------------------\n# Copyright (c) 2005-2014, Enthought, Inc.\n... | python | new_file | 1 | 1 | bsd-3-clause | f772eb5b606ade1d1ec9b8e16c554b715634aba8 | burnpanck/traits,burnpanck/traits | traits/util/tests/test_deprecated.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(m... | python | new_file | 1 | 0 | apache-2.0 | 6524be7830e1db3b7accbc95fb70318a66101c8e | SchoolIdolTomodachi/CinderellaProducers,SchoolIdolTomodachi/CinderellaProducers | cpro/migrations/0016_auto_20171216_1606.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for memory allocation"
},
{
"role": "assistant",
"content": "'Test of memory allocation'\n\nimport numpy as np\nfrom nose.tools import assert_raises\nfrom videocore.assembler import qpu, assemble\nfrom videocore.driver... | python | new_file | 2 | 1 | mit | 112a661139dfb85b4b3de346f569b3eb28a76e48 | nineties/py-videocore | tests/test_memory.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for typing module"
},
{
"role": "assistant",
"content": "\"\"\"tests/test_typing.py.\n\nTests to ensure hugs interacts as expected with the Python3.5+ typing module\n\nCopyright (C) 2016 Timothy Edmund Crosley\n\nPermiss... | python | new_file | 1 | 2 | mit | 8945ecc79c0233147a9c516b2530be958503841c | timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug | tests/test_typing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new exception for >1 value provided for a single valued parameter"
},
{
"role": "assistant",
"content": "\"\"\"Exception for missing query parameter.\"\"\"\n\n\nclass QueryParameterMultipleValuesError(Exception):\n \"\"\"E... | python | new_file | 1 | 1 | mit | 6f975b364301349bb19ea254b66f5d67008f4fdd | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/utils/errors/QueryParameterMultipleValuesError.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Modify caget method to convert to values using a list\n\nAlso refactoring some of the variables names."
},
{
"role": "assistant",
"content": "import pkg_resources\npkg_resources.require('aphla')\nimport aphla as ap\n\n# Load the ... | python | new_file | 5 | 0 | apache-2.0 | 80d410dc40250ef9da1f733551bd04cca84f3723 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | sri21_vs_vmx.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for LocalSyncClient"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport os\nimport tempfile\n\nfrom s3backup.local_sync_client import LocalSyncClient\n\n\nclass TestLocalSyncClient(object):\n\n... | python | new_file | 1 | 2 | mit | 4f82eae6efab831f6a6bd1e6c4a2ee28b452a2cd | MichaelAquilina/s3backup,MichaelAquilina/s3backup | tests/test_local_sync_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for parse. Not completed, but commit for move branch."
},
{
"role": "assistant",
"content": "\nimport re\nfrom app.module.shogi import Koma\n\nclass ParseInput:\n self.koma_names = [\n \"歩\",\n \"と\",\... | python | new_file | null | null | mit | 554f7eb48fea7af7d857e145ce1d36a25c73e6e3 | setokinto/slack-shogi | app/modules/parse_input.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add Logger class that acts as a convenient holder of common log information.\n\nAlso deals with emitting logs by calling global handle."
},
{
"role": "assistant",
"content": "# :coding: utf-8\n# :copyright: Copyright (c) 2013 Mar... | python | new_file | 1 | 1 | apache-2.0 | ca9654586c03dc746219b4e9dd6742ed9eca989d | 4degrees/mill,4degrees/sawmill | source/bark/logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test the call_attribute utility method."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport datetime\nimport pytest\n\nfrom components.correlations.utils import call_attributes\n\nFIELDS = ['started']\n\n\ndef ... | python | new_file | 1 | 1 | apache-2.0 | 8307c3f1e580393ffe433ce10d84a09273be11f5 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | tests/correlations/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add convenience function to convert from tag/value format to RDF.\n\nSigned-off-by: Philippe Ombredanne <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Copyright (C) 2017 BMW AG\n# Author: ... | python | new_file | 3 | 2 | apache-2.0 | 418e948a3ac3708f96d2137553e81480e8d01d1b | spdx/tools-python | spdx/tv_to_rdf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add quick POC of ICallInterceptor to COM samples"
},
{
"role": "assistant",
"content": "import windows\nimport windows.generated_def as gdef\nfrom windows import winproxy\n\n# POC of ICallInterceptor\n# Based on works by Pavel Yo... | python | new_file | 3 | 1 | bsd-3-clause | e40b9fb2ffaf91c11e167f6691738cc523eb9717 | hakril/PythonForWindows | samples/com/icallinterceptor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to purge a rabbitmq queue\n\nThis is useful in debugging when you just want to discard all the\nmessages in a queue because they have the wrong structure.\n\n(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74... | python | new_file | 3 | 2 | apache-2.0 | 233290d578aad1fde80999e75ccc29353ddaf834 | kokoar/zulip,codeKonami/zulip,developerfm/zulip,zwily/zulip,dattatreya303/zulip,aliceriot/zulip,glovebx/zulip,blaze225/zulip,dawran6/zulip,littledogboy/zulip,JPJPJPOPOP/zulip,bastianh/zulip,littledogboy/zulip,wdaher/zulip,glovebx/zulip,grave-w-grave/zulip,brockwhittaker/zulip,souravbadami/zulip,akuseru/zulip,RobotCaleb... | zerver/management/commands/purge_queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add code for evaluating a hand. Incomplete."
},
{
"role": "assistant",
"content": "from collections import defaultdict\n\n#ranks. Add (rank of cards involved / 13) to these values\n#for straights and flushes, (highest card / 13) ... | python | new_file | null | null | mit | de2496c1cd6ba7c9e59110f6e7efa0d1e01304ba | jason-rossmaier/poker-player-pokerface | eval_hand.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import with_statement\n\nfrom nose.tools import eq_\n\nfrom fabric.io import OutputLooper\nfrom fabric.context_managers import settings\n\n\ndef test_request_prompts():\n \"\"\"\n Test valid responses from prompts\n ... | python | edit | 1 | 1 | bsd-2-clause | 78ff64e41c7378200e99d26ea030ec12b70f0625 | ploxiln/fabric,mathiasertl/fabric,rodrigc/fabric | tests/test_io.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create mask file outlining map extents"
},
{
"role": "assistant",
"content": "import numpy as np\nimport aplpy\nimport matplotlib.pyplot as plt\nfrom astropy.io import fits\nfrom config import plottingDictionary\n\ndef mask_obs_a... | python | new_file | 5 | 2 | mit | 60bf87a9cf20d053c10ded99f2f3d39be785e8b8 | GBTAmmoniaSurvey/DR1_analysis,rfriesen/DR1_analysis | make_obs_mask.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: hooks: Add a hook to limit the size of any individual file"
},
{
"role": "assistant",
"content": "from mercurial import context\nfrom mercurial.i18n import _\n\n'''\n[extensions]\nhgfilesize=~/m5/incoming/util/hgfilesize.py\n\n[h... | python | new_file | 2 | 4 | bsd-3-clause | 1018589a17484c5ed337b80a5887aef68df7adbb | pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,hoangt/tpzsimul.gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul... | util/hgfilesize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add print view hierarchy command."
},
{
"role": "assistant",
"content": "\"\"\"Prints the current view hierarchy.\n\nUsage: pv\n\"\"\"\ndef print_view_hierarchy(debugger, command, result, internal_dict):\n debugger.HandleCommand... | python | new_file | 1 | 1 | mit | 23e2fa314ca6e912ad74e7c1bad6005da15d8186 | mrhappyasthma/HappyDebugging,mrhappyasthma/happydebugging | scripts/print_view_hierarchy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add towers of hanoi implementation\n\nSolves the tower of hanoi game for 3 disks."
},
{
"role": "assistant",
"content": "def hanoi(disks, source, helper, target):\n if disks >= 1:\n # Move n-1 disks from source to helpe... | python | new_file | 2 | 2 | mit | eebe2343ebcd10adfe5b5dc4b413c477e759bed8 | chinhtle/python_fun | algorithms/recursion/towersofhanoi.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initialisation script to add the admin user."
},
{
"role": "assistant",
"content": "import getpass\nimport hashlib\nfrom pymongo import MongoClient\n\nspider_db = MongoClient().spider\n\nadmin_present = False\nfor user in spi... | python | new_file | 1 | 0 | apache-2.0 | 4b198dd9b4109888692cd95881a6e5ebe64bccee | asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider | conf/init_mongodb.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add program to rename files automatically"
},
{
"role": "assistant",
"content": "import os\nimport shutil\nimport sys\n\ndef fullpath_names(root_dir, file_list):\n \"\"\"Create a list of fullpath file-name\n \"\"\"\n ful... | python | new_file | 5 | 4 | mit | c42a9633d9b4bbd0d2dec33b1e343e76d167bf6a | escorciav/linux-utils,escorciav/linux-utils | fix_name.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new test script that calls multiprocessing."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals, with_statement\n\nfrom mpi4py imp... | python | new_file | 4 | 2 | bsd-2-clause | 8c6559a442b2ca4a934aecd755b4643d2e234c84 | tskisner/pympit,tskisner/pympit | bin/pympit_multiprocess.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plugin for handling command permissions"
},
{
"role": "assistant",
"content": "from parser import parse_prefix\n\nclass Limit_Plugin:\n \"\"\" Plugin to control which users can use which commands.\n \"\"\"\n\n def __... | python | new_file | 3 | 5 | mit | 921d4544c2f2a78aeb36addcfa9f01720de2acb2 | aalien/mib | plugins/limit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create the plugin based on PyScanPrev conftest.py"
},
{
"role": "assistant",
"content": "\"\"\"Py.test doctest custom plugin\"\"\"\n# By Danilo J. S. Bellini\nimport sys, functools\n\ndef printer(value):\n \"\"\"Prints the obj... | python | new_file | 1 | 2 | mit | f84ba2d213636482951553cc453b33a4bac8541f | danilobellini/pytest-doctest-custom | pytest_doctest_custom.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add SgSession - a meta class for a query instance"
},
{
"role": "assistant",
"content": "\"\"\"A class for SQLGitHub sessions.\n\nSample Usage:\n g = Github(token)\n s = SgSession(g, [\"name\", \"description\"], \"abseil.re... | python | new_file | 1 | 5 | mit | 5a0b08e8eaa7cf0be947cda5f7f7e639bb38a689 | lnishan/SQLGitHub | components/session.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Mark orders older then 5 days that are still 'new' as 'failed'. This\nfixed rewards that are showed as \"claimed\", because old order were not\nfailed automatically.\n\nBB-10849 #resolve"
},
{
"role": "assistant",
"content": "# -... | python | new_file | 3 | 1 | bsd-3-clause | 21ddfc1802495f965524b163258c36231d8ee898 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/orders/migrations/0005_auto_20171003_1112.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool to import Markdown from srweb"
},
{
"role": "assistant",
"content": "import argparse\nimport yaml\nimport sys\nimport re\n\nparser = argparse.ArgumentParser()\nparser.add_argument('source', help='Path to source file',\... | python | new_file | 3 | 6 | mit | 289e5856e15d06b15136a9003d7a3754c0a773f8 | prophile/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,PeterJCLaw/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll | utils/import_srweb.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add general base64 formatting test"
},
{
"role": "assistant",
"content": "import datetime\nfrom borica import Request\n\n\nclass FakeSignature:\n def sign(self, content):\n return 'G' * 128\n\n\ndef test_general_request... | python | new_file | 1 | 1 | mit | bd37f8c88e1f999160fcec2c4ce4370a8d189d71 | IOEra/borica | tests/test_request.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add failing unit test for query_intent to test RequestType reprompt"
},
{
"role": "assistant",
"content": "from _ebcf_alexa import interaction_model as im\nfrom _ebcf_alexa.incoming_types import Intent\nimport pytest\n\n@pytest.f... | python | new_file | 1 | 1 | mit | a3927ac00117c1a9dd6896bc013a7c087cb1edcf | dmotles/ebcf-alexa | test/test_interaction_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup, find_packages\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path... | python | edit | 1 | 0 | mit | eaff4daa02a22a8d1dc233dd96a0848df195e6ea | knowledge4life/django-onmydesk,knowledge4life/django-onmydesk,alissonperez/django-onmydesk,knowledge4life/django-onmydesk,alissonperez/django-onmydesk,alissonperez/django-onmydesk | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool for running pylint on Jinja templates.\n\nCloses JIRA CAMKES-315"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n'''\nRun pylint on a Jinja 2 template.\n'''\n\nimport jinja2, os, subprocess, sys, tempfi... | python | new_file | 2 | 4 | bsd-2-clause | 6ac87bf5f6b86f507caa7764ed949d5b27d18517 | agacek/camkes-tool,agacek/camkes-tool,smaccm/camkes-tool,agacek/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool | tools/jinja_pylint.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add AWS disk integration tests"
},
{
"role": "assistant",
"content": "# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except i... | python | new_file | 1 | 1 | apache-2.0 | 0388e7323452f7b2a94ac9593ffce07e35012e09 | GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,kivio/PerfKitBenchmarker,syed/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,kivio/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,s... | tests/aws_disk_integration_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [RM-11742] Add initial argparse tests for install\n\nSigned-off-by: Travis Rhoden <<EMAIL>>"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom ceph_deploy.cli import get_parser\n\n\nclass TestParserInstall(object):\n\n ... | python | new_file | 1 | 1 | mit | 3481f958cb396be11a565bbb0213dc2d973d25b1 | Vicente-Cheng/ceph-deploy,trhoden/ceph-deploy,imzhulei/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy,codenrhoden/ceph-deploy,zhouyuan/ceph-deploy,branto1/ceph-deploy,osynge/ceph-deploy,ceph/ceph-deploy,isyippee/ceph-deploy,SUSE/ceph-deploy,isyippee/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,SUSE/ceph-deploy-to-be-del... | ceph_deploy/tests/parser/test_install.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to diff installed R packages\n\nUsed to check if all the R packages in the current\nR hub image are present in the new R hub image."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\"\"\"\nLists R package... | python | new_file | 1 | 3 | bsd-3-clause | 05dbf3473d320934ff306b673af7b72abc572375 | ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub | scripts/list-packages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add proxy rax example for terran"
},
{
"role": "assistant",
"content": "import random\n\nimport sc2\nfrom sc2 import Race, Difficulty, ActionResult\nfrom sc2.constants import *\nfrom sc2.player import Bot, Computer\n\nclass Proxy... | python | new_file | 21 | 16 | mit | 98b7c4444b80abb4cf63cbe389df80b938b6c1fd | Dentosal/python-sc2 | examples/proxy_rax.py | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script variant of the Gauss example"
},
{
"role": "assistant",
"content": "import sys\nimport time\nimport numpy as np\nfrom abcpy.core import *\nfrom abcpy.distributions import *\nfrom distributed import Client\nfrom dask.do... | python | new_file | 12 | 3 | bsd-3-clause | 89363fb720d259b60f9ec6d9872f59db1a28e14c | lintusj1/elfi,elfi-dev/elfi,elfi-dev/elfi,HIIT/elfi,lintusj1/elfi | examples/Gauss_example.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add settings file for launching tests"
},
{
"role": "assistant",
"content": "# runtests for django reusable apps\n# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app\n\nimport glob\nimport... | python | new_file | 1 | 0 | bsd-3-clause | 979101349fc35efaba5f23ecf2e8a09af0f52a7b | amrael/django-dynamodb2-sessions | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move python code to Pi\n\nNot complete, just moving to Pi"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n#Geoff Spielman\n#April 22, 2016\n\nimport sys\nimport time\nimport serial\nser = serial.Serial('/dev/ttyACM0', 9... | python | new_file | 3 | 2 | mit | 487c9fdd87c7435087d4b7260146d2f6f470ae7e | GeoffSpielman/SimonSays,GeoffSpielman/SimonSays,GeoffSpielman/SimonSays,GeoffSpielman/SimonSays | Main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add importer wrapper for NaPTAN"
},
{
"role": "assistant",
"content": "import httplib\nfrom tempfile import TemporaryFile\nfrom zipfile import ZipFile\nfrom tch.parsers.naptan import NaptanParser\n\nclass NaptanImporter(object):\... | python | new_file | 1 | 2 | apache-2.0 | 58501ff914c34b2cc81ac99e6fdf384c8b677608 | ManchesterIO/mollyproject-next,ManchesterIO/mollyproject-next,ManchesterIO/mollyproject-next | molly/apps/transport/importers/naptan.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [draft] Add tests for the AsyncActivationHandler"
},
{
"role": "assistant",
"content": "from unittest import mock\n\nfrom django.test import TestCase\nfrom viewflow import lock\nfrom viewflow.activation import STATUS\nfrom viewfl... | python | new_file | 1 | 2 | bsd-3-clause | 3220af50dd6c4642ac668b2c6dc89e9d76d0e732 | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | apps/submission/tests/test_flows.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to turn off all non-build nodes"
},
{
"role": "assistant",
"content": "#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <<EMAIL>>\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice... | python | new_file | 13 | 2 | apache-2.0 | 3ce6f9d4e1cdd282ba6747aab80c18d2e9106168 | sorenh/python-django-greenfan,sorenh/python-django-greenfan | greenfan/management/commands/turn-off-non-build-nodes.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a little package-em-up script for the Subversion book."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimport sys\nimport os\nimport shutil\n\ndef die(msg):\n sys.stderr.write('ERROR: ' + msg)\n sys.exit(1)... | python | new_file | 2 | 1 | apache-2.0 | ee621978cf6a218f71046afb0c1afeb9dd738677 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | doc/book/book-dist.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script that scans a directory tree for .js files, reads them, and builds an map -- path from root to file contents. This is outputted as a JSON string to standard out."
},
{
"role": "assistant",
"content": "#!/usr/bin/env p... | python | new_file | 1 | 3 | apache-2.0 | a738a4b5a9d5dbb56b79ca85ce325e8bfcd4a0cf | Prachigarg1/Prachi,Prachigarg1/Prachi,nanaze/jsdoctor,nanaze/jsdoctor,Prachigarg1/Prachi,nanaze/jsdoctor | genjsonfiletree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add indexes to new instance_uuid columns.\n\nResolves bug 1009738 as well as several other bugs that haven't been\nreported yet.\n\nChange-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92"
},
{
"role": "assistant",
"content": "# vim... | python | new_file | 1 | 2 | apache-2.0 | 0efa0da2313ae4fffca1a17e820262185d60a402 | angdraug/nova,usc-isi/nova,belmiromoreira/nova,ewindisch/nova,maelnor/nova,thomasem/nova,gooddata/openstack-nova,akash1808/nova,akash1808/nova,Stavitsky/nova,rrader/nova-docker-plugin,bclau/nova,JianyuWang/nova,openstack/nova,sebrandon1/nova,CEG-FYP-OpenStack/scheduler,OpenAcademy-OpenStack/nova-scheduler,projectcalico... | nova/db/sqlalchemy/migrate_repo/versions/103_instance_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for the multiply.py function"
},
{
"role": "assistant",
"content": "import multiply as mp \n\ndef test_multiply():\n\t\"\"\"\n\tTests that the multiply function works\n\t\"\"\"\n\tassert mp.multiply(5,5) == 25\n\tassert mp.m... | python | new_file | 1 | 1 | mit | 1d39f6bdbd27ba2d655dd74f62de46fe96628671 | ericmjl/github-tutorial | test_multiply.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to populate Entity type"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-11-07 08:44\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\... | python | new_file | 1 | 3 | apache-2.0 | ddb8d2f3078af9ded041b9eaacdfd3b8d69099bc | jberci/resolwe,genialis/resolwe,jberci/resolwe,genialis/resolwe | resolwe/flow/migrations/0025_entity_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add FFmpeg module for converting video files into image sequences"
},
{
"role": "assistant",
"content": "\n\n__author__ = 'Konstantin Dmitriev'\n\nfrom renderchan.module import RenderChanModule\nfrom renderchan.utils import which... | python | new_file | 4 | 2 | bsd-3-clause | 69d80b136a1d3d3e59bfc9a1a156e9a555e6682e | morevnaproject/RenderChan,scribblemaniac/RenderChan,morevnaproject/RenderChan,scribblemaniac/RenderChan | renderchan/contrib/ffmpeg.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a helpful message for people looking for old script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nprint('''udemy-dl can now be installed using pip\n\npip install udemy-dl\n\n\nIf you are looking for the old scri... | python | new_file | 1 | 0 | unlicense | 04d2998215b94c7f857a96ba40cb479209677b09 | rinodung/udemy-dl | udemy-dl.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add LineAnimator example with variable x-axis values."
},
{
"role": "assistant",
"content": "\"\"\"\n=============\nLineAnimator\n=============\n\nThis example shows off some ways in which you can use the\nLineAnimator object to ... | python | new_file | 1 | 0 | bsd-2-clause | 5dddba694e3bd06afbd7d68c1d8e895b8b6b947f | dpshelio/sunpy,dpshelio/sunpy,dpshelio/sunpy | examples/LineAnimator_examples.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for bot action registration"
},
{
"role": "assistant",
"content": "import re\nimport unittest\nfrom gather.bot import ListenerBot\n\n\nclass TestGatherBot(unittest.TestCase):\n def test_register(self):\n bot ... | python | new_file | 1 | 1 | mit | ea75b737ff6e2b3c54bc5e6417d64bd16f446dc3 | veryhappythings/discord-gather | test/test_bot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for creating from file location, file, StringIO, and string"
},
{
"role": "assistant",
"content": "from __future__ import division, absolute_import, print_function\nimport unittest\nfrom svgpathtools import *\nfrom io ... | python | new_file | 6 | 1 | mit | a743e0293c3ca04e7b5e4cdb7059085e2b4fdb6c | mathandy/svgpathtools | test/test_document.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for problem A2"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*- \n\n# Copyright 2014 Fabian M.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may ... | python | new_file | 3 | 0 | apache-2.0 | e6397785d5d17d1214c1d8fbf7cd503f4484c5d9 | fabianm/olympiad,fabianm/olympiad,fabianm/olympiad | olympiad/square.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test suite for the ndlib"
},
{
"role": "assistant",
"content": "import unittest\nimport networkx as nx\nimport sys\nsys.path.append(\"..\")\nimport ndlib.VoterModel as vm\nimport ndlib.SznajdModel as sm\nimport ndlib.MajorityRule... | python | new_file | 1 | 1 | bsd-2-clause | 53a4d9525439456de3d0f13d92c5671a4c39b69f | GiulioRossetti/ndlib | ndlib_test/ndlibTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split bam files based on barcodes."
},
{
"role": "assistant",
"content": "from __future__ import (absolute_import, division,\n print_function, unicode_literals)\nfrom builtins import (ascii, bytes, chr, dic... | python | new_file | 17 | 6 | mit | f5eeda75d9cc58c6552ab573f6866a144704c962 | jrderuiter/pyim,jrderuiter/pyim | pyim/main/split.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add positional list skeleton ???"
},
{
"role": "assistant",
"content": "class _DoubleLinkedBase:\n class _Node:\n __slots__ = '_element', '_prev', '_next'\n\n def __init__(self, element, prev, next):\n ... | python | new_file | 2 | 1 | mit | 807d589d941418a763b4ebfdd3c117df08de2df4 | xiao0720/leetcode,xliiauo/leetcode,xliiauo/leetcode,xiao0720/leetcode,xliiauo/leetcode | PositionalList.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial helper functions for connecting to LDAP"
},
{
"role": "assistant",
"content": "# Handles queries to the LDAP backend\n# Reads the LDAP server configuration from a JSON file\n\nimport json\nimport ldap\n\nfirst_connect... | python | new_file | 5 | 6 | mit | bc2d986478465c261e2a01a591c956b65364cd90 | motorolja/ldap-updater | ldap-helper.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add class for updating stock"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nclass StockUpdater:\n\n def __init__(self, db_connection):\n self.db_connection = db_connection\n\n ... | python | new_file | 1 | 3 | mit | 9aec0558e4174c16c44a8a5598c14a1fbcee55a9 | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | stock_updater.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a function for simple command line stdout histogram over an array"
},
{
"role": "assistant",
"content": "import numpy as np\n\n\ndef hist(data, width=20):\n counts, values = np.histogram(data)\n max_count = counts.max()... | python | new_file | 1 | 2 | mit | 6572f323a7cf5121789d510391371051d3014d1b | log0ymxm/corgi | corgi/visualization.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add logging and redaction tests"
},
{
"role": "assistant",
"content": "import structlog\nimport logging\nimport traceback\n\nfrom raiden.log_config import configure_logging\n\n\ndef test_basic_logging(capsys):\n configure_logg... | python | new_file | 1 | 2 | mit | eb09ba7be7f1eab48ee7e0cd1a6b7d7753907ff8 | hackaugusto/raiden,hackaugusto/raiden | raiden/tests/unit/test_logging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for pop method"
},
{
"role": "assistant",
"content": "from ..maps import PreshMap\n\n\ndef test_pop1():\n table = PreshMap()\n table[10] = 20\n table[30] = 25\n assert table[10] == 20\n assert table[... | python | new_file | 1 | 1 | mit | 64e5bf4187cd9a5e584901583a8ccd60a92314df | syllog1sm/preshed,explosion/preshed,explosion/preshed,spacy-io/preshed,spacy-io/preshed,explosion/preshed | preshed/tests/test_pop.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing kingdom/user foreign key"
},
{
"role": "assistant",
"content": "\"\"\"add creator\n\nRevision ID: 96ca40f7c6c2\nRevises: ef6fef5147b2\nCreate Date: 2016-10-27 15:14:18.031571\n\n\"\"\"\n\n# revision identifiers, used ... | python | new_file | 4 | 1 | mit | b20fbe03717183cb45da81179fd0b6886f2b6b2a | EliRibble/dominus,EliRibble/dominus,EliRibble/dominus,EliRibble/dominus | alembic/versions/96ca40f7c6c2_add_creator.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert JSON arrays to newline separated JSON\n\n[Finished #37633897]"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport json\nimport sys\n\ndef newline_json(in_file, out_file):\n for line in js... | python | new_file | 2 | 2 | apache-2.0 | 7cd4bf8bc72e3340daa70fff451760778a832e62 | quasar-analytics/quasar,quasar-analytics/quasar,jedesah/Quasar,slamdata/slamengine,drostron/quasar,drostron/quasar,drostron/quasar,jedesah/Quasar,slamdata/slamengine,jedesah/Quasar,slamdata/quasar,djspiewak/quasar,quasar-analytics/quasar,slamdata/slamengine,jedesah/Quasar,drostron/quasar,quasar-analytics/quasar | muspelheim/src/test/python/newlinejson.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mgmt command to auto-add new fields"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom corehq.apps.custom_data_fields.models import CustomDataFieldsDefinition, CustomDataField\nfr... | python | new_file | 6 | 4 | bsd-3-clause | 02181601597e203777412b9377af47525eee77f4 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/enikshay/management/commands/update_enikshay_custom_data.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to reindex mozillians ES."
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\n\nfrom mozillians.users.tasks import index_all_profiles\n\n\nclass Command(BaseCommand):... | python | new_file | 1 | 1 | bsd-3-clause | f499f58c765cbd83e77e44be1dfbccc3aed772c6 | akatsoulas/mozillians,mozilla/mozillians,johngian/mozillians,mozilla/mozillians,mozilla/mozillians,johngian/mozillians,akatsoulas/mozillians,johngian/mozillians,akatsoulas/mozillians,mozilla/mozillians,akatsoulas/mozillians,johngian/mozillians | mozillians/users/management/commands/reindex_mozillians.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the tests for the arithmetic submodule"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\n.. module:: text_dragonfire\n :platform: Unix\n :synopsis: tests for the arithmetic su... | python | new_file | 1 | 1 | mit | 6758e02cddf18d93e26ac23750980397089e869c | mertyildiran/Dragonfire,DragonComputer/Dragonfire,DragonComputer/Dragonfire,DragonComputer/Dragonfire,mertyildiran/Dragonfire | dragonfire/tests/test_arithmetic.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add package for transforming context-free grammar into Chomskey hiearchy"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy-tr... | python | new_file | 1 | 0 | mit | 808c00dd295fce89a5c8bde7b20bd558e7c674a2 | PatrikValkovic/grammpy | grammpy-transforms/ChomskyHiearchy/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for copper\n\nChange-Id: Ia4e53e2aee5b93071b3acd3d75c7e42841321a0a\nSigned-off-by: Cédric Ollivier <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Copyright (c) 2017 Orange and others.\n... | python | new_file | 1 | 1 | apache-2.0 | 4db57a5fa786e9e209b428d4215b6033d15f1315 | opnfv/functest,mywulin/functest,mywulin/functest,opnfv/functest | functest/tests/unit/features/test_copper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example listing installed Windows updates."
},
{
"role": "assistant",
"content": "\"\"\"\nExample script for listing installed updates on Windows 10\n\nRequirements:\n - Windows 10 (may work on Win7+)\n - pywinauto 0.6.1... | python | new_file | 1 | 0 | bsd-3-clause | 77eb463bde029956557a1e9abedbef22ec21f647 | airelil/pywinauto,vasily-v-ryabov/pywinauto,cetygamer/pywinauto,pywinauto/pywinauto,drinkertea/pywinauto | examples/list_windows_updates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Ghidra pluglin for decrypting strings"
},
{
"role": "assistant",
"content": "# Decrypts \"encrypted\" strings from ioncube's loaders\n#@author ss23\n#@category _NEW_\n#@keybinding \n#@menupath \n#@toolbar \n\nencryption_key... | python | new_file | 4 | 5 | bsd-2-clause | e727f062fff4f8b522a5637dc617ac57b1850021 | ss23/ioncube-string-decoder,ss23/ioncube-string-decoder | ghidra_plugin_ioncube_decrypt.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create zinnia_twitter module and add metadatas"
},
{
"role": "assistant",
"content": "\"\"\"Twitter plugin for Django-blog-zinnia\"\"\"\n__version__ = '1.0'\n__license__ = 'BSD License'\n\n__author__ = 'Fantomas42'\n__email__ = '... | python | new_file | 1 | 0 | bsd-3-clause | 7408c08e8550dddbdf02681fcf5c376a24f8f1f8 | django-blog-zinnia/zinnia-twitter | zinnia_twitter/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utils's check_string_length test case\n\n1. What is the problem\nTricircle does not have utils module's test case\n\n2. What is the solution to the problem\nImplement related test case\n\n3. What the features need to be implemented to th... | python | new_file | 1 | 1 | apache-2.0 | 310a7fd5024e49f82504410bf40647b7c8d14207 | stackforge/tricircle,openstack/tricircle,openstack/tricircle,stackforge/tricircle | tricircle/tests/unit/common/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for the gmail client class"
},
{
"role": "assistant",
"content": "from mock import call, patch\nfrom unittest import TestCase\n\nfrom keteparaha import GmailImapClient\n\n\n@patch('keteparaha.email_client.IMAPClient')\nclass... | python | new_file | 1 | 1 | mit | 433b2284ab8150a5c8c27b295b34324c7a87e905 | aychedee/keteparaha,tomdottom/keteparaha | tests/test_email_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a regression test showing hashing error"
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\nfrom marathon.models.base import MarathonObject\nimport unittest\n\n\nclass MarathonObjectTest(unittest.TestCase):\n\n def... | python | new_file | 1 | 1 | mit | b307df3b2b45e5ab003903b8ed5cf341506965fd | thefactory/marathon-python,thefactory/marathon-python | tests/test_model_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\nfrom nvpy import nvpy\n\n# Utility function to read the README file.\n# Used for the long_description. It's nice, because now 1) we have a top level\n# README file and 2) it's easier to type in the ... | python | edit | 1 | 1 | bsd-3-clause | fa88f6b332d14084f89aec99c0c436ae4c36dd58 | n8henrie/nvpy,dwu/nvpy,trankmichael/nvpy,khornberg/nvpy-gtk,yuuki0xff/nvpy,dwu/nvpy,bwillistower/nvpy,yuuki0xff/nvpy | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for main function; bring coverage to 100%"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport contextlib\nimport io\nimport nose.tools as nose\nimport src.simulator as sim\nfrom unittest.mock import p... | python | new_file | 1 | 1 | mit | 6f76a9735cd8208137e91782b233f98b406d401d | caleb531/cache-simulator | tests/test_simulator_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Include a (very) simple example"
},
{
"role": "assistant",
"content": "from dynamic_api_client import BaseClient\n\nclass MicroBlogApi(BaseClient):\n\n\tavailable_paths = ['POST account/signin', 'GET posts/all']\n\tseparator = '/... | python | new_file | 1 | 1 | mit | b75205319bc28f53c22fea34499d34aef279df9b | andymitchhank/bessie | examples/microblog.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create an underline for the selected text"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport re\nimport sublime, sublime_plugin\n\nclass UnderlineCommand(sublime_plugin.TextCommand):\n def run(self, edit):\n ... | python | new_file | 3 | 4 | mit | e215dc670cc258d3ec0d559f06e6fdfb7f37f845 | RichardHyde/SublimeText.Packages | Underline.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add db migration for user table"
},
{
"role": "assistant",
"content": "\"\"\"Add user model\n\nRevision ID: 70c7d046881\nRevises: 19b7fe1331be\nCreate Date: 2013-12-07 15:30:26.169000\n\n\"\"\"\n\n# revision identifiers, used by ... | python | new_file | 1 | 1 | mit | 46d7e6f8dcf9b7cd4c9de913f05d4e86ed16b497 | streamr/marvin,streamr/marvin,streamr/marvin | migrations/versions/70c7d046881_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for suggest_restaurant command."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom click.testing import CliRunner\n\nimport yoda\n\n\nclass TestSuggestRestaurant(unittest.TestCase):\n \"\"\"\n Test... | python | new_file | 1 | 1 | mit | ddd110081d4b21da88d947702ba2e37f87bf8cb0 | dude-pa/dude | tests/food/test_suggest_restaurant.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add default message for list pages"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.9 on 2018-02-02 20:51\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, mod... | python | new_file | 1 | 0 | mit | c11e14296848ccfbaab36d540da79afc86c83b92 | nfletton/bvspca,nfletton/bvspca,nfletton/bvspca,nfletton/bvspca | bvspca/core/migrations/0025_auto_20180202_1351.py | rejected_duplicate | Near-duplicate of sample 7464 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for make_github_projec and make_github_organization"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom django.contrib.auth.models import User\nfrom allauth.socialaccount.models import SocialToken... | python | new_file | 3 | 1 | mit | ec2861e077ec4b4084b60df085baf41caf9e15d4 | wanghaven/readthedocs.org,asampat3090/readthedocs.org,davidfischer/readthedocs.org,sunnyzwh/readthedocs.org,nikolas/readthedocs.org,laplaceliu/readthedocs.org,hach-que/readthedocs.org,nikolas/readthedocs.org,raven47git/readthedocs.org,hach-que/readthedocs.org,cgourlay/readthedocs.org,royalwang/readthedocs.org,laplaceli... | readthedocs/rtd_tests/tests/test_oauth.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for pollution_map"
},
{
"role": "assistant",
"content": "#run the test with default values of df, state and year \n\n\nimport unittest\nfrom pollution_map import pollution_map\nimport pandas as pd\n\n\ndf = pd.read_... | python | new_file | 3 | 1 | mit | 462205a8dde700b4d5f36225bbe5f9d15b59832b | abhisheksugam/Climate_Police | Climate_Police/tests/test_pollution_map.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test cuda via numba"
},
{
"role": "assistant",
"content": "# install nvidia-cuda-toolkit into the OS\n# conda install numba\n# conda install cudatoolkit -- otherwise will error out\n\nimport numpy as np\nfrom numba ... | python | new_file | 1 | 1 | mit | dd10599a0625e3ab53d2e84612f9162a7e9dbbaf | neurite/debian-setup,neurite/debian-setup | scripts/numba_cuda.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create enum for asset classes"
},
{
"role": "assistant",
"content": "from enum import Enum\n\nclass AssetClass(Enum):\n CASH_EQUIVALENTS = \"Cash Equivalents\"\n COMMODITIES = \"Commodities\"\n EQUITIES = \"Equities\"\n ... | python | new_file | 1 | 0 | mit | 4392e56f520cd50454a4a8e804f7382276ee3c3d | cmvandrevala/finance_scripts,cmvandrevala/finance_scripts,cmvandrevala/finance_scripts | valid_options/asset_class.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: src: Add empty implementation of the importer"
},
{
"role": "assistant",
"content": "from collections import namedtuple\n\n# BoundingBox:\n# top (int) Top of the box\n# bottom (int) Bottom of the box\n# left (int) L... | python | new_file | 1 | 1 | mit | 96aee303e9fcc3ef92d176418879089ad4f328a6 | mikebentley15/cs6350_project_ml | indexing/src/ldsImporter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create dummy files for /data"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# -----------------------------------------------------------------------------\n# EXPLANATION:\n# This file fi... | python | new_file | 1 | 0 | mit | 73509b5cc07bbf4610b9860cadd1d09e529b710d | MartinThoma/akademie-graph,MartinThoma/akademie-graph,MartinThoma/akademie-graph | create_dummy_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a log importer for logs that need indexing."
},
{
"role": "assistant",
"content": "# Copyright (c) Weasyl LLC\n# See COPYING for details.\n\nimport argparse\nimport datetime\nimport os.path\nimport re\n\nimport elastirc\n\nfr... | python | new_file | 2 | 9 | isc | 6b2896c9d31da924eb4f371e1f477b384056bd58 | Weasyl/elastirc | log-importer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\nfrom django.utils.translation import pgettext_lazy\n\nfrom ...product.models import Discount\n\n\nclass DiscountForm(forms.ModelForm):\n class Meta:\n model = Discount\n exclude = []\n\n def cle... | python | edit | 3 | 10 | bsd-3-clause | 1615fafde907488c9af7b40ea2f4ee02b4e05507 | UITools/saleor,laosunhust/saleor,UITools/saleor,itbabu/saleor,jreigel/saleor,KenMutemi/saleor,laosunhust/saleor,laosunhust/saleor,car3oon/saleor,spartonia/saleor,UITools/saleor,maferelo/saleor,jreigel/saleor,rchav/vinerack,car3oon/saleor,UITools/saleor,rodrigozn/CW-Shop,maferelo/saleor,rchav/vinerack,laosunhust/saleor,... | saleor/dashboard/discount/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a dead code elimination optimization pass."
},
{
"role": "assistant",
"content": "\"\"\"Removes unused instructions.\n\nThe definition of \"unused instruction\" is an instruction having a return\nID that is not used by any no... | python | new_file | 1 | 7 | mit | 34625c7e8817c6e979b59c8f8f3e37f0aaad56a2 | kristerw/spirv-tools | dead_code_elim.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create test data generator script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport sys\nimport math\nimport urllib\nimport urllib2\nimport time\n\nid = '123456789012345'\nserver = 'http://localhost:5055'\nperiod... | python | new_file | 3 | 1 | apache-2.0 | eb40246064d5185edf1d620dcf7270ffe9d7c074 | orcoliver/traccar,stalien/traccar_test,5of9/traccar,tsmgeek/traccar,ninioe/traccar,tsmgeek/traccar,jssenyange/traccar,vipien/traccar,stalien/traccar_test,renaudallard/traccar,AnshulJain1985/Roadcast-Tracker,orcoliver/traccar,duke2906/traccar,ninioe/traccar,tananaev/traccar,tsmgeek/traccar,renaudallard/traccar,joseant/t... | tools/test-generator.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.