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 simple test module for integration testing"
},
{
"role": "assistant",
"content": "import sys\nimport argparse\nimport operator\nimport threading\nimport time\n\nfrom jnius import autoclass, cast\nfrom TripsModule.trips_module... | python | new_file | 5 | 2 | bsd-2-clause | 17401f8fad648cbe4258f257fdc288b327aed9ab | sorgerlab/bioagents,bgyori/bioagents | integration/simple_test_module.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom django.test import TestCase\n\n\ncla... | python | edit | 3 | 1 | mit | 43b46f1e3ded3972dede7226cf0255b904d028bd | hstaugaard/notejam,nadavge/notejam,lefloh/notejam,lefloh/notejam,williamn/notejam,hstaugaard/notejam,nadavge/notejam,williamn/notejam,hstaugaard/notejam,hstaugaard/notejam,lefloh/notejam,lefloh/notejam,williamn/notejam,nadavge/notejam,lefloh/notejam,hstaugaard/notejam,williamn/notejam,shikhardb/notejam,williamn/notejam... | django/notejam/pads/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an utility module to load entry-points with whatever lib is available"
},
{
"role": "assistant",
"content": "import logging\nimport sys\nimport types\n\nUSE_IMPORTLIB_METADATA_STDLIB = USE_IMPORTLIB_METADATA = USE_PKG_RESOURC... | python | new_file | 1 | 11 | apache-2.0 | e56f42b17e96145d5e4ee5238ca16c4fe1d06df5 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/entrypoints.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to output codepage tables."
},
{
"role": "assistant",
"content": "\"\"\"Prints code page tables.\n\"\"\"\n\nimport six\nimport sys\n\nfrom escpos import printer\nfrom escpos.constants import *\n\n\ndef main():\n dum... | python | new_file | 2 | 5 | mit | 94e1944d160f242ebebe9614395bb795e5074d6d | python-escpos/python-escpos,belono/python-escpos,braveheuel/python-escpos | examples/codepage_tables.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add WiFi IP to LCD"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Copyright (c) 2015 Max Vilimpoc\n#\n# References:\n# http://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python... | python | new_file | 1 | 1 | bsd-2-clause | eacb6e0ce160e2b29f7be2f50ae05969ec31543d | ktkirk/HSSI,ktkirk/HSSI,ktkirk/HSSI | grovekit/ip_lcd.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add list of builtin codegenerators"
},
{
"role": "assistant",
"content": "\"\"\"Code generation primitives.\"\"\"\n\nimport hdltools.verilog.codegen\nimport hdltools.specc.codegen\n\nBUILTIN_CODE_GENERATORS = {\n \"verilog\": ... | python | new_file | 1 | 0 | mit | 2db27459ce1e102038a610e0d432ac5090097d27 | brunosmmm/hdltools,brunosmmm/hdltools | hdltools/codegen/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test to test automatic color assigment from TW"
},
{
"role": "assistant",
"content": "from time import sleep\nfrom tests.base import IntegrationTest, MultipleSourceTest\n\n\nclass TestSimpleColorAssigment(IntegrationTe... | python | new_file | 4 | 1 | mit | 42498b014c2ffcd4a507511aa62c4d49250d2a8c | Spirotot/taskwiki,phha/taskwiki | tests/test_config.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce tests for urlize_quoted_links() function"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\nfrom django.test import TestCase\nfrom rest_framework.templatetags.rest_framework import urlize_qu... | python | new_file | 3 | 2 | bsd-2-clause | ef1d65282771c806f68d717d57172597184db26c | yiyocx/django-rest-framework,buptlsl/django-rest-framework,arpheno/django-rest-framework,jness/django-rest-framework,kylefox/django-rest-framework,jerryhebert/django-rest-framework,jpadilla/django-rest-framework,justanr/django-rest-framework,abdulhaq-e/django-rest-framework,wwj718/django-rest-framework,wwj718/django-re... | rest_framework/tests/test_urlizer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test cases for normalized string"
},
{
"role": "assistant",
"content": "from rdflib import *\nimport unittest\n\nclass test_normalisedString(unittest.TestCase):\n def test1(self):\n lit2 = Literal(\"\\two\\nw\", datatyp... | python | new_file | 13 | 1 | bsd-3-clause | cc109dee42d9a221ebba9caae8cc5c8b6bba4351 | RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib | test/test_normalizedString.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\n'''\n nereid.backend\n\n Backed - Tryton specific features\n\n :copyright: (c) 2010-2012 by Openlabs Technologies & Consulting (P) Ltd.\n :license: GPLv3, see LICENSE for more details\n'''\nclass Transac... | python | edit | 1 | 2 | bsd-3-clause | ebb0916a7c63c1aaf383c696c203199ca79f70ac | riteshshrv/nereid,usudaysingh/nereid,usudaysingh/nereid,riteshshrv/nereid,fulfilio/nereid,fulfilio/nereid,prakashpp/nereid,prakashpp/nereid | nereid/backend.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a data migration to make sure we don’t send a lot of emails to old events"
},
{
"role": "assistant",
"content": "# Generated by Django 1.10.5 on 2017-01-07 17:29\nfrom __future__ import unicode_literals\n\nimport datetime\n\n... | python | new_file | 1 | 5 | bsd-3-clause | a24c6c66642060bf948023462a75fbc25ce6bc64 | patjouk/djangogirls,patjouk/djangogirls,patjouk/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls,patjouk/djangogirls | core/migrations/0030_email_flags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write test case for worker"
},
{
"role": "assistant",
"content": "from twisted.trial import unittest\n\nfrom ooni.plugoo import work, tests\n\nclass WorkerTestCase(unittest.TestCase):\n def testWorkGenerator(self):\n cl... | python | new_file | 3 | 3 | bsd-2-clause | 29cc044b50cf0fdc8bfad97f194ea7fa993e08e6 | kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,hackerberry/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,hackerberry/ooni-p... | tests/test_worker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement Philips HUE wrapper caller for Minion Proxy"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\nPhilips HUE lamps module for proxy.\n'''\n\nfrom __future__ import absolute_import\nimport sys\n\n__virtua... | python | new_file | 2 | 5 | apache-2.0 | fc43f8e71854aee1ac786bdb8555e8eba1510cd1 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/philips_hue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add segment conversion to feature string"
},
{
"role": "assistant",
"content": "feature_order = ['syllabic',\n 'stress',\n 'long',\n 'consonantal',\n 'sonorant',\n ... | python | new_file | 1 | 4 | mit | 9258bdf23f0019826c007cdf63ed956ad178ddbd | kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve | app/deparse.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add entry script for mies/acq4 analysis"
},
{
"role": "assistant",
"content": "import acq4\nfrom neuroanalysis.nwb_viewer import MiesNwbViewer, MiesNwb\nacq4.pyqtgraph.dbg()\n\nm = acq4.Manager.Manager(argv=['-D', '-n', '-m', 'Da... | python | new_file | 1 | 1 | mit | e52a45901e3a062d4b55c0f3050f2bd4b6b4d08c | campagnola/neuroanalysis | mies_nwb_viewer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some async protocol handling code\n\nSigned-off-by: Jan Losinski <<EMAIL>>"
},
{
"role": "assistant",
"content": "import asyncio\n\nimport logging\n\nfrom meshnet.serial.messages import SerialMessageConsumer\n\nlogger = loggi... | python | new_file | 1 | 3 | bsd-3-clause | 72b3ffe2ca7f735991aca304d42d495484ee3f3d | janLo/automation_mesh,janLo/automation_mesh,janLo/automation_mesh | meshnet/serial/connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add praw with post generator for selfposts"
},
{
"role": "assistant",
"content": "import praw\n\nr = praw.Reddit(user_agent='stream only self posts from a sub by /u/km97')\nposts = [post for post in r.get_subreddit('all').get_hot... | python | new_file | 1 | 0 | mit | cc57a70be1e5b9da6aca69f4728291214c353469 | kshvmdn/reddit-bots | self-post-stream/stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 684. Redundant Connection\n\n684. Redundant Connection: https://leetcode.com/problems/redundant-connection/"
},
{
"role": "assistant",
"content": "from collections import defaultdict\nclass Solution(object):\n... | python | new_file | 1 | 5 | apache-2.0 | 80ee01e15ec62b4286b98ecc85c13c398154d7ac | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/redundant-connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write migration to associate group users with the group's files."
},
{
"role": "assistant",
"content": "\"\"\"Associate groups with files.\n\nRevision ID: a3fe8c8a344\nRevises: 525162a280bd\nCreate Date: 2013-11-05 13:55:04.49818... | python | new_file | 1 | 10 | bsd-2-clause | 5de41a702f819fca3cea68470912b68dd82b2888 | ucsb-cs/submit,ucsb-cs/submit,ucsb-cs/submit,ucsb-cs/submit | alembic/versions/a3fe8c8a344_associate_groups_wit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Distance Between Two Points in python"
},
{
"role": "assistant",
"content": "from math import pow, sqrt\n\nx1, y1 = map(float, input().split())\nx2, y2 = map(float, input().split())\n\ndistance = sqrt(pow(x2 - x1, 2) + pow(... | python | new_file | 1 | 0 | mit | c0f5554e2259055c423098f6f6a83fc99e4d0789 | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1015/1015.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple node testing script in Python"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilities\nfrom selenium import webdriver\n\ndriver = web... | python | new_file | 1 | 0 | mit | 1759446be100c94bee19bfb0c7e1ea800adbb7c4 | saikrishna321/selenium-video-node,saikrishna321/selenium-video-node,saikrishna321/selenium-video-node | node-test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Where is the Marble? in python"
},
{
"role": "assistant",
"content": "import sys\n\n\ndef binary_search(marbles, query):\n begin = 0\n end = len(marbles) - 1\n middle = end // 2\n\n while begin <= end:\n ... | python | new_file | 1 | 6 | mit | 733d0ed4b39c2632129d7604474995badfe0321d | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1025/1025.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to upgrade Debian/Ubuntu bots.\n\nBug: skia:6890\nChange-Id: I30eea5d64c502ac7ef51cf2d8f6ef3c583e60b3e\nReviewed-on: https://skia-review.googlesource.com/28840\nCommit-Queue: Ben Wagner <<EMAIL>>\nReviewed-by: Eric Boren <<EMAIL>>... | python | new_file | 1 | 0 | bsd-3-clause | 0ae8934d4d1e1a6e57c73eebd85ede01326e8ca1 | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | scripts/run_on_swarming_bots/apt-full-upgrade.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move docker_stream_adapter tests from plugins/ into modern testsuite"
},
{
"role": "assistant",
"content": "import unittest\nfrom girder_worker.docker.stream_adapter import DockerStreamPushAdapter\n\n\nclass CaptureAdapter(object... | python | new_file | 1 | 2 | apache-2.0 | 907caa83f4aed45ba31c6aa796e7bcb589521abc | girder/girder_worker,girder/girder_worker,girder/girder_worker | tests/test_docker_stream_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for gene and ld snp pairs"
},
{
"role": "assistant",
"content": "# ------------------------------------------------\n# built-ins\nimport unittest\n\n# local\nfrom .base import TestPostgapBase\n# ------------------------... | python | new_file | 1 | 1 | apache-2.0 | d666e4f79e6646dc2f084a61b70c6cee3bf90d13 | Ensembl/cttv024,Ensembl/cttv024 | tests/health_checks/test_per_gene_AND_ld_snp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Duplicate info in parent and children"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom web import models\n\nclass Command(BaseCommand):\n can_import_settings = True... | python | new_file | 2 | 2 | apache-2.0 | 3b35b313fad8e1faf3a2eaa3ca03f64eb31ed421 | SchoolIdolTomodachi/frgl,SchoolIdolTomodachi/frgl,SchoolIdolTomodachi/frgl | web/management/commands/fixcardsfamily.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, division, absolute_import\nfrom tests import FlexGetBase\n\n\nclass TestSimplePersistence(FlexGetBase):\n\n __yaml__ = \"\"\"\n tasks:\n test:\n mock:\n - {... | python | edit | 1 | 1 | mit | 282d6ae5911e4fcf4625a7e82e7024c5dc0722d8 | cvium/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,patsissons/Flexget,ZefQ/Flexget,tarzasai/Flexget,X-dark/Flexget,qk4l/Flexget,tsnoam/Flexget,Danfocus/Flexget,spencerjanssen/Flexget,crawln45/Flexget,oxc/Flexget,tvcsantos/Flexget,Flexget/Flexget,tarzasai/Flexget,tobinjt/Flexget,qvazzler/Flexget,Pretagonist/Flexget,Lynxys... | tests/test_simple_persistence.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add expire reservations in backport position.\n\nChange-Id: If0e58da50ebe9b50b414737a9bd81d93752506e2\nRelated-bug: #1348720\n(cherry picked from commit f4454f4c6962dd2c57c08dc7fecfcdebe7924e3b)"
},
{
"role": "assistant",
"conten... | python | new_file | 1 | 3 | apache-2.0 | b53adea2d02458e20bb165c18c856b6816ab1983 | luogangyi/bcec-nova,leilihh/novaha,leilihh/novaha,luogangyi/bcec-nova,leilihh/nova,leilihh/nova | nova/db/sqlalchemy/migrate_repo/versions/234_add_expire_reservations_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test mask resulted in the same value as comprehension list\n\n\nFormer-commit-id: f1e3c2e5a3ddeab54e47746398620c57931170d6"
},
{
"role": "assistant",
"content": "\nimport numpy as np\nimport pytest\nfrom hypothesis import given\n... | python | new_file | 4 | 3 | mit | 8aedd861032d0bf73c5ea397b73827398d278dda | jason-neal/eniric,jason-neal/eniric | tests/test_equivalency.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add repeat a word a thousand times exercise"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\ndef main():\n word = raw_input(\"Say a word and I will repeat it a thousand times: \").strip()\n \n if (word.count(\" ... | python | new_file | 3 | 3 | apache-2.0 | 0c0ae76c33800951e718611a3c5b84518b43589d | MindCookin/python-exercises | repeatWordAThousandTimes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for the payload generator of the Uploader class."
},
{
"role": "assistant",
"content": "\"\"\"Tests for the uploader module\"\"\"\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __... | python | new_file | 1 | 1 | mit | 85340b0453fff6b78a0f8c5aec98eaf359ce0b09 | openspending/gobble | tests/test_uploader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the nodev.specs example code."
},
{
"role": "assistant",
"content": "\n# import pytest\n\nfrom nodev.specs.generic import FlatContainer\n\n#\n# possible evolution of a ``skip_comments`` function\n#\ndef skip_comments_v0(strea... | python | new_file | 1 | 3 | mit | 7143075a6150134bb61655ca9bef8b9a4092eeab | nodev-io/nodev-starter-kit,nodev-io/nodev-tutorial,nodev-io/nodev-starter-kit | tests/test_skip_comments.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for 'contain' matcher"
},
{
"role": "assistant",
"content": "import unittest\nfrom robber import expect\nfrom robber.matchers.contain import Contain\n\nclass TestAbove(unittest.TestCase):\n def test_matches(self):\n ... | python | new_file | 1 | 1 | mit | eda1d37c697956c92cf930c640a9d8d1a382bea5 | vesln/robber.py,taoenator/robber.py | tests/matchers/test_contain.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple selenium test for vtkObject."
},
{
"role": "assistant",
"content": "from selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.... | python | new_file | 12 | 3 | apache-2.0 | 52e4e2d7511b672ee022fe62ea726fbf2511185f | OpenGeoscience/vgl,OpenGeoscience/vgl,OpenGeoscience/vgl,OpenGeoscience/vgl | src/testing/drawVtkObject.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for repo_utils\n\nSigned-off-by: Zack Cerza <<EMAIL>>"
},
{
"role": "assistant",
"content": "import logging\nimport os.path\nfrom pytest import raises\nimport shutil\n\nfrom .. import repo_utils\nrepo_utils.log.set... | python | new_file | 1 | 1 | mit | abd359086c9ad99becfe1f61c8e22212c76bcc58 | robbat2/teuthology,robbat2/teuthology,caibo2014/teuthology,tchaikov/teuthology,ktdreyer/teuthology,t-miyamae/teuthology,tchaikov/teuthology,SUSE/teuthology,zhouyuan/teuthology,yghannam/teuthology,dreamhost/teuthology,michaelsevilla/teuthology,ivotron/teuthology,ceph/teuthology,ivotron/teuthology,ktdreyer/teuthology,dre... | teuthology/test/test_repo_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy input without modification to begin with"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport sys\n\nif len(sys.argv) < 3:\n print('usage: python {} input_filename output_filename'.format(sys.argv[0]))\n ... | python | new_file | 1 | 0 | apache-2.0 | 1f55c424c96dd06f21762bbe730bb4302e954539 | msufa/tracking-id-injector,msufa/tracking-id-injector | tracking-id-injector.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to update snapshot version."
},
{
"role": "assistant",
"content": "from sys import argv\nfrom tempfile import mkstemp\nfrom shutil import move\nfrom os import remove, close\n# import os, fileinput\n\nservices = [\"alch... | python | new_file | 3 | 4 | apache-2.0 | e3d9a92ac816b3406033d30d29eecf4c606e1e54 | JoshSharpe/java-sdk,JoshSharpe/java-sdk,JoshSharpe/java-sdk | update_snapshot_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create python example on formatting string"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"Format string precedence\"\"\"\n\nclass Foo(object):\n def __str__(self):\n return \"i am a __str__\"\n ... | python | new_file | 1 | 1 | mit | 04d19c4a97836f725d602896aa00a08040660e72 | brycepg/how-to | python/format_string_precedence.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a game of life benchmark"
},
{
"role": "assistant",
"content": "\"\"\"\nBenchmark a game of life implementation.\n\"\"\"\n\nimport numpy as np\n\nfrom numba import jit\n\n\n@jit(nopython=True)\ndef wrap(k, max_k):\n if k =... | python | new_file | 1 | 5 | bsd-2-clause | c01a771e577994bffcbe79f84195f2ea35470c97 | gmarkall/numba-benchmark,numba/numba-benchmark | benchmarks/bench_gameoflife.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make a tidy file of all miso summaries."
},
{
"role": "assistant",
"content": "\"\"\"\nwrite MISO summary tables out to tidy format\n\"\"\"\n\nfrom argparse import ArgumentParser\nimport pandas as pd\nimport os\nimport logging\nl... | python | new_file | 1 | 1 | mit | 86a92e78634ca259daa9f7cc681fd8ffbf67aed6 | roryk/junkdrawer,roryk/junkdrawer | miso-tables.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for last commit"
},
{
"role": "assistant",
"content": "from chai import Chai\nfrom datetime import datetime\n\nfrom dfaker.data_generator import dfaker \n\n\nclass Test_Pump_Settings(Chai):\n def test_smoke(self):\n ... | python | new_file | 4 | 1 | bsd-2-clause | ca32188cf154ed3f32aeb82ef15d42aee472cc77 | tidepool-org/dfaker | tests/test_data_generator.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for the methods in util"
},
{
"role": "assistant",
"content": "from lib import util\n\n\ndef test_cachedproperty():\n class Target:\n def __init__(self):\n self.call_count = 0\n\n @util.... | python | new_file | 1 | 1 | mit | fcc92760db0d1dc56aca70aff69b34a29c9e8e6c | shsmith/electrumx,thelazier/electrumx,Groestlcoin/electrumx-grs,erasmospunk/electrumx,shsmith/electrumx,bauerj/electrumx,thelazier/electrumx,erasmospunk/electrumx,Crowndev/electrumx,Groestlcoin/electrumx-grs,bauerj/electrumx,Crowndev/electrumx | tests/test_util.py | rejected_duplicate | Near-duplicate of sample 6734 | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up Code Fights create die problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Create Die Problem\n\nimport random\n\n\ndef createDie(seed, n):\n class Die(object):\n pass\n\n cla... | python | new_file | 3 | 3 | mit | dab3b241552734d6810013f53d55c2fec3e1e512 | HKuz/Test_Code | CodeFights/createDie.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for class as iterable"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nfrom nimble import Events\n\n\nclass TestClassIterable(TestCase):\n ... | python | new_file | 1 | 2 | mit | af83fd1f043696f5408c878306d4cc4928af97ba | rwhitt2049/nimble,rwhitt2049/trouve | tests/test_iterable_event.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use parametrize to test authorization and permissions"
},
{
"role": "assistant",
"content": "import pytest\n\n\nparameters = [\n (\"post\", (\"/api/viruses\", {})),\n (\"patch\", (\"/api/viruses/foobar\", {})),\n (\"dele... | python | new_file | 1 | 1 | mit | 04cbabc2ca4d36ea35ec564bd48927dea7919190 | igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool | virtool/tests/api/test_protected.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run test suite with multiple python versions at once"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"Runs the tornado test suite with all supported python interpreters.\"\"\"\n\nimport os\nimport... | python | new_file | 5 | 4 | apache-2.0 | 63a161f596ab166d54e525eaa6185067ea76c891 | djt5019/tornado,fengshao0907/tornado,QuanZag/tornado,bywbilly/tornado,frtmelody/tornado,ovidiucp/tornado,ifduyue/tornado,cyrilMargaria/tornado,liqueur/tornado,allenl203/tornado,gitchs/tornado,AlphaStaxLLC/tornado,zguangyu/tornado,ListFranz/tornado,tornadoweb/tornado,kevinge314gh/tornado,icejoywoo/tornado,0xkag/tornado,... | tornado/test/run_pyversion_tests.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for Malayalam transliteration"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nimport unittest\nimport unicodedata\n\nimport epitran\n\n\nclass TestMalaya... | python | new_file | 2 | 1 | mit | 44bd7e7b5932754c83d987af473479568ae62a16 | dmort27/epitran,dmort27/epitran | epitran/test/test_malayalam.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 3D power spectrum for comparing with generated fields"
},
{
"role": "assistant",
"content": "\nimport numpy as np\n\n\ndef threeD_pspec(arr):\n '''\n Return a 1D power spectrum from a 3D array.\n\n Parameters\n --... | python | new_file | 1 | 3 | mit | 6cc9f6b7bcb77ca8dc4a0904bf2cafd01d60028b | e-koch/TurbuStat,Astroua/TurbuStat | turbustat/simulator/threeD_pspec.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for Submission model"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom app.models import Submission, Comment\n\n\nMOCK_SUBMISSION = {\n 'permalink': (u'https://www.reddit.com/r/fake/comments'\n ... | python | new_file | 4 | 2 | mit | 1f141791c31525d16d5281790612d7e8f162f394 | PsyBorgs/redditanalyser,PsyBorgs/redditanalyser | app/tests/test_models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add merge migration - submissions migrations with develop (guardian)."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.15 on 2019-06-18 14:29\nfrom __future__ import unicode_literals\n\nf... | python | new_file | 1 | 0 | apache-2.0 | 461c008ebb5b1c048fc8117ee1730e84ee3d2a93 | Johnetordoff/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,felliott/osf.io,mfraezz/osf.io,felliott/osf.io,cslzchen/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,cslzchen/osf.io,mattclark/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,adlius/osf.io,baylee-d/osf.io,mfraezz/osf.io,baylee-d/osf.io,aaxelb/osf.i... | osf/migrations/0169_merge_20190618_1429.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example plugin for parser secure logs"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\nimport sys\nsys.path.insert(0, \"..\")\nimport re\n\nfrom libs.manager import Plugin\nfrom libs.mai... | python | new_file | 6 | 5 | apache-2.0 | a8aef6de4876cceb53da1335ada9163eaa184c6e | keepzero/fluent-mongo-parser | plugins/plugin_secure_check.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a couple set benchmarks"
},
{
"role": "assistant",
"content": "\"\"\"\nBenchmark various operations on sets.\n\"\"\"\n\nfrom __future__ import division\n\nimport numpy as np\n\nfrom numba import jit\n\n\n# Set benchmarks\n# N... | python | new_file | 1 | 3 | bsd-2-clause | 874794156b60caef3d6b944835ef11671b9b8c86 | numba/numba-benchmark | benchmarks/bench_sets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 477. Total Hamming Distance\n\n477. Total Hamming Distance: https://leetcode.com/problems/total-hamming-distance/"
},
{
"role": "assistant",
"content": "from collections import Counter\nclass Solution(object):... | python | new_file | 2 | 5 | apache-2.0 | fe79933c028d55a6ad2d8f203d33c9ca7939afbe | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/total-hamming-distance.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nSouth-specific signals\n\"\"\"\n\nfrom django.dispatch import Signal\nfrom django.conf import settings\n\n# Sent at the start of the migration of an app\npre_migrate = Signal(providing_args=[\"app\"])\n\n# Sent after each successful... | python | edit | 3 | 0 | apache-2.0 | ff36ab7972220940a8e4d5396b591cd02c045380 | RaD/django-south,philipn/django-south,philipn/django-south,RaD/django-south,nimnull/django-south,RaD/django-south,nimnull/django-south | south/signals.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for checkpoint averaging"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport argparse\n\nimport numpy as np\n\n# Parse arguments\nparse... | python | new_file | 4 | 0 | mit | 993025327f83e47c0b996690f661d4b54f8d2146 | emjotde/amunn,emjotde/amunn,emjotde/Marian,emjotde/amunn,emjotde/amunmt,marian-nmt/marian-train,emjotde/Marian,emjotde/amunmt,marian-nmt/marian-train,emjotde/amunmt,marian-nmt/marian-train,emjotde/amunn,emjotde/amunmt,marian-nmt/marian-train,marian-nmt/marian-train | scripts/checkpoints/average.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add disabled Ping integration test"
},
{
"role": "assistant",
"content": "import uuid\n\nfrom kitten.server import KittenServer\nfrom kitten.request import KittenRequest\n\nfrom mock import MagicMock\nimport gevent\n\n\nclass Tes... | python | new_file | 1 | 2 | mit | d2a1d906b863dcf57eea228282a1badd5274d3b2 | thiderman/network-kitten | test/integration/test_node_ping.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for feedback tags"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10 on 2016-08-27 01:39\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nimport t... | python | new_file | 1 | 0 | mit | 144738aecf4e593ebd8cbbc60f53692d783b1799 | zkan/pronto-feedback,zkan/pronto-feedback | pronto_feedback/feedback/migrations/0003_feedback_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of running an isolated step without using Swarm\n\nTBR=<EMAIL>\nBUG=\n\n\nReview URL: https://chromiumcodereview.appspot.com/11070006\n\ngit-svn-id: d5a9b8648c52d490875de6588c8ee7ca688f9ed1@160586 0039d316-1c4b-4281-b951-d872f208... | python | new_file | 1 | 2 | apache-2.0 | dbafa0d69c5c13282ed5f4c41ccb7550f1575c74 | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | example/run_example_cad.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement Parametizer class for defining and cleaning GET parameters\n\nA subclass can define class-level variables and clean_* methods for cleaning\ninput parameter values"
},
{
"role": "assistant",
"content": "def clean_bool(va... | python | new_file | 2 | 8 | bsd-2-clause | d83f702a6cf0ec86c457edf8668078a53ae86579 | bruth/restlib2 | restlib2/params.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to print num configs\n\nPiperOrigin-RevId: 240189946"
},
{
"role": "assistant",
"content": "# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"... | python | new_file | 1 | 1 | apache-2.0 | 0e88b500e3412b86696c892abe8207f14fb73b3a | tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets | tensorflow_datasets/scripts/print_num_configs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a debugging plugin to log the size of the queue."
},
{
"role": "assistant",
"content": "\nimport logging\n\nlogger = logging.getLogger(__name__)\n\nfrom arke.collect import Collect\n\nclass queue_monitor(Collect):\n defaul... | python | new_file | 1 | 1 | apache-2.0 | 60753aae90e1cba2e4dcb2dec94f9da530db5542 | geodelic/arke,geodelic/arke | contrib/queue_monitor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example to show random search vs gp"
},
{
"role": "assistant",
"content": "from time import time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.base import clone\nfrom sklearn.datasets import load_digi... | python | new_file | 4 | 2 | bsd-3-clause | f0413bbd3798361c6602deacb27a9da25d0c20d6 | glouppe/scikit-optimize,ccauet/scikit-optimize,betatim/BlackBox,scikit-optimize/scikit-optimize,betatim/BlackBox,scikit-optimize/scikit-optimize,glouppe/scikit-optimize | examples/plot_random_vs_gp.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests of number str() formatting.\n\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@5396 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom numpy.testing import ... | python | new_file | 8 | 3 | bsd-3-clause | 4850f232528f797539ce444a11dc248ae7696842 | illume/numpy3k,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,teoliphant/numpy-refactor,efiring/numpy-work,illume/numpy3k,chadnetzer/numpy-gaurdro,Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,efiring/numpy-work,Ademan/NumPy-GSoC,jasonmccampbell/... | numpy/core/tests/test_print.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for the ssh password regex matching"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Pedro Algarvio (<EMAIL>)`\n :copyright: © 2013 by the SaltStack Team, see AUTHORS ... | python | new_file | 1 | 2 | apache-2.0 | e45cbf1dcaf6ba6e142e7674d3a869f1492d43c7 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/utils/cloud_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example tests for core ModelAdmin"
},
{
"role": "assistant",
"content": "from django.contrib.admin.sites import AdminSite\nfrom django.test import TestCase\n\nfrom .. import admin\nfrom .. import factories\nfrom .. import mod... | python | new_file | 1 | 1 | bsd-3-clause | 486613951ac8b1584720b23c2a03d427bdf38162 | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | apps/core/tests/test_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple script for plotting iteration behaviors"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef update_accu_one(U, X):\n U = 1*U + l*(u - 1*X)\n ... | python | new_file | 2 | 1 | mit | e4a50aece7071091f5801c3e3239382b4b70256c | arasmus/eca | tools/state_updates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove obsolete locales, pa and fy"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\ndef remove_pa_fy(apps, schema_editor):\n ... | python | new_file | 3 | 2 | bsd-3-clause | acd14b9239b60ab27ae38a95bd6a832bce1c4af4 | mathjazz/pontoon,participedia/pontoon,m8ttyB/pontoon,vivekanand1101/pontoon,yfdyh000/pontoon,sudheesh001/pontoon,mastizada/pontoon,mozilla/pontoon,yfdyh000/pontoon,mastizada/pontoon,mathjazz/pontoon,jotes/pontoon,mozilla/pontoon,sudheesh001/pontoon,mathjazz/pontoon,jotes/pontoon,mozilla/pontoon,mastizada/pontoon,partic... | pontoon/base/migrations/0021_auto_20150904_1007.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional test for OSUtils\n\nTest involved detecting special UNIX files"
},
{
"role": "assistant",
"content": "# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache Licens... | python | new_file | 1 | 1 | apache-2.0 | 23a626124adb9882e78744a81d13996fe1d2f5aa | boto/s3transfer | tests/functional/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a files total size scriptwq"
},
{
"role": "assistant",
"content": "fp=open(\"qdisksync.cache\")\nfsize_all=0\nfor line in fp:\n\titems=line.split(\"\\t\")\n\tfsize_all+=int(items[1])\nfp.close()\nprint(\"Size:\"+str(fsize_all... | python | new_file | 1 | 0 | apache-2.0 | 400d2b85e1b50405539ae7f1e12db484f8545353 | jemygraw/qdiskbundle,jemygraw/qdiskbundle,jemygraw/qdisksync,jemygraw/qdisksync,jemygraw/qdisksync | src/main/fsize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add exercise 6 checking code"
},
{
"role": "assistant",
"content": "from learntools.core import *\nimport tensorflow as tf\n\n\n# Free\nclass Q1(CodingProblem):\n _solution = \"\"\n _hint = \"\"\n def check(self):\n ... | python | new_file | 10 | 1 | apache-2.0 | 750f9c3d243ad024d54b6f4903657ab35aa6feb9 | Kaggle/learntools,Kaggle/learntools | learntools/computer_vision/ex6.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test script to create an xml restart file\n\ngit-svn-id: 5cda8128732f5b679951344c24659131be7d2dfc@2733 fa922fa7-2fde-0310-acd8-f43f465a7996"
},
{
"role": "assistant",
"content": "from hoomd_script import *\n\ninit.read_xml('cubes... | python | new_file | 17 | 0 | bsd-3-clause | 86c41ea896031cbcdf3894835f2bd5c8a91de079 | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | test/rigid/cubes/create_restart.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add spider for Merrill Lynch offices"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport scrapy\nfrom locations.items import GeojsonPointItem\nimport json\n\n\nclass MerrillLynchSpider(scrapy.Spider):\n name... | python | new_file | 1 | 3 | mit | ac5696eb25063a753ac608c5765a5f7b804e95a2 | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/merrilllynch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a default configuration with instructions"
},
{
"role": "assistant",
"content": "# Copy this file to config.py and fill in your own values\nSECRET_KEY = 'Genjric Noguchen'\nDEBUG = True\nFACEBOOK_APP_ID = '1234567890'\nFACEBO... | python | new_file | 1 | 0 | isc | b4ab495f5addc50b885d07150de9ce3d6309c1bd | breadcrumbs-app/breadcrumbs,breadcrumbs-app/breadcrumbs,breadcrumbs-app/breadcrumbs | breadcrumbs/default_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add integration tests for signals and connection loss."
},
{
"role": "assistant",
"content": "from .. import monkey; monkey.patch_all()\n\nfrom nose.tools import eq_ as eq\n\nimport os\nimport nose\n\nfrom .. import connection, r... | python | new_file | 1 | 2 | mit | 9a5c959bc8d83b0b5c93666d66111b3337e937fc | ivotron/teuthology,robbat2/teuthology,dreamhost/teuthology,SUSE/teuthology,yghannam/teuthology,ktdreyer/teuthology,tchaikov/teuthology,caibo2014/teuthology,ktdreyer/teuthology,dmick/teuthology,dreamhost/teuthology,dmick/teuthology,t-miyamae/teuthology,SUSE/teuthology,tchaikov/teuthology,ceph/teuthology,robbat2/teutholo... | orchestra/test/test_integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a very simple performance testing tool."
},
{
"role": "assistant",
"content": "\"\"\"\nSimple peformance tests.\n\"\"\"\n\nimport sys\nimport time\n\nimport couchdb\n\n\ndef main():\n\n print 'sys.version : %r' % (sys.vers... | python | new_file | 4 | 5 | bsd-3-clause | b01076381ebc91f20c527f1632c7b3f2aa82d39a | ajmirsky/couchdb-python | perftest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\ndef source_plugin():\n\timport os\n\timport vim\n\n\tvim.command('source ' + vim.eval('fnameescape(\"' + os.path.join(os.path.abspath(os.path.dirname(__file__)), 'powerline.vim') + '\")'))\n\n```\n\nApply this c... | python | edit | 1 | 1 | mit | 7fb3df28b9fc9222e44ae48d8b2fd3c2a6b9fbfa | junix/powerline,lukw00/powerline,S0lll0s/powerline,kenrachynski/powerline,EricSB/powerline,bezhermoso/powerline,bezhermoso/powerline,lukw00/powerline,prvnkumar/powerline,EricSB/powerline,blindFS/powerline,EricSB/powerline,xxxhycl2010/powerline,magus424/powerline,xfumihiro/powerline,dragon788/powerline,prvnkumar/powerli... | powerline/ext/vim/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add back facility code sequence migrations"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom django.db import models, migrations\nfrom facilities.models import Facility\n\ndef set_min_code_value(apps, schema_ed... | python | new_file | 4 | 1 | mit | 50618c1f5cce31612d1278e7be0bfd14a670736a | MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api | facilities/migrations/set_facility_code_sequence_min_value.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a little package-em-up script for the Subversion book.\n\ngit-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@849264 13f79535-47bb-0310-9956-ffa450edef68"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimpor... | python | new_file | 2 | 1 | apache-2.0 | ce483720321097d982888f6dcb673b9348daad4e | YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion | doc/book/book-dist.py | rejected_duplicate | Near-duplicate of sample 8010 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for Splitter."
},
{
"role": "assistant",
"content": "import os\nimport os.path\n\nimport pytest\n\nfrom psyrun.core import load_infile, load_results, save_outfile\nfrom psyrun.pspace import Param\nfrom psyrun.split ... | python | new_file | 1 | 2 | mit | e1d3befa79e30846dc905eb7225f51e9e374f21a | jgosmann/psyrun | psyrun/tests/test_splitter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for Docdata gateway"
},
{
"role": "assistant",
"content": "from bluebottle.payments_docdata.gateway import DocdataClient, Amount, Shopper, Name, Destination, Address, Merchant\n\nfrom bunch import bunchify\nfrom mock imp... | python | new_file | 1 | 1 | bsd-3-clause | c187f77d3cc05f35613f3355f1df56e11d012463 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/payments_docdata/tests/test_gateway.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for tests of rule invalid add"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import Te... | python | new_file | 5 | 0 | mit | faf9dfd9f1b1218ad58c281734b2af4074d0fd1f | PatrikValkovic/grammpy | tests/rules_tests/grammarManipulation_tests/InvalidAddTest.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test script using Carrizo data"
},
{
"role": "assistant",
"content": "import dem\nimport tasks\nfrom celery import *\n\ncarrizo = dem.DEMGrid('tests/data/carrizo.tif')\n\nd = 100\nmax_age = 10**3.5\nage_step = 1\nnum_ages = m... | python | new_file | 7 | 0 | mit | 896286d2e031c621c0a93e30dac152b606453c4c | rmsare/scarplet,stgl/scarplet | celery/run_carrizo.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for utility methods"
},
{
"role": "assistant",
"content": "from utils import reverse_complement, gc_content, distance\n\n\ndef test_reverse_complement():\n assert reverse_complement('ATCG') == 'CGAT'\n assert reve... | python | new_file | 1 | 1 | mit | 108b7f7943a8338758ae55063d9eb21440c6297e | MichaelAquilina/rosalind-solutions | tests/utils_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python implementation for merge sort method"
},
{
"role": "assistant",
"content": "# python implementation of merge sort\n\ndef merge_sort(arr):\n\tif len(arr) > 1:\n\t\tmiddle = len(arr)/2\n\t\tleft = arr[:middle]\n\t\tright... | python | new_file | 1 | 7 | mit | 6d54528c74a5e0074bbddaabb7db803b655d06c3 | derekmpham/interview-prep,derekmpham/interview-prep | array/merge-sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Processor interface for post processing of schemas."
},
{
"role": "assistant",
"content": "# :coding: utf-8\n# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips\n# :license: See LICENSE.txt.\n\nfrom abc import ABCMeta, ... | python | new_file | 1 | 1 | apache-2.0 | 5737213ab2bc2ed041c71dd4e6d698ff00820038 | 4degrees/harmony | source/harmony/schema/processor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for use of BASE <..>"
},
{
"role": "assistant",
"content": "from rdflib import ConjunctiveGraph, Literal\nfrom StringIO import StringIO\nimport unittest\n\n\ntest_data = \"\"\"\n@prefix foaf: <http://xmlns.com/foaf/0.1... | python | new_file | 1 | 1 | bsd-3-clause | 4e3e14e5d916c229876fb2faae03082ed65d0918 | Letractively/rdflib,Letractively/rdflib,Letractively/rdflib | test/test_sparql_base_ref.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic presubmit script."
},
{
"role": "assistant",
"content": "# 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 LICENS... | python | new_file | 1 | 1 | bsd-3-clause | 8860cb45cbc0be048a0f87335b7a150a4d8b0b7a | bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer | PRESUBMIT.py | rejected_duplicate | Near-duplicate of sample 5937 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test case for colormap behavior change."
},
{
"role": "assistant",
"content": "from awscfncli2.cli.utils.colormaps import STACK_STATUS_TO_COLOR\n\n\ndef test_stack_status_to_color():\n assert STACK_STATUS_TO_COLOR['UPDAT... | python | new_file | 1 | 1 | mit | e9720a993332f4d08a76f49828ad87378c58abd2 | Kotaimen/awscfncli,Kotaimen/awscfncli | tests/unit/cli/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pytest config file for slow tests.\n\nAdded a pytest config file in the tests folder, so that I could define a\n--runslow option to some tests. This way, I don't have to run them all\nthe time if not necessary."
},
{
"role": "ass... | python | new_file | 1 | 3 | bsd-3-clause | 5b5027a6e84324bc09ad3ba29d84e54c51d33b45 | achabotl/pambox | tests/conftest.py | rejected_duplicate | Near-duplicate of sample 8978 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a solution for problem 35."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\n A solution for problem 35 from Project Euler.\n https://projecteuler.net/problem=35\n\n The number, 197, is called a... | python | new_file | 4 | 3 | mit | 80c1af071c0942060a00de40f14c5ab5fec36e0d | smillet15/project-euler | problem35.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens... | python | edit | 1 | 0 | apache-2.0 | f2fa55c8d2f94bd186fc6c47b8ce00fb87c22aaf | alsrgv/tensorflow,annarev/tensorflow,sarvex/tensorflow,ppwwyyxx/tensorflow,chemelnucfin/tensorflow,jalexvig/tensorflow,ageron/tensorflow,gunan/tensorflow,gautam1858/tensorflow,seanli9jan/tensorflow,girving/tensorflow,jart/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,xzturn/tensorflow,aldian/ten... | tensorflow/contrib/autograph/converters/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a python script to filter out all DICOM constants."
},
{
"role": "assistant",
"content": "# DICOM_constant_filter.py\r\n# Strip out a list of all constant names from the list of source files in the location provided\r\n# and ... | python | new_file | 1 | 0 | mit | e3cad9bfa134900218bb8502698f8bcf147ff474 | jimbo00000/Rift-Volume,jimbo00000/Rift-Volume | tools/DICOM_constant_filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the handshake functions."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom .handshake import *\nfrom .handshake import accept # private API\n\n\nclass HandshakeTests(unittest.TestCase):\n\n def... | python | new_file | 12 | 1 | bsd-3-clause | e2b3934dfa9793759802afb2204d5068f21fc2d1 | aaugustin/websockets,aaugustin/websockets,aaugustin/websockets,dommert/pywebsockets,aaugustin/websockets,andrewyoung1991/websockets,biddyweb/websockets | websockets/test_handshake.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add framework for counting command"
},
{
"role": "assistant",
"content": "import discord\nfrom stickord.registry import Command\n\n@Command(['tellen', 'tel'])\nasync def counting(cont, mesg, client, *args, **kwargs):\n count, ... | python | new_file | null | null | mit | b8572aa26114bd9792b83dfb9187e466537303fa | RobinSikkens/Sticky-discord | stickord/commands/games.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add module of IO examples.\n\nGetting this into the manual is the next step."
},
{
"role": "assistant",
"content": "\nimport fiona\n\n# This module contains examples of opening files to get feature collections in\n# different way... | python | new_file | 1 | 0 | bsd-3-clause | 3ae053008cc8ab7b8bac2a392cd95a12fc38974e | perrygeo/Fiona,Toblerity/Fiona,Toblerity/Fiona,rbuffat/Fiona,perrygeo/Fiona,rbuffat/Fiona,johanvdw/Fiona | examples/io.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sample for set chlauth"
},
{
"role": "assistant",
"content": "'''\n This sample will create a new local queue.\n MQWeb runs on localhost and is listening on port 8081.\n'''\nimport sys\nimport json\nimport httplib\nimport soc... | python | new_file | 3 | 0 | mit | cd74d2af4d0d09f8ba2b6aefffde14cc233740b7 | fbraem/mqweb,fbraem/mqweb,fbraem/mqweb | samples/python/chlauth_set.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights build palindrome problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Build Palindrome Problem\n\n\ndef buildPalindrome(st):\n if st == st[::-1]:\n return st\n for i... | python | new_file | 1 | 4 | mit | 69277650b4f1f118a76a7be74f14a71a74849d0c | HKuz/Test_Code | CodeFights/buildPalindrome.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to process EnergyPlus SQL and create json result files."
},
{
"role": "assistant",
"content": "\nimport os\nimport pandas as pd\nimport sqlite3\nimport json\n\n\ninput_path=''\ninput_filenames = [\"0101000000.sql\", \"... | python | new_file | 2 | 1 | mit | d56da91c5613b281ebd90a7391429ebac0d83159 | design-generator/data,design-generator/data | scripts/process_results.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Network IP availability API's new policy rules\n\nRelated-blueprint: bp/secure-rbac-roles\nChange-Id: I21a016a6aa58dc78fc67af093933caaf94991fbd"
},
{
"role": "assistant",
"content": "# Copyright (c) 2021 Red Hat Inc... | python | new_file | 1 | 1 | apache-2.0 | 1785b211a017b25b2b180a042b58a15ae0ff7d7a | openstack/neutron,openstack/neutron,mahak/neutron,mahak/neutron,openstack/neutron,mahak/neutron | neutron/tests/unit/conf/policies/test_network_ip_availability.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the start of a test of the RP class."
},
{
"role": "assistant",
"content": "import eos_defns\nimport SR1d\nfrom numpy.testing import assert_allclose\n\ndef test_standard_sod():\n \"\"\"\n Relativistic Sod test.\n \n ... | python | new_file | 1 | 1 | mit | 152f9a2410bc3714ca8c9395295ff67f30ebd548 | harpolea/r3d2 | test_SR1d.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.