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 handler for concurrently logging to a file"
},
{
"role": "assistant",
"content": "\n'''\nUtilities to assist with logging in python\n'''\n\nimport logging\n\n\nclass ConcurrentFileHandler(logging.Handler):\n \"\"\"\n A ... | python | new_file | 2 | 2 | mit | da2a4fa9e618b212ddbb2fcbc079fa37970ae596 | todddeluca/tfd | tfd/loggingutil.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial tests for alerter class"
},
{
"role": "assistant",
"content": "import unittest\nimport datetime\nimport Alerters.alerter\n\n\nclass TestAlerter(unittest.TestCase):\n\n def test_groups(self):\n config_options... | python | new_file | 1 | 1 | bsd-3-clause | eb1c7d1c2bfaa063c98612d64bbe35dedf217143 | jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor | tests/test_alerter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test_learning_journal.py with test_app() for configuring the app for testing"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom contextlib import closing\nimport pytest\n\nfrom journal import app\nfrom journ... | python | new_file | 4 | 1 | mit | 700db5c742be8a893b1c362ae0955a934b88c39b | sazlin/learning_journal | test_journal.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unit-test for thread_pool.py."
},
{
"role": "assistant",
"content": "import thread_pool\nimport unittest\nfrom six.moves import queue\n\nclass TestThreadPool(unittest.TestCase):\n\n def _producer_thread(self, results):\n ... | python | new_file | 1 | 2 | mit | 3ebb2731d6389170e0bef0dab66dc7c4ab41152e | graveljp/smugcli | thread_pool_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a plot just of backscatter phase vs. diameter.\n\nThis (mostly) reproduces a figure in Matrosov et al. 2002 in JAM."
},
{
"role": "assistant",
"content": "import matplotlib.pyplot as plt\nimport numpy as np\nimport scattering... | python | new_file | 1 | 2 | bsd-2-clause | b63e65b1a41f809caf1c2dcd689955df76add20f | dopplershift/Scattering | test/test_delta.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for asyncio coroutines"
},
{
"role": "assistant",
"content": "from trollius import test_utils\nfrom trollius import From, Return\nimport trollius\nimport unittest\n\ntry:\n import asyncio\nexcept ImportError:\n ... | python | new_file | 5 | 1 | apache-2.0 | 33658163b909073aae074b5b2cdae40a0e5c44e8 | overcastcloud/trollius,overcastcloud/trollius,overcastcloud/trollius | tests/test_asyncio.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing test data folder"
},
{
"role": "assistant",
"content": "# Copyright 2020 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 the L... | python | new_file | 1 | 1 | apache-2.0 | 744d7971926bf7672ce01388b8617be1ee35df0e | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-pl... | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add blink example on two different boards"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Author: Andrea Stagi <<EMAIL>>\n# Description: keeps your led blinking on 2 boards\n# Dependencies: None\n\nfrom nanpy im... | python | new_file | 1 | 0 | mit | 8a668efbc266802a4f4e23c936d3589b230d9528 | joppi/nanpy,nanpy/nanpy | nanpy/examples/blink_2boards.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script that dumps the python path"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\n\n# path[0], is the directory containing the script that was used to invoke the Python interpreter\nfor s in sorted... | python | new_file | 2 | 0 | apache-2.0 | a3939b572c51b7a721b758cb5b93364e4b156c13 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | dev_tools/syspath.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"tests/test_directives.py.\n\nTests to ensure that directives interact in the etimerpected mannor\n\nCopyright (C) 2015 Timothy Edmund Crosley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this soft... | python | edit | 1 | 1 | mit | 533559e20e377ce042591709e53d7dc7031d6205 | giserh/hug,STANAPO/hug,MuhammadAlkarouri/hug,janusnic/hug,MuhammadAlkarouri/hug,janusnic/hug,gbn972/hug,MuhammadAlkarouri/hug,STANAPO/hug,shaunstanislaus/hug,yasoob/hug,jean/hug,philiptzou/hug,philiptzou/hug,jean/hug,shaunstanislaus/hug,origingod/hug,giserh/hug,yasoob/hug,timothycrosley/hug,alisaifee/hug,timothycrosley... | tests/test_directives.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 513. Find Bottom Left Tree Value\n\n513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# c... | python | new_file | 1 | 4 | apache-2.0 | a8419c46ceed655a276dad00a24e21f300fda543 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/find-bottom-left-tree-value.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to synthesize all uploaded files. Patch by Dan Callahan."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\"\"\"\nThis script touches all files known to the database, creating a skeletal\nmirror for local deve... | python | new_file | 4 | 2 | bsd-3-clause | 51e04ff17bccb4b71b8d5db4057a782fd2f8520c | techtonik/pydotorg.pypi,techtonik/pydotorg.pypi | tools/touch_all_files.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Use Q-learning to learn all state-action values via self-play"
},
{
"role": "assistant",
"content": "'''\nIn this example we use Q-learning via self-play to learn\nthe value function of all Tic-Tac-Toe positions.\n'''\nfrom capst... | python | new_file | 4 | 0 | mit | 893e4292f6b1799bf5f1888fcbad41ec8b5a5951 | davidrobles/mlnd-capstone-code | examples/tic_ql_tabular_selfplay_all.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add partial evaluation tool to replace functools module for python < 2.5\n\nFrom: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>\n\ngit-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8"
},
{... | python | new_file | 1 | 4 | bsd-3-clause | b56690d046021e036b5b15c484d86c92f3519600 | shikhardb/scikit-learn,ClimbsRocks/scikit-learn,bthirion/scikit-learn,samuel1208/scikit-learn,sinhrks/scikit-learn,OshynSong/scikit-learn,ky822/scikit-learn,treycausey/scikit-learn,TomDLT/scikit-learn,RomainBrault/scikit-learn,zuku1985/scikit-learn,icdishb/scikit-learn,arabenjamin/scikit-learn,sarahgrogan/scikit-learn,... | scikits/learn/common/myfunctools.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\n\n\"\"\"\njrnl is a simple journal application for your command line.\n\"\"\"\n\n__title__ = 'jrnl'\n__version__ = '1.0.3'\n__author__ = 'Manuel Ebert'\n__license__ = 'MIT License'\n__copyright__ ... | python | edit | 5 | 0 | mit | dab192db863fdd694bb0adbce10fa2dd6c05353b | rzyns/jrnl,philipsd6/jrnl,notbalanced/jrnl,flight16/jrnl,maebert/jrnl,MSylvia/jrnl,dzeban/jrnl,nikvdp/jrnl,cloudrave/jrnl-todos,MinchinWeb/jrnl,beni55/jrnl,zdravi/jrnl,Shir0kamii/jrnl | jrnl/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the analysis driver for the run step of the study"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# Brokers communication between Dakota and SWASH through files.\n#\n# Arguments:\n# $1 is 'params.in' from Dak... | python | new_file | 4 | 1 | mit | ed4d07fb2a7fa8f1dd30a2b7982940a5fe78275b | mdpiper/dakota-swash-parameter-study,mdpiper/dakota-swash-parameter-study | dakota_run_driver.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for the logger"
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import unicode_litera... | python | new_file | 1 | 1 | mit | 3dcf737fa6a6467e1c96d31325e26ecf20c50320 | thombashi/sqliteschema | test/test_logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Format all local .json files for human readability"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport json, os\n\nfor filename in os.listdir('.'):\n if os.path.isfile(filename) and os.path.splitext(filename... | python | new_file | 1 | 0 | apache-2.0 | f06a71a87daaaf0bc4b1f5701ce4c59805b70f6b | cclauss/Ten-lines-or-less | usr/bin/json_readable.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create stub for 2016 NFLPool player picks"
},
{
"role": "assistant",
"content": "\n\nstone = {\"firstname\": \"chris\", \"lastname\": \"stone\", \"timestamp\": \"9/6/2016\", \"email\": \"<EMAIL>\",\n \"afc_east_1\": \"Pat... | python | new_file | 1 | 0 | mit | 61a005ffbc988b6a20441841112890bb397f8ca3 | prcutler/nflpool,prcutler/nflpool | 2016_player_picks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some preliminary code and function to enlarge image"
},
{
"role": "assistant",
"content": "from lxml import html\nfrom PIL import Image\nimport requests\n\ndef enlarge_image(image_file):\n\timage = Image.open(image_file)\n\te... | python | new_file | 3 | 1 | mit | 1165673d784eab36edcdc4ed4caf22dbd222874a | SkullTech/whois-scraper | whois-scraper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for configure failure.\n\nTryRun fails to find the executable when VariantDir is set up from\nSConscript/SConstruct."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# __COPYRIGHT__\n#\n# Permission ... | python | new_file | 3 | 0 | mit | 8b0b7c19d2e2c015fd8ba7d5408b23334ee8874f | Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons | test/Configure/VariantDir2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sine wave sweep test\n\nThis test produces spectrograms like those available on the SRC\nComparisons web site.\n\nhttp://src.infinitewave.ca/"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\ntry:\n from cStrin... | python | new_file | 1 | 4 | bsd-2-clause | 1fd09e7328b1ebf41bc0790f2a96c18207b10077 | depp/libfresample,depp/libfresample,depp/libfresample,h6ah4i/libfresample,h6ah4i/libfresample | tests/test-sweep.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add nagios check for idot snowplow ingest"
},
{
"role": "assistant",
"content": "\"\"\"\n Nagios check to see how much snowplow data we are currently ingesting\n\"\"\"\nimport sys\nimport os\nimport psycopg2\n\nPOSTGIS = psycopg2... | python | new_file | 4 | 0 | mit | 9ec957af0c3d57dff4c05c1b7ed3e66e1c033f6b | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | nagios/check_idot_snowplows.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add page extension for tracking page creation and modification dates.\n\nThis can be used in conjunction with a response processor to set the \"last-modified\" or \"etag\" response headers."
},
{
"role": "assistant",
"content": "... | python | new_file | 4 | 2 | bsd-3-clause | d21743f2543f8d953a837d75bff0fcdb0105f4db | feincms/feincms,hgrimelid/feincms,pjdelport/feincms,joshuajonah/feincms,nickburlett/feincms,matthiask/django-content-editor,joshuajonah/feincms,matthiask/django-content-editor,matthiask/django-content-editor,nickburlett/feincms,michaelkuty/feincms,joshuajonah/feincms,mjl/feincms,michaelkuty/feincms,hgrimelid/feincms,jo... | feincms/module/page/extensions/changedate.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom os.path import expanduser\nfrom os import kill\nimport subprocess\nimport sys\nimport time\n\n\npython = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')\ncwd = expanduser('~/FrameworkBenchmarks/tornado')\n\n\ndef start(args... | python | edit | 1 | 3 | bsd-3-clause | 2c57f2143e21fa3d006d4e4e2737429fb60b4797 | knewmanTE/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,stefanocasazza/FrameworkB... | tornado/setup_pg.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create test case for tail from file"
},
{
"role": "assistant",
"content": "\"\"\"\nTests for the tail implementation\n\"\"\"\n\nfrom tail import FileTail\n\ndef test_tail_from_file():\n \"\"\"Tests that tail works as advertise... | python | new_file | 1 | 1 | mit | bc35e89d04e541f75fc12788893b21a3b876aaf9 | shuttle1987/tail,shuttle1987/tail | tail/tests/test_tail.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example map flow"
},
{
"role": "assistant",
"content": "from taskin import task\n\n\ndef get_servers(data):\n return [\n 'foo.example.com',\n 'bar.example.com',\n ]\n\n\ndef create_something(data):\n ... | python | new_file | 2 | 2 | bsd-3-clause | 717b20e298547685ed0685bd09a4fac541034910 | ionrock/taskin | example/map_flows.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some unit tests for the hashing protocol of dtype (fail currently).\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "import numpy as np\n... | python | new_file | 7 | 2 | bsd-3-clause | 61139332ce1bcfd145f16b8f3c411e178db4054c | teoliphant/numpy-refactor,efiring/numpy-work,efiring/numpy-work,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,chadnetzer/nu... | numpy/core/tests/test_dtype.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing tests for messaging notifer plugin\n\nChange-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5"
},
{
"role": "assistant",
"content": "# Copyright 2014 Mirantis Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apac... | python | new_file | 1 | 1 | apache-2.0 | 06e4fd4b7d4cc4c984a05887fce00f7c8bbdc174 | stackforge/osprofiler,openstack/osprofiler,stackforge/osprofiler,openstack/osprofiler,stackforge/osprofiler,openstack/osprofiler | tests/notifiers/test_messaging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for compare version numbers"
},
{
"role": "assistant",
"content": "\"\"\"\nSource : https://oj.leetcode.com/problems/compare-version-numbers/\nAuthor : Changxi Wu\nDate : 2015-01-23\n\nCompare two version numbers v... | python | new_file | 5 | 7 | mit | 65e689dd66124fcaa0ce8ab9f5029b727fba18e2 | chancyWu/leetcode | src/compare_version_numbers.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for IosBrowserFinder.\n\nThis test checks if Chrome on iOS is running. It only\nruns on iOS platforms.\n\nBUG=None\n\nReview URL: https://codereview.chromium.org/350583002\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0... | python | new_file | 1 | 2 | bsd-3-clause | 32d46fe3e080b13ab9ae9dc3d868e9a724cccda9 | krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,M4sse/chrom... | tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder_unittest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 556. Next Greater Element III\n\n556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/\n\nApproach:\n Observe the first item remaining in each step. The value will be added\n 1 << st... | python | new_file | 1 | 6 | apache-2.0 | a136eeefdd6cf276a0d4815fa39453737ed04727 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/next-greater-element-iii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to normalize the spelling in a dataset\n\nAdded a script that normalizes the spelling in a dataset consisting of\nfiles containing <sentence_id> \\t <sentence> \\t <label(s)>"
},
{
"role": "assistant",
"content": "\"\"... | python | new_file | 3 | 0 | apache-2.0 | 387b5732c0b2231580ae04bf5088ef7ce59b0d84 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | normalize_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test driving robot via serial input"
},
{
"role": "assistant",
"content": "import nengo\n\nimport nengo_pushbot\nimport numpy as np\n\nmodel = nengo.Network()\nwith model:\n input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.... | python | new_file | 1 | 0 | mit | 2dd5afae12dc7d58c3349f2df2694eeb77ca0298 | ctn-waterloo/nengo_pushbot,ctn-waterloo/nengo_pushbot | examples/test_spinn_tracks4.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: <EMAIL>\n# Maintained By: <EMAIL>\n\nfrom ggrc.converters.sections... | python | edit | 1 | 1 | apache-2.0 | 8ad4627973db344e228a9170aef030ab58efdeb9 | edofic/ggrc-core,hasanalom/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,hyperNURb/ggrc-... | src/ggrc/converters/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add starter code for Lahman db"
},
{
"role": "assistant",
"content": "################################################\n# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL\n# TODO: Make a callable function that retrieves the Lahman d... | python | new_file | 3 | 0 | mit | 89c17110f9d17e99ea7686e884cfba91b4762d57 | jldbc/pybaseball | pybaseball/lahman.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.db import models\n\n\nclass Discussion(models.Model):\n user = models.ForeignKey(User)\n name = models.CharField(max_length=255)\n slug = models.SlugField()\n\n def __unic... | python | edit | 1 | 1 | bsd-2-clause | 0e9e63a48c5f3e02fb49d0068363ac5442b39e37 | incuna/django-discussion,lehins/lehins-discussion,lehins/lehins-discussion,incuna/django-discussion,lehins/lehins-discussion | discussion/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [RM-11742] Add argparse tests for ceph-deploy admin\n\nSigned-off-by: Travis Rhoden <<EMAIL>>"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom ceph_deploy.cli import get_parser\n\n\nclass TestParserAdmin(object):\n\n ... | python | new_file | 1 | 1 | mit | 6be3e0c5264ca2750a77ac1dbd4175502e51fd3c | Vicente-Cheng/ceph-deploy,ceph/ceph-deploy,codenrhoden/ceph-deploy,shenhequnying/ceph-deploy,branto1/ceph-deploy,ghxandsky/ceph-deploy,imzhulei/ceph-deploy,isyippee/ceph-deploy,trhoden/ceph-deploy,zhouyuan/ceph-deploy,Vicente-Cheng/ceph-deploy,zhouyuan/ceph-deploy,ceph/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy-to... | ceph_deploy/tests/parser/test_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add celery based job runner"
},
{
"role": "assistant",
"content": "import os\nfrom time import time\nimport logging\n\nimport pandas as pd\n\nfrom celery import Celery\nfrom billiard import current_process\n\n\napp = Celery()\n\n... | python | new_file | 5 | 4 | bsd-3-clause | b75e10f3235e9215458071279b67910627a95180 | ihmeuw/vivarium | ceam/framework/celery_tasks.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add little script calculate sample spectra."
},
{
"role": "assistant",
"content": "'''\nCreated on Oct 12, 2015\n\n@author: wirkert\n'''\n\nimport pickle\nimport logging\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimp... | python | new_file | 2 | 1 | bsd-3-clause | 8141d6cafb4a1c8986ec7065f27d536d98cc9916 | RabadanLab/MITKats,MITK/MITK,MITK/MITK,RabadanLab/MITKats,MITK/MITK,MITK/MITK,fmilano/mitk,fmilano/mitk,fmilano/mitk,iwegner/MITK,RabadanLab/MITKats,iwegner/MITK,RabadanLab/MITKats,iwegner/MITK,RabadanLab/MITKats,MITK/MITK,fmilano/mitk,iwegner/MITK,fmilano/mitk,iwegner/MITK,fmilano/mitk,fmilano/mitk,RabadanLab/MITKats,... | Modules/Biophotonics/python/iMC/script_plot_one_spectrum.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create database import script for the Picks table (each NFLPool Player's picks for a given season)"
},
{
"role": "assistant",
"content": "import sqlite3\n\nconn = sqlite3.connect('nflpool.sqlite')\ncur = conn.cursor()\n\n# Do som... | python | new_file | 1 | 0 | mit | 20d77f66e0287b3aab08b4cf14f23e7e5672aefd | prcutler/nflpool,prcutler/nflpool | db_setup/nflpool_picks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration (updating validators=)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.7 on 2016-07-22 22:03\nfrom __future__ import unicode_literals\n\nimport django.core.validator... | python | new_file | 1 | 0 | apache-2.0 | 1e7b84155623691fb9fc1cec4efa6386938f3e72 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | core/migrations/0055_update_username_validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for kline result of exact amount"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# coding=utf-8\n\nfrom binance.client import Client\nimport pytest\nimport requests_mock\n\n\nclient = Client('api_key', 'api... | python | new_file | 3 | 2 | mit | 48217e5317412a9b5fb8181b6915963783efeaf2 | sammchardy/python-binance | tests/test_historical_klines.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of connecting OGR to matplotlib through shapely and numpy\n\ngit-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145"
},
{
"role": "assistant",
"content": "import ogr\nimport pyla... | python | new_file | 1 | 0 | bsd-3-clause | 52236b1ad285683d828b248e462a7b984d31e636 | jdmcbr/Shapely,mindw/shapely,jdmcbr/Shapely,mouadino/Shapely,abali96/Shapely,abali96/Shapely,mouadino/Shapely,mindw/shapely | examples/world.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example script to store & read datetime"
},
{
"role": "assistant",
"content": "import h5py\nimport numpy as np\n\narr = np.array([np.datetime64('2019-09-22T17:38:30')])\n\nwith h5py.File('datetimes.h5', 'w') as f:\n # Crea... | python | new_file | 1 | 0 | bsd-3-clause | 82d34111295fdfa35d0e9815053498e935d415af | h5py/h5py,h5py/h5py,h5py/h5py | examples/store_datetimes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add to support the chinese library"
},
{
"role": "assistant",
"content": "# Naver Search Workflow for Alfred 2\n# Copyright (C) 2013 Jinuk Baek\n# This program is free software; you can redistribute it and/or\n# modify it un... | python | new_file | 1 | 4 | mit | 2523d34d4f3e26a408c7ec0e43708efea77f03a9 | Kuniz/alfnaversearch,Kuniz/alfnaversearch | workflow/cndic_naver_search.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test of randomized select algorithm\n\nSimilar to the sorting algorithm tests, selection_test.py checks\nthe runtime and correctness of the randomized selection algorithm\nfor exponentially increasing n.\n\nBecause it checks for correctn... | python | new_file | 3 | 5 | mit | 164f43f902b89b84b4f0d474f4d3e0a18924110d | timpel/stanford-algs,timpel/stanford-algs | selection_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for blank true."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.7 on 2017-05-31 18:40\nfrom __future__ import unicode_literals\n\nimport kolibri.core.fields\nfrom django.db ... | python | new_file | 1 | 0 | mit | 9f6f6b727458eb331d370443074a58d1efa6d755 | mrpau/kolibri,benjaoming/kolibri,indirectlylit/kolibri,benjaoming/kolibri,christianmemije/kolibri,lyw07/kolibri,benjaoming/kolibri,learningequality/kolibri,rtibbles/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,jonboiser/kolibri,MingDai/kolibri,DXCanas/kolibri,rtibbles/kolibri,benjaoming/kolibri,rtibbles/kolibri,... | kolibri/logger/migrations/0003_auto_20170531_1140.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for Registration changed"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.4 on 2016-04-18 13:50\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, ... | python | new_file | 1 | 0 | mit | fd33fadc260cda2bd2395f027457f990ab05480b | pythonkr/pyconapac-2016,pythonkr/pyconapac-2016,pythonkr/pyconapac-2016 | registration/migrations/0008_auto_20160418_2250.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for microstructure generator\n\naddress #242\n\nAdd tests for microstructure generator to test new functionality. These\ntests change that correct quantities of the volume fraction are\ngenerated and that in appropriate sets of para... | python | new_file | 3 | 1 | mit | b04e3787de29d4bee68854e15a7e783cbe3c3bd0 | awhite40/pymks,davidbrough1/pymks,davidbrough1/pymks | pymks/tests/test_microstructure_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write unit test for utility functions"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\ntry:\n import io\n StringIO = io.StringIO\nexcept ImportError:\n import StringIO\n StringIO = Str... | python | new_file | 1 | 2 | mit | 07467664b699612e10b51bbeafdce79a9d1e0127 | unnonouno/cudnnenv | test/test_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: scripts: Include a helpful MOD analyser script"
},
{
"role": "assistant",
"content": "# mod_info.py\n# \n# Display information about a Protracker module.\n# \n# Written & released by Keir Fraser <<EMAIL>>\n# \n# This is free and ... | python | new_file | 1 | 0 | unlicense | 116babc38e2e4023eb0b45eabc02050ed433e240 | keirf/Amiga-Stuff,keirf/Amiga-Stuff | scripts/mod_info.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert caffemodel of FCN8s to chainer model"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import print_function\nimport argparse\nimport os.path as osp\n\nimport caffe\nimport chainer.functions ... | python | new_file | 4 | 0 | mit | 77e980157f51af421eceb7c7b7a84945d8d33a91 | wkentaro/fcn | scripts/caffe_to_chainermodel.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Write tests for new functionality; several destinations"
},
{
"role": "assistant",
"content": "from numpy import testing\nimport unittest\nimport numpy as np\nfrom numpy import pi\n\nfrom robot_arm import RobotArm\n\n\nclass Test... | python | new_file | 3 | 1 | mit | b0d699066799d0309e7af3f8892f56a6feaac778 | JakobGM/robotarm-optimization | new_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to rotate a solid angle in the xz plane"
},
{
"role": "assistant",
"content": "'''\nRotates the protein by a solid angle on the plane xz\n'''\n\nimport numpy\nimport os\n\nfrom argparse import ArgumentParser\n\nfrom mo... | python | new_file | 3 | 1 | bsd-3-clause | 4f404a71cb7ee912bca8184fe94c97d6cfba1186 | barbagroup/pygbe,barbagroup/pygbe,barbagroup/pygbe | preprocessing_tools/solid_rotation_y.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper functions for to/from bytes/unicode"
},
{
"role": "assistant",
"content": "from . import str_mode\n\nif str_mode == 'bytes':\n unicode_type = unicode\nelse: # str_mode == 'unicode'\n unicode_type = str\n\ndef re... | python | new_file | 2 | 4 | mit | 1d8cbf94f127571358aee97677a09f7cea3bf3a7 | rh314/p23serialize | p23serialize/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial test for binheap"
},
{
"role": "assistant",
"content": "import pytest\nfrom binheap import Binheap\n\n\ndef test_init_bh():\n b = Binheap()\n assert b.binlist is []\n c = Binheap([1, 2])\n assert c.binlist... | python | new_file | 4 | 1 | mit | 008625fef55f8f58ab80b883d34ae5d40e55c721 | constanthatz/data-structures | test_binheap.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pytest option for specifying the typing module to use"
},
{
"role": "assistant",
"content": "import sys\n\n\ndef pytest_addoption(parser):\n parser.addoption('--typing', action='store', default='typing')\n\n\ndef pytest_co... | python | new_file | 1 | 3 | mit | 256648ad4effd9811d7c35ed6ef45de67f108926 | bintoro/overloading.py | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for shell utils."
},
{
"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 for additi... | python | new_file | 1 | 2 | apache-2.0 | 01f21a16e4bcecccf51a565b51222ab18b79adb4 | tonybaloney/st2,pixelrebel/st2,Plexxi/st2,emedvedev/st2,pixelrebel/st2,grengojbo/st2,armab/st2,StackStorm/st2,StackStorm/st2,lakshmi-kannan/st2,Itxaka/st2,emedvedev/st2,punalpatel/st2,alfasin/st2,punalpatel/st2,dennybaa/st2,pinterb/st2,dennybaa/st2,StackStorm/st2,peak6/st2,armab/st2,tonybaloney/st2,Plexxi/st2,Plexxi/st... | st2common/tests/unit/test_util_shell.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add renderer for base64 content"
},
{
"role": "assistant",
"content": "import base64\n\nfrom rest_framework import renderers\n\n\nclass Base64Renderer(renderers.BaseRenderer):\n media_type = \"image/png;base64\"\n format = ... | python | new_file | 1 | 1 | apache-2.0 | 542bc508b587a39a6e709d469c1cb166dee9eef4 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | app/grandchallenge/retina_api/renderers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add verbose names to UserProfile fields."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migratio... | python | new_file | 1 | 0 | bsd-3-clause | b40512e834e88f24c20885cddb220188fce11339 | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | accounts/migrations/0004_auto_20150227_2347.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for import time."
},
{
"role": "assistant",
"content": "import subprocess\nimport sys\nimport pytest\n\nAVG_ITERATIONS = 15\n\n# Maximum expected import time for rasa module when running on a Travis VM.\n# Keep in mind t... | python | new_file | 1 | 5 | apache-2.0 | e8832b5f126f39672cfc48159148b490c1e3c6c7 | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu | tests/import_time.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to automate review markdown file creation"
},
{
"role": "assistant",
"content": "import sys\nimport os\nimport subprocess\n\ninitial_layout = [\n \"---\",\n \"layout: default\",\n \"permalink: 'reviews/{}.html... | python | new_file | 3 | 1 | cc0-1.0 | 112dcd24d9888c8376afa36535870eb861982d9c | v1n337/research-review-notes,v1n337/research-review-notes,v1n337/research-review-notes | create_review.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test admin views in order to catch stupid errors"
},
{
"role": "assistant",
"content": "from django.apps import apps\nfrom django.contrib import admin\nfrom django.contrib.auth import get_user_model\nfrom django.core.urlresolvers... | python | new_file | 1 | 5 | mit | 1a311415c007bebcb2c6f042816a86a7cc32ec36 | uppsaladatavetare/foobar-api,uppsaladatavetare/foobar-api,uppsaladatavetare/foobar-api | src/foobar/tests/test_admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nimport time\n\nfrom mopidy.exceptions import MpdNotImplemented\nfrom mopidy.models import Playlist\n\nlogger = logging.getLogger('backends.base')\n\nclass BaseBackend(object):\n current_playlist = None\n library = None... | python | edit | 5 | 1 | apache-2.0 | 353df423343688f206c0f3628092608d1a95f5c2 | SuperStarPL/mopidy,liamw9534/mopidy,glogiotatidis/mopidy,mopidy/mopidy,hkariti/mopidy,tkem/mopidy,hkariti/mopidy,jcass77/mopidy,bencevans/mopidy,pacificIT/mopidy,jodal/mopidy,jmarsik/mopidy,woutervanwijk/mopidy,kingosticks/mopidy,hkariti/mopidy,jodal/mopidy,mokieyue/mopidy,pacificIT/mopidy,mokieyue/mopidy,vrs01/mopidy,... | mopidy/backends/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 654. Maximum Binary Tree\n\n654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/\n\n Approach 1:\n 1. Modify the method to accept (nums, start, end), and the method\n will return the subtr... | python | new_file | 3 | 6 | apache-2.0 | 7594e2b4405be3fb8b5b07fc9b5fd79ecc5a5aec | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/maximum-binary-tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test 'python -m setuptools_scm' invocation (__main__.py)."
},
{
"role": "assistant",
"content": "import os.path\n\nmainfile = os.path.join(\n os.path.dirname(__file__), \"..\", \"setuptools_scm\", \"__main__.py\")\nwith open(m... | python | new_file | 1 | 0 | mit | 27f0b6481675fcc07ec2ce09acbd2bd1ac8cf197 | esben/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm | testing/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to parse incoming CDN log entries"
},
{
"role": "assistant",
"content": "#!/usr/bin/python -u\nimport sys\nimport redis\nimport csv\nimport posixpath\nimport datetime\nimport logging\nimport logging.handlers\n\nfrom ... | python | new_file | 1 | 3 | bsd-3-clause | 1d7165dc88be1aea9a233c8e794ee66b99f1c70e | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | tools/rsyslog-cdn.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 680. Valid Palindrome II\n\n680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def validPalindromeIdx(self, s, i, j... | python | new_file | 1 | 5 | apache-2.0 | 01acf59474ac2ccd5612bba9b7fa925ebec1e5c5 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/valid-palindrome-ii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new script to move existing entries to their correct location\n\nNow that we have moved it out of the usercache into its own class"
},
{
"role": "assistant",
"content": "import logging\nimport arrow\n\nimport emission.core.... | python | new_file | 3 | 4 | bsd-3-clause | f57ac6c3c7935d44956fac1295e417e34039c703 | e-mission/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-... | bin/historical/migrations/move_trips_places_sections_stops_to_analysis_timeseries_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a library for data visualization and add a dummy function"
},
{
"role": "assistant",
"content": "'''\nCreated on Sep 6, 2017\n\n@author: Hossein\n\nThis file handles all the visualizations. It assumes that the status are read... | python | new_file | 3 | 5 | apache-2.0 | 2f3b3a34cfed77fea3c48ec17b8c2e40603bbcc0 | TeMedy/DaViL,TeMedy/DaViL | app/src/visualizer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new local dependency of scripts."
},
{
"role": "assistant",
"content": "\"\"\"Utility functions not closely tied to other spec_tools types.\"\"\"\n# Copyright (c) 2018-2019 Collabora, Ltd.\n# Copyright (c) 2013-2019 The Khron... | python | new_file | 1 | 3 | apache-2.0 | 9eab96f40634c81ed53d54d2c9df126a445dfd56 | KhronosGroup/Vulkan-Headers,KhronosGroup/Vulkan-Headers,KhronosGroup/Vulkan-Headers | registry/spec_tools/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an utility getting the free proxy from the certain site."
},
{
"role": "assistant",
"content": "import json\nimport time\nimport traceback\n\nimport requests\nfrom lxml import etree\n\n\ndef updateProxy():\n with open('F:\... | python | new_file | 1 | 11 | mit | 01d848f77690bfafff1fdc28efb09b6c0e9e11bc | i2it/XYWYCrawler | AutoUpdateProxy.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test_get for api data (and missing file)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom django.conf import settings\nfrom django.test import TestCase\nfrom django.test.client import Client\nfrom django.... | python | new_file | 3 | 1 | mit | a7aa9301daeff4c93bd907f51114af68b36669df | ibrahimcesar/panda,PalmBeachPost/panda,datadesk/panda,datadesk/panda,newsapps/panda,datadesk/panda,PalmBeachPost/panda,PalmBeachPost/panda,pandaproject/panda,ibrahimcesar/panda,NUKnightLab/panda,pandaproject/panda,pandaproject/panda,newsapps/panda,NUKnightLab/panda,ibrahimcesar/panda,newsapps/panda,NUKnightLab/panda,da... | redd/tests/test_api_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add automated Snowrunner save file renaming"
},
{
"role": "assistant",
"content": "\"\"\"Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231\"\"\"\nimport argparse... | python | new_file | 1 | 5 | mit | dc038e9b0da446e4d8b3f3e5964d6d6b4ec82d8e | esabouraud/scripts,esabouraud/scripts | snowrunner/transfer_save.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move pool.Connection tests into own file"
},
{
"role": "assistant",
"content": "\"\"\"\nTests for Connection class in the pool module\n\n\"\"\"\nimport mock\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import... | python | new_file | 1 | 1 | bsd-3-clause | 2d3d63adac30db637cedd0280679db1100c39525 | gmr/queries,gmr/queries | tests/pool_connection_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add external client for pushing values"
},
{
"role": "assistant",
"content": "import argparse\nimport ReplicatorClient\n\nPORT = 3000\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"host\", help=... | python | new_file | 1 | 1 | mit | 67cc1656a7d075c1136c6e18b63167792b8747c3 | rimpybharot/CMPE273 | assignment2/my_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 654. Maximum Binary Tree\n\n654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# class TreeNode(object):\n... | python | new_file | 3 | 4 | apache-2.0 | 9116776bd62e6b7ae7a018fa2c2c0b3964c3fa7d | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/maximum-binary-tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement simple for loop and SUBVN"
},
{
"role": "assistant",
"content": "from .helpers import codetest\n\n\nclass TestWhile(object):\n \"\"\"\n tests for the lua if then else and various comparisons\n \"\"\"\n\n def... | python | new_file | 1 | 1 | bsd-3-clause | e9c851ac5a328ed43c61df29b9a3b6129e08c7c5 | fhahn/luna,fhahn/luna | pylua/tests/test_while.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights concatenate arrays problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Concatenate Arrays Problem\n\n\ndef concatenateArrays(a, b):\n return a + b\n\n\ndef main():\n tests... | python | new_file | 1 | 3 | mit | 3468794db82e020bc40c54a9399269169fbb37a8 | HKuz/Test_Code | CodeFights/concatenateArrays.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add beginnings of Player class implementation"
},
{
"role": "assistant",
"content": "# card-fight-thingy - Simplistic battle card game... thingy\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2015 The Underscores\n#\n# Permissio... | python | new_file | 1 | 3 | mit | 4308a409ea970a59be5965cce2617c7cecf8b5b6 | TheUnderscores/card-fight-thingy | src/player.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add combine cooccurrence script for Food project"
},
{
"role": "assistant",
"content": "import argparse\nimport os\nimport codecs\nfrom collections import Counter\n\nif __name__ == '__main__':\n\tparser = argparse.ArgumentParser(... | python | new_file | 1 | 0 | mit | b373bfeaaf9017b9c16b21adb495155e0345a05a | jakelever/pubrunner,jakelever/pubrunner | tests/testrepos/FoodRelations/combineCooccurrences.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add source file to repository."
},
{
"role": "assistant",
"content": "import PyPDF2\nfrom formlayout import fedit\n\npaths = [('Input', ''), ('Output', '')]\n\npathsRead = fedit(paths, \n title=\"Interleave pdf\"... | python | new_file | 1 | 0 | mit | 5ed3bc5627b8dc3643f6a4d0d6ee782b701bdfd1 | sproberts92/interleave-pdf | InterleavePdf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport curses\nimport readline\n\nimport bz2\nassert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')\n\nimport zlib\nassert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT ... | python | edit | 4 | 0 | apache-2.0 | f659f773b7713fab2bb02a4a26eefc9e002145ca | chorrell/official-images,docker-flink/official-images,docker-library/official-images,nodejs-docker-bot/official-images,jperrin/official-images,docker-library/official-images,chorrell/official-images,pesho/docker-official-images,benbc/docker-official-images,mattrobenolt/official-images,docker-flink/official-images,31z4/... | test/tests/python-imports/container.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement lecture & say methods in the ArrogantProfessor class using inheritance"
},
{
"role": "assistant",
"content": "# Problem 6-1\n# 10.0 points possible (graded)\n\n\nclass Person(object):\n def __init__(self, name):\n ... | python | new_file | 1 | 1 | mit | 1773e9084964b3c44e0ab46ea64da0ac3d1ba671 | Kunal57/MIT_6.00.1x | final/problem6.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add scripts directory with lie_workflow script"
},
{
"role": "assistant",
"content": "import sys\n\nfrom autobahn.twisted.wamp import ApplicationRunner\nfrom twisted.internet.defer import inlineCallbacks, returnValue\nfrom ... | python | new_file | 3 | 5 | apache-2.0 | bb25e2d989f208b803830349748900f687473b12 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | scripts/lie_docking.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration script to add the 'github_repo_id' field"
},
{
"role": "assistant",
"content": "\"\"\"Backfills tables to populate GitHub's repo ID.\"\"\"\n\nimport rethinkdb as r\n\nimport db.plugins\nimport db.util\n\nr_conn = db... | python | new_file | 2 | 4 | mit | 171c46d0698a53d38f332aa681c2e5ea3a09fd00 | jonafato/vim-awesome,shaialon/vim-awesome,divad12/vim-awesome,divad12/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,jonafato/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,shaialon/vim-awesome,starcraftman/vim-awesome,jonafato/vi... | db/migrations/backfill_github_repo_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mock object for easier testing"
},
{
"role": "assistant",
"content": "from bot import Tofbot\n\nclass TestTofbot(Tofbot):\n\n def __init__(self, nick, name, chan, origin):\n chans = [chan]\n Tofbot.__init__(s... | python | new_file | 1 | 1 | bsd-2-clause | 22e80f1fccb120f90774195d1592750f6d39a8a2 | p0nce/tofbot,p0nce/tofbot,chmduquesne/tofbot,martinkirch/tofbot,soulaklabs/tofbot,soulaklabs/tofbot,tofbot/tofbot,martinkirch/tofbot,tofbot/tofbot | testbot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test and fixtures for themes."
},
{
"role": "assistant",
"content": "import os\nimport textwrap\nimport shutil\nimport pytest\n\n\n@pytest.fixture(scope='function')\ndef theme_project_tmpdir(tmpdir):\n\n # Copy theme... | python | new_file | 1 | 1 | bsd-3-clause | 57fc7ec4630174315b0a453073009783757ba3f6 | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor | tests/test_themes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce fuse module to mount Registry Ellipticsbased FS"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nfrom __future__ import with_statement\n\nimport logging\nimport os\nimport sys\nimport stat\n\nimport yaml\nf... | python | new_file | 3 | 7 | apache-2.0 | c297f803a30989d3f3593d98b5af861a839d4e0a | noxiouz/docker-registry-driver-elliptics,noxiouz/docker-registry-driver-elliptics | fuse_module/registry-fs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create script to make PHAT patch fitting queue"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nMake a CANFAR queue for patch fitting.\n\n>>> from canque import Submission\n>>> sub = Submis... | python | new_file | 2 | 3 | mit | 05ebb3eb9e28e738145cd81fc256c7b83ba32e7b | jonathansick/androcmd,jonathansick/androcmd | scripts/make_patch_fit_queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add config environment variables test"
},
{
"role": "assistant",
"content": "import os\nimport unittest\n\nfrom config import get_config\n\n\nclass ConfigTest(unittest.TestCase):\n def setUp(self):\n os.environ['DESTALI... | python | new_file | 1 | 1 | apache-2.0 | 6aea126e743b8a2b6808f4d9cc329b4955e796ae | royrapoport/destalinator,randsleadershipslack/destalinator,TheConnMan/destalinator,TheConnMan/destalinator,royrapoport/destalinator,randsleadershipslack/destalinator | tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add site engine for ProjectFuture"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Copyright (C) 2019-2020 Tobias Gruetzmacher\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom .common i... | python | new_file | 1 | 3 | mit | 47956133433425c3e0c1f33ff6596c9ead3f6558 | webcomics/dosage,webcomics/dosage,peterjanes/dosage,peterjanes/dosage | dosagelib/plugins/projectfuture.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small script to test motor feedback"
},
{
"role": "assistant",
"content": "\"\"\"Helps eye-ball rpc-based motor control\"\"\"\n\nimport time\n\nfrom ev3control.rpc import Robot\n\n# for convenience set the time to one second\... | python | new_file | 1 | 0 | mit | bd3c47780ac0c1629e8657bb03188bf6af27ebb1 | TheCamusean/DLRCev3,TheCamusean/DLRCev3 | scripts/robot_control/actuator_feedback.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to automate plugin testing on Windows\n\n* Opens Anki for you\n* Polls every second for a change to the watched file (uses time last modified)\n* Restarts Anki automatically"
},
{
"role": "assistant",
"content": "impor... | python | new_file | 3 | 0 | apache-2.0 | 46733c983a90d6dbfd32aed8f41ff4ed377b86d2 | CSE-437/AnkiPlugin,CSE-437/AnkiPlugin | src/windowsAnkiRestart.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to compute tile coverage for city bounding boxes"
},
{
"role": "assistant",
"content": "from tilepack.builder import cover_bbox\n\nimport argparse\nimport os\nimport requests\n\ndef main():\n parser = argparse.Arg... | python | new_file | 1 | 5 | mit | d2b4965f43d5fd853584b0abee666573a184c260 | tilezen/tilepacks | tilepack/tile_cover.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Build Fix - Merged db migrations"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2016-10-31 12:57\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nc... | python | new_file | 1 | 0 | bsd-3-clause | 720a011b59ea1fbe38e2ae940133cb4485d12d8d | falcaopetri/enqueuer-api | api/migrations/0009_merge_20161031_1057.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test method calls, with return value or side effect"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom pykka import Actor\n\nclass MethodCallTest(unittest.TestCase):\n def setUp(self):\n class ActorWithMetho... | python | new_file | 1 | 1 | apache-2.0 | 641d4a0fc8c226b7a1e8e62c8c8e9fd3892a9ed7 | tamland/pykka,jodal/pykka,tempbottle/pykka | tests/method_call_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for file-based datasets."
},
{
"role": "assistant",
"content": "import os\nimport shutil\nimport tempfile\nimport unittest\n\nfrom lobster.cmssw import dataset\nfrom lobster import fs, se\n\nclass TestDataset(unittest.Te... | python | new_file | 2 | 4 | mit | c63a5e46e6e3a5e0106c20a3217b53e17147aaf8 | matz-e/lobster,matz-e/lobster,matz-e/lobster | test/test_core_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test suite for comments in the dict structure"
},
{
"role": "assistant",
"content": "import collections\nimport logging\nimport pytest\nfrom mappyfile.pprint import PrettyPrinter\n\n\ndef test_comment():\n d = collection... | python | new_file | 2 | 1 | mit | 49d6984f2c57cf2169304de8fd3956e2f21aba19 | geographika/mappyfile,geographika/mappyfile | tests/test_comments.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.