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 string compression problem and tests."
},
{
"role": "assistant",
"content": "#!/Applications/anaconda/envs/Python3/bin\n\n\ndef main():\n # Test suite\n tests = [None, '', 'AABBCC', 'AAABCCDDDD']\n results = [None, '... | python | new_file | 1 | 10 | mit | af9ec9b12f5111cf6b2352ca9efc147c86093024 | HKuz/Test_Code | Problems/compressString.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#\n# furl - URL manipulation made simple.\n#\n# Arthur Grunseid\n# grunseid.com\n# <EMAIL>\n#\n# License: Build Amazing Things (Unlicense)\n\n__title__ = 'furl'\n__version__ = '0.3.9'\n__license__ = 'Unlicense'\n__author__ = 'Arthur Grunsei... | python | edit | 2 | 0 | unlicense | 3061099d72364eb6d6aa36613b2a425fc3f99915 | Gerhut/furl,lastfm/furl,penyatree/furl,guiquanz/furl | furl/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to find gaps between on-demand instances and reservations."
},
{
"role": "assistant",
"content": "from collections import Counter\n\nfrom boto.ec2 import connect_to_region\n\nREGION = 'us-east-1'\n\nCOUNTER_KEY_FMT = '... | python | new_file | 9 | 2 | mit | b28d544167dcee75ff7476ae3d43d51191aca717 | kjoconnor/aws | reservation_gap.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement usermode +s (currently doesn't do anything)"
},
{
"role": "assistant",
"content": "from txircd.modbase import Mode\n\nclass ServerNoticeMode(Mode):\n\tpass\n\nclass Spawner(object):\n\tdef __init__(self, ircd):\n\t\tsel... | python | new_file | 1 | 1 | bsd-3-clause | a3b72336c5f04dfdc91b4d296adf669c9e3bf355 | ElementalAlchemist/txircd,Heufneutje/txircd,DesertBus/txircd | txircd/modules/umode_s.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to get average duration based on video list data"
},
{
"role": "assistant",
"content": "import sys\n\nfrom Ziggeo import Ziggeo\n\nif(len(sys.argv) < 3):\n\tprint (\"Error\\n\")\n\tprint (\"Usage: $>python _videos_inde... | python | new_file | 1 | 4 | apache-2.0 | 55eb1c81f02a715adfe70c188985924fbeb340fd | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | demos/_videos_index_duration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add provider for (Swedish) Netflix.\n\nChange \"country\" inside the provider for the movies available in a different country."
},
{
"role": "assistant",
"content": "from providers.popularity.provider import PopularityProvider\nf... | python | new_file | 4 | 2 | mit | 57a58893a2ba94b174b06e7f5f63478dff1e879e | EmilStenstrom/nephele | providers/popularity/netflix.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new script to loop on randomly writing registers"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- coding:utf-8 -*-\n\nimport random\nimport time\n\nfrom automaton_client import AutomatonClient\n\nSERVER_HO... | python | new_file | 2 | 3 | mit | 6e1f1d900d77f1352eb941f7ac569a0c681c8dc1 | vandaele/light-automation,vandaele/light-automation | loop_write.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new tests (don't yet work)"
},
{
"role": "assistant",
"content": "# from blueice.test_helpers import *\n# from blueice.likelihood import BinnedLogLikelihood\n#\n# from scipy import stats\n#\n#\n# def test_single_bin():\n# ... | python | new_file | 1 | 0 | bsd-3-clause | 59f9e977ee343082b9ad3e815c662d1425549e83 | JelleAalbers/blueice | tests/test_binned_likelihood.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittest to verify remote stat on misc fd types\n\nFixes #8"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom filedes.test.base import BaseFDTestCase\nfrom filedes.subprocess import Popen\n... | python | new_file | 1 | 7 | isc | 7df6010f1dd4cfa00b48f2fe646d3bb0bd02f8ec | fmoo/python-filedes,fmoo/python-filedes | tests/fd_remote.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple window transform example"
},
{
"role": "assistant",
"content": "\"\"\"\nCalculating Percentage of Total\n-------------------------------\nThis chart demonstrates how to use a window transform to display data values\nas... | python | new_file | 1 | 0 | bsd-3-clause | a5f0544bf0ce88ecfca515f0db344fffb90c8d8e | altair-viz/altair,ellisonbg/altair,jakevdp/altair | altair/vegalite/v2/examples/percentage_of_total.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert .png endings to .jpg"
},
{
"role": "assistant",
"content": "\"\"\"\nChange image extensions from .png to .jpg\n\nEXAMPLE:\n >>>> echo An  -d <download_directory>\n#\n#\n\nfrom fenix import Fenix\nimport argpar... | python | new_file | 3 | 0 | mit | c2506fdc71f1dcff2e3455c668e78ad6b7d5d94b | iluxonchik/python-general-repo | scripts/fenix/fenix_download.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add testcase for search indexing of Service"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom services.tests.factories import ServiceFactory\nfrom services.models import Service\nfrom services.search... | python | new_file | 1 | 1 | bsd-3-clause | 9f27cf9f0669f98694e7751eb9d22064d24bdb3f | theirc/ServiceInfo,theirc/ServiceInfo,theirc/ServiceInfo,theirc/ServiceInfo | services/tests/test_indexing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nbl_info = {\n\t\"name\": \"Booltron\",\n\t\"author\": \"Mikhail Rachinskiy (jewelcourses.com)\",\n\t\"version\": (2000,),\n\t\"blender\": (2,7,4),\n\t\"location\": \"3D View → Tool Shelf\",\n\t\"description\": \"Booltron—super add-on for su... | python | edit | 4 | 2 | mit | 5995fb29869e828ae7dd6bcca9eb30bfe00a959d | mrachinskiy/blender-addon-booltron | __init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add serialization tests for tagger"
},
{
"role": "assistant",
"content": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom ..util import make_tempdir\nfrom ...pipeline import NeuralTagger as Tagger\n\nimport pytes... | python | new_file | 1 | 1 | mit | 43b4d63f8587bcc7078635a099f1acf48264303c | honnibal/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,honnibal/spaCy,recognai/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spa... | spacy/tests/serialize/test_serialize_tagger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Build a legacy distance export"
},
{
"role": "assistant",
"content": "import json\nimport sys\nimport database as db\nfrom database.model import Team\nfrom geotools import simple_distance\nfrom geotools.routing import MapPoint\nf... | python | new_file | 5 | 0 | bsd-3-clause | a2ab40bd7da2131ff6b9d502cc3dde1f6a8531e6 | janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | src/legacy_data_export.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for the salt user module"
},
{
"role": "assistant",
"content": "import pathlib\n\nimport pytest\nfrom saltfactories.utils import random_string\n\npytestmark = [\n pytest.mark.skip_if_not_root,\n pytest.... | python | new_file | 1 | 3 | apache-2.0 | 1ec1bede9f5451aeef09d250ad4542bfb0cedb3d | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/pytests/functional/modules/test_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for quick sort implementation."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nfrom helper.read_data_file import read_int_array\nfrom sorting.qu... | python | new_file | 1 | 1 | mit | 81728590b09270e4e32af61cdb5855bb814f683c | weichen2046/algorithm-study,weichen2046/algorithm-study | test/unit/sorting/test_quick_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create the Contacts App - Part II > New Contact - Create Form"
},
{
"role": "assistant",
"content": "from django import forms\n\nfrom .models import Contact\n\n\nclass ContactForm(forms.ModelForm):\n class Meta:\n model... | python | new_file | 1 | 0 | mit | 560228cbc2e95fd24f994e0a78465a031f6e0eef | deenaariff/Django,tabdon/crmeasyapp,tabdon/crmeasyapp | crmapp/contacts/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for limits api in V1 api\n\nChange-Id: Id05520acf5e3a62647915829d72ca7afd3916337"
},
{
"role": "assistant",
"content": "# coding=utf-8\n# Copyright 2012 Managed I.T.\n#\n# Author: Kiall Mac Innes <<EMAIL>>\n#\n# License... | python | new_file | 1 | 1 | apache-2.0 | b273248f1c33abfe355657e8b0e4e85492efb10d | cneill/designate-testing,muraliselva10/designate,ionrock/designate,grahamhayes/designate,ramsateesh/designate,tonyli71/designate,cneill/designate-testing,grahamhayes/designate,tonyli71/designate,ramsateesh/designate,openstack/designate,grahamhayes/designate,muraliselva10/designate,cneill/designate-testing,ionrock/desig... | designate/tests/test_api/test_v1/test_limits.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"Runs Microsoft's RoboHornet Pro benchmark.\"\"\"\n\nimport os\n... | python | edit | 1 | 1 | bsd-3-clause | d388709d1c7d52cf1f2552bcfdbfd6b83b578675 | ChromiumWebApps/chromium,ChromiumWebApps/chromium,anirudhSK/chromium,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,bright-spar... | tools/perf/benchmarks/robohornet_pro.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to find destructors which are not virtual, but should be\n\ngit-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n... | python | new_file | 4 | 10 | apache-2.0 | 7f4d21ad84dc12165ea65abd1606d4aa3689e3cb | myint/cppclean,myint/cppclean,myint/cppclean,myint/cppclean | headers/cpp/nonvirtual_dtors.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migrations for verbose name changes"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.7 on 2017-10-23 16:20\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | new_file | 1 | 0 | mit | 50886a39d3cda7b487ed3862626d565c80737add | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | calaccess_processed/migrations/0011_auto_20171023_1620.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Package for console_mode test suite."
},
{
"role": "assistant",
"content": "############################################################################\n##\n## Copyright (C) 2006-2007 University of Utah. All rights reserved.\n##... | python | new_file | 3 | 1 | bsd-3-clause | 9a3695316f469bb70161d50665697ab248b0d7f1 | Nikea/VisTrails,Nikea/VisTrails,minesense/VisTrails,VisTrails/VisTrails,minesense/VisTrails,hjanime/VisTrails,minesense/VisTrails,Nikea/VisTrails,celiafish/VisTrails,VisTrails/VisTrails,celiafish/VisTrails,hjanime/VisTrails,hjanime/VisTrails,minesense/VisTrails,celiafish/VisTrails,hjanime/VisTrails,VisTrails/VisTrails,... | vistrails/tests/resources/console_mode_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Publisher mixins for using Mappers"
},
{
"role": "assistant",
"content": "'''\nMixins for using Mappers with Publisher\n'''\nfrom django.core.exceptions import ValidationError\n\nfrom nap import http\nfrom nap.utils import fl... | python | new_file | 1 | 2 | bsd-3-clause | a1a552857498206b6684681eb457978dd5adf710 | limbera/django-nap,MarkusH/django-nap | nap/rest/mapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing file for last commit"
},
{
"role": "assistant",
"content": "import imp\n\nmodule = imp.new_module('config')\nmodule.__file__ = 'config.py'\nconfig = {}\nconfig_file = open(module.__file__)\n\nexec(compile(config_file.... | python | new_file | 1 | 0 | isc | 8efab0283613dd09b09b1771fe35732c9cbc5cea | tobbez/lys-reader | common/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a quick way to show the current queue configuration.\n\nSigned-off-by: Chris Lamb <<EMAIL>>"
},
{
"role": "assistant",
"content": "from django.core.management.base import NoArgsCommand\n\nfrom ... import app_settings\n\nclass... | python | new_file | 9 | 3 | bsd-3-clause | bf8c008742dd921865f18f10b1c925c485406343 | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | django_lightweight_queue/management/commands/queue_configuration.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for bazaar URL handling\n\nTested on 2.4.4, 2.7.1 and 3.2\n\nnosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:\n\n2.4:\n\n----------------------------------------------------------------------\nRan 107 ... | python | new_file | 1 | 1 | mit | ab9fed3a9a9152ed266d40eab2f16b12c77349fd | pypa/pip,willingc/pip,jythontools/pip,blarghmatey/pip,patricklaw/pip,domenkozar/pip,rouge8/pip,squidsoup/pip,zorosteven/pip,benesch/pip,pjdelport/pip,zvezdan/pip,dstufft/pip,supriyantomaftuh/pip,sbidoul/pip,caosmo/pip,natefoo/pip,h4ck3rm1k3/pip,techtonik/pip,minrk/pip,jasonkying/pip,sigmavirus24/pip,RonnyPfannschmidt/p... | tests/test_vcs_bazaar.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights longest word problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Longest Word Problem\n\nimport re\n\n\ndef longestWord(text):\n m = re.findall(r'\\b[a-z]+?\\b', text, flags=... | python | new_file | 1 | 3 | mit | 0fa5e9944d573d053633b1ea81497bc20598abee | HKuz/Test_Code | CodeFights/longestWord.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pint numpy type snippet"
},
{
"role": "assistant",
"content": "# A variable imbued with pint unit mutates its state when touched by Numpy.\n# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167\n# ... | python | new_file | 2 | 0 | mit | ff50744e2dd1f04959e4f7f63ff3a08d21ef9839 | cmey/surprising-snippets,cmey/surprising-snippets | pint-numpy-type.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial Python submission parameter test"
},
{
"role": "assistant",
"content": "# coding=utf-8\n# Licensed Materials - Property of IBM\n# Copyright IBM Corp. 2016\nfrom __future__ import print_function\nimport unittest\nimpor... | python | new_file | 12 | 2 | apache-2.0 | f7fd11d657f10b2cb29000a29fcf839da6dea921 | ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,I... | test/python/topology/test2_submission_params.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a custom client side test runner"
},
{
"role": "assistant",
"content": "from tests import web_client_test\n\n\nsetUpModule = web_client_test.setUpModule\ntearDownModule = web_client_test.tearDownModule\n\n\nclass WebClientTes... | python | new_file | 1 | 1 | apache-2.0 | 6708fd75eb7272701e8e333e4940e47d5b6a05af | Kitware/minerva,Kitware/minerva,Kitware/minerva | plugin_tests/web_client_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small utility for removing package references"
},
{
"role": "assistant",
"content": "import fnmatch\nimport os\nimport re\n\nre_reference = re.compile(r'\\<Reference Include=\\\"([\\w\\.]+)\\,.*?\\<\\/Reference\\>', re.DOTALL... | python | new_file | 3 | 4 | mit | cbf29ea21179dcf3cf9c5f0a7eacd664f025f5db | SaladLab/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladLab/Akka.Interfaced | tools/scripts/remove_package.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 494. Target Sum\n\n494. Target Sum: https://leetcode.com/problems/target-sum/"
},
{
"role": "assistant",
"content": "from collections import Counter\nclass Solution(object):\n def findTargetSumWays(self, nu... | python | new_file | 1 | 3 | apache-2.0 | e77957398f78f905c6b8ac881b621c67c1352d0a | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/target-sum.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of the commandline tool"
},
{
"role": "assistant",
"content": "\"\"\"Calculate the number of Pomodori available within a time period.\n\nUsage:\n get-pomodori [--from=<time>] [--break=<minutes>] [--long-break... | python | new_file | 1 | 1 | mit | 544857a7a3cdb40fd793fed8e33694d551cc695f | Matt-Deacalion/Pomodoro-Calculator | pomodoro_calculator/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Sort Array By Parity II"
},
{
"role": "assistant",
"content": "class Solution:\n def sortArrayByParityII(self, A):\n \"\"\"\n :type A: List[int]\n :rtype: List[int]\n \"\"\"\n \n if no... | python | new_file | 1 | 10 | apache-2.0 | 31b46f0ab99b945a97e3dd08d7e8d6a9a63ad75a | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | array/922.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flexget.manager import Session\r\n\r\n\r\ndef with_session(func):\r\n \"\"\"\"Creates a session if one was not passed via keyword argument to the function\"\"\"\r\n\r\n def wrapper(*args, **kwargs):\r\n passed_session = kw... | python | edit | 1 | 3 | mit | c6fbba9da9d1cf2a5a0007a56d192e267d19fcff | vfrc2/Flexget,tobinjt/Flexget,Pretagonist/Flexget,oxc/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,Flexget/Flexget,spencerjanssen/Flexget,ianstalk/Flexget,xfouloux/Flexget,malkavi/Flexget,asm0dey/Flexget,v17al/Flexget,camon/Flexget,ZefQ/Flexget,cvium/Flexget,jacobmetrick/Flexget,crawln45/Flexget,camon/Flexget,OmgOhnoe... | flexget/utils/database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom tvrenamr.cli import helpers\n\nfrom .base import BaseTest\n\n\nclass TestFrontEnd(BaseTest):\n def setup(self):\n super(TestFrontEnd, self).setup()\n self.config = helpers.get_config()\n\n def test_pass... | python | edit | 3 | 3 | mit | e0d631b4aab431c31689ccd7aa6ac92d95e32e80 | wintersandroid/tvrenamr,ghickman/tvrenamr | tests/test_frontend.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snippet (Python OpenCV)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n\"\"\"\nOpenCV - Read image: read an image given... | python | new_file | 1 | 3 | mit | 08573c7c6eb20c7cf168d38a6566757b08fed6d9 | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/videos/capture_video_from_camera.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some test for settings. TODO fix save."
},
{
"role": "assistant",
"content": "\ndef test_settings_group(plex):\n assert plex.settings.group('general')\n\n\ndef test_settings_get(plex):\n # This is the value since it we ... | python | new_file | 2 | 1 | bsd-3-clause | d47d7931f5531c4fe28598d15c305592e446af2b | pkkid/python-plexapi,mjs7231/python-plexapi | tests/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool for adding COOP IDs"
},
{
"role": "assistant",
"content": "# Need to check the log files for shef parser and create new sites \n# within database based on what we find\n\nimport re, iemdb, os\nMESOSITE = iemdb.connect('m... | python | new_file | 2 | 0 | mit | 0db38995d9cb7733d5dcc7bd88234c4a356fc9fb | akrherz/pyWWA,akrherz/pyWWA | util/merge_coop_nwsli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test to set a sysctl value"
},
{
"role": "assistant",
"content": "import os\nimport sysctl\nfrom sysctl.tests import SysctlTestBase\n\n\nclass TestSysctlANum(SysctlTestBase):\n\n def test_sysctl_setvalue(self):\n du... | python | new_file | 1 | 7 | bsd-2-clause | 62ec4eca706bbb521d02ec597c0c18a949b37e52 | williambr/py-sysctl,williambr/py-sysctl | sysctl/tests/test_sysctl_setvalue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for generic relationship batch fetching"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\nimport sqlalchemy as sa\nfrom tests import TestCase\nfrom sqlalchemy_utils import batch_fetch, gene... | python | new_file | 1 | 1 | bsd-3-clause | 0d92340f2b1cab932f14e376dc776a7c11e3e42f | konstantinoskostis/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,cheungpat/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,spoqa/sqlalchemy-utils,rmoorman/sqlalchemy-utils,marrybird/sqlalchemy-utils,JackWink/sqlalchemy-utils | tests/batch_fetch/test_generic_relationship.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add our custom dashboard modules"
},
{
"role": "assistant",
"content": "from admin_tools.dashboard.modules import LinkList\nfrom django.core.urlresolvers import reverse\nfrom linkcheck.views import get_status_message\n\n\nclass P... | python | new_file | 1 | 3 | mit | 333ae389c14593421d01bd0c8f6904d1688dfa7e | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | ixxy_admin_utils/dashboard_modules.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add w2v create graph from corpus"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nimport sys\nfrom random import shuffle\n\nDISTANCE = 10\n\nwith open(sys.argv[1], 'r') as corpus:\n text = corpus.r... | python | new_file | 3 | 0 | apache-2.0 | a7529057f590f8b5185a77b3ff62889b1357a0e7 | agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades | data/word_embeddings/create_graph_from_corpus.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for the EPSG-3857 spatial reference."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\nimport rasterio\nimport pytest\nfrom math import pi\n\nfrom numpy import array\nfrom numpy.testing import assert_ar... | python | new_file | 1 | 1 | apache-2.0 | 1c4429759a3e89ed952b1a025b1470a9e187537f | ecometrica/gdal2mbtiles | tests/test_spatial_reference.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a utility to retrieve the latest version of RStudio."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n#\n# RStudio does not provide a \"-latest\" download link so we deduce it from\n# their S3 bucket listing and save... | python | new_file | 2 | 0 | apache-2.0 | 490d5110b46afe5210bf2da4489854561e1bb259 | dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive | bsd2/vagrant-ansible/provisioning/getrstudio.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Complete word idx dict + prefix/suffix pal sol"
},
{
"role": "assistant",
"content": "\"\"\"336. Palindrome Pairs\nHard\n\nURL: https://leetcode.com/problems/palindrome-pairs/\n\nGiven a list of unique words, find all pairs of di... | python | new_file | 4 | 10 | bsd-2-clause | bcb73da9d30d6737fdbdb4ba2378a612851ec9b9 | bowen0701/algorithms_data_structures | lc0336_palindrome_pairs.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add normalize and Vector substraction functions"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport math\n\nprint 'Insert one points, separated with commas: '\nxy = input('Insert first ... | python | new_file | 4 | 1 | apache-2.0 | 74dab4e4e7c87e247659bff6cfd4e333b7cd71f7 | MindCookin/python-exercises | chapter03/triangleArea.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights cyclic name problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Cyclic Name Problem\n\nfrom itertools import cycle\n\n\ndef cyclicName(name, n):\n gen = cycle(name)\n res ... | python | new_file | 1 | 3 | mit | 30e33acc50725ea5f8bb4a094e60dbeadaa6d1f8 | HKuz/Test_Code | CodeFights/cyclicName.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add check on HADS ingest"
},
{
"role": "assistant",
"content": "\"\"\"\n Check how much HADSA data we have\n\"\"\"\nimport os\nimport sys\nimport stat\nimport iemdb\nHADS = iemdb.connect('iem', bypass=True)\nhcursor = HADS.cursor... | python | new_file | 4 | 1 | mit | fb3766204cbb25ccf8ee73ab4f480ba34251542c | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | nagios/check_hads_ingest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example - Cumulative count"
},
{
"role": "assistant",
"content": "\"\"\"\nCumulative Count Chart\n----------------------\nThis example shows an area chart with cumulative count.\nAdapted from https://vega.github.io/vega-lite/... | python | new_file | 1 | 0 | bsd-3-clause | e21d3a1da1d20a341ae165c0fa3605248744ce7e | altair-viz/altair,jakevdp/altair | altair/examples/cumulative_count_chart.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a debugging file connecting Python to GH"
},
{
"role": "assistant",
"content": "import rpyc\n\nc = rpyc.utils.factory.connect(\n \"localhost\",\n 18871,\n service=rpyc.core.service.ClassicService,\n config={\"sync... | python | new_file | 1 | 2 | mit | 1a1a8c00e3dc4101be78a69b3bae7d27fbb51b39 | pilcru/ghpythonremote,Digital-Structures/ghpythonremote | ghpythonremote/examples/CPython_to_GH_manual.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Put constants into a dedicated module"
},
{
"role": "assistant",
"content": "####################################\n#\n# Keep all the constants used to\n# create glidein entries in this\n# module\n#\n# Author: Igor Sfiligoi\n#\n##... | python | new_file | 6 | 0 | bsd-3-clause | d9db8056450528f10b9bfaa9f6226486108ac37d | bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old | creation/lib/cgWConsts.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only)"
},
{
"role": "assistant",
"content": "import os, os.path\nimport shutil\nfrom datetime import datetime\nimport sys\n\ndef do_... | python | new_file | 5 | 5 | mit | 6fb6829c6ac0f755b468393042f538c5073c76ff | joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public | tools/rename_by_timestamp/rename_by_timestamp.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert csv to json for clusters\n\nConvert csv to json for cluster-d3.html(or dynamic-cluster.html)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2.7\n#\n# Licensed to the Apache Software Foundation (ASF) under one... | python | new_file | 2 | 0 | apache-2.0 | 642b777f5eabc02abd54208e3895c0b1898401db | YongchaoShang/tika-img-similarity,chrismattmann/tika-similarity,harsham05/tika-similarity,chrismattmann/tika-similarity,chrismattmann/tika-img-similarity,YongchaoShang/tika-img-similarity,harsham05/tika-similarity,chrismattmann/tika-img-similarity | edit-cosine-cluster.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a benchmark of import time"
},
{
"role": "assistant",
"content": "\"\"\"\nMiscellaneous benchmarks.\n\"\"\"\n\nimport subprocess\nimport sys\nimport time\n\nfrom numba import jit\n\n\nclass InitializationTime:\n # Measure ... | python | new_file | 3 | 1 | bsd-2-clause | 3756fa9cef258e91ebd8d344f6773cfc2ac537dd | numba/numba-benchmark,gmarkall/numba-benchmark | benchmarks/bench_misc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for CaseBulkDB"
},
{
"role": "assistant",
"content": "import uuid\nfrom unittest import mock\n\nfrom django.test import TestCase\n\nfrom casexml.apps.case.mock import CaseBlock\n\nfrom corehq.apps.hqcase.bulk impor... | python | new_file | 1 | 2 | bsd-3-clause | 39039b8a6584984d6778b271a4b9c8a181198cd3 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/hqcase/tests/test_bulk.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test for calling inherited native method on subclass."
},
{
"role": "assistant",
"content": "# Test calling non-special method inherited from native type\n\nclass mylist(list):\n pass\n\nl = mylist([1, 2, 3])\nprint... | python | new_file | 1 | 0 | mit | c963310123765baddf638c8d08b8fdb2f73b6ba6 | drrk/micropython,ryannathans/micropython,MrSurly/micropython-esp32,warner83/micropython,redbear/micropython,noahchense/micropython,AriZuu/micropython,martinribelotta/micropython,toolmacher/micropython,martinribelotta/micropython,jlillest/micropython,oopy/micropython,feilongfl/micropython,mhoffma/micropython,vitiral/mic... | tests/basics/subclass-native4.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add post_only and get_only decorators"
},
{
"role": "assistant",
"content": "from django.http import HttpResponseNotAllowed\n\ndef post_only(func):\n def decorated(request, *args, **kwargs):\n if request.method != 'POST... | python | new_file | 1 | 2 | apache-2.0 | b3cbf179371c289121126d0cb66d9873d740f202 | Nikola-K/django_reddit,Nikola-K/django_reddit,Nikola-K/django_reddit | utils/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for GMEU entry \"a\", part C"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Test GMEU entry 'a', part C.\n\nThis entry is about pronunciation of the word 'a' and is unlikel... | python | new_file | 1 | 0 | bsd-3-clause | 1b971b32d57df48919e0c45372237d858996e3d9 | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | tests/test_gmeu/test_a_C.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new tool to set bytes in file"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport sys\nimport ast\n\ntry:\n file_name, location, new_byte = sys.argv[1:]\nexcept:\n print(\"Usage: ./{} file location new... | python | new_file | 1 | 0 | mit | fd48746e8d1d2d94a7453a4a976ffbf362711f63 | Dentosal/rust_os,Dentosal/rust_os,Dentosal/rust_os | tools/setbyte.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tentative construct format for ClientHello messages."
},
{
"role": "assistant",
"content": "from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8\n\n\nProtocolVersion = Struct(\n \"version\",\n UBInt8(\"m... | python | new_file | 1 | 0 | mit | 47c4043dfecd95686b1520c93717fa4c512c4e74 | Ayrx/tlsenum,Ayrx/tlsenum | tlsenum/hello_constructs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the API available inside GenTests method for the raw_io module.\n\nThis CL makes the raw_io module ready to have its output mocked\nin GenTests.\n\nR=<EMAIL>\n\nReview URL: https://codereview.chromium.org/160143003\n\ngit-svn-id: 239fca9... | python | new_file | 1 | 1 | bsd-3-clause | c5723be490b5baf953de71a6af778fe5663c70ed | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/recipe_modules/raw_io/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py2exe setup file for creating windows executables"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\r\n#\r\n# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)\r\n# All Rights Reserved.\r\... | python | new_file | 3 | 0 | apache-2.0 | 836f23046a25edbdeafcbe487fa9f918a9bae5cb | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/JT/Jam/application/trunk/setup_py2exe.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test for accessing attribute of inherited native type."
},
{
"role": "assistant",
"content": "class MyExc(Exception):\n pass\n\ne = MyExc(100, \"Some error\")\nprint(e)\n# TODO: Prints native base class name\n#print... | python | new_file | 1 | 0 | mit | 5a12137c3e766451d83e6598ba93d16e0a8cbde8 | noahchense/micropython,matthewelse/micropython,micropython/micropython-esp32,Vogtinator/micropython,danicampora/micropython,adafruit/micropython,warner83/micropython,emfcamp/micropython,MrSurly/micropython-esp32,noahwilliamsson/micropython,mpalomer/micropython,kostyll/micropython,EcmaXp/micropython,drrk/micropython,MrS... | tests/basics/subclass-native3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for CLI object"
},
{
"role": "assistant",
"content": "import hug\n\n\n@hug.cli_object(name='git', version='1.0.0')\nclass GIT(object):\n \"\"\"An example of command like calls via an Object\"\"\"\n\n @hug.cli_ob... | python | new_file | 1 | 1 | mit | cea54800ae2ac13b830984aa368125faf02ba429 | MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug | examples/cli_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example to show how to create dom hit statistics"
},
{
"role": "assistant",
"content": "\"\"\"\n==================\nDOM hits.\n==================\n\nThis example shows how to create DOM hits statistics to estimate track\ndist... | python | new_file | 1 | 3 | mit | 15a655e490b0f0d035edd4f772f126146959e531 | tamasgal/km3pipe,tamasgal/km3pipe | examples/plot_dom_hits.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a header to burp response"
},
{
"role": "assistant",
"content": "# Burp extension to add CSP headers to responses\n__author__ = 'jay.kelath'\n\n# setup Imports\nfrom burp import IBurpExtender\nfrom burp import IHttpListener\n... | python | new_file | 4 | 2 | mit | fad392fd67aa858f92659ab94ca1c190898d4951 | kelath/Burp-Extensions | add_csp_header.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for exercise 4.3"
},
{
"role": "assistant",
"content": "'''\nCreated on 30 Aug 2017\n\n@author: igoroya\n'''\nimport collections\nfrom chapter4 import utils\n\ndef make_lists(root_node):\n stack = collections.dequ... | python | new_file | 1 | 4 | mit | fecbaf30cadcf02b44f920116edea3c5de94ba4e | igoroya/igor-oya-solutions-cracking-coding-interview | crackingcointsolutions/chapter4/exercisethree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic unit test for cubic interpolation"
},
{
"role": "assistant",
"content": "import torch\nfrom gpytorch.utils.interpolation import Interpolation\nfrom gpytorch import utils\n\n\ndef test_interpolation():\n x = torch.lin... | python | new_file | 1 | 1 | mit | e142d7ec83d9b5896a741a84ff5148f300254d89 | jrg365/gpytorch,jrg365/gpytorch,jrg365/gpytorch | test/util/test_cubic_interpolation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add job to create CIViC VCF"
},
{
"role": "assistant",
"content": "class CreateCivicVcf < ActiveJob::Base\n def perform\n system(\"python3 #{script_path} #{vcf_path}\")\n self.class.set(wait_until: Date.tomorrow.midnight).... | python | new_file | null | null | mit | 145d90259715e826ac88f86715e5a7215f3800ac | genome/civic-server,genome/civic-server,genome/civic-server,genome/civic-server,genome/civic-server | app/jobs/create_civic_vcf.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Update script to export colormaps"
},
{
"role": "assistant",
"content": "\"\"\"\nExport colormaps from Python / matplotlib to JavaScript.\n\"\"\"\n\n# -----------------------------------------------------------------------------\... | python | new_file | 1 | 0 | mit | 5a6759b131e4a61f9e7e4aaebb190a7e04b28b00 | derherrg/js-colormaps,derherrg/js-colormaps | create-colormaps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate fake data"
},
{
"role": "assistant",
"content": "import requests \nimport json\nimport random \nimport uuid\n\nlogin=\"test\"\npassword=\"P@ssword\"\n\nwith open(\"dict\", 'r', encoding=\"latin-1\") as word... | python | new_file | 3 | 4 | mit | d34dad32170e53f49e14611f5bfbfcb4eb7b8d4d | H0neyBadger/cmdb,H0neyBadger/cmdb | extra/create_rand_host.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add support for extracting a UFO from a UFO. It sounds silly, but it is useful."
},
{
"role": "assistant",
"content": "import os\nfrom robofab.ufoLib import UFOReader\n\n# ----------------\n# Public Functions\n# ----------------\... | python | new_file | 4 | 9 | mit | 99ee6ecfa4bafbfd66a3cb2c2315a8daeeff3023 | typesupply/extractor,typemytype/extractor,anthrotype/extractor | Lib/extractor/formats/ufo.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some unit tests for the diagonals."
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\nimport numpy as np\n\nfrom nose.tools import assert_is, assert_is_instance\nfrom numpy.testing import assert_array_equal\n\nfro... | python | new_file | 1 | 1 | mit | 2986ca3ebd7562d9cb84f33598e17b3b9627f3a2 | amandersillinois/landlab,landlab/landlab,cmshobe/landlab,cmshobe/landlab,cmshobe/landlab,landlab/landlab,amandersillinois/landlab,landlab/landlab | landlab/grid/tests/test_diagonals.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for get_poll and save_poll."
},
{
"role": "assistant",
"content": "\"\"\"Tests for go.apps.dialogue.dialogue_api.\"\"\"\n\nfrom twisted.internet.defer import inlineCallbacks\nfrom twisted.trial.unittest import TestCase\... | python | new_file | 1 | 1 | bsd-3-clause | 974651717968885fd766f17ce942e77a15011253 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/apps/dialogue/tests/test_dialogue_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add check_mk swift proxy diagnostic\n\nAdded a check_mk script that runs healthcheck to ensure that a\nproxy node is up and running with proxy services. This diag is\nalso check_mk compliant (ie. the output matches check_mk desired\nformat).... | python | new_file | 1 | 8 | apache-2.0 | 263cd80a16f44e900d939322e3e6e1ce0cea31b7 | rdo-management/tripleo-image-elements,radez/tripleo-image-elements,radez/tripleo-image-elements,rdo-management/tripleo-image-elements,openstack/tripleo-image-elements,openstack/tripleo-image-elements | elements/swift-proxy/check_mk_checks/swift_proxy_healthcheck.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for writing defaults from a directory of patch dictionaries."
},
{
"role": "assistant",
"content": "#! /usr/bin/python\n# Encoding: utf-8\n\nimport json\nimport os\nimport re\nimport subprocess\nimport sys\n\nclass Typ... | python | new_file | 3 | 5 | mit | 014096616d8263ea96b5b8a2b7926b498f02b425 | douglashill/OS-X-setup,douglashill/OS-X-setup | setupdefaults.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow stopping of all queueing threads and respond to keyboard interrupt in main"
},
{
"role": "assistant",
"content": "\"\"\"\n queueing.resources\n ==================\n\n Utilities and resources for queueing.\n\n :a... | python | new_file | 1 | 1 | bsd-3-clause | e274c17ac8bc61d5e96fcab579b8ad07c3a48403 | mrbrowning/queueing | queueing/resources.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: UPDATE Post model, published boolea field added"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-05-10 23:46\nfrom __future__ import unicode_literals\n\nfrom django.db import mi... | python | new_file | 1 | 0 | mit | 475a573731de50695a12b8376d6f01ab155f5893 | semitki/semitki,semitki/semitki,semitki/semitki,semitki/semitki | api/sonetworks/migrations/0029_post_published.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve the Trailing String challenge"
},
{
"role": "assistant",
"content": "# Trailing String\n# \n# https://www.codeeval.com/open_challenges/32/\n# \n# Challenge Description: There are two strings: A and B. Print 1 if string B \n... | python | new_file | 1 | 1 | mit | 0f2ef5a0eae40a24e50c10187606aa884faff728 | TommyN94/CodeEvalSolutions,TommyN94/CodeEvalSolutions | TrailingString.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add name to family member"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2017-05-17 16:49\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\n... | python | new_file | 1 | 0 | mit | cb26f56c47e8125f9ac09ddfcd952fc42a9c3669 | wearespindle/quickly.press,wearespindle/quickly.press,wearespindle/quickly.press | quickly/families/migrations/0002_familymember_name.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a few statement comparison tests"
},
{
"role": "assistant",
"content": "\"\"\"\nTest ChatterBot's statement comparison algorithms.\n\"\"\"\n\nfrom unittest import TestCase, SkipTest\nfrom chatterbot.conversation import Statem... | python | new_file | 1 | 1 | bsd-3-clause | 9f2d4c6052089706f9398be3234eb1fc63de95bf | Gustavo6046/ChatterBot,davizucon/ChatterBot,vkosuri/ChatterBot,Reinaesaya/OUIRL-ChatBot,maclogan/VirtualPenPal,gunthercox/ChatterBot,Reinaesaya/OUIRL-ChatBot | tests/test_comparisons.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: fix: Add patch to delete duplicate issues"
},
{
"role": "assistant",
"content": "import frappe\n\n# This patch deletes all the duplicate indexes created for same column\n# The patch only checks for indexes with UNIQUE constraints... | python | new_file | 1 | 7 | mit | 8fac2cf0cb4d7b530670797ef1c2731238dfa655 | yashodhank/frappe,vjFaLk/frappe,StrellaGroup/frappe,frappe/frappe,StrellaGroup/frappe,adityahase/frappe,mhbu50/frappe,saurabh6790/frappe,StrellaGroup/frappe,vjFaLk/frappe,almeidapaulopt/frappe,frappe/frappe,almeidapaulopt/frappe,saurabh6790/frappe,yashodhank/frappe,saurabh6790/frappe,yashodhank/frappe,yashodhank/frappe... | frappe/patches/v12_0/delete_duplicate_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test that makes a new guide stats database"
},
{
"role": "assistant",
"content": "import tempfile\nimport os\n\nfrom .. import guide_stats\n\n\ndef test_calc_stats():\n guide_stats.calc_stats(17210)\n\n\ndef test_make_gu... | python | new_file | 1 | 1 | bsd-3-clause | 518dd9401b41fc02c815ee6e0ca3b6b113d87f43 | sot/mica,sot/mica | mica/stats/tests/test_guide_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to problme 5"
},
{
"role": "assistant",
"content": "from collections import Counter\nfrom functools import reduce\nfrom operator import mul\nfrom typing import Generator\n\n_range = tuple(range(2, 21))\n\n\ndef _fact... | python | new_file | 1 | 4 | bsd-3-clause | 0f5de6aeae62337797993697307335276fd1d11a | gidj/euler,gidj/euler | python/005_smallest_multiple/smallest_multiple.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add failing test for get_all_names."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_fu... | python | new_file | 3 | 1 | apache-2.0 | fee9c862334bfd290a2b9bd1e07b93badfb66ae5 | letsencrypt/letsencrypt,lmcro/letsencrypt,stweil/letsencrypt,lmcro/letsencrypt,letsencrypt/letsencrypt,stweil/letsencrypt | letsencrypt-postfix/TestPostfixConfigGenerator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to count changes per node.\n\nThis makes it possible to show a heatmap of recently changed nodes."
},
{
"role": "assistant",
"content": "# script $<\"<changes>\" | \"<countChanges>\" | \"<heatmap>\">$\n\n# assume sin... | python | new_file | 6 | 0 | bsd-3-clause | 88dd94982afa76c3e450c9b186fa8054979779d3 | Vaishal-shah/Envision,Vaishal-shah/Envision,mgalbier/Envision,Vaishal-shah/Envision,mgalbier/Envision,Vaishal-shah/Envision,lukedirtwalker/Envision,lukedirtwalker/Envision,lukedirtwalker/Envision,mgalbier/Envision,dimitar-asenov/Envision,mgalbier/Envision,Vaishal-shah/Envision,mgalbier/Envision,lukedirtwalker/Envision,... | InformationScripting/test/scripts/countChanges.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for window module"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom time import sleep\nfrom unittest.mock import MagicMock\n\nfrom wdom.document import get_document\nfrom wdom... | python | new_file | 1 | 1 | mit | 60c99b91cede21a509030f276684bb2ff706ec3c | miyakogi/wdom,miyakogi/wdom,miyakogi/wdom | wdom/tests/test_window.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set post stat on draft by default"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-08-10 14:30\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, mode... | python | new_file | 1 | 0 | mit | 4b125b0d6f1c3710499be585b08ecf70663415c3 | oktomus/website,oktomus/website,oktomus/website | work/migrations/0002_auto_20170810_1630.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for `qidoc list`\n\nChange-Id: I0fcd9fa17c2d69c5d90ec61eca872ca9a23f92b3\nReviewed-on: http://gerrit.aldebaran.lan/62795\nTested-by: gerrit\nReviewed-by: vbarbaresi <<EMAIL>>"
},
{
"role": "assistant",
"content": "## C... | python | new_file | 1 | 1 | bsd-3-clause | 0d1ce8eaf0329ab6efb6e1bbbb0edca2e78ce649 | aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild | python/qidoc/test/test_qidoc_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tempest: Add Unicode volume name test\n\nCreate and view a volume with Unicode characters\nin the name.\n\nChange-Id: I0c49814a98921d9743f74a6fc0b0b0044473c398"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Cop... | python | new_file | 1 | 2 | apache-2.0 | 52fbd3f92454c103a484c03ae6cbea63dc1329ce | Datera/cinder,bswartz/cinder,cloudbase/cinder,bswartz/cinder,phenoxim/cinder,Nexenta/cinder,eharney/cinder,eharney/cinder,mahak/cinder,Nexenta/cinder,Hybrid-Cloud/cinder,ge0rgi/cinder,j-griffith/cinder,openstack/cinder,NetApp/cinder,phenoxim/cinder,j-griffith/cinder,Datera/cinder,openstack/cinder,Hybrid-Cloud/cinder,Ne... | cinder/tests/tempest/api/volume/test_volume_unicode.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nHarvester for Dryad for the SHARE project\n\nExample API call: http://www.datadryad.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc\n'''\n\nfrom __future__ import unicode_literals\nfrom scrapi.base import OAIHarvester\n\n\nclass... | python | edit | 1 | 4 | apache-2.0 | 1d6c17e5adc3df4de86636ef77fc0a406bf065e9 | icereval/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,mehanig/scrapi,alexgarciac/scrapi,erinspace/scrapi,felliott/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,ostwald/scrapi,fabianvf/scrapi,jeffreyliu3230/scrapi,mehanig/scrapi | scrapi/harvesters/dryad.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a helper to check for differences in dataframes"
},
{
"role": "assistant",
"content": "import pandas as pd\n\nfrom dataactcore.interfaces.db import GlobalDB\n\n\ndef check_dataframe_diff(new_data, model, id_col, sort_cols,... | python | new_file | 1 | 3 | cc0-1.0 | 49b8df3387e6839bc2e0025ec8d2454ab61654a2 | fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-broker-backend | dataactbroker/helpers/pandas_helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test of PIV read/write object cycle"
},
{
"role": "assistant",
"content": "import os\nimport unittest\n\nfrom ..framework import cli_test_suite\nfrom ykman.piv import OBJ\nfrom .util import DEFAULT_MANAGEMENT_KEY\n\n\n@cli_te... | python | new_file | 1 | 1 | bsd-2-clause | 1263bf8dd374afe04735948e767bb31813d99077 | Yubico/yubikey-manager,Yubico/yubikey-manager | test/on_yubikey/cli_piv/test_read_write_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Jenkins Python3 monster to dials, but don't enable it here yet."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\n\nimport os\n\ndef find_new_python3_incompatible_code(mo... | python | new_file | 1 | 13 | bsd-3-clause | 00b35fc6373ec290d92b4b6aa71972b1f9d94105 | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | test/python3_regression.py | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test suite used for testing the Component level API for fixed box sizes\n\n\nMichael"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport Axon\nimport time\nfrom Kamaelia.Chassis.Pipeline import Pipeline\n\nclass My... | python | new_file | 9 | 8 | apache-2.0 | a61d86d235d3968898911596df594f93fe96d7e5 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/MPS/Synchronous.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for faultwrap middleware\n\nPartially implements bp exception-formatting\n\nChange-Id: Ib57ce625775e222e5b42b22c10687bce7b63d26d"
},
{
"role": "assistant",
"content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n... | python | new_file | 1 | 1 | apache-2.0 | 3ef6a9d7d40dd66c89fd3e5c309ad76b5d4e836c | miguelgrinberg/heat,JioCloud/heat,takeshineshiro/heat,pshchelo/heat,jasondunsmore/heat,dragorosson/heat,rh-s/heat,maestro-hybrid-cloud/heat,pratikmallya/heat,miguelgrinberg/heat,rickerc/heat_audit,NeCTAR-RC/heat,cwolferh/heat-scratch,cryptickp/heat,openstack/heat,steveb/heat,gonzolino/heat,rh-s/heat,citrix-openstack-bu... | heat/tests/test_fault_middleware.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.