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 basic unit test for parseCommand"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport unittest\nfrom udpRemote import parseCommand\n\n\nclass MockDriveParam:\n velocity = 0.0\n angle = 0.0\n\n\nclass U... | python | new_file | 1 | 1 | mit | 1a49426497819c13ccf858d51e5fa333d95f1f7d | atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot | src/autobot/src/udpRemote_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert python 2 version to python 3"
},
{
"role": "assistant",
"content": "import os\nimport shutil\nimport fnmatch\n\ndef get_files(patterns):\n \"\"\" gets all files matching pattern from root\n pattern supports any ... | python | new_file | 5 | 9 | mit | 3a4de870ebefd0e3e32b8c1b9facee6c98ce8b7f | Lingotek/filesystem-connector,Lingotek/translation-utility,Lingotek/client,Lingotek/client,Lingotek/translation-utility,Lingotek/filesystem-connector | ltk2to3.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for testing the widget tree iterators."
},
{
"role": "assistant",
"content": "import unittest\n\n\nclass FileWidgetWalk(unittest.TestCase):\n\n def test_walk_large_tree(self):\n from kivy.uix.boxlayout im... | python | new_file | 1 | 6 | mit | 9c70a5d65b1c06f62751dfb4fcdd4d6a60a5eb71 | eHealthAfrica/kivy,xpndlabs/kivy,vipulroxx/kivy,rafalo1333/kivy,CuriousLearner/kivy,Farkal/kivy,rafalo1333/kivy,Cheaterman/kivy,bionoid/kivy,bliz937/kivy,vipulroxx/kivy,habibmasuro/kivy,xiaoyanit/kivy,dirkjot/kivy,Farkal/kivy,rafalo1333/kivy,manashmndl/kivy,KeyWeeUsr/kivy,darkopevec/kivy,viralpandey/kivy,matham/kivy,cb... | kivy/tests/test_widget_walk.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic support for LimitlessLED"
},
{
"role": "assistant",
"content": "\"\"\"\nhomeassistant.components.light.limitlessled\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSupport for LimitlessLED bulbs, also known as...\n\nEasyBulb\nA... | python | new_file | 3 | 4 | mit | a86852fe908bb0a44ef267a75b9446ddcaf03f6e | Duoxilian/home-assistant,betrisey/home-assistant,CCOSTAN/home-assistant,open-homeautomation/home-assistant,Smart-Torvy/torvy-home-assistant,pschmitt/home-assistant,hexxter/home-assistant,srcLurker/home-assistant,postlund/home-assistant,alexmogavero/home-assistant,MungoRae/home-assistant,srcLurker/home-assistant,turboko... | homeassistant/components/light/limitlessled.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add conditional command prefix plugin"
},
{
"role": "assistant",
"content": "from cloudbot import hook\n\nimport re\n\n@hook.sieve\ndef conditional_prefix(bot, event, plugin):\n if plugin.type == 'command':\n if event.c... | python | new_file | 3 | 5 | mit | db4bc200f9a48edf9e160c2134293df0313183a7 | Aaron1011/CloudBotPlugins | conditional_prefix.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add standalone wave trigger tool."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Standard library imports\nimport argparse\nimport collections\nimport logging\nimport os\nimport time\n\n# Additional library imp... | python | new_file | 1 | 0 | apache-2.0 | ebf4d87390307dcf735c53f18a18f3466a4ee5e4 | lordjabez/light-maestro,lordjabez/light-maestro,lordjabez/light-maestro,lordjabez/light-maestro | tools/standalonewavetrigger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for 'holes' argument in add_polygon"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport pygmsh as pg\nimport numpy as np\n\ndef generate():\n # Characteristic length\n lcar =... | python | new_file | 1 | 1 | bsd-3-clause | 37f286812bea7429bea67172a40d26ad435d6f67 | nschloe/python4gmsh | test/examples/hole_in_square.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new top level script to ease running of individual unittests."
},
{
"role": "assistant",
"content": "\nimport sys\nimport unittest\n\nfrom toast.mpirunner import MPITestRunner\n\nfile = sys.argv[1]\n\nloader = unittest.TestLo... | python | new_file | 1 | 0 | bsd-2-clause | b80e52ecf09f96e84625eb6fff9aa7a20059c0f8 | tskisner/pytoast,tskisner/pytoast | test_single.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [Util] Add a helper script for converting -print-before-all output into a file based equivelent\n\nSimple little utility which takes a opt logfile generated with \"opt -print-before-all -print-module-scope -o /dev/null <args> 2&>1\", and spl... | python | new_file | 3 | 1 | apache-2.0 | 26df96a0c772c70013cc7a027022e84383ccaee2 | llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm | utils/chunk-print-before-all.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple terminal-based version of rock-paper-scissors."
},
{
"role": "assistant",
"content": "from random import choice\n\nclass RPSGame:\n shapes = ['rock', 'paper', 'scissors']\n draws = [('rock', 'rock'), ('paper', 'p... | python | new_file | 1 | 3 | mit | 4f08f057c7e4cc8230a996d853892ab3eef36065 | kubkon/ee106-additional-material | rps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: test: Add tests for circle ci checks"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom semantic_release import ci_checks\nfrom semantic_release.errors import CiVerificationError\n\n\ndef test_circle_should_pass_if_bran... | python | new_file | 1 | 1 | mit | fa1223c661d60033b7d7aba2a27151d6ee18a299 | relekang/python-semantic-release,wlonk/python-semantic-release,relekang/python-semantic-release,riddlesio/python-semantic-release | tests/ci_checks/test_circle.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add stubby saved roll class"
},
{
"role": "assistant",
"content": "import sqlite3\n\n\nconnection = sqlite3.connect('data.db')\n\n\nclass SavedRoll:\n @staticmethod\n def save(user, name, args):\n pass\n\n @static... | python | new_file | 1 | 1 | mit | 2e6c7235c555799cc9dbb9d1fa7faeab4557ac13 | foxscotch/foxrollbot | db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for google menu"
},
{
"role": "assistant",
"content": "\"\"\"\nGoogle Menu tests\n\"\"\"\n\n\nfrom base import BaseTouchscreenTest\nimport time\nfrom base import MAPS_URL, ZOOMED_IN_MAPS_URL, Pose\nfrom base import scre... | python | new_file | 4 | 1 | apache-2.0 | a193f1d9b1816f72661254bba69c2c4a1e2c1b30 | EndPointCorp/appctl,EndPointCorp/appctl | tests/extensions/functional/tests/test_google_menu.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up contextmanager for db cals"
},
{
"role": "assistant",
"content": "# muddersOnRails()\n# Sara McAllister November 5, 2-17\n# Last updated: 11-5-2017\n\n# library for SQLite database calls for teamwork analysis app\n\nimport... | python | new_file | 1 | 2 | mit | 0aaed7764d743afe46af503fe5938fa718fe3abc | nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis,nathanljustin/teamwork-analysis | teamworkApp/lib/dbCalls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Disable IPv6 on wireless (Extension Attribute for Casper)"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n#Copyright 2014 Quam Sodji\n\nimport subprocess\n\ndef getinfo(hardware): #Return network info on select interf... | python | new_file | 2 | 1 | mit | 45e86e49e845ef25df6e1db3bcb336809ffb5f5f | killahquam/JAMF,killahquam/JAMF | ipv6_Checker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for all exceptions"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\nimport pytest\nimport responses\nimport kiteconnect.exceptions as ex\n\n\n@responses.activate\ndef test_wrong_json_response(kiteconnect):\n ... | python | new_file | 5 | 1 | mit | 4ebfc2e6ffb21fd55ef1fc4f1fd836153b2da545 | rainmattertech/pykiteconnect | tests/unit/test_exceptions.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for exact search with album query"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nimport unittest\n\nfrom mopidy.local import search\nfrom mopidy.models import Album, Track\n\n\nclass Lo... | python | new_file | 1 | 1 | apache-2.0 | dac5f9e406f3c205d6ed212d4414ca55c94b8f15 | pacificIT/mopidy,hkariti/mopidy,bencevans/mopidy,jmarsik/mopidy,swak/mopidy,swak/mopidy,diandiankan/mopidy,vrs01/mopidy,dbrgn/mopidy,jodal/mopidy,tkem/mopidy,quartz55/mopidy,hkariti/mopidy,ali/mopidy,swak/mopidy,mokieyue/mopidy,mokieyue/mopidy,swak/mopidy,dbrgn/mopidy,SuperStarPL/mopidy,kingosticks/mopidy,tkem/mopidy,g... | tests/local/test_search.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom spec import Spec\n\n\nclass Runner_(Spec):\n class run:\n def out_stream_defaults_to_sys_stdout(self):\n \"out_stream defaults to sys.stdout\"\n\n def err_stream_defaults_to_sys_stderr(self):\n \"... | python | edit | 1 | 1 | bsd-2-clause | 0ca298f6706706637dccd4f27c56eed6e91c98ba | mattrobenolt/invoke,pyinvoke/invoke,mattrobenolt/invoke,pyinvoke/invoke,kejbaly2/invoke,frol/invoke,tyewang/invoke,pfmoore/invoke,mkusz/invoke,mkusz/invoke,pfmoore/invoke,singingwolfboy/invoke,kejbaly2/invoke,frol/invoke | tests/runners.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move utility functions for checking passported benefits into separate module"
},
{
"role": "assistant",
"content": "from cla_public.apps.checker.constants import PASSPORTED_BENEFITS, \\\n NASS_BENEFITS\n\n\ndef passported(bene... | python | new_file | 1 | 1 | mit | 226c2f36b9cc8257ce99bd15648be4aba2ccb606 | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | cla_public/apps/checker/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add image processing system (dummy)"
},
{
"role": "assistant",
"content": "from chunsabot.botlogic import brain\n\n@brain.route(\"@image\")\ndef add_image_description(msg, extras):\n attachment = extras['attachment']\n if n... | python | new_file | 1 | 2 | mit | 1ece8c8640214d69a224f94f1b1ac93ec53d7699 | susemeee/Chunsabot-framework | chunsabot/modules/images.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example of SQLalchemy model"
},
{
"role": "assistant",
"content": "from flask.ext.sqlalchemy import SQLAlchemy\n\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'\ndb = SQLAlchemy(app)\n\nclass User(db.Mode... | python | new_file | 3 | 1 | bsd-3-clause | e61dbf66d6f73e4999a5ff9f732a8df0637fdbf2 | raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite | server/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add (failing) tests for the dashboard"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2.5\n#\n# Copyright 2011 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may no... | python | new_file | 3 | 1 | apache-2.0 | f131cd221b2ce6fc144b2aa9882cb0ad1b116675 | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | tests/views/test_dashboard.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright (c) 2011 Openstack, LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may ob... | python | edit | 1 | 1 | apache-2.0 | 3d1cef9e56d7fac8a1b89861b7443e4ca660e4a8 | vmturbo/nova,fnordahl/nova,cloudbau/nova,CEG-FYP-OpenStack/scheduler,vladikr/nova_drafts,yrobla/nova,bigswitch/nova,eharney/nova,KarimAllah/nova,Stavitsky/nova,TwinkleChawla/nova,zzicewind/nova,klmitch/nova,rickerc/nova_audit,belmiromoreira/nova,cloudbase/nova-virtualbox,luogangyi/bcec-nova,Yusuke1987/openstack_templat... | nova/ipv6/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Repository class and module"
},
{
"role": "assistant",
"content": "import os\n\nfrom morenines import output\nfrom morenines import util\n\nfrom morenines.index import Index\nfrom morenines.ignores import Ignores\n\n\nNAMES =... | python | new_file | 1 | 3 | mit | b2dd561322f6f277f470eae425028412a209da93 | mcgid/morenines,mcgid/morenines | morenines/repository.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of bot script"
},
{
"role": "assistant",
"content": "import time\nfrom slackclient import SlackClient\n\ntoken = 'kekmao'\nsc = SlackClient(token)\nteam_join_event = 'team_join'\n\n\ndef send_welcome_message(u... | python | new_file | 1 | 6 | mit | 72678c437f1b1110fb8a14c78dcdd4c3c8b64157 | devupin/allie | rtm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD Cleaning before each test"
},
{
"role": "assistant",
"content": "from lettuce import *\nimport requests\n\nTARGET_URL='http://localhost:8080'\n\ntenantList = [ \"511\", \"615\", \"634\", \"515\" ]\n\n@before.each_scenario\nde... | python | new_file | 5 | 2 | apache-2.0 | b01c602f156b5a72db1ea4f27989aa5b1afdada8 | telefonicaid/fiware-keypass,telefonicaid/fiware-keypass,telefonicaid/fiware-keypass | src/behavior/features/terrain.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fortran ABI mismatch test for scipy.linalg."
},
{
"role": "assistant",
"content": "from subprocess import call, PIPE, Popen\nimport sys\nimport re\n\nimport numpy as np\nfrom numpy.testing import TestCase, dec\n\nfrom scipy.l... | python | new_file | 5 | 5 | bsd-3-clause | 0cad5e1673069d0fb8f2abb4eb6b062e3461fb70 | mikebenfield/scipy,ChanderG/scipy,chatcannon/scipy,juliantaylor/scipy,newemailjdm/scipy,sonnyhu/scipy,WarrenWeckesser/scipy,mhogg/scipy,arokem/scipy,newemailjdm/scipy,FRidh/scipy,Eric89GXL/scipy,mgaitan/scipy,pschella/scipy,larsmans/scipy,anntzer/scipy,pizzathief/scipy,chatcannon/scipy,mortonjt/scipy,vigna/scipy,sriki1... | scipy/linalg/tests/test_build.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add url rewriter for eztv"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals, division, absolute_import\nimport re\nimport logging\nfrom urlparse import urlparse, urlunparse\nfrom requests import Reque... | python | new_file | 3 | 7 | mit | c7987bde28992ef0ae8cae9fca500730b2fcea15 | jawilson/Flexget,crawln45/Flexget,ZefQ/Flexget,crawln45/Flexget,crawln45/Flexget,grrr2/Flexget,poulpito/Flexget,tobinjt/Flexget,ianstalk/Flexget,dsemi/Flexget,Flexget/Flexget,Flexget/Flexget,OmgOhnoes/Flexget,qk4l/Flexget,jacobmetrick/Flexget,JorisDeRieck/Flexget,ZefQ/Flexget,tsnoam/Flexget,Danfocus/Flexget,antivirtel/... | flexget/plugins/urlrewrite_eztv.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add exception to describe errors in configuration processing\n\nMostly just a marker, but with some extra debug information."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#-*- coding: utf-8 -*-\n\n#This software i... | python | new_file | 1 | 1 | cc0-1.0 | 41631175c7aae124f7504f068d9c2f8cf1c9e617 | Ghostkeeper/Luna | plugins/configuration/configurationtype/configuration_error.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for valid recipes"
},
{
"role": "assistant",
"content": "import os\n\nimport pytest\n\nfrom conda_verify import utils\nfrom conda_verify.exceptions import RecipeError\nfrom conda_verify.verify import Verify\n\n\n@pytest... | python | new_file | 1 | 2 | bsd-3-clause | d3f556b6d7da2c67fc9dcc6b7d73a0d1b76d278c | mandeep/conda-verify | tests/functional_tests/test_valid_recipes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add topological sorting in Python\n\nIssue #57"
},
{
"role": "assistant",
"content": "'''\nTopological sort.\nTaken from : \nhttp://stackoverflow.com/questions/15038876/topological-sort-python\n'''\n\nfrom collections import defa... | python | new_file | 1 | 4 | mit | 6274ee8d776c829998dfaa56cb419d1263242a48 | salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ?wv command for encouraging action\n\nReviewed-by: Zi Li"
},
{
"role": "assistant",
"content": "__commands__ = '''\n ?wv [name] - congratulates people on their public sprited gesture\n'''\n\n\ndef plugin(bot):\n bot.hea... | python | new_file | 1 | 1 | mit | 58c604a8574ade75aecbd80314004a9539e80c84 | smarkets/hal | plugins/volunteers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for http live streaming"
},
{
"role": "assistant",
"content": "var http = require('http');\nvar fs = require('fs');\nvar url = require('url');\nvar path = require('path');\nvar zlib = require('zlib');\n\nPORT = 8000;\n... | python | new_file | null | null | mit | 07442bd7ddd07635002493bafb6ac16a24fd5d82 | voidabhi/node-scripts,voidabhi/node-scripts,voidabhi/node-scripts | hls.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Define decorator for requiring login"
},
{
"role": "assistant",
"content": "from functools import wraps\n\nfrom flask import redirect, session, url_for\n\ndef login_required(f):\n @wraps(f)\n def wrapper(*args, **kwargs):\n... | python | new_file | 1 | 2 | apache-2.0 | 40ad674ae170347ed69b19434241438bb09e473d | ueg1990/customer-info,ueg1990/customer-info | app/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test if points are in footprint"
},
{
"role": "assistant",
"content": "import unittest\nimport pcl\nimport numpy as np\nfrom patty_registration.conversions import loadLas, loadCsvPolygon\nfrom numpy.testing import assert_array_eq... | python | new_file | 6 | 3 | apache-2.0 | 722b11eab90c6d532ea96209f7632e17181c0b3e | NLeSC/PattyAnalytics | tests/test_inpoly.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to execute a simple command in a remote server over SSH"
},
{
"role": "assistant",
"content": "import paramiko # pip install paramiko\nimport os\n\n\ndef ssh_command(ip, user, command):\n # you can run this script ... | python | new_file | 2 | 2 | mit | 62b2c69482d36a7afcdb732dd70a037d2513ba51 | inakidelamadrid/bhp_exercises | bh_sshcmd.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add platform_map to remap Platform.os and arch based on config"
},
{
"role": "assistant",
"content": "import re\n\n\ndef platform_mapped(func):\n \"\"\"\n Decorates functions for lookups within a config.platform_map diction... | python | new_file | 1 | 4 | apache-2.0 | 7115d25c57404a42bc29513eb514073747d876ce | nerdvegas/rez,instinct-vfx/rez,nerdvegas/rez,instinct-vfx/rez | src/rez/utils/platform_mapped.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an extract_features(image, measurements) function returning a feature vector"
},
{
"role": "assistant",
"content": "import numpy as np\n\n\"\"\"\nGiven an image as a Numpy array and a set of measurement objects\nimplementing ... | python | new_file | 1 | 2 | apache-2.0 | 3b29a94a7009c0b652e8eca0b175bb97250e1b33 | widoptimization-willett/feature-extraction | feature_extraction/extraction.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move Chuck database query function to another file"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport json\n\ntry:\n from urllib2 import urlopen\nexcept:\n from urllib.request import urlopen\n\n\ndef g... | python | new_file | 1 | 1 | bsd-3-clause | d11491d30a2fb418dd40bf7e97d4d35cc84d6f3f | trojjer/pyjokes,gmarkall/pyjokes,Wren6991/pyjokes,bennuttall/pyjokes,borjaayerdi/pyjokes,ElectronicsGeek/pyjokes,pyjokes/pyjokes,martinohanlon/pyjokes,birdsarah/pyjokes | pyjokes/chuck.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example for pre signed URL\n\nChange-Id: I6abb998cee022e5cf3e83df4600dc027bc537d32"
},
{
"role": "assistant",
"content": "# Copyright 2016 Catalyst IT Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice... | python | new_file | 1 | 2 | apache-2.0 | 8a1448ed3bd426d11f6222d63f77604ec132b2da | openstack/python-zaqarclient | examples/signed_url_auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to fix admin users with roles"
},
{
"role": "assistant",
"content": "from django.db import migrations\n\nfrom corehq.apps.es import UserES\nfrom corehq.apps.users.models import WebUser\nfrom corehq.util.couch import... | python | new_file | 1 | 5 | bsd-3-clause | 681c21a5fbf3bc713468e33bb10dfa9bf6d62850 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/users/migrations/0004_rm_role_id_from_admins.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to clear all matches mostly useful with heroku"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom match.models import Match\n\nimport sys\n\nclass... | python | new_file | 4 | 1 | mit | 2f268173e25bee5d671583bb905829e0ffd4f631 | maxf/address-matcher,maxf/address-matcher,maxf/address-matcher,maxf/address-matcher | match/management/commands/reset-matches.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for wagtail.tests\n\nIt only appears in Python 3.x for some reason."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, mi... | python | new_file | 1 | 0 | bsd-3-clause | 860f8224bf8ef2f1553a17842d1389491f43bfa5 | inonit/wagtail,janusnic/wagtail,chrxr/wagtail,FlipperPA/wagtail,nrsimha/wagtail,benjaoming/wagtail,jordij/wagtail,taedori81/wagtail,takeshineshiro/wagtail,mephizzle/wagtail,hanpama/wagtail,darith27/wagtail,gogobook/wagtail,gasman/wagtail,wagtail/wagtail,timorieber/wagtail,rsalmaso/wagtail,FlipperPA/wagtail,mjec/wagtail... | wagtail/tests/migrations/0008_auto_20141113_2125.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for Helmholtz rates"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport pandas as pd\n\n\np4_data = \"helmholtz-results/helmholtz_conv-d-4.csv\"\np5_data = \"helmholtz-results/helmholtz_conv-d-5.csv\"\... | python | new_file | 1 | 2 | mit | 9ba0ff62572dcfd7912c9b58091b59844f8e1753 | thomasgibson/tabula-rasa | results/sccg-table.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for gold projects"
},
{
"role": "assistant",
"content": "from django.contrib.auth.models import User\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\n\nfrom django_dynamic_fixture import ... | python | new_file | 1 | 1 | mit | 5d1da267791456f6c5e386d6e7204d02371c2eb2 | emawind84/readthedocs.org,kenshinthebattosai/readthedocs.org,Tazer/readthedocs.org,SteveViss/readthedocs.org,atsuyim/readthedocs.org,clarkperkins/readthedocs.org,safwanrahman/readthedocs.org,kenwang76/readthedocs.org,SteveViss/readthedocs.org,sunnyzwh/readthedocs.org,mhils/readthedocs.org,attakei/readthedocs-oauth,rtfd... | readthedocs/rtd_tests/tests/test_gold.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to batch convert a directory recursively"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport re\nfrom pathlib import Path\n\nimport argparse\n\nfrom convert2netcdf4 import parseandconvert\n\nparser = a... | python | new_file | 1 | 5 | mit | 1e82283cc85b2eb449969849d23c4ffa2c090426 | kinow/pccora | scripts/directory_batch_convert.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate images from all samples"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport teetime\nimport os\n\n\ndef main():\n with open('samples/sample-texts.txt') as fh:\n for line in fh:\... | python | new_file | 2 | 2 | mit | 03f46b0d6867bcb8a88e53b26089705cb1667bbd | megacool/teetime | tools/create_from_sample_texts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a regression test for whitespace normalization in the BibTeX parser."
},
{
"role": "assistant",
"content": "from pybtex.database import BibliographyData\nfrom pybtex.core import Entry\nfrom pybtex.database.input.bibtex import... | python | new_file | 1 | 2 | mit | 1818959519207eb1bd888d8abed096c32bb85b96 | live-clones/pybtex | pybtex/tests/bibtex_parser_test.py | rejected_duplicate | Near-duplicate of sample 6290 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to write user counts to csv."
},
{
"role": "assistant",
"content": "\"\"\"\nScript to write user counts for each region to CSV.\n\n\"\"\"\n\nimport twitterproj\n\ndef main():\n\n db = twitterproj.connect()\n file... | python | new_file | 3 | 3 | unlicense | 5af36bbe29a8a7a7418fc535c5647c9be511f0b4 | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | scripts/userCounts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic endopoints powered by bottle"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport bottle\nfrom bottle import route, run, template, request, response\n\nimport os\nimport uuid\n... | python | new_file | 4 | 3 | mit | 3134e22eb5da9bd7104c199f788288e0fc823db2 | ciela/chainer-gogh | app.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for calibration procedure (draft)"
},
{
"role": "assistant",
"content": "from ..calibration import CalibratorTable\nfrom ..read_config import read_config\nfrom ..scan import list_scans\nimport numpy as np\nimport matplo... | python | new_file | 6 | 3 | bsd-3-clause | d8ad74b80f214ca313d01533ea6f15082cbb3af2 | matteobachetti/srt-single-dish-tools | srttools/core/tests/test_calibration.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for problem 34\n\nSlow and brute force solution..."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom math import factorial, log\nvalues = [0]*10\n\nfor i in range(10):\n values[i] = factorial(i)\n\n... | python | new_file | 3 | 0 | mit | e50dc18525e0e4cbbef56cd16ba4e2d9690464f1 | cifvts/PyEuler | euler034.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add temporary satellites analysis example."
},
{
"role": "assistant",
"content": "assert __name__ == '__main__'\n\nimport bayeslite.bql as bql\nimport bayeslite.core as core\nimport bayeslite.parse as parse\nimport crosscat.Local... | python | new_file | 2 | 3 | apache-2.0 | 0af447c0371bd157c03fc5097ac8c0e0a5873ff7 | probcomp/bayeslite,probcomp/bayeslite | examples/satellites_analyze.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for env module.\n\nThese are pretty simple - just tests wiring to datetime and pytz"
},
{
"role": "assistant",
"content": "from _ebcf_alexa import env\nfrom unittest.mock import patch, call\nimport pytest\n\n\n@pyt... | python | new_file | 1 | 1 | mit | 47c1dfd602281c56973de0d8afe64b923eb29592 | dmotles/ebcf-alexa | test/test_env.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new script to get comet velocity from kymograph"
},
{
"role": "assistant",
"content": "# @Float(label=\"Time Interval (s)\", value=1) dt\n# @Float(label=\"Pixel Length (um)\", value=1) pixel_length\n# @Boolean(label=\"Do you ... | python | new_file | 11 | 6 | bsd-3-clause | 943e162eee203f05b5a2d5b19bcb4a9c371cc93b | hadim/fiji_tools,hadim/fiji_scripts,hadim/fiji_scripts,hadim/fiji_scripts,hadim/fiji_tools | plugins/Scripts/Plugins/Kymograph_Comet_Velocity.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple 8x benchmark script\n\nSigned-off-by: David Shah <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport os, sys, threading\nfrom os import path\nimport subprocess\nimport re\n\nnum_runs = 8\n... | python | new_file | 3 | 3 | isc | e39290b71299843eff858fb51543b99a06178a1d | YosysHQ/nextpnr,SymbiFlow/nextpnr,SymbiFlow/nextpnr,YosysHQ/nextpnr,YosysHQ/nextpnr,YosysHQ/nextpnr,SymbiFlow/nextpnr,SymbiFlow/nextpnr | ice40/picorv32_benchmark.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python -m mistune cli"
},
{
"role": "assistant",
"content": "import sys\nimport argparse\nfrom . import (\n create_markdown,\n __version__ as version\n)\n\n\ndef _md(args):\n if args.plugin:\n plugins = args.p... | python | new_file | 1 | 5 | bsd-3-clause | e9f88f1c43189fe429730c488f4514bf78edea4e | lepture/mistune | mistune/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple script mapping YTID to KA URLs."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nfrom kapi import *\nfrom utils import *\nimport argparse, sys\nimport time\n\n\ndef read_cmd():\n \"\"\"Function for read... | python | new_file | 11 | 3 | mit | 069a5758b16624ac2b547ede44123b64c89baf96 | danielhollas/AmaraUpload,danielhollas/AmaraUpload | map_ytids_to_ka_urls.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic summary query implementation\n\nSigned-off-by: Jan Losinski <<EMAIL>>"
},
{
"role": "assistant",
"content": "from datetime import datetime\nimport zmq\n\nfrom messages import common_pb2, replies_pb2, requests_pb2\n\n\... | python | new_file | 3 | 2 | bsd-3-clause | 96bbf25be25482a7edfd92ec9b956b0bbeab39c4 | agdsn/traffic-service-client,agdsn/traffic-service-client | src/traffic/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unittest-based test suite for scenarios\n\nThis can be run directly using:\n\n ./test_converge.py\n\nor (equivalently):\n\n python -m unittest test_converge\n\nor with a test runner such as nose:\n\n nosetests test_converge"
},
... | python | new_file | 4 | 3 | apache-2.0 | fc9e9b4b9bdee1bd1f6b112c90772702cf60ad2d | zaneb/heat-convergence-prototype | test_converge.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add custom form for editing and updating of decks"
},
{
"role": "assistant",
"content": "from django.forms import ModelForm\nfrom django.forms.widgets import Textarea, TextInput\nfrom deck_model import Deck\n\nclass DeckForm(Mode... | python | new_file | 1 | 0 | mit | 3e345bc4a17cf53c40ef51cd2ae1732744be7e60 | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | cardbox/deck_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command for updating genome coordinate names using Ensembl-INSDC mapping"
},
{
"role": "assistant",
"content": "\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformatics Institute\nLicensed under the Apache Licens... | python | new_file | 1 | 1 | apache-2.0 | fa8b40b8ebc088f087ff76c36068fea67dae0824 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | rnacentral/portal/management/commands/update_coordinate_names.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix fixture, add doc string"
},
{
"role": "assistant",
"content": "\"\"\"Defines fixtures that can be used to streamline tests and / or define dependencies\"\"\"\nfrom random import randint\n\nimport pytest\n\nimport hug\n\n\n@py... | python | new_file | 1 | 1 | mit | 6418807dbba9fb946ffeb05aee525c51c2e71f75 | MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug | tests/fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a module to deal with credentials"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom ctypes import cast, byref, c_char_p, c_void_p, string_at\n\nfrom .gssapi_h import (\n GSS_C_NO_CREDENT... | python | new_file | 20 | 1 | mit | f65c6f3939c50326eea14bd0dadc77b7c9364dd2 | sigmaris/python-gssapi,sigmaris/python-gssapi,sigmaris/python-gssapi,sigmaris/python-gssapi | gssapi/creds.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python user customization file."
},
{
"role": "assistant",
"content": "\"\"\" Customize Python Interpreter.\n\nLink your user customizing file to this file.\n\nFor more info see: https://docs.python.org/3/library/site.html\n\... | python | new_file | 1 | 0 | mit | 8e8c14446a0089ee7fa57cfd5520c7d6d6e2711e | fossilet/dotfiles,fossilet/dotfiles,fossilet/dotfiles | usercustomize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial unit tests for io module"
},
{
"role": "assistant",
"content": "from unittest.mock import MagicMock, patch\n\nimport pytest\n\nfrom isort import io\n\n\nclass TestFile:\n def test_read(self, tmpdir):\n test_... | python | new_file | 3 | 1 | mit | 6f9d02510ad861bf8ae5ad8f1ae335a4e565756d | PyCQA/isort,PyCQA/isort | tests/test_io.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a widget for line editors."
},
{
"role": "assistant",
"content": "from django.forms.widgets import Textarea\nfrom django.utils.safestring import mark_safe\n\nclass LineEditorWidget(Textarea):\n class Media:\n js = (... | python | new_file | 1 | 2 | apache-2.0 | 436719050ada475d840004a49c693d08c3f92034 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/project/widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add more tests to cli"
},
{
"role": "assistant",
"content": "from click.testing import CliRunner\nfrom tinydb import TinyDB, where\nfrom tinydb.storages import MemoryStorage\nimport pytest\ntry:\n import mock\nexcept ImportErr... | python | new_file | 1 | 1 | mit | 4442fabf9292efa44a82f420e2d3e807d7d15b04 | eiginn/passpie,eiginn/passpie,scorphus/passpie,scorphus/passpie,marcwebbie/passpie,marcwebbie/passpie | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n'''This module contains convolution network structures.'''\n\nfrom . import feedforward\n\n\nclass Regressor(feedforward.Regressor):\n '''A regressor attempts to produce a target output.\n\n A convolutional ... | python | edit | 1 | 0 | mit | 4fd051fd6d048e64f574097a3ca314111087ee45 | chrinide/theanets,lmjohns3/theanets | theanets/convolution.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case of BloArticle class\n\nImplement basic test setup, test case of load_from_file method."
},
{
"role": "assistant",
"content": "import unittest\nfrom blo.BloArticle import BloArticle\n\n\nclass TestBloArticle(unittest... | python | new_file | 1 | 1 | mit | 13be4749aef2415ab84ffbd090c5b24d8ed98af5 | 10nin/blo,10nin/blo | tests/TestBloArticle.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the first script to try a led light"
},
{
"role": "assistant",
"content": "import RPi.GPIO as GPIO\nimport time\nGPIO.setmode(GPIO.BOARD)\nGPIO.setup(7,GPIO.OUT)\nfor x in range(0,10):\n GPIO.output(7,True)\n time.sleep(1)\... | python | new_file | 1 | 0 | mit | 1696ca33e644d3cb1138d7ee4c48239b7a757cfd | mirontoli/tolle-rasp,mirontoli/tolle-rasp,mirontoli/tolle-rasp,mirontoli/tolle-rasp,mirontoli/tolle-rasp | python_scripts/gpio_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for unicode characters in grammars."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport pytest\nfrom textx.metamodel import metamodel_from_str\n\n\ndef test_unico... | python | new_file | 3 | 1 | mit | e583d977c7089f21841890b7eb50c824db153202 | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | tests/functional/test_unicode.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Pandas integration unit tests"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nimport numpy as np\nimport pandas as pd\nimport numpy.testing as npt\n\nfrom nimble import Events\n\n\nclass TestAsPandasCo... | python | new_file | 1 | 1 | mit | dcc64e9fd8bb3cb407959a30a2054fc180596bae | rwhitt2049/nimble,rwhitt2049/trouve | tests/test_pandas_integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the start of some test for the scoring stuff.\n\nChange-Id: I7eb7b9176eb9a259d8fac0a99610f4bb3b938a51"
},
{
"role": "assistant",
"content": "import scores_db\nimport mock\nimport redis_client\nimport control\nfrom twisted.int... | python | new_file | 5 | 1 | mit | 288a59cfeade739260a1f76cf632d735677022be | prophile/compd,prophile/compd | src/test_scores_db.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the cipher map problem."
},
{
"role": "assistant",
"content": "import operator\ndef checkio(arr):\n index = convertMapToTuples(arr[0])\n cube = convertCubeToList(arr[1])\n output = ''\n\n dimension = len(arr... | python | new_file | 1 | 4 | mit | 8bf521bf26af93f13043ee6e0d70070d49f76f68 | edwardzhu/checkio-solution | Home/cipherMap.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple HTTP Basic Authentication decorator for the API"
},
{
"role": "assistant",
"content": "from functools import wraps\nimport httplib\n\nfrom django.contrib.auth import authenticate\nfrom django.utils.cache import patch... | python | new_file | 5 | 5 | bsd-3-clause | 457ba730a6541ab27ce8cbe06cbb6bfe246bba74 | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | towel/api/decorators.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to filter result by result type."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport argparse\nimport os\nimport logging\nimport pprint\nimport sys\nimport yaml\n\n# HACK\n_file = os.path.abspath(__fil... | python | new_file | 3 | 4 | bsd-3-clause | 655bf4b4159e70b4a99185a1735ac63c3ee951dc | symbooglix/boogie-runner,symbooglix/boogie-runner | analysis/filter-by-result-type.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to list nodes without an external ID"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport httplib\nimport urllib\nimport json\nimport ssl\nimport argparse\nimport re\n\nparser = argparse.ArgumentParse... | python | new_file | 4 | 2 | mit | 30be74075e761f932a10ea0806a08991b8fd9cb4 | ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content | code/python/find-nodes-without-external-id.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix description of 'api_read_full_member' permission\n\nBB-11023 #resolve"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2017-10-31 09:48\nfrom __future__ import unicode_literals\n... | python | new_file | 1 | 1 | bsd-3-clause | 7039e4f25d8eecdf2d5d2b4a4a769e05c5075222 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/members/migrations/0020_auto_20171031_1048.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for environment handler."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Testing the environment/configuration handler.\n\"\"\"\nimport os\nfrom copy import copy\n\nimport pytest\n\nfrom typhon... | python | new_file | 1 | 1 | mit | 71a6d0a032896f4ef2e9a4cda541d142f2c48171 | atmtools/typhon,atmtools/typhon | typhon/tests/test_environment.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple test for SetupPrometheusEndpointOnPortRange"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nfrom django_prometheus.exports import SetupPrometheusEndpointOnPortRange\nimport unittest\n\n\nclass ExportTes... | python | new_file | 1 | 1 | apache-2.0 | 3e0903ba2f74d5f73241d1ffc5056f2a77c709e0 | obytes/django-prometheus,korfuri/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus | tests/test_exports.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new script to simplify profiling of cvs2svn.py. Document in the\nscript how to use kcachegrind to view the results.\n\n* tools/cvs2svn/profile-cvs2svn.py: New script.\n\n\ngit-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@848715 13... | python | new_file | 1 | 0 | apache-2.0 | bf93b3b4c8965e31e5b9b8ebdbf3f1b1d258e15e | YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,wbond/subversion | tools/cvs2svn/profile-cvs2svn.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Python program which reads from a pipe and writes the data it gets to syslog."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n\nimport argparse\nimport os\nimport syslog\n\nparser = argparse.ArgumentParser(... | python | new_file | 1 | 0 | bsd-3-clause | 248023106d4e881110a646e9d078ecad4f58e24d | tonnerre/pipelogger | pipelogger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Random Forest Regression in Python"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Random Forest Regression for machine learning.\n\nRandom forest algorithm is a supervised classification algorithm. As t... | python | new_file | 1 | 0 | mit | d84a0b0d50fb4d01b2a2354d5317afd181f1053c | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Regression/RandomForestRegression/regularRandomForestRegression.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add selcet_gamma.py (authored by Amnon)\n\nUsed in the filtering notebook."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 18 10:13:48 2013\n\n@author: amnon\n\n### 80... | python | new_file | 1 | 6 | bsd-3-clause | 14aba0695514866439164f48fe1f66390719431f | EmbrietteH/American-Gut,wasade/American-Gut,JWDebelius/American-Gut,mortonjt/American-Gut,wasade/American-Gut,biocore/American-Gut,EmbrietteH/American-Gut,biocore/American-Gut,JWDebelius/American-Gut | scripts/select_gamma.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to queue expired tiles"
},
{
"role": "assistant",
"content": "from tilequeue.queues import make_sqs_queue\nfrom tilequeue.tile import explode_with_parents\nfrom tilequeue.tile import parse_expired_coord_string\nimport... | python | new_file | 6 | 4 | mit | a152c7c48baa0f1c82e7d84bebbee674eb4f2761 | tilezen/tilequeue,mapzen/tilequeue | tilequeue/commands.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for synapse.cells"
},
{
"role": "assistant",
"content": "import synapse.axon as s_axon\nimport synapse.cells as s_cells\nimport synapse.cryotank as s_cryotank\n\nfrom synapse.tests.common import *\n\nclass CellTest... | python | new_file | 3 | 1 | apache-2.0 | a61d37449f8000a83942513f2ad71151ef26822d | vertexproject/synapse,vivisect/synapse,vertexproject/synapse,vertexproject/synapse | synapse/tests/test_cells.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example to compare layers in a char-rnn task."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport climate\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport theanets\n\nimport utils\n\nclimate.ena... | python | new_file | 1 | 0 | mit | 98398398f590c3a98733193fc0ea45a1948edd0e | lmjohns3/theanets,chrinide/theanets | examples/recurrent-text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for fetching metadata from audio file"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python ... | python | new_file | 1 | 6 | mit | 6119f7998d918d3b38f129b7afd720f9a35e35c1 | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | audio-metadata.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests/import: Add a test for the builtin __import__ function."
},
{
"role": "assistant",
"content": "# test calling builtin import function\n\n# basic test\n__import__('builtins')\n\n# first arg should be a string\ntry:\n __im... | python | new_file | 1 | 0 | mit | 3a9445c6b3053d492c12bbf808d251c6da55632a | pozetroninc/micropython,pfalcon/micropython,micropython/micropython-esp32,AriZuu/micropython,torwag/micropython,HenrikSolver/micropython,Timmenem/micropython,pozetroninc/micropython,ryannathans/micropython,tralamazza/micropython,blazewicz/micropython,oopy/micropython,lowRISC/micropython,alex-robbins/micropython,bvernou... | tests/import/builtin_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add print lists function practice problem"
},
{
"role": "assistant",
"content": "#!/Applications/anaconda/envs/Python3/bin\n\n\ndef main():\n # Test suite\n test_list_1 = [\"puppy\", \"kitten\", \"lion cub\"]\n test_list... | python | new_file | 1 | 3 | mit | a17efdceeeec0932ff403ebeb6f787ea8b08a3a4 | HKuz/Test_Code | Problems/printLists.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a primitive pythonic wrapper."
},
{
"role": "assistant",
"content": "import os\nimport _xxdata_11\n\nparameters = {\n 'isdimd' : 200,\n 'iddimd' : 40,\n 'itdimd' : 50,\n 'ndptnl' : 4,\n 'ndptn' : 128,\n 'ndp... | python | new_file | 2 | 1 | mit | a72a0674a6db3880ed699101be3c9c46671989f0 | cfe316/atomic,ezekial4/atomic_neu,ezekial4/atomic_neu | xxdata_11.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for query_result_to_dict"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom . import models\nfrom sir.schema.searchentities import SearchEntity as E, SearchField as F\n\n\nclass QueryResultToDictTest(unitte... | python | new_file | 1 | 1 | mit | abe6ead4f93f98406fe197b6884e51015c200ca1 | jeffweeksio/sir | test/test_searchentities.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test stopping all running file backups"
},
{
"role": "assistant",
"content": "import urbackup_api\r\n\r\n\r\nserver = urbackup_api.urbackup_server(\"http://127.0.0.1:55414/x\", \"admin\", \"foo\")\r\n\r\nfor action in server.get_... | python | new_file | 1 | 0 | apache-2.0 | 42a287d23a1153df636c193695615d99b7c75e4d | uroni/urbackup-server-python-web-api-wrapper | test/stop_all.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test to enforce unique file names.\n\nThis patch adds a unit test to ensure we have uniquely named\nfiles across each of the element/target directories. Because\nDIB copies these files into a common namespace files can\nby cryptical... | python | new_file | 1 | 5 | apache-2.0 | b6cd59f800b254d91da76083546ab7c10689df5f | rdo-management/tripleo-image-elements,rdo-management/tripleo-image-elements,openstack/tripleo-image-elements,radez/tripleo-image-elements,radez/tripleo-image-elements,openstack/tripleo-image-elements | tests/test_no_dup_filenames.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test - add cmake test tool"
},
{
"role": "assistant",
"content": "# Copyright 2015 0xc0170\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License... | python | new_file | 3 | 2 | apache-2.0 | e81fd02cc7431ea01416126b88a22b4bba9b755e | sarahmarshy/project_generator,ohagendorf/project_generator,0xc0170/project_generator,project-generator/project_generator | tests/test_tools/test_cmake.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a super simple color correction client example"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Simple example color correction UI.\n# Talks to an fcserver running on localhost.\n#\n# Micah Elizabeth Scott\n... | python | new_file | 2 | 1 | mit | 257a328745b9622713afa218940d2cd820987e93 | PimentNoir/fadecandy,fragmede/fadecandy,fragmede/fadecandy,Jorgen-VikingGod/fadecandy,PimentNoir/fadecandy,poe/fadecandy,pixelmatix/fadecandy,pixelmatix/fadecandy,adam-back/fadecandy,jsestrich/fadecandy,Protoneer/fadecandy,Protoneer/fadecandy,hakan42/fadecandy,adam-back/fadecandy,Protoneer/fadecandy,piers7/fadecandy,pi... | examples/color-correction-ui.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for pacman list packages"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Eric Vz <<EMAIL>>`\n'''\n\n# Import Python Libs\nfrom __future__ import absolute_import\n\n# Im... | python | new_file | 3 | 1 | apache-2.0 | 0179d4d84987da76c517de4e01100f0e1d2049ea | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/modules/pacman_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to extract artist names from MusicBrainz database"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\nScript to extract the artist names from a MusicBrainz database dump.\n\nUsage:\n ./extract-from... | python | new_file | 2 | 0 | mit | fe63d6e1e822f7cb60d1c0bdaa08eb53d3849783 | xhochy/libfuzzymatch,xhochy/libfuzzymatch | benchmark/datasets/musicbrainz/extract-from-dbdump.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 331. Verify Preorder Serialization of a Binary Tree\n\n331. Verify Preorder Serialization of a Binary Tree: https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/"
},
{
"role": "assistant",
... | python | new_file | 1 | 2 | apache-2.0 | 3a235e25ac3f5d76eb4030e01afbe7b716ec6d91 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/verify-preorder-serialization-of-a-binary-tree.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.