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: git: Add hook to prevent student changes to top level files/dirs"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport subprocess\nimport sys\n\nif __name__ == '__main__':\n\n ref_name = sys.argv[1]\n old_... | python | new_file | 1 | 0 | mit | cc8e9b9576cf08d7a91508e8f629104f5fef0c54 | MarkUsProject/Markus,benjaminvialle/Markus,benjaminvialle/Markus,benjaminvialle/Markus,MarkUsProject/Markus,MarkUsProject/Markus,MarkUsProject/Markus,benjaminvialle/Markus,MarkUsProject/Markus,benjaminvialle/Markus,benjaminvialle/Markus,MarkUsProject/Markus,benjaminvialle/Markus,MarkUsProject/Markus,MarkUsProject/Marku... | lib/repo/git_hooks/update.d/02-block_change_top_level_folders.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add FindMinn.py file, which contains O(n) and O(n**2) methods in finding the minimum number in a random list.\n\nAdd author and email."
},
{
"role": "assistant",
"content": "__author__ = \"Claytonbat\"\nfrom random import randran... | python | new_file | 1 | 5 | mit | bae805afa67bbced9a968b12c38e1b22e05f8f61 | mcsoo/Exercises | Findminn.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add BM string search algorithm implementation"
},
{
"role": "assistant",
"content": "# -*- coding:utf-8 -*-\n\n\ndef build_bad_char_map(pattern_s, sz=256):\n bcmap = [-1] * sz\n for i,s in enumerate(pattern_s):\n bcm... | python | new_file | 4 | 6 | apache-2.0 | 4e9ec5bd0219d4fdda55113f16471bab5d7e41d7 | free-free/algorithm,free-free/algorithm | string/bm.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to download slack archives"
},
{
"role": "assistant",
"content": "\"\"\"A script to download slack archives.\"\"\"\n\nfrom os.path import abspath, dirname, join\n\nfrom splinter import Browser\nfrom splinter.exceptions... | python | new_file | 1 | 1 | bsd-3-clause | d18b86de344ea720451feece2ebbaee8b0eb3d1e | punchagan/parktain,punchagan/parktain,punchagan/parktain | scripts/download_archive.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small script to get public ip"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"Get your public IP address from a UDP socket connection\n\"\"\"\n\nimport socket as _socket\n\n\ndef get_my_ip(host, port=80)... | python | new_file | 1 | 2 | bsd-3-clause | 5244c06403aa82c920b742cf22e60adc34c72295 | eddiejessup/ciabatta | Scripts/get-my-ip.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to split data into train/validation/test datasets"
},
{
"role": "assistant",
"content": "import os\nimport random\nimport shutil\n\ntrain_split_percent, validation_split_percent, test_split_percentage = 70, 20, 10\n\nd... | python | new_file | 1 | 0 | apache-2.0 | 914cb7d5eac4598474c3473568ec9705f5485dae | tomwhite/set-game,tomwhite/set-game,tomwhite/set-game | split-training.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Time Laps python file\n\nAdd Time Laps python file, exciting. Reference:\nhttp://www.makeuseof.com/tag/raspberry-pi-camera-module/"
},
{
"role": "assistant",
"content": "import time\n\nimport picamera\n\n \n\nVIDEO_DAYS = 1\n... | python | new_file | 1 | 1 | mit | c389c560cda1d4a3bc9a13dafb006e89d4cafa8f | RoelofZA/WeatherStation | timelaps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plugin for finding bidirecitonal sypanses missing edges."
},
{
"role": "assistant",
"content": "from tulip import *\nimport tulipplugins\nimport tulippaths as tp\nfrom FileOutputPlugin import FileOutputPlugin\n\n\nclass Bidir... | python | new_file | 2 | 6 | mit | 3545caa05b5ef9a123b438884c2a32989fa47319 | visdesignlab/TulipPaths,visdesignlab/TulipPaths | plugins/BidirectionalSynapseCleanup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small script to print out db stats"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Dump stats for raw and queue.\n\nimport os\nimport time\nimport pymongo\nimport json\n\nconn = pymongo.Connection()\n\n# db ->... | python | new_file | 2 | 0 | mit | 56da9b10abcc94a341488e5032e5617d0def9d56 | emarschner/gothub,emarschner/gothub,emarschner/gothub,emarschner/gothub | mongo_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add stub test file for Distributed Array Protocol."
},
{
"role": "assistant",
"content": "import unittest\nimport distarray as da\nfrom distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError\n\n\nclass TestDistrib... | python | new_file | 1 | 2 | bsd-3-clause | 9232d69874ae5d1b2b7ae86476aa690a1bb89029 | enthought/distarray,RaoUmer/distarray,enthought/distarray,RaoUmer/distarray | distarray/core/tests/test_distributed_array_protocol.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom nose2.tests._common import FunctionalTestCase\n\n\nclass TestPluggableTestProgram(FunctionalTestCase):\n def test_run_in_empty_dir_succeeds(self):\n proc = self.runIn('scenario/no_tests')\n stdout, stderr = proc.commun... | python | edit | 1 | 1 | bsd-2-clause | 577d13a232b426960dae0b28c63ecac7c33b2643 | ojengwa/nose2,ezigman/nose2,leth/nose2,little-dude/nose2,ptthiem/nose2,leth/nose2,ezigman/nose2,ojengwa/nose2,ptthiem/nose2,little-dude/nose2 | nose2/tests/functional/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to speed test the feedback."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#import httplib\nimport json\nimport os\nimport sys\nimport time\nimport urllib2\n\nimport ipaddr\n\nnb_ip = 250\n#nb_ip = 20\... | python | new_file | 5 | 0 | bsd-3-clause | aa2983686245f79e39aff81f88834375ca2a1b7b | lisa-lab/pings,lisa-lab/pings,lisa-lab/pings,lisa-lab/pings | client/test_feedback_proxy.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a model to store references to program's static content."
},
{
"role": "assistant",
"content": "# Copyright 2013 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may no... | python | new_file | 1 | 0 | apache-2.0 | d3c95eb39a7fbaa2028b00176e71b192bf6d6e1b | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gci/models/static_content.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create script runing predictions for each rep and each fold"
},
{
"role": "assistant",
"content": "import synthetic_data_experiments as sde\n\nimport logging\n\nif __name__ == \"__main__\":\n args = sde.get_integrous_arguments... | python | new_file | 5 | 0 | mit | 0bef2f3c6307ccdc8222e68d224d7c9aac215237 | chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan,chagaz/sfan | code/run_predictions.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 2d plot example for batch iteration optimizers"
},
{
"role": "assistant",
"content": "\"\"\"Visualizes batch ('population') optimizers as 2D plots.\"\"\"\n\nimport numpy as np\nfrom heuristic_optimization.optimizers import Pa... | python | new_file | 1 | 3 | mit | fecd1e39592ea420039be37717f2b641249b5458 | tjanson/heuristic_optimization | examples/plot_2d.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for analyzing stimulus waveforms"
},
{
"role": "assistant",
"content": "import numpy as np\n\n\ndef square_pulses(trace, baseline=None):\n \"\"\"Return a list of (start, stop, amp) tuples describing square pulses\n ... | python | new_file | 1 | 5 | mit | dc136bb96455944436b56e39ce6929799036bfa8 | campagnola/neuroanalysis | neuroanalysis/stimuli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow came swap between two applications."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport httplib\nimport json\n\nif len(sys.argv) != 3:\n print \"\"\"ERROR: wrong number of argument... | python | new_file | 3 | 2 | mit | 60c70bf439d35238c0331b665ece60cf9718cf0f | emerleite/tsuru-swap-cname | src/swap-cname.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add debugpanel for Muffin Debugtoolbar"
},
{
"role": "assistant",
"content": "import logging\nimport jinja2\nimport datetime as dt\n\nfrom muffin_debugtoolbar.panels import DebugPanel\nfrom muffin_debugtoolbar.utils import Loggin... | python | new_file | 1 | 2 | mit | 32912c8c5c02d1922f56bac4b8c97f4e53eccb81 | klen/muffin-peewee | muffin_peewee/debugtoolbar.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read from serial, write to CVS"
},
{
"role": "assistant",
"content": "__author__ = 'miahi'\n\n## Serial logger for APC Smart UPS\n\nimport serial\nimport csv\nimport time\nimport datetime\n\nPORT = 'COM2'\nBAUDRATE = 2400\nSLEEP_... | python | new_file | 3 | 2 | mit | c10ace67fcb209955647426ac776fd1821fb6f86 | miahi/python.apcserial | read_serial.py | rejected_duplicate | Near-duplicate of sample 6101 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add derived generator Apply which allows to apply a function to a set of input generators"
},
{
"role": "assistant",
"content": "from .base import TohuBaseGenerator\n\n\nclass Apply(TohuBaseGenerator):\n\n def __init__(self, f... | python | new_file | 1 | 3 | mit | 9cb23fe24ddf244b3e2569ce1760202995ab035d | maxalbert/tohu | tohu/v3/derived_generators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2016 Intel, Inc.\n# Copyright (c) 2013 OpenStack Foundation\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 Lic... | python | edit | 1 | 1 | apache-2.0 | adf46f5b90d04ce8e26701810b6c23bc230ddc37 | openstack/nova,klmitch/nova,klmitch/nova,mahak/nova,phenoxim/nova,gooddata/openstack-nova,mikalstill/nova,gooddata/openstack-nova,mahak/nova,rahulunair/nova,klmitch/nova,klmitch/nova,rahulunair/nova,mikalstill/nova,gooddata/openstack-nova,mikalstill/nova,rahulunair/nova,openstack/nova,phenoxim/nova,openstack/nova,mahak... | nova/conf/consoleauth.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add text to speech example."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Asks for coffee using different Python modules.\n\nRequires macspeechX module:\n* https://pypi.python.org/py... | python | new_file | 1 | 0 | bsd-3-clause | 64806d4b3a0fb277ffe07e9d9670c4e80563f56b | audreyr/useful | text_to_speech.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add openfda1 get drugs practice"
},
{
"role": "assistant",
"content": "import http.client\nimport json\n\nheaders = {'User-Agent': 'http-client'}\n\n\nconn = http.client.HTTPSConnection(\"api.fda.gov\")\n\n# Get a https://api.fd... | python | new_file | 1 | 0 | apache-2.0 | a4a25587edbfef824b131c22f8fb6c17ccce6abe | acs-test/openfda,acs-test/openfda | openfda-1/get_drug.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Json unit test file"
},
{
"role": "assistant",
"content": "'''\n\nCreated on: June 5th, 2016\n@author: Numair Mansur (<EMAIL>)\n\n'''\n\n\nimport unittest\nclass TestJsonMethods(unittest.TestCase):\n\n def test_json_bas... | python | new_file | 1 | 1 | bsd-3-clause | 18e14ba67c245f2a9ec24b05d5c504452a1f299d | aaronkl/RoBO,aaronkl/RoBO,aaronkl/RoBO,automl/RoBO,numairmansur/RoBO,automl/RoBO,numairmansur/RoBO | robo/test/test_json_dump.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add search manager from metronom"
},
{
"role": "assistant",
"content": "import re\n\nfrom django.db import models\nfrom django.db.models import Q\n\n\ndef normalize_query(query_string,\n findterms=re.compile(r'... | python | new_file | 3 | 10 | bsd-3-clause | 4fe2cd2bbb83fff577bab7811a5ba5ba634d9146 | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | towel/managers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Work on parts of functional API"
},
{
"role": "assistant",
"content": "def layerize(begin_update=None, **kwargs):\n '''Wrap a function into a layer'''\n if begin_update is not None:\n return FunctionLayer(begin_updat... | python | new_file | 10 | 2 | mit | 449c48db23a76ec1d2f04045d111d968b6df469e | explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc | thinc/api.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add concurrent.future ti Python prototypes"
},
{
"role": "assistant",
"content": "# concurrent.futures - Launch parallel tasks\nimport concurrent.futures as ft\n\ndef main():\n with ft.ThreadPoolExecutor(max_workers=1) as exec... | python | new_file | 1 | 1 | apache-2.0 | 118fc8570b15700a62e5cb5aa7c3d1bfe70c9dc6 | yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes | Python/concurrency/furutes_prot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: CVE-2020-14215: Add migration to clear INVITED_AS_REALM_ADMIN.\n\nThis migration fixes any PreregistrationUser objects that might have\nbeen already corrupted to have the administrator role by the buggy\noriginal version of migration 0198_pr... | python | new_file | 1 | 1 | apache-2.0 | 9f4905d7e3f42002209d8ce46435d3b9447de588 | hackerkid/zulip,punchagan/zulip,shubhamdhama/zulip,shubhamdhama/zulip,shubhamdhama/zulip,rht/zulip,shubhamdhama/zulip,kou/zulip,brainwane/zulip,brainwane/zulip,hackerkid/zulip,brainwane/zulip,showell/zulip,punchagan/zulip,timabbott/zulip,rht/zulip,kou/zulip,zulip/zulip,zulip/zulip,kou/zulip,brainwane/zulip,showell/zuli... | zerver/migrations/0261_pregistrationuser_clear_invited_as_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012-2013, Mark Peek <<EMAIL>>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty\nfrom .compat import policytypes\nfrom .validators import boolean\n\n\nclass Subscriptio... | python | edit | 10 | 0 | bsd-2-clause | edcde8ed3562e19b7bde43632965c2902a8e7f25 | cloudtools/troposphere,cloudtools/troposphere,ikben/troposphere,ikben/troposphere | troposphere/sns.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for load_for_view_safely and parse_safely"
},
{
"role": "assistant",
"content": "from crosscompute.exceptions import DataTypeError\nfrom crosscompute.types import DataType\nfrom pytest import raises\n\n\nclass ADataType... | python | new_file | 3 | 3 | mit | 346188fe171b98aca87f3e5f96d6e41b1eb46fd1 | crosscompute/crosscompute,crosscompute/crosscompute,crosscompute/crosscompute,crosscompute/crosscompute | tests/test_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a file to test JIT related issues"
},
{
"role": "assistant",
"content": "import afnumpy\nfrom asserts import *\n\ndef test_conditionals():\n a = afnumpy.arange(10, dtype=\"float32\") - 5.\n b = afnumpy.ones((10), dtype=... | python | new_file | 2 | 1 | bsd-2-clause | a452eedc5f5a7e5f59776ba66a18f57c72bca3c4 | FilipeMaia/afnumpy,daurer/afnumpy | tests/test_jit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sleep functionality testing code"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n\"\"\"Puts sensor to sleep and waits for it to wakeup\"\"\"\n\nimport minimalmodbus\nimport serial\nfrom time import sleep\nfrom sys... | python | new_file | 1 | 0 | apache-2.0 | f2bbd5bd1eca7906d7d09bc595abd67af02b23ea | Miceuz/rs485-moist-sensor,Miceuz/rs485-moist-sensor | utils/sleepTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a helper tool for updating keystone"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sys\n\nfrom optparse import OptionParser\n\npossible_topdir = os.path.normpath(os.path.join(os.path.abspath... | python | new_file | 7 | 2 | apache-2.0 | f605c6918f0868fc46a15c08650e5406453451c5 | stackforge/anvil,mc2014/anvil,stackforge/anvil,mc2014/anvil | tools/key-update.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plugin for parse nginx error"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\nimport re\nfrom manager import Plugin\n\nclass NginxError(Plugin):\n\n def __init__(self, **kwargs):\n ... | python | new_file | 5 | 3 | apache-2.0 | 743ae5270d2ba24da652110a967f15b5fa526e3d | keepzero/fluent-mongo-parser | plugins/plugin_nginx_error.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple led chaser example.\n\nChange-Id: I18a5dc49d115d9f222ea2445a086fc9994adce06"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\"\"\"Demonstrates on board LED support with correct polarity.\n\nImplements si... | python | new_file | 1 | 0 | apache-2.0 | 981e8bb1898ef186e646beab98a637a2bcf8c9a0 | google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian | src/examples/gpiozero/led_chaser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a DB migration to create Templates.hidden column\n\nCreates the column as nullable, sets the value to false for all\nexisting templates and template versions and then applies a\nnot-nullable constraint.\n\nAll future Templates are create... | python | new_file | 1 | 1 | mit | 6d1439e39a2970eaa7c98cb0ee69b9b954fd1c16 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0168_hidden_templates.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals, division, absolute_import\nimport logging\n\nfrom flexget import plugin\nfrom flexget.event import event\n\nlog = logging.getLogger('priority')\n\n\n# TODO: 1.2 figure out replacement for this\nclass... | python | edit | 1 | 1 | mit | 3bcafade7e9a611d073a2baf3d66f46caee9b4aa | X-dark/Flexget,ianstalk/Flexget,JorisDeRieck/Flexget,Pretagonist/Flexget,ratoaq2/Flexget,X-dark/Flexget,qk4l/Flexget,tsnoam/Flexget,drwyrm/Flexget,crawln45/Flexget,cvium/Flexget,jawilson/Flexget,ratoaq2/Flexget,v17al/Flexget,grrr2/Flexget,patsissons/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,tarzasai/Flexget,qvazzler/Fl... | flexget/plugins/operate/feed_priority.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a config class for an opt out helper"
},
{
"role": "assistant",
"content": "from vumi.config import Config, ConfigBool, ConfigList\n\n\nclass OptOutHelperConfig(Config):\n case_sensitive = ConfigBool(\n \"Whether ca... | python | new_file | 1 | 0 | bsd-3-clause | d7c2fdca488761aecc2ba1cfd80e44af3de2ea2b | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/vumitools/opt_out/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add forgotten migration to OSBS app"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n... | python | new_file | 1 | 0 | mit | df438a82cb78ecb0404b39182b7a4e049fbac2f9 | pombredanne/product-definition-center,xychu/product-definition-center,product-definition-center/product-definition-center,pombredanne/product-definition-center,product-definition-center/product-definition-center,tzhaoredhat/automation,xychu/product-definition-center,pombredanne/product-definition-center,lao605/product-... | pdc/apps/osbs/migrations/0002_auto_20151001_1115.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python script to create .alfredsnippets file from plist."
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nimport binascii\nimport json\nimport os\nimport plistlib\nimport sys\nimport unicodeda... | python | new_file | 1 | 2 | mit | 00a52ec4453ee0bcd498c439e411bfcaad41a4fc | warpling/Macmoji,warpling/Macmoji | scripts/update-alfred.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Basic Admin Functionality for Estimators, EvaluationResult and DataSet"
},
{
"role": "assistant",
"content": "from django.contrib import admin\n\nfrom estimators.models import DataSet, Estimator, EvaluationResult\n\nadmin.sit... | python | new_file | 1 | 0 | mit | 16956e0d482e871ba2ff6800a107bd57ea0fdd9b | fridiculous/django-estimators | estimators/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new letter rates from 1st of October 2018"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0226_new_letter_rates\nRevises: 0225_another_letter_org\n\n\"\"\"\n\nrevision = '0226_new_letter_rates'\ndow... | python | new_file | 2 | 2 | mit | 8b410e8876835133b7f18e42754da7c793ce950f | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0226_new_letter_rates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for CtfManager."
},
{
"role": "assistant",
"content": "from contextlib import contextmanager\nfrom os.path import isfile, join\nimport shutil\nimport tempfile\n\nfrom numpy.testing import assert_allclose\n\nfrom en... | python | new_file | 1 | 2 | bsd-3-clause | dcfa7bfa11bea86d831959a217b558d704ece078 | dmsurti/ensemble | ensemble/ctf/tests/test_manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Test runs with no descriptors or no events."
},
{
"role": "assistant",
"content": "import event_model\nfrom intake_bluesky.core import documents_to_xarray\n\n\ndef test_no_descriptors():\n run_bundle = event_model.compose... | python | new_file | 1 | 1 | bsd-3-clause | b1eba723dbdc068558ab34cc226c32bcb8bfa2ef | ericdill/databroker,ericdill/databroker | intake_bluesky/tests/test_core.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for saving request data to file\n\nSigned-off-by: Christopher Arndt <<EMAIL>>"
},
{
"role": "assistant",
"content": "import mrequests\n\nhost = 'http://httpbin.org/'\n#host = \"http://localhost/\"\nurl = host + \"imag... | python | new_file | 1 | 0 | mit | 36d597c38537e68b648fb9c85e8ec448e324c41e | SpotlightKid/micropython-stm-lib | mrequests/examples/get_save_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix old tasks for stats too"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2017-06-02 21:04\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef ad... | python | new_file | 1 | 2 | bsd-3-clause | 87acd24224a648407bd0ee538db3c2a1f925a7b1 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/tasks/migrations/0024_auto_20170602_2304.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add correlation matrix heatmap example"
},
{
"role": "assistant",
"content": "\"\"\"\nCortical networks correlation matrix\n====================================\n\n\"\"\"\nimport seaborn as sns\nimport matplotlib.pyplot as plt\ns... | python | new_file | 1 | 0 | bsd-3-clause | 143e76eaf220e5200150653627642dc2bc3a645e | oesteban/seaborn,gef756/seaborn,arokem/seaborn,anntzer/seaborn,drewokane/seaborn,ischwabacher/seaborn,phobson/seaborn,ebothmann/seaborn,cwu2011/seaborn,sinhrks/seaborn,q1ang/seaborn,aashish24/seaborn,ashhher3/seaborn,dimarkov/seaborn,lypzln/seaborn,mwaskom/seaborn,JWarmenhoven/seaborn,olgabot/seaborn,dotsdl/seaborn,luk... | examples/network_correlations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test stub for crossref"
},
{
"role": "assistant",
"content": "##############################################################################\n# Name: test_crossref.py\n# Purpose: Test for verifying output the semantic verific... | python | new_file | 4 | 1 | mit | 081612c1a07422cfa5292482c409e46346d15dc5 | Ygg01/master | domm/tests/test_crossref.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python example - channel options"
},
{
"role": "assistant",
"content": "# Copyright 2018 gRPC authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance ... | python | new_file | 1 | 3 | apache-2.0 | cf09d16ca8c6852f39e9cc347e4d726a79d6c1cf | ejona86/grpc,grpc/grpc,carl-mastrangelo/grpc,ejona86/grpc,grpc/grpc,mehrdada/grpc,carl-mastrangelo/grpc,vjpai/grpc,carl-mastrangelo/grpc,ctiller/grpc,ejona86/grpc,donnadionne/grpc,grpc/grpc,nicolasnoble/grpc,vjpai/grpc,stanley-cheung/grpc,nicolasnoble/grpc,donnadionne/grpc,pszemus/grpc,muxi/grpc,vjpai/grpc,pszemus/grpc... | examples/python/helloworld/greeter_client_with_options.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Complete population script and seeding"
},
{
"role": "assistant",
"content": "import os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tango_with_django_project.settings')\n\nimport django\ndjango.setup()\n\nfrom rango.models ... | python | new_file | 1 | 1 | mit | 7d55f2a8fc5db6092abe1965da6c5ad0046a8d1e | dnestoff/Tango-With-Django,dnestoff/Tango-With-Django | populate_rango.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Rename tests file to test_*"
},
{
"role": "assistant",
"content": "import src.Cubie as Cubie\nimport unittest\n\nclass TestSticker(unittest.TestCase):\n def test_init(self):\n not_allowed_chars = 'acdefhijklmnpqstuvxz'\... | python | new_file | 1 | 3 | mit | b6920055ca0498bc621da51e5296a001415166dd | Wiston999/python-rubik | tests/test_Cubie.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 338. Counting Bits\n\n338. Counting Bits: https://leetcode.com/problems/counting-bits/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def count_bits(self, n):\n c = (n - ((n >> 1) &... | python | new_file | 2 | 1 | apache-2.0 | 2204ff556bf6257dcfeb39447b04607729d6b4d2 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/counting-bits.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for phone number template tag."
},
{
"role": "assistant",
"content": "from common.templatetags.common import phone_number\n\n\nclass TestPhoneNumberTag(object):\n \"\"\"Test cases for the phone number tag\"\"\"\n\n ... | python | new_file | 1 | 1 | mit | 315858ae41722442668e289f2c1492a591526f0f | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | chmvh_website/common/tests/templatetags/test_phone_number_tag.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test all builds.\n\nChange-Id: I6bbed8bcb2dfa3458ffc59179dfba66c92e18125"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport subprocess\nimport sys\n\ndef RunCommand(command):\n run = subprocess.Pope... | python | new_file | 3 | 6 | bsd-3-clause | 3a82bf4d0597c79a41029004b1a5622ad70268a9 | jmvalin/aom,ittiamvpx/libvpx,smarter/aom,shacklettbp/aom,mwgoldsmith/libvpx,Laknot/libvpx,altogother/webm.libvpx,Distrotech/libvpx,altogother/webm.libvpx,running770/libvpx,hsueceumd/test_hui,matanbs/vp982,Topopiccione/libvpx,zofuthan/libvpx,Laknot/libvpx,reimaginemedia/webm.libvpx,webmproject/libvpx,shareefalis/libvpx,... | all_builds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for Buckets\n\nThe others will require mocking a DB connection."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# This file is part of BridgeDB, a Tor bridge distribution system.\n#\n# :copyright: (c... | python | new_file | 2 | 1 | bsd-3-clause | 12311fff64dba06b24c66dd0523e52f3cd8927b9 | pagea/bridgedb,pagea/bridgedb | lib/bridgedb/test/test_Bucket.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command that deletes stale content types\n\n - nc-1511"
},
{
"role": "assistant",
"content": "from django.contrib.admin.models import LogEntry\nfrom django.core.management.base import BaseCommand\n\nfrom nodeconductor.cost_tr... | python | new_file | 2 | 5 | mit | 000266aed1f4c1106c791105427a7238add90a01 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/core/management/commands/removestalect.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 696. Count Binary Substrings\n\n696. Count Binary Substrings: https://leetcode.com/problems/count-binary-substrings/"
},
{
"role": "assistant",
"content": "from itertools import groupby\nclass Solution(object)... | python | new_file | 1 | 2 | apache-2.0 | acb985cf87917d7b29be517a5c5e2fd5285bebe1 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/count-binary-substrings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to create new database with all tables"
},
{
"role": "assistant",
"content": "# !/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom flask import current_app as app\nfrom flask_script import Command\nfrom project.database ... | python | new_file | 1 | 1 | mit | 2b3fcfbd9b497d3a162cb36af4eb28e619648258 | andreffs18/flask-template-project,andreffs18/flask-template-project,andreffs18/flask-template-project | project/commands/create_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Cover AggregateFilter with unit tests [WAL-397]"
},
{
"role": "assistant",
"content": "import mock\nfrom django.test import TestCase\n\nfrom nodeconductor.logging import models as logging_models\nfrom nodeconductor.logging.tests ... | python | new_file | 1 | 2 | mit | 5c0c8451f3975ae98be33e0f47dde73cb5a2e3ac | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/tests/unittests/test_filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for uart magma impl"
},
{
"role": "assistant",
"content": "import fault\nimport magma\nfrom txmod import TXMOD\nimport random\n\n\ndef get_random(port):\n if isinstance(port, magma.BitType):\n return random.cho... | python | new_file | 4 | 2 | mit | 3eb614d8c0edd1d52509c1ec7b48bba983600c35 | phanrahan/magmathon,phanrahan/magmathon | examples/uart/txmod_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for Kibana"
},
{
"role": "assistant",
"content": "# Copyright (C) 2014 Nicolas Lamirault <<EMAIL>>\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General... | python | new_file | 1 | 1 | apache-2.0 | 0a33ea9c108693e94405dbd964b9361bb2ae7e2a | portefaix/hyperion-k8s,portefaix/hyperion,nlamirault/hyperion | hyperiontests/test_kibana.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test the pipeline code for the MNase-seq pipeline"
},
{
"role": "assistant",
"content": "\"\"\"\n.. Copyright 2017 EMBL-European Bioinformatics Institute\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n ... | python | new_file | 1 | 2 | apache-2.0 | 48cd3380c23cc7a41917d281084c74420cd7b4f1 | Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq,Multiscale-Genomics/mg-process-fastq | tests/test_pipeline_mnaseseq.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing skimage script for valgrind\n\nUnreviewed.\n(RunBuilders:Test-Ubuntu12-ShuttleA-HD2000-x86_64-Release-Valgrind)\n\nReview URL: https://codereview.chromium.org/18301004\n\ngit-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9894 ... | python | new_file | 1 | 0 | bsd-3-clause | ba7548816106c652b8c85a9aa703b7d40b5c2307 | Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Ti... | slave/skia_slave_scripts/valgrind_run_decoding_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for the chainer."
},
{
"role": "assistant",
"content": "import pytest\n\nimport keyring.backends.chainer\nfrom keyring import backend\n\n\n@pytest.fixture\ndef two_keyrings(monkeypatch):\n def get_two():\n cl... | python | new_file | 1 | 1 | mit | a2400b6980089803b38121e20e2d24ee2f463eb1 | jaraco/keyring | keyring/tests/backends/test_chainer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version_info__ = (1, 3, 0, 'dev')\n\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join([str(i) for i in __version_info__[:-1]])\nif __version_info__[-1] is not None:\n __version__ += ('-%s' %... | python | edit | 1 | 1 | apache-2.0 | 558d3e45e8e7c81ab46b560e6c1beb791f1e935f | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | derrida/__init__.py | rejected_duplicate | Near-duplicate of sample 5061 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some basic tests of command-line interface"
},
{
"role": "assistant",
"content": "from tomso import cli\nimport unittest\n\ntmpfile = 'data/tmpfile'\n\nclass TestCLIFunctions(unittest.TestCase):\n\n def setUp(self):\n ... | python | new_file | 1 | 3 | mit | 7aa7d6222256b20fd256c27479e54594fc646405 | warrickball/tomso | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import division\n\nfrom django.utils.duration import _get_duration_components\n\nfrom datetime import timedelta\n\nfrom decimal import Decimal\n\n\ndef parse_duration(duration):\n hours = None\n minutes = None\n\n i... | python | edit | 1 | 8 | bsd-2-clause | f5915cf24dc7e6fed96700e00a3bbc6ccb6bc552 | cdubz/timestrap,overshard/timestrap,overshard/timestrap,cdubz/timestrap,muhleder/timestrap,cdubz/timestrap,overshard/timestrap,muhleder/timestrap,muhleder/timestrap | core/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial untested and unfinished front matter adding/converting script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\nimport sys, os\n\ndef main(argv):\n folder = argv[1]\n project = argv[2]\n\n # for each file i... | python | new_file | null | null | mit | 552d88f497557bc449d98b7828b47dbba2ab0150 | sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs,sensu/sensu-docs | insertFrontMatter.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add skeleton for query-processing module"
},
{
"role": "assistant",
"content": "# LING 573 Question Answering System\n# Code last updated 4/15/14 by Andrea Kahn\n# This code implements a QueryProcessor for the question answering ... | python | new_file | 2 | 2 | mit | 18085ebbf45473046980d182fe285d6663698e72 | amkahn/question-answering,amkahn/question-answering | src/query_processing/query_processing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a context processor for the COMMENTS_MODERATE_AFTER setting\n\ngit-svn-id: 9770886a22906f523ce26b0ad22db0fc46e41232@69 5f8205a5-902a-0410-8b63-8f478ce83d95"
},
{
"role": "assistant",
"content": "\"\"\"\nA context processor wh... | python | new_file | 1 | 0 | bsd-3-clause | fb19d7753073fb51da5a6fa1d458a3c8bca1d6b4 | clones/django-coltrane,mafix/coltrane-blog | coltrane/context_processors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to make inference set"
},
{
"role": "assistant",
"content": "\"\"\"\nCopies files from the original dataset for use with inference.\nNOTE: For inference, images need to be in the form:\n image{}.jpg where {} sho... | python | new_file | 1 | 3 | mit | 97e64eae02ef5f850f8b4bd2ad1028f59c8328c7 | CUFCTL/DLBD,CUFCTL/DLBD | Spring2018/src/make_inf_set.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: AlexBanks97\n# Purpose: LIFO Stack implementation using python array.\n# Date: October 15th 2017\n\nclass Stack(object):\n def __init__(self):\n # Initialize stack as empty array\n self.stack = []\n\n # Return ... | python | edit | 1 | 2 | cc0-1.0 | 5f385913ab06fc288c61d22d98f2f9a903194f8f | manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,Cnidarias/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-ri... | data_structures/Stack/Python/Stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate JSON with translation data\n\nTake the csv with the translation variables and\nvalues and convert it to a json file."
},
{
"role": "assistant",
"content": "import csv\nimport json\nimport collections\n\ndat... | python | new_file | 1 | 3 | apache-2.0 | 026e2b6ffc70fc1732ed6f69aa76d0c1263b0b09 | samanehsan/isp,CenterForOpenScience/isp,samanehsan/isp,CenterForOpenScience/isp,samanehsan/isp,CenterForOpenScience/isp | app/format_json.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for relative imports"
},
{
"role": "assistant",
"content": "from neomodel import StructuredNode, RelationshipTo, StringProperty\nfrom .test_relationships import Country\n\n\nclass Cat(StructuredNode):\n name = StringP... | python | new_file | 1 | 1 | mit | bda9c236c978601ea8c62c60488afaecc03f384f | pombredanne/neomodel,fpieper/neomodel,bleib1dj/neomodel,cristigociu/neomodel_dh,robinedwards/neomodel,wcooley/neomodel,andrefsp/neomodel,robinedwards/neomodel,bleib1dj/neomodel | test/test_relative_relationships.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Akhet installation script.\n\"\"\"\nimport os\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\nhere = os.path.abspath(os.path.dirname(__file__))\nREADME = open(os.path.join(here, \"README.txt\")).read()\nCHANGE... | python | edit | 1 | 0 | mit | 87a5419d9717d641bf4c30740d2d431f4fd7a478 | Pylons/akhet,hlwsmith/akhet,Pylons/akhet,hlwsmith/akhet,hlwsmith/akhet | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for grids."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nfrom __future__ import print_function, division\n\nimport numpy as np\nfrom sht.grids import standard_grid, get_cartesian_grid\n\ndef test_gri... | python | new_file | 3 | 1 | mit | 1c3141488f13819d76ca179984aed0cadf932d5c | praveenv253/sht,praveenv253/sht | tests/test_grids.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Store all the state of the canvas"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom reportlab.pdfgen.canvas import Canvas\n\n\nclass NumberedCanvasFactory(object):\n def __init__(sel... | python | new_file | 1 | 4 | mit | 91e33076e343c04aea8e905a96c07edb2da04700 | cecedille1/PDF_generator | pdf_generator/page_number.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the main server loop"
},
{
"role": "assistant",
"content": "import sys\nimport socket\nimport threading\n\n\ndef server_loop(local_host, local_port, remote_host, remote_port,\n receive_first):\n \"\"\"\n ... | python | new_file | 5 | 3 | mit | 792072f6e95101395f49f62ca6276eb287cbaf30 | inakidelamadrid/bhp_exercises | proxy.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: :memo: Add dummy models test file"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom labsys.inventory.models import (\n Product, StockProduct, Specification, OrderItem, Order, Transaction\n)\n\n'''\nTODO: Tests\n\nPr... | python | new_file | 9 | 0 | mit | b17b0f82b94aaba1f37b68d0660873a3c4329f8b | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys | tests/test_inventory/test_models.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a batch STS to ascii exporter"
},
{
"role": "assistant",
"content": "from PyQt4 import QtGui\nimport sys\nimport pyOmicron as pyO\nimport re\nimport numpy as np\n\napp=QtGui.QApplication(sys.argv)\npath=QtGui.QFileDialog.getE... | python | new_file | 1 | 0 | apache-2.0 | b5a7dba9339b199b96cbb0e0682b20437f738311 | scholi/pyOmicron | batchSTSconverter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add very basic tests for OAuth"
},
{
"role": "assistant",
"content": "from nose.tools import *\n\nfrom website.oauth.models import ExternalProvider\nfrom website.oauth.models import OAUTH1\nfrom website.oauth.models import OAUTH2... | python | new_file | 6 | 1 | apache-2.0 | a173a4f2922fe0f2b9e9f5162ceb947681c837ae | billyhunt/osf.io,SSJohns/osf.io,Nesiehr/osf.io,cosenal/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,laurenrevere/osf.io,ticklemepierce/osf.io,erinspace/osf.io,brianjgeiger/osf.io,fabianvf/osf.io,Nesiehr/osf.io,samchrisinger/osf.io,abought/osf.io,ticklemepierce/osf.io,TomBaxter/osf.io,danielneis/osf.io,hmoco/osf.io,ZobairAl... | tests/test_oauth.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to find files for DS/Run/LS"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport argparse\nfrom dbs.apis.dbsClient import DbsApi\n\n_PREFIX = 'root://eoscms.cern.ch//eos/cms/'\n\ndef getFilesForQuer... | python | new_file | 1 | 3 | mit | d55df3a30820b24e16beef1b5c824b8ef32b7d61 | rovere/utilities,rovere/utilities,rovere/utilities,rovere/utilities | select_files_for_runlumidataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add inotify alternative to watchdog\n\nWatchdog was not working as expected when used in a networking enviroment.\nInotify is used in directinotify.py to watch a directory for IN_CLOSE_WRITE"
},
{
"role": "assistant",
"content": ... | python | new_file | 1 | 4 | mit | 906741c38d074fec9d304a74c54937db0d569b95 | HaBaLeS/digital-mess-cleaner | directinotidy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a version of sensu checking script which works on monitoring-1"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding: utf-8\n\nimport datetime\nimport json\nimport requests\n\n\nJSON_REQUEST = {\n \"query\... | python | new_file | 1 | 3 | mit | bb3bab2b8efb49d8a3ac9070289681d12fb8c7e2 | alphagov/pp-puppet,alphagov/pp-puppet,alphagov/pp-puppet,alphagov/pp-puppet | modules/performanceplatform/files/sensu-elasticsearch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [data_analysis] Add algorithm to count the news and to produce an output file."
},
{
"role": "assistant",
"content": "\"\"\"Generate year files with news counts\nUsage:\n filter_news.py <directory> <output>\nOptions:\n -h, --he... | python | new_file | 1 | 0 | mit | fbc5215199af220fd0dcf6f0911363e5e8fe9190 | geektoni/Influenza-Like-Illness-Predictor,geektoni/Influenza-Like-Illness-Predictor | data_analysis/filter_news.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple switch/case usage example"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n'''\nSuppose you're trying to estimate someone's median household income\nbased on their current location. Perhaps they posted a ... | python | new_file | 3 | 0 | mit | 160049859e40855082f7482421df383a5ed80df4 | selik/destructure | examples/fips.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple test for %s"
},
{
"role": "assistant",
"content": "a = \"well\"\nb = \"seems to work\"\nc = \"something else\"\n\n# form 0\ns = \"b=%s\" % a\nprint s\n\n# form 1\ns = \"b,c,d=%s+%s+%s\" % (a, b, c)\nprint s\n"
}
] | python | new_file | 3 | 0 | mit | 7c6c9a688b33961b2eb904ee94e87ec90154260a | buchuki/pyjaco,chrivers/pyjaco,qsnake/py2js,chrivers/pyjaco,chrivers/pyjaco,buchuki/pyjaco,mattpap/py2js,buchuki/pyjaco,qsnake/py2js,mattpap/py2js | tests/strings/string_format_s_simple.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for converting a solarized dark file to solarized dark high contrast"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\n\nif sys.version_info < (3, 4):\n sys.exit('ERROR: Requires Python 3.4... | python | new_file | 1 | 9 | mit | 971570b4288c9ac7131a1756e17574acbe6d1b9a | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | python/misc/solarized-dark-high-contrast.py | rejected_duplicate | Near-duplicate of sample 7885 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test new language feature in cuda python"
},
{
"role": "assistant",
"content": "\"\"\"\nTest basic language features\n\n\"\"\"\nfrom __future__ import print_function, absolute_import, division\n\nimport numpy as np\nfrom numba im... | python | new_file | 1 | 2 | bsd-2-clause | e57fe864a312b6a1f5493c5b4687568bad99949c | jriehl/numba,numba/numba,pombredanne/numba,cpcloud/numba,gmarkall/numba,GaZ3ll3/numba,gdementen/numba,seibert/numba,stonebig/numba,GaZ3ll3/numba,stonebig/numba,seibert/numba,ssarangi/numba,gmarkall/numba,pitrou/numba,jriehl/numba,pombredanne/numba,numba/numba,IntelLabs/numba,stuartarchibald/numba,cpcloud/numba,gdemente... | numba/cuda/tests/cudapy/test_lang.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for converting json data blob to .db file"
},
{
"role": "assistant",
"content": "import json\nimport sys\nimport sqlite3\nimport os\n\n\nno_ending = os.path.splitext(sys.argv[1])[0]\nfile_fields = no_ending.split(\"_\"... | python | new_file | 1 | 0 | mit | 514e2b3ce6464bd9a4f926fb9c42789ab82bbbd2 | F1LT3R/bitcoin-scraper,F1LT3R/bitcoin-scraper | json_to_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial test for inheritance pattern compilation"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom tests.compiler import compile_snippet, A_INST, B_INST, C_INST, compile_base, A_THING, B_THING\nfrom thinglang.compi... | python | new_file | 3 | 1 | mit | 15916aa477163ce8613aaec61ab2a114018d1071 | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/compiler/test_inheritance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add nonworking tests for xml writer"
},
{
"role": "assistant",
"content": "import glob\nimport itertools as it\nimport os\n\nimport parmed as pmd\nfrom pkg_resources import resource_filename\nimport pytest\n\nfrom foyer import Fo... | python | new_file | 12 | 1 | mit | 50f837a89a2303d89a7831e0cf5a4afc99eb7026 | iModels/foyer,mosdef-hub/foyer,iModels/foyer,mosdef-hub/foyer | foyer/tests/test_xml_writer.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add yet another script, this one for doing an area graph of the wc-ng data\ncollected by gather-data.sh.\n\n* tools/dev/wc-ng/graph-data.py:\n New.\n\n\ngit-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@880258 13f79535-47bb-0310-9956-ffa... | python | new_file | 6 | 0 | apache-2.0 | b73fa8f8daaef9130563cfa2f7d0546c6e393d33 | YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion | tools/dev/wc-ng/graph-data.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a format_fname function which translates a absolute filename to a filename relative to the sys.path or relative to the project root"
},
{
"role": "assistant",
"content": "import os.path\nimport sys\n\nfrom flask import curren... | python | new_file | 3 | 8 | bsd-3-clause | d7b98f9e77caef34cff9fc7de19ac4980abb9d38 | lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,dianchang/flask-debugtoolbar | flaskext/debugtoolbar/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Memory component, inheriting from InputLayer"
},
{
"role": "assistant",
"content": "import theano\nimport theano.tensor as T\nimport numpy as np\n\nfrom lasagne.layers import InputLayer\n\n\nclass Memory(InputLayer):\n \"\... | python | new_file | 6 | 1 | mit | fe5d8c87f976d1d73f26f713919193da21a0ae84 | snipsco/ntm-lasagne | ntm/memory.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test writing XML to stdout (currently failing in py3)."
},
{
"role": "assistant",
"content": "from nose.tools import *\n\nimport beastling.beastxml\nimport beastling.configuration\n\ndef test_extractor():\n config = beastling.... | python | new_file | 2 | 1 | bsd-2-clause | ced1e16a316fb6f5b22f5da7bb130faf1477b400 | lmaurits/BEASTling | tests/stdout_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check stickers (find elements, locators, wait)"
},
{
"role": "assistant",
"content": "import pytest\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.common.exceptions import NoSuchElemen... | python | new_file | 1 | 3 | apache-2.0 | 1670ec1055ef6c957a319e683104081afd8db718 | eugene-petrash/selenium-webdriver-full-tutorial,eugene-petrash/selenium-webdriver-full-tutorial | python-example/test_check_stickers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add html to text script"
},
{
"role": "assistant",
"content": "import argparse\nimport html2text\nimport pypandoc\n\ndef main():\n p = argparse.ArgumentParser()\n h = html2text.HTML2Text()\n\n p.add_argument(\"filename\"... | python | new_file | 3 | 2 | mit | b6deb0495f1a31801d95e2d59de7ea2731eb8970 | dahlbaek/Ubuntu-dotfiles | home/bin/h2t.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool info for the witness linter."
},
{
"role": "assistant",
"content": "import benchexec.result as result\nimport benchexec.tools.template\n\n\nclass Tool(benchexec.tools.template.BaseTool2):\n \"\"\"\n Tool info for t... | python | new_file | 1 | 2 | apache-2.0 | 35b67e00e378df43a657c56bd751e7059ef45c38 | ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec | benchexec/tools/witnesslint.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check in a script to diagnose common system configuration problems.\n\nReview URL: https://chromiumcodereview.appspot.com/9309011\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98"
},
{
... | python | new_file | 4 | 3 | bsd-3-clause | 1fa0385bc8f0fc21233005c611b169fa5b95f993 | gavinp/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,ropik/c... | tools/diagnose-me.py | rejected_lint | Too many lint violations: 4 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.