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 a script that will use pyinstaller to create an exe."
},
{
"role": "assistant",
"content": "\"\"\"\r\nBuild (freeze) the versionhero program.\r\n\"\"\"\r\nimport os\r\n\r\n\r\ndef main():\r\n \"\"\"\r\n Run this main fu... | python | new_file | 1 | 1 | apache-2.0 | 13e07eac9c69ed49210695a8465679c3df480d50 | chadgra/versionhero | build.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add DNS injection test for detecting censorship when DNS inject happens"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\nfrom twisted.python import usage\nfrom twisted.internet import defer\n\nfrom ooni.templates... | python | new_file | 4 | 3 | bsd-2-clause | c32514d224704cdd247a3b1da3519af277065d8e | lordappsec/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,kdmurray91/o... | nettests/experimental/dns_injection.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Test that there are no ambiguous dispatch definitions\n\nAuthor: Phillip Cloud <<EMAIL>>\n\nCloses #1026 from cpcloud/test-amb and squashes the following commits:\n\n073d7b8 [Phillip Cloud] TST: Test that there are no ambiguous dispatch... | python | new_file | 1 | 1 | apache-2.0 | 318656f44d4f987e912229f83192c2d8adf97142 | ibis-project/ibis,deepfield/ibis,cpcloud/ibis,cpcloud/ibis,deepfield/ibis,ibis-project/ibis,deepfield/ibis,cloudera/ibis,cpcloud/ibis,cpcloud/ibis,cloudera/ibis,deepfield/ibis,ibis-project/ibis,ibis-project/ibis,cloudera/ibis | ibis/pandas/tests/test_core.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Index Build (project_id, patch_id, date_created)"
},
{
"role": "assistant",
"content": "\"\"\"Index Build.project_id,patch_id,date_created\n\nRevision ID: 21b7c3b2ce88\nRevises: 4134b4818694\nCreate Date: 2013-12-03 16:19:11.7949... | python | new_file | 1 | 1 | apache-2.0 | 0c537c9cb0d6899557fd0cce125bf35a626493cf | dropbox/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,dropbox/changes | migrations/versions/21b7c3b2ce88_index_build_project_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add API tests for profile delete\n\nAdd API tests for profile delete\n\nChange-Id: I47a733ce203ba76fc57080a1b086661720e83930"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"... | python | new_file | 1 | 1 | apache-2.0 | c87e206d524137e9e76166faf20d5b1e10419220 | openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin,stackforge/senlin | senlin/tests/tempest/api/profiles/test_profile_delete.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add API test for receiver list\n\nAdd API test for receiver list\n\nChange-Id: I45d63410dc3a8cf361fe2ca446439abd0e9c2cec"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); y... | python | new_file | 1 | 3 | apache-2.0 | 8ef4bb66c77fd0643b5d5a0b99290da05bcdce47 | openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin,stackforge/senlin | senlin/tests/tempest/api/receivers/test_receiver_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read data from file and split the data nad print"
},
{
"role": "assistant",
"content": "openFile = open(\"sample.txt\")\nfor line in openFile:\n line = line.rstrip()\n if not line.startswith(\"From \"):\n continue\n ... | python | new_file | 2 | 0 | mit | 4e6f834056141667fdbbe4e5a1101f65d5cb61a8 | rahulbohra/Python-Basic | 66_split_file_in_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add outline of INDRA-based graph completeness checker\n\nThis is what we talked about @sgebel. This can be modified to give name-based checking instead of node-based checking as well as relation-level checking between nodes"
},
{
"ro... | python | new_file | 1 | 7 | mit | 61f93dabbf740572b2e7a415198a68e6a165cdeb | pybel/pybel-tools,pybel/pybel-tools,pybel/pybel-tools | src/pybel_tools/assess_completeness.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Replace `ord` depends on Python version"
},
{
"role": "assistant",
"content": "from six import PY3, binary_type\n\n__all__ = 'byte_to_int',\n\n\ndef byte_to_int(x):\n if PY3 and isinstance(x, binary_type):\n return x\n ... | python | new_file | 1 | 3 | mit | 795d22c113951e45803baadde2c4c95ba05de4c9 | Blizzard/s2protocol | s2protocol/compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create and find cases that were viewed two years ago\n\nSteps:\n1. Create 3 case: one new case and two cases with their 'created' property set to 3 years ago\n2. Create an event log for each case with code property 'CASE_VIEWED'\n3. The new ... | python | new_file | 1 | 1 | mit | b846a96e10eaac0bb9e90086198ce1175758adb6 | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/cla_eventlog/tests/test_find_and_delete_old_cases.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2016 Cloudbase Solutions Srl\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy o... | python | edit | 1 | 1 | apache-2.0 | 62c24f6edaa91834d4a7b2a3f9b99b8b96322230 | rahulunair/nova,gooddata/openstack-nova,mikalstill/nova,mahak/nova,Juniper/nova,mahak/nova,mikalstill/nova,Juniper/nova,rahulunair/nova,gooddata/openstack-nova,vmturbo/nova,openstack/nova,Juniper/nova,jianghuaw/nova,openstack/nova,gooddata/openstack-nova,klmitch/nova,gooddata/openstack-nova,jianghuaw/nova,klmitch/nova,... | nova/policies/hide_server_addresses.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Grid: Add a simple set of tests for explicit grid sampling"
},
{
"role": "assistant",
"content": "from parcels import Grid\nimport numpy as np\nimport pytest\n\n\n@pytest.fixture\ndef grid(xdim=200, ydim=100):\n \"\"\" Standar... | python | new_file | 1 | 3 | mit | 76f037ee6aa4fb54cf483f44f0a8dfa098d1f57c | OceanPARCELS/parcels,OceanPARCELS/parcels | tests/test_grid_sampling.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for DatasourceContext"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom chassis.services import data_context\nfrom chassis.test.services.foo_context import FooContext\n\n\nclass UnextendedDatasourceCont... | python | new_file | 4 | 1 | mit | 0086ac0d96e2093fa56b9a6ccc26b38d9fe30497 | refinery29/chassis,refinery29/chassis | chassis/test/services/data_context_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic \"copy_app\" mgmt cmd"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, print_function, unicode_literals\n\nfrom django.core.management import BaseCommand\n\nfrom corehq.apps.app_manager.dba... | python | new_file | 3 | 2 | bsd-3-clause | a2e16379067b37a12e147ee2b35fbebdadc17451 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds/management/commands/copy_icds_app.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to suspend users"
},
{
"role": "assistant",
"content": "from django.contrib.auth import get_user_model\nfrom django.core.management.base import BaseCommand, CommandError\n\nUserModel = get_user_model()\n\n\... | python | new_file | 1 | 8 | mit | 0de96828c959ef2dd3c007618c81e1b8f8a42f77 | PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans | open_humans/management/commands/suspend_users.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add iterative approach that changes to quickly"
},
{
"role": "assistant",
"content": "\"\"\"\r\nIn a given grid, each cell can have one of three values:\r\n\r\nthe value 0 representing an empty cell;\r\nthe value 1 representing a... | python | new_file | 5 | 9 | mit | 28407c8761d22c46c302342d2bcd2bf2a1c274b9 | lemming52/white_pawn,lemming52/white_pawn | leetcode/q994/solution.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for list project users when no user\n\nThere was no test that shows what happens when you list project users\n(GET /v2.0/tenants/{tenant_id}/users) and a user with a role on the\nproject doesn't exist. The server returns a 404 Not F... | python | new_file | 1 | 1 | apache-2.0 | 44e0336db0af70acc0ff890e6dd512bb3ce01065 | cernops/keystone,reeshupatel/demo,promptworks/keystone,nuxeh/keystone,idjaw/keystone,mahak/keystone,blueboxgroup/keystone,ilay09/keystone,openstack/keystone,ilay09/keystone,vivekdhayaal/keystone,nuxeh/keystone,reeshupatel/demo,jamielennox/keystone,UTSA-ICS/keystone-kerberos,jumpstarter-io/keystone,ilay09/keystone,klmit... | keystone/tests/test_v2_controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: hslog: Add some tests for an empty game"
},
{
"role": "assistant",
"content": "import pytest\nfrom io import StringIO\nfrom hearthstone.enums import PowerType\nfrom hearthstone.hslog import LogParser\n\n\nEMPTY_GAME = \"\"\"\nD 0... | python | new_file | 3 | 1 | mit | bf90cd6fd3966eb2d96a9357593f8cfc13daab12 | HearthSim/python-hearthstone | hearthstone/hslog/tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write basic unit tests for scatter argument checks"
},
{
"role": "assistant",
"content": "\"\"\"test_visualise.py\nUnit testing for the pointcloud.visualise module\n\"\"\"\nimport pytest\nfrom simulocloud.visualise import scatter... | python | new_file | 5 | 1 | mit | f328e60bf62e7bee662113f9f2fdb41f69b3ee24 | stainbank/simulocloud | tests/test_visualise.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to tools/security to check consistency of message file owners.\n\nPeriodic use of this script will show places where the OWNERS files\nhave become inconsistent. This poses a problem for CL authors when\nthe reviewer they have sel... | python | new_file | 2 | 4 | bsd-3-clause | 86ba77f9aa26ccc70d45596745b6532b5eeeff52 | hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-c... | tools/security/check_message_owners.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test with each example image in the repository"
},
{
"role": "assistant",
"content": "#!/usr/bin/env py.test\n# -*- coding: utf-8 -*-\n# Created on Fri Apr 25 02:33:04 2014\n# License is MIT, see COPYING.txt for more details.\n# ... | python | new_file | 1 | 3 | mit | cdc40da26edfcb00a1da3125a925232fc947d143 | danilobellini/fractals | test_fractal.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create file for positive is_valid tests"
},
{
"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 m... | python | new_file | 3 | 0 | mit | 74798cdc6a68e30fcb0583f69fd9dd361608988b | PatrikValkovic/grammpy | tests/rules_tests/isValid_tests/ValidRulesTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a YouCompleteMe configuration file that contains C-family compilations tags specific to Plexus"
},
{
"role": "assistant",
"content": "def Settings(**kwargs):\n return {\n 'flags': [\n '-pthread',\n ... | python | new_file | 1 | 1 | mit | dffb641b91e8f02750b4b925a7e2eb0d30a2e96d | mertyildiran/Plexus,mertyildiran/Plexus | plexus/.ycm_extra_conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration (only changes verbose names)."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport partialdate.fields\n\n\nclass... | python | new_file | 1 | 0 | bsd-3-clause | bb3e67e317eb97929f8dcb79184afee767b4caae | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | genealogio/migrations/0005_auto_20150223_2319.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add export mapping cache tests"
},
{
"role": "assistant",
"content": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\nimport mock\nfrom collections import defa... | python | new_file | 1 | 11 | apache-2.0 | 6c293b42bdae81082c73754b8cf2d8616cbf1ec2 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | test/integration/ggrc/converters/test_base_block.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for taking heap snapshot"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\n# https://chromedevtools.github.io/debugger-protocol-viewer/tot/HeapProfiler/\n\nimport json\n\nimport requests\nimport seleniu... | python | new_file | 1 | 0 | mit | 8e328a265e624c3dad6ea702d61475308bbce1ff | bayandin/devtools-proxy,bayandin/devtools-proxy | examples/heap_snapshot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for display module."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"\nTests for board display engine\n\"\"\"\nimport pytest\nfrom fen import Position\nfrom display import render_ascii_board\n\n@pyte... | python | new_file | 3 | 1 | mit | 4887243e578e175ee97740cc275a69f32fedd669 | gisraptor/fen-parser | test_display.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a skeleton of builder test."
},
{
"role": "assistant",
"content": "\"\"\"\ntest.test_builder\n~~~~~~~~~~~~~~~~~\n\nThis is the unit test file for site builder.\n\n:Copyright: Copyright 2014 Yang LIU <<EMAIL>>\n:License: BSD, ... | python | new_file | 1 | 3 | bsd-3-clause | 3e509b8350c79d1f65dee45faac025e3942fa80f | zesik/zkb | test/test_builder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add negative tests for deleting attached volume\n\nDue to lack of an error handling, Nova's delete-volume API returns\nHTTP500 error when deleting an attached volume.\nThis patch adds the corresponding test for reproducing the problem\non th... | python | new_file | 1 | 2 | apache-2.0 | 4d547c1ed3c5d28770b75f183e9c34c0083e0f7e | openstack/tempest,Juniper/tempest,vedujoshi/tempest,Tesora/tesora-tempest,openstack/tempest,vedujoshi/tempest,sebrandon1/tempest,Tesora/tesora-tempest,masayukig/tempest,sebrandon1/tempest,cisco-openstack/tempest,cisco-openstack/tempest,masayukig/tempest,Juniper/tempest | tempest/api/compute/volumes/test_attach_volume_negative.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make a list of all non-edX people from people.yaml"
},
{
"role": "assistant",
"content": "\"\"\"Produce a list of the emails of all non-edX people in people.yaml\"\"\"\n\nimport yaml\n\nwith open(\"people.yaml\") as people_yaml:\... | python | new_file | 2 | 0 | apache-2.0 | 30bb17a94cb6c5c31b3e6f87a9b6f17fc86012ba | edx/repo-tools,edx/repo-tools | non-edx-people.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to print reward table."
},
{
"role": "assistant",
"content": "import numpy as np\n\nimport common\n\n\ndef print_reward(inpaths, legend, budget=1e6, last=1e5, sort=False):\n runs = common.load_runs(inpaths, budget)\n ... | python | new_file | 1 | 12 | mit | 76b62e4be81ec06f9b0b5611abb3f49ba2a41dae | danijar/crafter | analysis/print_reward.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for \"use_default\"."
},
{
"role": "assistant",
"content": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work fo... | python | new_file | 1 | 1 | apache-2.0 | ae558a68765cd884f1d702ebe613c173faaff062 | Itxaka/st2,tonybaloney/st2,Itxaka/st2,StackStorm/st2,pinterb/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,grengojbo/st2,grengojbo/st2,jtopjian/st2,peak6/st2,emedvedev/st2,alfasin/st2,emedvedev/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,lakshmi-kannan/st2,emedvedev/st2,StackStorm/st2,pixelrebel/st2,denny... | st2common/tests/unit/test_json_schema.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple wrapper script for command line usage"
},
{
"role": "assistant",
"content": "import click\n\nfrom thinglang import run\n\n\n@click.command()\n@click.argument('file', type=click.File('r'))\ndef thinglang(file):\n sou... | python | new_file | 1 | 1 | mit | 00a312cd7e4928d859dbe7cfc68719d814439b1f | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/tl.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD Django migration for change in Post model"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-02-02 02:07\nfrom __future__ import unicode_literals\n\nfrom django.db import migr... | python | new_file | 1 | 0 | mit | f9b87b08db621fe0f2c39ba7f03b586b09e521bd | semitki/semitki,semitki/semitki,semitki/semitki,semitki/semitki | api/sonetworks/migrations/0002_auto_20170202_0207.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests for server.HTTPServer.bind_addr"
},
{
"role": "assistant",
"content": "\"\"\"Tests for the HTTP server.\"\"\"\n# -*- coding: utf-8 -*-\n# vim: set fileencoding=utf-8 :\n\nimport os\nimport tempfile\nimport threadi... | python | new_file | 1 | 4 | bsd-3-clause | 32ec67c2a4fa0e225e9edef03cd59b4f1a509db8 | cherrypy/cheroot | cheroot/test/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a client to migrate from ResultParent.user_agent_list to ResultParent.user_agent_pretty"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2.4\n#\n# Copyright 2009 Google Inc.\n#\n# Licensed under the Apache License, Ver... | python | new_file | 2 | 7 | apache-2.0 | 241f4bb835c3335819f66a25367336470d7e3583 | elsigh/browserscope,elsigh/browserscope,elsigh/browserscope,elsigh/browserscope | bin/result_updater.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for PropertyModTracker plugin"
},
{
"role": "assistant",
"content": "import sqlalchemy as sa\nfrom sqlalchemy_continuum.plugins import PropertyModTrackerPlugin\nfrom tests import TestCase\n\n\nclass TestPropertyModifica... | python | new_file | 1 | 1 | bsd-3-clause | 0b1a4a57a9e8f9e7038fb4330cbac68596f5960c | avilaton/sqlalchemy-continuum,piotr-dobrogost/sqlalchemy-continuum,rmoorman/sqlalchemy-continuum,kvesteri/sqlalchemy-continuum | tests/plugins/test_property_mod_tracker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to backfill is_squashed on squashable models"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2.8 on 2019-12-09 21:03\n\nfrom django.db import migrations\n\nBATCH_SIZE = 2500\n\n\ndef populate_is_squas... | python | new_file | 1 | 3 | bsd-3-clause | 0a0ed8d26f930d80bf38164d5010b96007e17bfd | rapidpro/casepro,rapidpro/casepro,rapidpro/casepro | casepro/statistics/migrations/0015_populate_is_squashed.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add iOS api for spatial orientation"
},
{
"role": "assistant",
"content": "'''\niOS Spatial Orientation\n-----------------------\n\n'''\n\nfrom plyer.facades import SpatialOrientation\nfrom pyobjus import autoclass\n\n\nclass iOS... | python | new_file | 1 | 1 | mit | 41a4a37dae64813b6e6c2e1b78dc75cd0847a587 | kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,KeyWeeUsr/plyer,kivy/plyer | plyer/platforms/ios/spatialorientation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the view class required to moderate account deletion requests."
},
{
"role": "assistant",
"content": "# Copyright 2011 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you ... | python | new_file | 1 | 1 | apache-2.0 | 43d038920a7e4e0b352c42675646a19285c1fb60 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gci/views/moderate_delete_account.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for VATINField, VATINValidator"
},
{
"role": "assistant",
"content": "import unittest\nfrom decimal import Decimal as D\nfrom oscar_vat_moss.fields import * # noqa\nfrom django.core.exceptions import ValidationErr... | python | new_file | 11 | 2 | bsd-3-clause | 5aebcc61f12087b4f2e594b28264b8601722af93 | hastexo/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss,fghaas/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss,hastexo/django-oscar-vat_moss,fghaas/django-oscar-vat_moss | tests/test_fields.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for response codes for /search route"
},
{
"role": "assistant",
"content": "from .helpers import BaseApplicationTest\n\n\nclass TestApplication(BaseApplicationTest):\n def test_search_with_query(self):\n respo... | python | new_file | 1 | 1 | mit | fbb6fee97a668e716028f4cecefb698824cb2933 | alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,mtekel/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,mtekel/digitalmar... | tests/test_search.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial Falcon API tests"
},
{
"role": "assistant",
"content": "import pytest\nimport msgpack\nfrom falcon import API, testing\n\nfrom pianodb.routes import ValidatorComponent, SongFinish\n\n\nTOKEN = 'CB80CB12CC0F41FC87CA6F2... | python | new_file | 3 | 1 | isc | 6c1815e30a66478b3534c42847b088a08ad71c90 | reillysiemens/pianodb | tests/test_routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to supervise gene mentions"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python3\n#\n# Perform distant supervision on gene mentions\n#\n# Each input row contains a mention and the sentence it is from\n#\n\nimp... | python | new_file | 1 | 10 | apache-2.0 | 64216937d00f7a5437da022eeff0a543059e89ed | rionda/dd-genomics,amwenger/dd-genomics,amwenger/dd-genomics,amwenger/dd-genomics,rionda/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics | code/supervise_gene_mentions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial gpio commands to python file"
},
{
"role": "assistant",
"content": "import RPi.GPIO as gpio\n\n#use board numbering on the pi\n\ngpio.setmode(gpio.BOARD)\n\ngpio.setup(40, gpio.OUT)\ngpio.setup(38, gpio.IN)\n\n#true a... | python | new_file | 1 | 0 | mit | 9f4978ff189c6fc8a2f4c263d43b10644c1e978e | emgreen33/easy_bake,emgreen33/easy_bake | easy_bake.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n replaces = [(b'chat', '0001_squashed_0008_auto_20150702_1437'), (b'chat', '0002_... | python | edit | 1 | 0 | mit | 91e7a4f36637e7706dd17f1e093fe029f031bc3d | gtklocker/ting,sirodoht/ting,gtklocker/ting,odyvarv/ting-1,VitSalis/ting,mbalamat/ting,VitSalis/ting,gtklocker/ting,sirodoht/ting,odyvarv/ting-1,gtklocker/ting,dionyziz/ting,mbalamat/ting,VitSalis/ting,odyvarv/ting-1,dionyziz/ting,mbalamat/ting,VitSalis/ting,odyvarv/ting-1,dionyziz/ting,mbalamat/ting,sirodoht/ting,dion... | API/chat/migrations/0001_squashed_0002_auto_20150707_1647.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a program to Convert String to Camel Case"
},
{
"role": "assistant",
"content": "# python3\n# \n# Sample Input: min value array\n# Sample Output: minValueArray\n#\ninputString = input().strip().split(' ')\n\nresult = inpu... | python | new_file | 1 | 0 | mit | f64e2f17f2e4b69790d6dccf3279c36659d499a0 | laxmena/CodeKata,laxmena/CodeKata | strToCamelCase.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create database row class (DBRow)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\n dbcol.py: DBCol is a struct describing an sqlite database table column\n\"\"\"\n\nfrom dbcol import *\n\n\n# ------------... | python | new_file | 3 | 8 | mit | 11abd1c48968e0fd14eb8879fd64af35af9e1e20 | rlinguri/pyfwk | pyfwk/struc/dbrow.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to parse pagerank results."
},
{
"role": "assistant",
"content": "import pandas as pd\nimport argparse\nimport glob\nimport os\n\nif __name__ == \"__main__\":\n\n parser = argparse.ArgumentParser(description='Proces... | python | new_file | 3 | 0 | mit | 21f1f9ea6abbf5b2fc7f851224821d8e94864372 | geektoni/Influenza-Like-Illness-Predictor,geektoni/Influenza-Like-Illness-Predictor | data_analysis/parse_pagerank.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport os\n\nCONFIG_PATH = '/genconf/config.yaml'\nSSH_KEY_PATH = '/genconf/ssh_key'\nIP_DETECT_PATH = '/genconf/ip-detect'\nSERVE_DIR = '/genconf/serve'\nSTATE_DIR = '/genconf/state'\nGENCONF_DIR = '/genconf'\n\nlog = loggi... | python | edit | 1 | 0 | apache-2.0 | 7c4cf25868a907eb3ac718b2d4dbef2966fbe806 | lingmann/dcos,xinxian0458/dcos,amitaekbote/dcos,branden/dcos,dcos/dcos,xinxian0458/dcos,surdy/dcos,lingmann/dcos,mesosphere-mergebot/dcos,jeid64/dcos,surdy/dcos,mesosphere-mergebot/mergebot-test-dcos,darkonie/dcos,mnaboka/dcos,mnaboka/dcos,dcos/dcos,jeid64/dcos,vishnu2kmohan/dcos,GoelDeepak/dcos,darkonie/dcos,asridhara... | ext/dcos-installer/dcos_installer/util/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a more simple MasterQA example"
},
{
"role": "assistant",
"content": "from seleniumbase import MasterQA\n\n\nclass MasterQATests(MasterQA):\n\n def test_masterqa(self):\n self.open(\"http://xkcd.com/1700/\")\n ... | python | new_file | 1 | 1 | mit | 08834282a5b3aec366d594bbd6d1f866876a7cb1 | possoumous/Watchers,ktp420/SeleniumBase,mdmintz/seleniumspot,ktp420/SeleniumBase,mdmintz/SeleniumBase,ktp420/SeleniumBase,possoumous/Watchers,mdmintz/seleniumspot,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,possoumous/Watchers,possoumous/Watchers,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,ktp420/SeleniumBas... | examples/basic_masterqa_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for polymorphic inheritance"
},
{
"role": "assistant",
"content": "\"\"\"Example of using polymorphic inheritance features to keep multiple related\nmodels in a single collection\"\"\"\n\nimport uuid\n\nfrom modularod... | python | new_file | 1 | 0 | apache-2.0 | 46f3909e6f50d7832db1331a74916e47d656d459 | CenterForOpenScience/modular-odm,sloria/modular-odm,icereval/modular-odm,chrisseto/modular-odm | examples/polymorphic_inheritance.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db.models.sql.expressions import SQLEvaluator\nfrom django.db.models.expressions import ExpressionNode\n\n\nOPERATION_MAP = {\n ExpressionNode.ADD: lambda x, y: x + y,\n ExpressionNode.SUB: lambda x, y: x - y,\n Express... | python | edit | 1 | 4 | bsd-3-clause | 1124da4ea6c30f0c36854ec938aa9ea60cca73d4 | django-nonrel/djangoappengine,Implisit/djangoappengine,dwdraju/djangoappengine | djangoappengine/db/expressions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for email logic (just config)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport mock\nimport unittest\n\nimport logic.email\n\n\nclass EmailTest(unittest.TestCase):\n \"\"\"We really just want to ... | python | new_file | 1 | 1 | mit | 062a7beae15fbea11286b4c3266eae16ceb46a3d | Yelp/love,Yelp/love,Yelp/love | tests/logic/email_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for ordering of projects"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom django.conf import settings\n\n\ncla... | python | new_file | 1 | 0 | mit | 1e6eab50744e77c31918929c8ff825a59b41d292 | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | frigg/builds/migrations/0008_auto_20150216_0959.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Choose default tab on homepage in settings (following or all)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migratio... | python | new_file | 1 | 0 | apache-2.0 | cafa02b22a5b3600f9c46331bf73fa3a4bf75ed1 | rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,dburr/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI | api/migrations/0098_userpreferences_default_tab.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Bioregistry module"
},
{
"role": "assistant",
"content": "from indra.databases import bioregistry\n\n\ndef test_get_ns_from_bioregistry():\n assert bioregistry.get_ns_from_bioregistry('xxxx') is None\n assert ... | python | new_file | 1 | 1 | bsd-2-clause | 3b8326b8f0fc2ab9fec2bc25f1e05ad3ca4928bb | johnbachman/indra,bgyori/indra,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra | indra/tests/test_bioregistry.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to tell if an Explorer PHAT or HAT is available"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# coding: Latin-1\n\nfrom explorerhat import motor\n\n# If ImportError raised, the library is not installe... | python | new_file | 3 | 0 | mit | e7ced56f3776d78920caa28b6ced3e74b0738de9 | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | hardware/explorer_phat/has_explorer_phat_or_hat.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script used to generate urls test file.\n\nThank you @woxcab for the script."
},
{
"role": "assistant",
"content": "from urllib.parse import urljoin, urlparse\nfrom itertools import product\nimport csv\nimport posixpath\n\n\n... | python | new_file | 1 | 3 | unlicense | 09854094677961d6833a793584d2098264900ab5 | zachborboa/php-curl-class,php-curl-class/php-curl-class,zachborboa/php-curl-class,php-curl-class/php-curl-class,zachborboa/php-curl-class,php-curl-class/php-curl-class | tests/generate_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Drop the old xref table"
},
{
"role": "assistant",
"content": "\"\"\"Remove the match table.\n\nRevision ID: a8849e4e6784\nRevises: 2979a1322381\nCreate Date: 2020-03-14 20:16:35.882396\n\n\"\"\"\nfrom alembic import op\n\n# revi... | python | new_file | 1 | 1 | mit | b682339c19702e01de228d0ff982ca086ef9906f | pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph | aleph/migrate/versions/a8849e4e6784_match_table.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create OwnStorj backend engine module"
},
{
"role": "assistant",
"content": "from UI.utilities import account_manager\nfrom UI.engine import StorjEngine\nfrom ownstorj_config_manager import OwnStorjConfigManager\n\n# OwnStorj ba... | python | new_file | 3 | 2 | mit | 71267c56b3dbe1fafc953d676ee68da7a31aaa89 | lakewik/storj-gui-client | UI/flask_ownstorj/ownstorj/models/backend_engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 96"
},
{
"role": "assistant",
"content": "\"\"\"\nDefinition of ListNode\nclass ListNode(object):\n\n def __init__(self, val, next=None):\n self.val = val\n self.next = next\n\"\... | python | new_file | 2 | 4 | mit | e032e8156843109931c1f66e9deb64c580348ebf | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Easy/096_Partition_List.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a health check tool for use by the deployment tools.\n\nBug: 812965\nChange-Id: I3edcc8830f186c6b02e3d2071a8d7c73b54a4193\nReviewed-on: https://chromium-review.googlesource.com/940382\nReviewed-by: Marc-Antoine Ruel <<EMAIL>>\nCommit-Que... | python | new_file | 2 | 2 | apache-2.0 | f3b32a91e2f7ae5a04b19f2c5918f24e443033ad | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | appengine/swarming/tools/health_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for Speaker.biography.\n\nSee 370690e."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.13 on 2018-01-26 18:57\nfrom __future__ import unicode_literals\n\nfrom django... | python | new_file | 1 | 0 | bsd-3-clause | 7d828d3715e2cca4e3a073c1f71bf16a5e4d8c38 | pydata/symposion,pydata/symposion | symposion/speakers/migrations/0007_add_biography_help_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Atlas and Mkl checkers."
},
{
"role": "assistant",
"content": "from numscons.checkers.new.common import \\\n save_and_set, restore, get_initialized_perflib_config\n\n# Performance library checks\ndef _check_perflib(context... | python | new_file | 1 | 4 | bsd-3-clause | bf51bd060eaaa139851300bf9deed9096afc23e1 | cournape/numscons,cournape/numscons,cournape/numscons | numscons/checkers/new/perflib_checkers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a XML pareser for GO OBO XML"
},
{
"role": "assistant",
"content": "import xml.etree.ElementTree as ElementTree\n\nclass GOXMLParser(object):\n\n def go_term_information(self, xml):\n tree = ElementTree.fromstring(x... | python | new_file | 1 | 1 | isc | ebfdc2e87a6798cfd0e3aae1e974069c828fbc4d | konrad/kufpybio | kufpybio/goxmlparser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration file for ash impact file path."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migr... | python | new_file | 1 | 0 | bsd-2-clause | 68ed2a5c2dfa24551ea936aa52e98525acbe9d42 | AIFDR/inasafe-django,AIFDR/inasafe-django,AIFDR/inasafe-django,AIFDR/inasafe-django | django_project/realtime/migrations/0035_ash_impact_file_path.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add program to convert from PML to XML"
},
{
"role": "assistant",
"content": "#!/usr/bin/env/python\n\nimport sys\nimport os.path\nimport subprocess\n\n\n# Read in a pml file and save to an xml file\ndef translate_pml_file(xml_fi... | python | new_file | 3 | 2 | mit | e3c6bc1a8ac54fa4613fdd96f9e5aeebfed32c68 | CS4098/GroupProject,CS4098/GroupProject,CS4098/GroupProject | src/main/translator-xml/PMLToXML.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add merge sort practice of python int list."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\n\ndef merge_sorted_list(alist, blist):\n \"\"\" Use merge sort to sort sorted alist and blist, and return merged sort... | python | new_file | 1 | 8 | apache-2.0 | a7f4a0395848fa96b584d24576c13a0533c1296d | sjh/python | merge_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 678. Valid Parenthesis String\n\n678. Valid Parenthesis String: https://leetcode.com/problems/valid-parenthesis-string/\n\nApproach1:\n DFS with cutting"
},
{
"role": "assistant",
"content": "from collectio... | python | new_file | 4 | 13 | apache-2.0 | 7476d0695b0c39ddf2d55988daaf838c8ba3003e | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/valid-parenthesis-string.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for invalid parametrized usage cases"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom tests.compiler import compile_snippet\nfrom thinglang.compiler.errors import UnfilledGenericParameters\n\n\ndef test_both_... | python | new_file | 1 | 1 | mit | c339c54d44963ece2ef3a29787f4475e8736824e | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/compiler/test_parametrized_usage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to stream h264 frames from uv4l"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport requests\n\nframes = []\ndata = b\"\"\nfound_first = False\nresponse = requests.get(\"http://navigation.local:8080/s... | python | new_file | 1 | 0 | bsd-3-clause | 2f4be8ad7234ab59fc6e98b8353a40195dd08ffb | gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2 | scripts/video/get_stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test 'annotate_object' for a WAF rule"
},
{
"role": "assistant",
"content": "# Copyright 2015 Isotoma Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complian... | python | new_file | 1 | 1 | apache-2.0 | b3466bc6ce36383eba573457cba34087fd54c84a | yaybu/touchdown | touchdown/tests/test_aws_waf_rule.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example simulation setup for an ultracold neutral plasma."
},
{
"role": "assistant",
"content": "import ucilib.Sim as Sim\nimport ucilib.BorisUpdater as BorisUpdater\nimport numpy as np\n\n\n# Some helpful constants.\nfund... | python | new_file | 1 | 0 | mit | 450c79939e20f6d9d49729f6c941e7fc8e06950b | Tech-XCorp/ultracold-ions,hosseinsadeghi/ultracold-ions,hosseinsadeghi/ultracold-ions,Tech-XCorp/ultracold-ions | examples/ultracoldNeutralPlasma.py | rejected_duplicate | Near-duplicate of sample 8916 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for get_or_create util"
},
{
"role": "assistant",
"content": "import unittest\nimport os, sys\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\\\\\"))\n\nfrom app import create_app, db\nfrom app.utils... | python | new_file | 1 | 1 | mit | 531d11ea10064fdbbad85b482bcdf075529c977d | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for ABC-specific getblocktemplate behavior\n\nSummary:\nFirst step in T1014\n\nAs we modify behavior in getblocktemplate, we really need better test coverage.\nD7201 (f8360b5e981) is one such change. This patch tests that behavior... | python | new_file | 1 | 2 | mit | f02132a0d60bfe37febe4dd42fb17a5dd96c4698 | Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc | test/functional/abc_mining_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 5010 generic ISA facade tests."
},
{
"role": "assistant",
"content": "import datetime\nimport os\nimport unittest\n\nfrom tigershark.facade.common import IdentifyingHeaders\nfrom tigershark.parsers import IdentifyingParser\n\... | python | new_file | 1 | 1 | bsd-3-clause | 1049ee1d79d5c4aa80f44011d0ee21df1226c5fc | jdavisp3/TigerShark,jdavisp3/TigerShark,jdavisp3/TigerShark,jdavisp3/TigerShark | tests/test_identifying_headers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Save and load persistent state."
},
{
"role": "assistant",
"content": "import os\nimport errno\nimport uuid\n\nimport msgpack # we're using it anyway...\n\ndef read_state():\n sfile = '/tmp/raft-state'\n try:\n with... | python | new_file | 3 | 3 | unlicense | 66f2f1caf8b9f7e5325111a995b993d61df9aed1 | kurin/py-raft | raft/store.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to list scheduled checkins"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# This script retrieves a detailed list of the currently running checkins\n\nimport argparse\nimport concurrent.futures\nimport... | python | new_file | 3 | 3 | mit | 44da0c97ac662375dd45d201cce88c32896ca361 | DavidWittman/serverless-southwest-check-in | scripts/list-checkins.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for failing commands because of n_args"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"Fail commands because of arguments test for vimiv's test suite.\"\"\"\n\nfrom unittest import ... | python | new_file | 1 | 5 | mit | fcb9d55dd5bdaae2ec088b576f9ee78ac81a4b1a | karlch/vimiv,karlch/vimiv,karlch/vimiv | tests/fail_arguments_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Linear Algebra python Example"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# Linear Algebra with Python\nimport numpy as np\n\ndef numpy_show():\n # create a column vector\n col_vec = np.array([[1], [2]])\n... | python | new_file | 31 | 1 | mit | 99bf15563d495f5772d82dae4bf6511b88c2c45b | nachovizzo/AUTONAVx,nachovizzo/AUTONAVx,nachovizzo/AUTONAVx | Algebra_Geometry/linear_algebra.py | rejected_lint | Too many lint violations: 31 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to renumber antennas to below 256 in uvfits files"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\nA command-line script for renumbering antenna numbers > 255 if possible in uvfits files.\n\"\"\"... | python | new_file | 2 | 0 | bsd-2-clause | bda3fa5dfea480f8db5393602616d6a4b430175e | HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata | scripts/renumber_ants.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to build API docs."
},
{
"role": "assistant",
"content": "# Copyright 2021 Google LLC\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with ... | python | new_file | 3 | 1 | apache-2.0 | b81540972a24ee3146c6035ebeaacb7fbc785f13 | quantumlib/OpenFermion-FQE,quantumlib/OpenFermion-FQE,quantumlib/OpenFermion-FQE | dev/docs/build_api_docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils import timezone\nfrom datetime import datetime\n\n# Create your models here.\n\n\nclass DoorStatus(models.Model):\n datetime = models.DateTimeField(default=timezone.now)\n status = model... | python | edit | 4 | 1 | mit | 3771d3165d4873592f53d8b2401806297fe2989f | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | door/models.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new stats management command"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport arrow\n\nfrom django.contrib.auth import get_user_model\nfrom django.core.management.base import BaseCommand\nfrom django.d... | python | new_file | 4 | 2 | mit | 7f22d9687563660852926333a9c8bacaa31df591 | PersonalGenomesOrg/open-humans,OpenHumans/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans,PersonalGenomesOrg/open-humans,OpenHumans/open-humans,OpenHumans/open-humans,PersonalGenomesOrg/open-humans | open_humans/management/commands/stats_new.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to print the initial password for an account\n\n(imported from commit 0a2b7d8215961801dbd24d9af89785e857b9ba14)"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\n... | python | new_file | 3 | 3 | apache-2.0 | 8a1ba0d7200ea72e20ab1db5a62c3e36ce7f8489 | souravbadami/zulip,tbutter/zulip,PaulPetring/zulip,he15his/zulip,avastu/zulip,littledogboy/zulip,glovebx/zulip,hafeez3000/zulip,DazWorrall/zulip,littledogboy/zulip,tdr130/zulip,zwily/zulip,mdavid/zulip,MayB/zulip,tommyip/zulip,ashwinirudrappa/zulip,niftynei/zulip,jackrzhang/zulip,MariaFaBella85/zulip,brockwhittaker/zul... | zephyr/management/commands/print_initial_password.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add convert to shellcode tool"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\nimport sys, subprocess, os, re\n\nif len(sys.argv) < 3:\n print('Incorrect usage')\n exit(1)\n\nif not os.path.isfile(sys.argv[1]):\n ... | python | new_file | 1 | 0 | mit | a18da9856a95f7206f2ee49f728b8e8ba5f12814 | reykjalin/tools,reykjalin/tools | CLI/convSH.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for TableTextLoaderFactory"
},
{
"role": "assistant",
"content": "\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nimport pytest\n\nimport pytablereader as ptr\n\n\nclass Test_TableTextLoaderFactory:\... | python | new_file | 1 | 1 | mit | 78cf46620600998af834c9a99df07e18f302a282 | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | test/factory/test_text_loader_factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for unyt.testing module"
},
{
"role": "assistant",
"content": "\"\"\"\nTest unyt.testing module that contains utilities for writing tests.\n\n\"\"\"\n\n# -----------------------------------------------------------------... | python | new_file | 1 | 1 | bsd-3-clause | f8c597e5318501ad84a0332a62c02a446685dd26 | yt-project/unyt | unyt/tests/test_unyt_testing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new, simpler example"
},
{
"role": "assistant",
"content": "from strip_recipes import RecipeFile\n\nrecipe = RecipeFile()\nrecipe.record_start('example01')\nrecipe.sbs_on()\n\nfor cur_gate in (10.0, 20.0, 50.0):\n\trecipe.b... | python | new_file | 1 | 0 | mit | 61af01f79158dffeb9e4649cbaa98a9cb77cfd99 | lspestrip/strip_recipes | examples/example01.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add automated tests for literature reference module."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\nCreated by: Lee Bergstrand (2017)\n\nDescription: A simple unittest for testing the literature reference... | python | new_file | 1 | 1 | apache-2.0 | 94d808cf8c353a49161ac6b1ff9c40671e82f9bd | LeeBergstrand/pygenprop | modules/testing/test_literature_reference.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests running against a live Gerrit server\n\nChange-Id: I313a9132d2de7a87b3257af7846febb64b3873ee"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# The MIT License\n#\n# Copyrig... | python | new_file | 1 | 1 | mit | 68693163fc4bcc7432a9890a37721cac3641ca51 | dpursehouse/pygerrit2 | livetests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for pickling doc"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nimport pickle\n\nfrom ...language import Language\n\n\ndef test_pickle_single_doc():\n nlp = Language()\n doc = nl... | python | new_file | 1 | 2 | mit | 45d1dd90b1794897d72b25d9090bed785387560f | explosion/spaCy,aikramer2/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,aikramer2/spaCy,honnibal/spaCy,recognai... | spacy/tests/doc/test_pickle_doc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add result buffering/batch processing example."
},
{
"role": "assistant",
"content": "\"\"\"\nProcess 20 lines of output at a time.\n\nExample runs:\npython buffer_results.py\n\"\"\"\nimport sys\nimport time\nimport drainers\n\n#... | python | new_file | 4 | 3 | bsd-3-clause | 354fcdbe045e80119b1edd4b322589e56df09c39 | nvie/python-drainers,nvie/python-drainers | examples/buffer_results.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for queue implementation"
},
{
"role": "assistant",
"content": "import unittest\nfrom queue import Queue\n\n\nclass TestStringMethods(unittest.TestCase):\n\n def test_enqueue_to_empty_queue(self):\n queue = Qu... | python | new_file | 1 | 1 | mit | d4f53913c2e3aee61fe59e42a66e0ac279b186a1 | julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/training,julianespinel/training,julianespinel/trainning | data-structures/queue/queue_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nwkhtmltopdf Blueprint\n\nblueprints:\n - blues.wkhtmltopdf\n\n\"\"\"\nfrom fabric.decorators import task\n\nfrom refabric.context_managers import sudo\nfrom refabric.contrib import blueprints\n\nfrom . import debian\n\n__all__ = ['... | python | edit | 1 | 1 | mit | 61b36218cc0cf74e90ac7ee8d7f02b1ffffe3890 | gelbander/blues,andreif/blues,chrippa/blues,5monkeys/blues,adisbladis/blues,5monkeys/blues,Sportamore/blues,adisbladis/blues,andreif/blues,gelbander/blues,chrippa/blues,Sportamore/blues,jocke-l/blues,jocke-l/blues,andreif/blues,Sportamore/blues,adisbladis/blues,gelbander/blues,chrippa/blues,5monkeys/blues,jocke-l/blues | blues/wkhtmltopdf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for Receipt created field"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport datetime\nfrom django.utils.timez... | python | new_file | 1 | 0 | mit | cb8977ed160933701dd6588150ee0f00d14511b6 | trimailov/finance,trimailov/finance,trimailov/finance | books/migrations/0002_auto_20151116_2351.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add computing frequencies with mismatches"
},
{
"role": "assistant",
"content": "from neighbors import neighbors\nfrom pattern_to_number import pattern_to_number\n\ndef computing_frequencies_with_mismatches(text, k, d):\n freque... | python | new_file | 2 | 3 | mit | 4e2e9ba9336d2e60084cda9623e7573785f4f0e0 | dennis95stumm/bioinformatics_algorithms,dennis95stumm/bioinformatics_algorithms | computing_frequencies_with_mismatches.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run test suite on a wheel in a virtualenv\n\n[skip ci]"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\nTests a .whl file by installing it and pytest into a virtual environment and\nrunning the ... | python | new_file | 1 | 7 | bsd-3-clause | 5147674980d3d81314bbe3e5ddbad4c01e9ffc21 | chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d,chandler14362/panda3d | makepanda/test_wheel.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create initial RDFa tests as their own top-level test module."
},
{
"role": "assistant",
"content": "\"\"\"Unit tests utilizing RDFa parsing. Primarily cc.license.formatter.\"\"\"\n\nimport cc.license\nimport rdfadict\nimport rdf... | python | new_file | 1 | 1 | mit | 9d91e0dd2d6175fe1a45d1a556a33c08133185b3 | creativecommons/cc.license,creativecommons/cc.license | cc/license/tests/test_rdfa.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.