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 test for User table initialization"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom app import create_app, db\nfrom app.models import User\n\n\nclass TestUtils(unittest.TestCase):\n def setUp(self):\n ... | python | new_file | 1 | 1 | mit | bc1f2adee99e2c20c897e6ec012e4014aecba26b | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for connection class"
},
{
"role": "assistant",
"content": "\"\"\" Tests for the Connection module \"\"\"\n\nimport unittest\n\nfrom src import connection\n\nclass TestConnection(unittest.TestCase):\n \"\"\" Tests fo... | python | new_file | 1 | 1 | mit | 90c6293ef1f719d53e02bd4c6f613cb205fa9497 | blairck/jaeger | test/test_connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple unit tests for exceptions"
},
{
"role": "assistant",
"content": "import pytest\n\nimport exceptions\n\n\ndef test_exceptions():\n # testing exception inheritance\n with pytest.raises(Exception):\n raise ex... | python | new_file | 1 | 1 | mit | b500e4b0e8ac0088fbff906dfb42e9e604fbc397 | BiohZn/Cardinal,JohnMaguire/Cardinal | cardinal/test_exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution and unit tests for problem 4"
},
{
"role": "assistant",
"content": "\"\"\"\nProject Euler Problem 4\n=======================\n\nA palindromic number reads the same both ways. The largest palindrome made\nfrom the pro... | python | new_file | 1 | 4 | mit | 017840d4b6986ea1b0c43791b76f724e1f4aaf22 | BeataBak/project-euler-problems | 004.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move R's spline to regression module"
},
{
"role": "assistant",
"content": "\"\"\" Regression or prediction methods from R\n\"\"\"\nimport numpy as np\nfrom rpy2.robjects.packages import importr\nimport rpy2.robjects.numpy2ri\n\n... | python | new_file | 1 | 1 | mit | 855972f9e8b59732a65111fb69f1388272727849 | c11/yatsm,c11/yatsm | yatsm/regression/cran.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add inital MI feature selection code"
},
{
"role": "assistant",
"content": "import numpy as np\nimport pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_selection import chi2, SelectK... | python | new_file | 3 | 0 | mit | 604b24cfdf03b657e4a60d3f8dd9e2cf1c10cf5a | achyudhk/Ensemble-Text-Classification | baseline_knn_mi_webKB.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to split fasta files"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n__description__ = \"Split a fasta file and generate a file for each entry\"\n__author__ = \"Konrad Foerstner <<EMAIL>>\"\n__copyright... | python | new_file | 1 | 0 | isc | 641ebde8628ee9bb85ab0bd675bcecc88c06d171 | konrad/kuf_bio_scripts | split_fasta_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Towers of Hanoi algorithm and tests"
},
{
"role": "assistant",
"content": "#!/Applications/anaconda/envs/Python3/bin\n\n\ndef main():\n for i in range(1, 8):\n print(\"============================\")\n print(... | python | new_file | 1 | 2 | mit | fc5c95e7480e38cbd3156b1e6b968e50fa98954d | HKuz/Test_Code | Problems/towersOfHanoi.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test to check that error is properly raised when a photon is emitted outside the grid."
},
{
"role": "assistant",
"content": "import pytest\nimport numpy as np\n\nfrom .. import Model\nfrom .test_helpers import random_filena... | python | new_file | 1 | 1 | bsd-2-clause | d6a8b8a518727a50f9dbe41f5874061b5ae6bc33 | bluescarni/hyperion,hyperion-rt/hyperion,astrofrog/hyperion,hyperion-rt/hyperion,hyperion-rt/hyperion,bluescarni/hyperion,astrofrog/hyperion | hyperion/model/tests/test_fortran.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic context processor which exposes common settings"
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\n\ndef site_settings(request):... | python | new_file | 1 | 3 | bsd-3-clause | 274d6a95cafb882ef422a46c2e5f91739b368c6f | acdha/django-sugar | sugar/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper classes for using python-twitter on App Engine (currently just a cache implementation on top of the App Engine datastore)."
},
{
"role": "assistant",
"content": "import time\n\nfrom django.utils import simplejson\nfrom... | python | new_file | 1 | 5 | apache-2.0 | 6c8136ff03250b41418a415efcfc4717ad73c82c | mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot,mihaip/streamspigot | app/twitterappengine.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add failing test validating missing imapsieve capability.\n\nIssue #41"
},
{
"role": "assistant",
"content": "import unittest\nimport checksieve\n\nclass TestNoRequire(unittest.TestCase):\n\n\tdef test_no_require(self):\n\t\tsiev... | python | new_file | 1 | 1 | mit | 77f15c5b055bc9ba04b0857f5a34b2e537d2c158 | dburkart/check-sieve,dburkart/check-sieve,dburkart/check-sieve | test/6785/norequire_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix for display date repeat of YYYY"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport re\n\nr=re.compile(r'(\\d\\d\\d\\d)-\\1')\n\ndef fix_repeated_date(doc):\n dates = doc['sourceResource'].get('date', No... | python | new_file | 1 | 5 | bsd-3-clause | e8688d666ae2ccbd06fc5e2811789886cbd1d5f2 | mredar/harvester,barbarahui/harvester,barbarahui/harvester,ucldc/harvester,ucldc/harvester,mredar/harvester | harvester/post_processing/fix_repeated_displayDate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test to ensure access to missing attributes raises the correct exception"
},
{
"role": "assistant",
"content": "# Copyright 2011 OpenStack LLC.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0... | python | new_file | 6 | 1 | apache-2.0 | 64141d4e195000289b005028f7368452698c701c | klmitch/dtest,klmitch/dtest | tests/test_tests.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add recursive also for fibonnaci"
},
{
"role": "assistant",
"content": "\"\"\"Implement a function recursivly to get the desired\nFibonacci sequence value.\nYour code should have the same input/output as the\niterative code in th... | python | new_file | 4 | 3 | mit | 06b1344fe949cf0d7c53e56a1f42e281571dbfea | rav1n/basic-algorithms | get_fib.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add util & lots of funciton"
},
{
"role": "assistant",
"content": "# coding=utf-8\n\nimport os\n\n\"\"\"\n 公用方法\n\"\"\"\n\n\"\"\"\n 日志\n level: 级别\n msg: 信息\n\"\"\"\nlog_limit_level = 2\ndef log(level, msg, limit_leve... | python | new_file | 4 | 5 | mit | 74217c0a7db82fa0df153e68e22395ee1e820071 | Jecvay/PyGDB | PyGdbUtil.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simplistic test to run through all autonomous modes"
},
{
"role": "assistant",
"content": "'''\n Runs all of the autonomous modes in a basic way\n'''\n\n\ndef test_all_autonomous(robot, wpilib, fake_time):\n\n autonomou... | python | new_file | 1 | 2 | bsd-3-clause | 083549a49dfe242efdc631de3b698b2db1bf5119 | frc1418/2014 | robot/robot/tests/autonomous_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple script for renaming files using thetvdb.com"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n'''\nTODO: \n- Get episode names, numbers, seasons from URL\n- Get path to rename from stdin\n- Get thetvdb ur... | python | new_file | 1 | 8 | mit | ad706e2a98e564159aa5b505d7522fa39bfcceb5 | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | python/video-tools/rename-thetvdb.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create script to run stats on aws."
},
{
"role": "assistant",
"content": "import boto3\nfrom indra.db.util import get_db_statistics\nfrom datetime import datetime\n\ndef main():\n utcnow = datetime.utcnow()\n fname = \"Prim... | python | new_file | 1 | 1 | bsd-2-clause | d38ea61fc5ffa7c526094900a0dbb8c7405aac7b | pvtodorov/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,bgyori/indra,bgyori/indra,johnbachman/indra | indra/db/get_db_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration remove generated paths"
},
{
"role": "assistant",
"content": "# Generated by Django 2.0.13 on 2020-04-06 13:40\n\nfrom django.conf import settings\nfrom django.contrib.gis.geos import Point, LineString\nfrom django.... | python | new_file | 1 | 1 | bsd-2-clause | a4dd889a44cf7b4ea4e2e85880343ede234ec60c | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | geotrek/core/migrations/0017_remove_path_from_factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test a variety of URIs"
},
{
"role": "assistant",
"content": "[\n {\n \"message\": b\"GET / HTTP/1.1\\r\\n\\r\\n\",\n \"expected\": {\n \"request_method\": b\"GET\",\n \"request_uri\": b\"/\... | python | new_file | 1 | 0 | apache-2.0 | 5bfe049c57198367ec244ff6ae7779c87d9f1e53 | dstufft/http11,dstufft/http11 | tests/cases/uris.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights twins score problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Twins Score Problem\n\n\ndef twinsScore(b, m):\n return [sum(item) for item in zip(b, m)]\n\n\ndef main():\n ... | python | new_file | 1 | 3 | mit | e7c48871ee7d7132155697ac44fc31a29dcb00e1 | HKuz/Test_Code | CodeFights/twinsScore.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Reimplement setup and teardown of TestVCSPrompt"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_vcs_prompt\n---------------\n\"\"\"\n\nimport os\nimport pytest\n\nfrom cookiec... | python | new_file | 1 | 3 | bsd-3-clause | 194bf3f4ba0b3488a5cfbb536247ac9f1bc7a006 | tylerdave/cookiecutter,Vauxoo/cookiecutter,sp1rs/cookiecutter,cichm/cookiecutter,audreyr/cookiecutter,vintasoftware/cookiecutter,pjbull/cookiecutter,Springerle/cookiecutter,cichm/cookiecutter,kkujawinski/cookiecutter,Springerle/cookiecutter,moi65/cookiecutter,ramiroluz/cookiecutter,janusnic/cookiecutter,venumech/cookie... | tests/test_vcs_prompt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add one test for Experiment object\n\nThis was copied over from the tests for related dataobjects.\n\nMaybe all of these types of test could be factored out into the\nDataObjectTest.py testfile?"
},
{
"role": "assistant",
"conten... | python | new_file | 20 | 1 | mit | 89221866255a8191938346b59ea32bc805fa6be9 | gsarma/PyOpenWorm,openworm/PyOpenWorm,openworm/PyOpenWorm,gsarma/PyOpenWorm | tests/ExperimentTest.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add document / image permissions"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.15 on 2019-11-11 12:19\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom... | python | new_file | 1 | 1 | bsd-3-clause | d36f7dbdc6b25e85ca857074edda0b2d33a4b833 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/files/migrations/0003_auto_20191111_1533.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first pass at simple cli tooling"
},
{
"role": "assistant",
"content": "import argparse\nimport os\nfrom nephoria.testcontroller import TestController\nimport logging\nparser = argparse.ArgumentParser(description='Euca Runtim... | python | new_file | 1 | 0 | bsd-2-clause | 862b18e3e0c93418124068ddd76f4ad37f71f015 | nephomaniac/nephoria,nephomaniac/nephoria | toolbox/neph_cli_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create code to parse Tafseer files fomr Tanzil.net"
},
{
"role": "assistant",
"content": "from quran_text.models import Ayah\nfrom quran_tafseer.models import TafseerText, Tafseer\n\n\ndef parse_tafseer_file(file_name, tafseer_na... | python | new_file | 1 | 2 | mit | ce948382108303020069f8805c92a930c5b6c99a | EmadMokhtar/tafseer_api | data_text/parse_tafseer_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test case for Queryable class"
},
{
"role": "assistant",
"content": "from busbus.queryable import Queryable\n\n\ndef test_queryable():\n q = Queryable(xrange(10)).where(lambda x: x % 5 == 0)\n assert next(q) == 0\... | python | new_file | 2 | 1 | mit | 8f7e6623e34827f480eee971a8922b56922aa3e4 | spaceboats/busbus | tests/test_queryable.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add code to see what authors there are in the dataset"
},
{
"role": "assistant",
"content": "import os\nfrom utils import Reader\nimport code\nimport sys\n\nauthor_dict = dict()\n\n\ndef extract_authors(tweets):\n # code.inter... | python | new_file | 3 | 4 | apache-2.0 | 046ca6c16b60c787e3dc865b3080a65d74ee437b | chuajiesheng/twitter-sentiment-analysis | exploratory_analysis/author_scan.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to get metrics from BERT models"
},
{
"role": "assistant",
"content": "import pickle\nimport os\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom sklearn.cluster import Agglomerat... | python | new_file | 3 | 0 | apache-2.0 | 074730f14d3b04305b67baf2e6bc853c13c9bdd8 | googleinterns/smart-news-query-embeddings,googleinterns/smart-news-query-embeddings | training/get_metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration that got removed during re-generation."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.28 on 2020-05-20 14:56\nfrom __future__ import unicode_literals\n\nfrom django.db imp... | python | new_file | 1 | 0 | mit | ae1a84df1bdbdbd6b92ba4210cc0d630981bc26c | learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri | kolibri/core/content/migrations/0026_contentnode_options.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add explicit test for finals2000A.all converter"
},
{
"role": "assistant",
"content": "from numpy import array, inf\nfrom skyfield.data.iers import _build_timescale_arrays\n\ndef test_build_timescale_arrays():\n mjd = array([4... | python | new_file | 1 | 1 | mit | f384a5d77cae62b6487d039e4e8dd51ef9cdc258 | skyfielders/python-skyfield,skyfielders/python-skyfield | skyfield/tests/test_data_iers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: testing: Add dEQP test merge script.\r\n\r\nThis script will allow ANGLE to process custom logic when we complete\r\na suite of dEQP tests on the bots. The first customization step we\r\ncan do is merge the myriad batch QPA files into one m... | python | new_file | 1 | 1 | bsd-3-clause | 926d1cea1a0c52325cc66dc51dd8b941a0dfa783 | ppy/angle,ppy/angle,ppy/angle,ppy/angle | scripts/angle_deqp_test_merge.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix incorrect migration that left out stat titles on result pages.\n\nThis should fix all stats on all tenants except for manual input.\n\nBB-11474 #resolve"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Genera... | python | new_file | 1 | 5 | bsd-3-clause | 98d27c8366a39dceaecf558535ec8312e0c03e92 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/cms/migrations/0064_auto_20171220_1145.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add linting tests (PEP8 and PyPi)"
},
{
"role": "assistant",
"content": "import sys\nimport subprocess\n\n\ndef test_pep8():\n result = subprocess.call(['pep8', '--statistics', '--show-source'])\n assert result == 0\n\n\nde... | python | new_file | 3 | 1 | mit | 7047c48d0772fe61b2ba9ed9e7f2992712a63700 | Kromey/pynano | tests/test_linting.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a source with changing shape for debuging"
},
{
"role": "assistant",
"content": "# Import analysis/plotting modules\nimport analysis.event\nimport plotting.image\nimport numpy as np\n\n# Set new random seed\nnp.random.seed()\... | python | new_file | 1 | 2 | bsd-2-clause | 87cfabdc68d42f1a269741a38780ed6c38e53cb1 | FXIhub/hummingbird,FXIhub/hummingbird | examples/debug/shape_shifter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split the element class from the data store so that it can be imported independently as needed\n\ngit-svn-id: 27e0aca8c7a52a9ae65dfba2e16879604119af8c@1336 93a4e39c-3214-0410-bb16-828d8e3bcd0f"
},
{
"role": "assistant",
"content"... | python | new_file | 1 | 6 | bsd-3-clause | df885b68ae5b97fe12c34d32b3187ab6326ae04a | fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia | gmetad-python/gmetad_element.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to broadcast local ip via mdns, for easy to find the pi address without monitor"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport socket\nimport time\n\nfrom zeroconf import *\n\ndef main():\n print... | python | new_file | 2 | 4 | apache-2.0 | 1f38e1fbba7e83d35903587245c8f8e09cec9965 | TimonLio/rex-pi,TimonLio/rex-pi | tool/zeroconf_ssh.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Complete test coverage for content_type_resolvers"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom odinweb import content_type_resolvers\nfrom odinweb.testing import MockRequest\n\n\n@pytest.mark.parametrize('resolver... | python | new_file | 1 | 1 | bsd-3-clause | 8930434e0e4a079c855ed4beb7d2304ebab78b45 | python-odin/odinweb,python-odin/odinweb | tests/test_content_type_resolvers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add CyRasterize test to script\n\nDuplicates nose test I had added to the cyrasterize package"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom cyrasterize import CyRasterizer\nfrom numpy.testing import assert_allcl... | python | new_file | 1 | 1 | bsd-3-clause | a513c18975fb5711b0fb2cefbf4496379747daa9 | menpo/conda-recipes,menpo/conda-recipes | cyrasterize/run_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unit test for the no_NO bban"
},
{
"role": "assistant",
"content": "# coding=utf-8\n\nimport re\nimport unittest\n\nfrom faker import Faker\n\nclass TestNoNO(unittest.TestCase):\n \"\"\" Tests the street address in no_NO... | python | new_file | 1 | 1 | mit | 936a01efe745e8596a23142895a385d47611ff15 | joke2k/faker,joke2k/faker,danhuss/faker | tests/providers/test_bank.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert search results to stream filter API format."
},
{
"role": "assistant",
"content": "\"\"\"\nConvert GET search (v1.1 or higher) from searchtweets.py to 'stream' format\nas expected by twitter-streamer. This means it will ... | python | new_file | 2 | 0 | mit | 6e047e9a4e07c379bcb0c47d13fa91dec796858a | inactivist/twitter-utils | twitter-utils/search2stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add notebook pre processing script to replace load magics."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport json\nimport re\nfrom pathlib import Path\n\n\ndef format_script_for_cell(path):\n \"\"\"Read an... | python | new_file | 1 | 3 | mit | bfda3309085919bd849e7478e1335a9da5dfc792 | julienchastang/unidata-python-workshop,Unidata/unidata-python-workshop,julienchastang/unidata-python-workshop | notebooks_preprocess.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to extract zip file with passowrd"
},
{
"role": "assistant",
"content": "import zipfile\n\ndef bf_extract(zfile, password):\n zip = zipfile.ZipFile(zfile)\n try:\n zip.setpassword(password)\n zip.... | python | new_file | 1 | 3 | apache-2.0 | 3577db65eceabd6c5ceb9858f45faee65ce0bbdf | alexst07/ZipBruteforce | zforce.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test script for parameter detemination.\n\nsee https://github.com/pellepl/spiffs/issues/169"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n\"Test spiffs filesystem with a range of parameters\"\n\nimport spiffs\n\ncla... | python | new_file | 5 | 1 | mit | d65502a67a3ae356f7af3c40f68139ca90b66ed0 | pellepl/spiffs,pellepl/spiffs | py/sp_test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a plane fitting roufit"
},
{
"role": "assistant",
"content": "from scipy.optimize import least_squares as lsq\nimport numpy as np\n\ndef myplane(p, x, y, z):\n return(p[0] + p[1] * x + p[2] * y - z)\n\n\ndef plane_fit(x, y... | python | new_file | 1 | 2 | mit | 4866c643c0cb8f041dbdfa9db0611279ca4ef98d | low-sky/py-low-sky | plane_fit.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#from django.core.paginator import Paginate\n\ntry:\n import floppyforms as forms\nexcept ImportError:\n from django import forms\n \n# TODO add default widgets \n\nclass BaseMongoAdmin(object):\n \n search_fields = []\n ... | python | edit | 1 | 2 | mit | f83d04e389fdac327f8347f30bd2532cb26532ee | pydanny/django-mongonaut,lchsk/django-mongonaut,jazzband/django-mongonaut,pydanny/django-mongonaut,pydanny/django-mongonaut,jazzband/django-mongonaut,lchsk/django-mongonaut,lchsk/django-mongonaut,jazzband/django-mongonaut | mongonaut/sites.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add jwt library in contrib"
},
{
"role": "assistant",
"content": "\"\"\" JSON Web Token implementation\n\nMinimum implementation based on this spec:\nhttp://self-issued.info/docs/draft-jones-json-web-token-01.html\n\"\"\"\nimport... | python | new_file | 3 | 6 | mit | e87ba8f0a36c2d6ed9b058efd6fd91ed680af82c | supermanheng21/twilio-python,YeelerG/twilio-python,Rosy-S/twilio-python,Stackdriver/twilio-python,twilio/twilio-python,cinemapub/bright-response,clearcare/twilio-python,Stackdriver/twilio-python,johannakate/twilio-python,RobSpectre/twilio-python,Mobii/twilio-python,tysonholub/twilio-python,cinemapub/bright-response,bco... | twilio/contrib/jwt/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add util for extracting just the tweet text."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\nGiven a JSON file, return just the text of the tweet.\nExample usage:\nutils/tweet_text.py tweets.jsonl > tweets... | python | new_file | 1 | 0 | mit | 109595a93089a80d4b762e91c2eecad58025d69d | hugovk/twarc,remagio/twarc,DocNow/twarc,edsu/twarc,remagio/twarc | utils/tweet_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add token test for string functions"
},
{
"role": "assistant",
"content": "import kindred\n\ndef test_token_str():\n\tt = kindred.Token(word=\"hat\",lemma=\"hat\",partofspeech=\"NN\",startPos=0,endPos=3)\n\n\tassert str(t) == \"h... | python | new_file | 1 | 1 | mit | bf694c664649d225006b764af467fe106f59742e | jakelever/kindred,jakelever/kindred | tests/test_token.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add top down design of ANN and Layer"
},
{
"role": "assistant",
"content": "\n\nclass ANN:\n\n def __init__(self):\n pass\n\n def train(self):\n pass\n\n def predict(self):\n pass\n\n def update_w... | python | new_file | 1 | 1 | apache-2.0 | ff44e924a4f01bd39d4b26a39519bf55dd5e7560 | Razvy000/ANN_Course | ann.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for adding comments that runs against a real server"
},
{
"role": "assistant",
"content": "import bugsy\nbz = bugsy.Bugsy(\"username\", \"password\", \"https://bugzilla-dev.allizom.org/rest\")\nbug = bugsy.Bug()\nbug.... | python | new_file | 1 | 0 | apache-2.0 | b7d95fd7ae0515b15c14e6f01f3c22645953afe7 | AutomatedTester/Bugsy,indygreg/Bugsy,parkouss/Bugsy | example/add_comments.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration following status choices changes"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migra... | python | new_file | 1 | 0 | bsd-3-clause | 37de8d954b9e870590f5bfb9fff3e4ce4e41acca | diox/zamboni,washort/zamboni,elysium001/zamboni,diox/zamboni,ddurst/zamboni,elysium001/zamboni,diox/zamboni,ddurst/zamboni,elysium001/zamboni,elysium001/zamboni,washort/zamboni,mozilla/zamboni,mozilla/zamboni,ingenioustechie/zamboni,jasonthomas/zamboni,diox/zamboni,mozilla/zamboni,ingenioustechie/zamboni,jasonthomas/za... | mkt/extensions/migrations/0006_auto_20150914_0745.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for searching in titles"
},
{
"role": "assistant",
"content": "from suds.client import Client\n\nurl = 'http://legislatie.just.ro/apiws/FreeWebService.svc?wsdl'\n\nprint(\"==== create client\")\nclient = Client(url)\n... | python | new_file | 1 | 0 | mit | 9e178a56d84a634a32b0f05d5a3c7436c565418f | govro/legislatie-just-python-soap-client,govro/legislatie-just-python-soap-client | script2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to get mac address from host."
},
{
"role": "assistant",
"content": "import logging\nimport re\nimport socket\nfrom subprocess import Popen, PIPE\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef get_mac_address(host... | python | new_file | 1 | 5 | mit | c80f8e1c1d53f1a19b654f17361d40720b5a90fe | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | app/core/netutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add predication from K-Nearest Neighbors"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import accuracy_score, classification_report, confu... | python | new_file | 1 | 0 | mit | 43d1f8f1d5ef6a7452d6bad7e10d5be1f688c0b9 | lucasb/iris-machine-learning | app/knn_prediction.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose2 import config\nfrom nose2.compat import unittest\n\n\nclass TestConfigSession(unittest.TestCase):\n def test_can_create_session(self):\n config.Session()\n\n\nclass TestConfig(unittest.TestCase):\n def setUp(self):\n... | python | edit | 1 | 1 | bsd-2-clause | a121281532dc3c9da6534684da0eae0ab57b000b | little-dude/nose2,ojengwa/nose2,ezigman/nose2,ptthiem/nose2,ptthiem/nose2,ezigman/nose2,little-dude/nose2,leth/nose2,ojengwa/nose2,leth/nose2 | nose2/tests/unit/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for navigating backwards, after submission - failing"
},
{
"role": "assistant",
"content": "from .test_happy_path import TestHappyPath\n\nclass TestbackwardsNavigationAfterSubmission(TestHappyPath):\n\n def test_backw... | python | new_file | 1 | 1 | mit | 6a3eda2781f1ea4ed7106313fdc5b7c40786304c | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | tests/integration/mci/test_backwards_navigation_after_submission.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split functionality of the Channel API into a separate file and refactored it a bit. Not functional."
},
{
"role": "assistant",
"content": "from django.utils import simplejson\nfrom google.appengine.api import channel, memcache\n... | python | new_file | 1 | 2 | mit | 1b2f9c992982a288d0e7e20b0a1eb96b2fd8a12c | 2cloud/AppEngine,2cloud/AppEngine | channels.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update submission for Day 5"
},
{
"role": "assistant",
"content": "#Day 5: Count Vowels\n\n#This program counts the number of vowels in the entered string.\n#For added complexity, it reports a sum of each vowel found in a long te... | python | new_file | 7 | 0 | mit | d45f71966ffa298245e3577126a5bf299ba1e36a | ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_code_submissions,ConsonanceNg/100_Days_of_c... | submissions/faeludire/Day_5/count_vowels.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: [Bug] Fix SQLACHEMY_DATABASE_URI for the tests database"
},
{
"role": "assistant",
"content": "import os\n\nclass Config(object):\n \"\"\" This class configures the parameters to be used in a production enviroment\"\"\"\n C... | python | new_file | 1 | 0 | mit | 292468de015338bde2e7ddbe22a518391ee767c4 | CharlesJonah/bucket_list_api,CharlesJonah/bucket_list_api | application/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add nagios check for remaining IP addresses\n\nCheck currently assumes a single external network and checks for routers\nwith allocated IP's and floating IP's allocated\n\nChange-Id: I6835de8b036ed5247994ebd904f63147dfef3d67"
},
{
"r... | python | new_file | 3 | 10 | apache-2.0 | 4a1577d1a31d30fa006d4030114c9e2790056127 | openstack/osops-tools-monitoring,openstack/osops-tools-monitoring,openstack/osops-tools-monitoring | nagios-plugins/check_ip_pool.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate recovery time versus object size data"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Copyright (c) 2011 Stanford University\n#\n# Permission to use, copy, modify, and distribute this soft... | python | new_file | 4 | 0 | isc | 1984bf841dd45b6f49d9981aaa61b10205db2dd4 | mrdiegoa/ramcloud,DavidLi2010/ramcloud,Frank-Wu/RamCloud,Frank-Wu/RamCloud,rstutsman/RAMCloud,matrix207/RAMCloud,jblomer/ramcloud,anirajk/RAMCloud,jcarreira/ramcloud,QingkaiLu/RAMCloud,Frank-Wu/RamCloud,y-higuchi/ramcloud,behnamm/cs244b_project,matrix207/RAMCloud,y-higuchi/ramcloud,jcarreira/ramcloud,IMCG/RamCloud,jcar... | scripts/objectsize_recovery.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: bot: Add optimized bot. Reduce the number of queries\n\nSigned-off-by: Valentin Ilie <<EMAIL>>"
},
{
"role": "assistant",
"content": "import praw\nimport time\n\nr = praw.Reddit('Comment parser example by u/_Daimon_')\nmulti_redd... | python | new_file | 3 | 0 | unlicense | de179fafa95082b266ea0ca561b835058dc902de | vilie/rp,vilie/rp | bot/bot_optimized.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to plot learning curve"
},
{
"role": "assistant",
"content": "#coding=utf-8\n\nimport sys\nimport argparse\nimport matplotlib.pyplot as plt\n\n\ndef parse_args():\n parser = argparse.ArgumentParser('Parse Log')\n ... | python | new_file | 3 | 5 | apache-2.0 | 207642657e353003507243bdf863b1e27b7a04cd | reyoung/Paddle,QiJune/Paddle,lcy-seso/Paddle,Canpio/Paddle,jacquesqiao/Paddle,pkuyym/Paddle,putcn/Paddle,Canpio/Paddle,Canpio/Paddle,baidu/Paddle,luotao1/Paddle,tensor-tang/Paddle,reyoung/Paddle,pkuyym/Paddle,lcy-seso/Paddle,jacquesqiao/Paddle,PaddlePaddle/Paddle,reyoung/Paddle,Canpio/Paddle,lcy-seso/Paddle,lcy-seso/Pa... | benchmark/paddle/image/plotlog.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for vat.py"
},
{
"role": "assistant",
"content": "import unittest\nfrom decimal import Decimal as D\nfrom oscar_vat_moss import vat\n\n\nclass AddressTest(unittest.TestCase):\n ADDRESSES = (\n # Submissio... | python | new_file | 1 | 2 | bsd-3-clause | 9d269683fbfaaf2afc9b0ce171f8a11242144eb2 | fghaas/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss,hastexo/django-oscar-vat_moss,fghaas/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss,hastexo/django-oscar-vat_moss | tests/test_vat.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example (with wrong import path)."
},
{
"role": "assistant",
"content": "import build.eve_nerd as eve_nerd\n\ndef print_route(v):\n print((\" %s to %s \" % (v.points[0].entity.system.name, v.points[-1].entity.system.nam... | python | new_file | 1 | 6 | mit | cd3a5bc00444266d417e09bba54230024c810888 | StephenSwat/new-eden-route-derivation,StephenSwat/new-eden-route-derivation | examples/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add implementation of the behave feature in steps"
},
{
"role": "assistant",
"content": "from behave import given, when, then\nfrom appium import webdriver\nimport os\nimport time\n\nfrom selenium.webdriver.support.ui import WebD... | python | new_file | 6 | 1 | mit | 982fc34e7b4b78f49ef8b8c5c1842f410f394dc9 | avidas/reliability-demo | steps/app-switch-demo.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\n\nimport os\nfrom speech_recognition import WavFile\n\nfrom mycroft.client.speech.listener import RecognizerLoop\n\n__author__ = 'seanfitz'\n\nDATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), \"data\")\n\... | python | edit | 1 | 1 | apache-2.0 | 4790b1afa5d0125948bb8fdbed6f5838d470a570 | MycroftAI/mycroft-core,forslund/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,linuxipho/mycroft-core,MycroftAI/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core | test/client/local_recognizer_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement extra Juniper operations in devices module"
},
{
"role": "assistant",
"content": "\"\"\"\nHandler for Cisco CSR device specific information.\n\nNote that for proper import, the classname has to be:\n\n \"<Devicename>... | python | new_file | 1 | 1 | apache-2.0 | 1038f39191ae5dad0d91f7b8a89411c51ad028d0 | sebastianw/ncclient,lightlu/ncclient,aitorhh/ncclient,OpenClovis/ncclient,katharh/ncclient,nnakamot/ncclient,ncclient/ncclient,earies/ncclient,vnitinv/ncclient,einarnn/ncclient,kroustou/ncclient,nwautomator/ncclient,cmoberg/ncclient,GIC-de/ncclient,leopoul/ncclient,joysboy/ncclient | ncclient/devices/junos.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Add some tests for ABCHasTraits."
},
{
"role": "assistant",
"content": "\"\"\" Test the ABC functionality.\n\"\"\"\n\nimport unittest\n\ntry:\n import abc\n\n from ..api import ABCHasTraits, ABCMetaHasTraits, HasTraits... | python | new_file | 1 | 1 | bsd-3-clause | 092abd7035168c18c2e49bfbcb5a36b778015a2d | burnpanck/traits,burnpanck/traits | traits/tests/test_abc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple tool for tabulating classes of event types for readability"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# note: must be invoked from the top-level sts directory\n\nimport time\nimport argparse\nimpor... | python | new_file | 3 | 4 | apache-2.0 | f4026b34f97c4e42a2229d47e778fbe09b351eb1 | jmiserez/sts,jmiserez/sts,ucb-sts/sts,ucb-sts/sts | tools/tabulate_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests for text."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom vdm.text import normalize, tokenize, url_slug\n\n\ndef test_normalize():\n #Mixed case and str to unicode\n assert normalize('Br... | python | new_file | 1 | 3 | mit | 3fd9bfaea8b11a12fd7bdece9c1877c1a5a6afa6 | Brown-University-Library/vivo-data-management,Brown-University-Library/vivo-data-management | tests/test_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for admin log viewing"
},
{
"role": "assistant",
"content": "from wolis.test_case import WolisTestCase\n\nclass AdminLogTest(WolisTestCase):\n def test_admin_log(self):\n self.login('morpheus', 'morpheus')\n ... | python | new_file | 1 | 1 | bsd-2-clause | 780c2ed7df2a94de5f5ec89cc4b970cf44c04f06 | p/wolis-phpbb,p/wolis-phpbb | tests/admin_log.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add project coverage index endpoint"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, unicode_literals\n\nfrom flask.ext.restful import reqparse\n\nfrom changes.api.base import APIView\nfrom... | python | new_file | 3 | 7 | apache-2.0 | 69d3cb59c19410d4ac6b619c06fd9d1a9bba9154 | wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes | changes/api/project_coverage_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic model for a Task"
},
{
"role": "assistant",
"content": "from mongoengine import Document, DateTimeField, EmailField, IntField, \\\n ReferenceField, StringField\nimport datetime, enum\n\nclass Priority(enum.IntEnum... | python | new_file | 3 | 0 | mit | 32301da235d40ae3eca7dcbdd7c8438d3c35f775 | Zillolo/lazy-todo | app/task.py | rejected_duplicate | Near-duplicate of sample 1271 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the initial draft of the migration script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport boto3\n\n\ndef get_existing_records(dynamodb_client):\n \"\"\"\n Generates existing... | python | new_file | 1 | 3 | mit | 1206fe0a6f57bc925dc01db03c604b7b786384aa | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | misc/migrate_miro_vhs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 687. Longest Univalue Path\n\n687. Longest Univalue Path: https://leetcode.com/problems/longest-univalue-path/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# class TreeNode(obje... | python | new_file | 1 | 6 | apache-2.0 | 4a41fb3a3b6a689e3cc3c83d711331ad743824de | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/longest-univalue-path.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plotly graph example with animals"
},
{
"role": "assistant",
"content": "import datetime\nimport time\nimport random\n\nfrom dash.react import Dash\nfrom dash_html_components import Div\nfrom dash_core_components import Dropd... | python | new_file | 5 | 1 | mit | a3cad465c43cc88ac382e0bf44166d49420ae02e | plotly/dash,plotly/dash,plotly/dash,plotly/dash,plotly/dash | dash/plotly_graph.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for LpNorm"
},
{
"role": "assistant",
"content": "\"\"\"\nTest LpNorm cost\n\"\"\"\nimport numpy\nimport theano\nfrom theano import tensor as T\nfrom nose.tools import raises\n\n\ndef test_shared_variables():\n '... | python | new_file | 5 | 1 | bsd-3-clause | 5b531877f30a323de3171422916c29f20921a18a | woozzu/pylearn2,Refefer/pylearn2,ddboline/pylearn2,nouiz/pylearn2,w1kke/pylearn2,pkainz/pylearn2,fulmicoton/pylearn2,mkraemer67/pylearn2,pkainz/pylearn2,se4u/pylearn2,cosmoharrigan/pylearn2,skearnes/pylearn2,msingh172/pylearn2,JesseLivezey/pylearn2,pombredanne/pylearn2,ddboline/pylearn2,fulmicoton/pylearn2,pombredanne/... | pylearn2/costs/tests/test_lp_norm_cost.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script that processes stats from Redis"
},
{
"role": "assistant",
"content": "#!usr/bin/env python\nimport os\nimport sys\nimport datetime\nimport redis\n\nfrom itertools import izip, izip_longest\n\n# Workaround current bu... | python | new_file | 3 | 0 | bsd-3-clause | 0ce38e6dd892083e74113852424d1825f5dbf8bd | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | tools/integrate-redis-stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an implementation of the NIST X.509 tests in Python"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport sys, re, os, botan\nfrom os.path import join;\n\nclass TestResult(Exception):\n def __init__(self, r):\... | python | new_file | 3 | 12 | bsd-2-clause | f1932b77306e2c1138ec99b312f2db80d0078079 | randombit/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Sch... | misc/python/nisttest.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: omas: Make test more robust to missing USER and HOME"
},
{
"role": "assistant",
"content": "import omas, os\nif 'USER' not in os.environ:\n os.environ['USER'] = 'TEST_CONDA_USER'\nif 'HOME' not in os.environ:\n os.environ['... | python | new_file | 1 | 0 | bsd-3-clause | b3657c48b3958f57a1d71e296570566d7924d7ca | Cashalow/staged-recipes,kwilcox/staged-recipes,patricksnape/staged-recipes,guillochon/staged-recipes,birdsarah/staged-recipes,basnijholt/staged-recipes,mariusvniekerk/staged-recipes,mcs07/staged-recipes,Juanlu001/staged-recipes,petrushy/staged-recipes,ocefpaf/staged-recipes,ceholden/staged-recipes,Juanlu001/staged-reci... | recipes/omas/run_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic vehicle model and garage"
},
{
"role": "assistant",
"content": "\"\"\"\nTesla car model\n\"\"\"\nimport uuid\nimport json\nfrom random import choice\n\n__OFF__ = 'off'\n__ON__ = 'on'\n__COLOR__ = ['black', 'white', 'r... | python | new_file | 1 | 3 | mit | 29a4c1e0d905b92e4c35d594183e73be31e5c89e | headforwards/tesla-simulator-server,headforwards/tesla-simulator-server | tesla/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add raw history from geodesic basins"
},
{
"role": "assistant",
"content": "# IPython log file\n\n\nfrom skimage import graph\nimage = np.array([[1, 1, 2, 2], [2, 1, 1, 3], [3, 2, 1, 2], [2, 2, 2, 1]])\nmcp = graph.MCP_Geometric(... | python | new_file | 3 | 0 | bsd-3-clause | 0e40eeb87504c896917fcbd9cc718c9953fed94f | jni/useful-histories | finding-geodesic-basins-with-scipy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple example showing HandsonTable and PivotTable"
},
{
"role": "assistant",
"content": "from __future__ import print_function\n\nfrom bokeh.objects import ColumnDataSource\nfrom bokeh.widgetobjects import TableColumn, Hands... | python | new_file | 3 | 0 | bsd-3-clause | b1adfe977ae272546d5bb10f2a4472cc3ae17667 | PythonCharmers/bokeh,evidation-health/bokeh,maxalbert/bokeh,ChinaQuants/bokeh,rothnic/bokeh,percyfal/bokeh,CrazyGuo/bokeh,lukebarnard1/bokeh,timothydmorton/bokeh,aiguofer/bokeh,deeplook/bokeh,timsnyder/bokeh,draperjames/bokeh,paultcochrane/bokeh,muku42/bokeh,tacaswell/bokeh,xguse/bokeh,mindriot101/bokeh,bokeh/bokeh,ala... | examples/glyphs/data_tables_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix build: missed a file\n\nTBR=tony\n\nReview URL: http://codereview.chromium.org/13209\n\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@6449 0039d316-1c4b-4281-b951-d872f2087c98"
},
{
"role": "assistant",
"content": "#... | python | new_file | 2 | 5 | bsd-3-clause | faf4d4d4a80456caf39fbc547763f80bee50acee | junmin-zhu/chromium-rivertrail,jaruba/chromium.src,rogerwang/chromium,ChromiumWebApps/chromium,dednal/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,robclark/chromium,mogoweb/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,jaruba/chromium.src,krieger-od/nwjs... | webkit/tools/layout_tests/test_types/fuzzy_image_diff.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to do the sliding window efficiently"
},
{
"role": "assistant",
"content": "'''\nThis script showing you how to use a sliding window\n'''\n\nfrom itertools import islice\ndef sliding_window(a, n, step):\n '''\n ... | python | new_file | 1 | 2 | bsd-3-clause | d85d1edc769a1d80f8cb4b99824a9277beff4c4c | qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script | python/sliding_window.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n=========================================\nPCA 2d projection of of Iris dataset\n=========================================\n\nThe Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour\nand Virginica) with 4 attributes:... | python | edit | 2 | 0 | bsd-3-clause | 4bec379b3cfea87f17b0d5fa5d80148afe87a470 | mikebenfield/scikit-learn,liyu1990/sklearn,YinongLong/scikit-learn,Titan-C/scikit-learn,xwolf12/scikit-learn,massmutual/scikit-learn,siutanwong/scikit-learn,tmhm/scikit-learn,Aasmi/scikit-learn,icdishb/scikit-learn,yunfeilu/scikit-learn,quheng/scikit-learn,vibhorag/scikit-learn,kaichogami/scikit-learn,cybernet14/scikit... | examples/plot_pca.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python-based JS build script\n\nStill needs to be ported to JS"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport os\nimport subprocess\n\n\noptions = [\"--compress\", \"--mangle\"... | python | new_file | 1 | 0 | mit | 506175af6040ff159ca32836c71792d00649e9f6 | le717/CodeTriangle.me,le717/CodeTriangle,le717/CodeTriangle,le717/CodeTriangle.me,le717/CodeTriangle.me | build-js.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests to verify hyphens are not allowed in attribute codes"
},
{
"role": "assistant",
"content": "import pytest\nfrom django.core.exceptions import ValidationError\n\nfrom oscar.apps.catalogue import models\n\n\ndef test_prod... | python | new_file | 1 | 1 | bsd-3-clause | 5033f95757c414bb223e09ee9c2c9b535c89df3e | binarydud/django-oscar,okfish/django-oscar,solarissmoke/django-oscar,lijoantony/django-oscar,WillisXChen/django-oscar,MatthewWilkes/django-oscar,bnprk/django-oscar,jmt4/django-oscar,Bogh/django-oscar,bnprk/django-oscar,vovanbo/django-oscar,itbabu/django-oscar,spartonia/django-oscar,rocopartners/django-oscar,john-parton... | tests/unit/catalogue/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to roll against a loaded roll table\n\nAs referenced in 1f0decf & 6500a93, add function to 'roll against' a\ntable generated by table_loader.load_table and return the description\nof the event associated with the roll."
},
{... | python | new_file | 1 | 3 | mit | 5e8db67d31ca24508839bfc702b2fbd8a9a2efe6 | whonut/Random-Table-Roller,whonut/Random-Table-Roller,whonut/Random-Table-Roller | autoroller.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for computing autocorrelation of spectra"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Module to compute the autocorrelation of quantities along spectra\"\"\"\nimport _autocorr_spectra_priv\n\n\... | python | new_file | 1 | 1 | mit | b47f49bcb53b707bf9ef1b981b9851ea08805237 | sbird/vw_spectra | autocorr_spectra.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of bootstrap tool"
},
{
"role": "assistant",
"content": "#! /bin/bash\n\n##############################################################################\n# Author: Tomas Babej <<EMAIL>>\n#\n# Builds the FreeIPA... | python | new_file | null | null | mit | 398bdd0b004f8f29bfd405a690102d7d3283fb76 | pspacek/labtool,pvoborni/labtool,pspacek/labtool,tomaskrizek/labtool,pvoborni/labtool,tomaskrizek/labtool | ipa-fun-bootstrap.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add a few utility functions for plotting particle distributions."
},
{
"role": "assistant",
"content": "import numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\n\ndef get_data(i):\n return ... | python | new_file | 3 | 6 | mit | ee5a0017277b49e3a4a27a2d571c10f86563023c | Tech-XCorp/ultracold-ions,hosseinsadeghi/ultracold-ions,Tech-XCorp/ultracold-ions,hosseinsadeghi/ultracold-ions | examples/plotPtcls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple test to scroll plugin"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport app_config\napp_config.DATABASE_NAME = 'carebot_test.db'\napp_config.DEFAULT_CONFIG_PATH = 'tests/config_test.yml'\n\ntry:\n ... | python | new_file | 4 | 1 | mit | 9fd7b4477cc8420af1b8d120cd4386e8a0cb82d1 | thecarebot/carebot,thecarebot/carebot,thecarebot/carebot | tests/test_plugin_scroll.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for setting up the bridge VM"
},
{
"role": "assistant",
"content": "# Setup tapuser for SSH from the CI nodes\nuseradd tapuser\nmkdir -p /home/tapuser/.ssh\nchown -R tapuser:tapuser /home/tapuser\nchmod 700 /home/tapus... | python | new_file | null | null | apache-2.0 | feb4f46959ff5e2226d968e8a9de849f3883d967 | CiscoSystems/project-config-third-party,CiscoSystems/project-config-third-party | scripts/make_bridge_vm.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add step to revoke nfs access"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport logging\nfrom util import full_stack\nfrom dbaas_nfsaas.provider import NfsaasProvider\nfrom workflow.steps.util.base import Bas... | python | new_file | 1 | 2 | bsd-3-clause | 1536633a8515db4667ed9ca60fd33d07d42e1bed | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/workflow/steps/mysql/region_migration/revoke_nfs_access.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for subhandlers of AttrHandler"
},
{
"role": "assistant",
"content": "import asyncio\nimport aiozmq\nimport aiozmq.rpc\n\n\nclass Handler(aiozmq.rpc.AttrHandler):\n\n def __init__(self, ident):\n self.ident ... | python | new_file | 1 | 1 | bsd-2-clause | 7c7f673eeb731baf186db66a26147b67b8762eae | MetaMemoryT/aiozmq,aio-libs/aiozmq,claws/aiozmq,asteven/aiozmq | examples/rpc_with_subhanlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for member settings display"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom django.core.urlresolvers import reverse\n\nfrom sentry.models import OrganizationMember, OrganizationMembe... | python | new_file | 3 | 1 | bsd-3-clause | 534dece8a904868aafe17f521535468c386700aa | BuildingLink/sentry,zenefits/sentry,kevinastone/sentry,drcapulet/sentry,wujuguang/sentry,camilonova/sentry,llonchj/sentry,fotinakis/sentry,kevinastone/sentry,JackDanger/sentry,BuildingLink/sentry,mvaled/sentry,drcapulet/sentry,Kryz/sentry,jean/sentry,hongliang5623/sentry,ngonzalvez/sentry,JackDanger/sentry,mvaled/sentr... | tests/sentry/web/frontend/test_organization_member_settings.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.