messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Write python code for the following: Add a template to readily generate PDF report from properties and dimensions"
},
{
"role": "assistant",
"content": "import os\nfrom . import reporting\n\n\ndef create_section(title, desc, props, subsects, figures_list):\n asse... | python | new_file | 1 | 5 | mit | fba35ea4fdaf3a9076bcd9eefdcf1dce3d41b05a | iwob/evoplotter,iwob/evoplotter | src/templates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add program populating matrix with numbers starting with 1 in the matrix center and then spiralling out"
},
{
"role": "assistant",
"content": "size = 7\nm = [[0] * size for _ in range(size)]\nstart = size // 2\ntotal = size * siz... | python | new_file | 1 | 0 | mit | 9f88afa75279a6accd859a521afb2ec311874032 | dnl-blkv/algorithms | spiral_out.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nbyceps.blueprints.ticketing.views\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2017 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom flask import abort, g\n\nfrom ...services.ticketing... | python | edit | 1 | 2 | bsd-3-clause | cc14698280f5982c472c51185d57d5f5292ce518 | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps | byceps/blueprints/ticketing/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to complementing a strand of DNA"
},
{
"role": "assistant",
"content": "\"\"\"\nIn DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.\n\nThe reverse complement of a DNA string s is th... | python | new_file | 2 | 0 | mit | 79a83a46f788814d186267eeea640bcb9127be6f | MichaelAquilina/rosalind-solutions | problem3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate to a custom User class (4)\n\nstep4: create an empty migration script\npython manage.py makemigrations --empty note\n\nThen edit the script and add a function that will copy the users from\nthe old users table to the new one."
},
... | python | new_file | 4 | 3 | bsd-2-clause | 1a11007938fbe2964fc121b57aadef8a9d9cb1a0 | LeMeteore/boomer2 | note/migrations/0004_auto_20150305_1003.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for check_bmi."
},
{
"role": "assistant",
"content": "from bmi_tester.api import check_bmi\n\n\ndef test_bmi_check(tmpdir):\n with tmpdir.as_cwd():\n with open(\"input.yaml\", \"w\") as fp:\n p... | python | new_file | 4 | 1 | mit | 94c481fc17968030d7c25072985d70eb7b4413e1 | csdms/bmi-tester | tests/test_api.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple script to display positive detections"
},
{
"role": "assistant",
"content": "# Ported From: http://docs.opencv.org/3.1.0/d7/d8b/tutorial_py_face_detection.html\nimport os\nimport cv2\n\ncascade = cv2.CascadeClassifier(... | python | new_file | 1 | 0 | mit | ea4294761482d5cf1c6f7c5aeab452f43bfcd1fa | mattmakesmaps/opencv-junk | tools/detect_stuff.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add print XSL files script"
},
{
"role": "assistant",
"content": "import logging\nimport os\n\nfrom settings import CONVERSIONS, XSL_PATH\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef print_xsl_files():\n\tfor parts in CONVE... | python | new_file | 1 | 2 | mit | b4a35dc750ca1b9defd955c239fb43cb9a322732 | AustralianAntarcticDataCentre/metadata_xml_convert,AustralianAntarcticDataCentre/metadata_xml_convert | print_xsl.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add my two pass solution"
},
{
"role": "assistant",
"content": "class ListNode:\n def __init__(self, x):\n self.val = x\n self.next = None\n\nclass Solution:\n def removeNthFromEnd(self, head, n):\n \"\... | python | new_file | 1 | 4 | mit | 97f0326bc5ab5ce5601b72eb3e2196dd85588705 | xliiauo/leetcode,xiao0720/leetcode,xliiauo/leetcode,xiao0720/leetcode,xliiauo/leetcode | 19/Solution.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add very basic turing tests"
},
{
"role": "assistant",
"content": "from unittest import TestCase, expectedFailure\n\n\nclass TuringTests(TestCase):\n\n def setUp(self):\n from chatterbot import ChatBot\n\n self.c... | python | new_file | 1 | 1 | bsd-3-clause | 5a59094e58e3389bd2f182b080e065c4a709f8f9 | vkosuri/ChatterBot,gunthercox/ChatterBot | tests/test_turing.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport sys\nfrom os.path import dirname, abspath\n\nfrom django.conf import settings\n\n\nif len(sys.argv) > 1 and 'postgres' in sys.argv:\n sys.argv.remove('postgres')\n db_engine = 'postgresql_psycopg2'\n d... | python | edit | 3 | 2 | mit | dceae6725d10a5d1af6287e1b684c651683d1750 | jayfk/django-generic-m2m,jayfk/django-generic-m2m,coleifer/django-generic-m2m,coleifer/django-generic-m2m,coleifer/django-generic-m2m | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for frames."
},
{
"role": "assistant",
"content": "from . import TheInternetTestCase\nfrom helium.api import click, Text\n\nclass FramesTest(TheInternetTestCase):\n\tdef get_page(self):\n\t\treturn \"http://the-inte... | python | new_file | 1 | 1 | mit | 460db2ca2fb55adc5ae67516f0e1af4c42898080 | bugfree-software/the-internet-solution-python | tests/test_frames.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert README from Markdown to rst."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# register.py\n#\n# purpose: Automagically creates a Rst README.txt\n# author: Filipe P. A. Fernandes\n# e-mail: ocefpaf... | python | new_file | 1 | 0 | bsd-3-clause | b30644799afb03ba6985b3e6d135d08e0db3d697 | pyoceans/python-oceans,ocefpaf/python-oceans | register.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write default config with paver."
},
{
"role": "assistant",
"content": "from paver.easy import *\n\n\nconfig = \"\"\"# replace pass with values you would like to overwrite from DefaultConfig in\n# default_config.py. Values you do... | python | new_file | 3 | 1 | mit | b36eb09bb85bb4eee0db9669745e0c1adc244980 | simon-andrews/movieman2,simon-andrews/movieman2 | pavement.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move win32 audio experiment to trunk."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\r\n# $Id:$\r\n\r\n# Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU.\r\n# Caveats:\r\n# - Requires a filena... | python | new_file | 3 | 0 | bsd-3-clause | d5c7d429be93a2b2de4a1c09bd73f72c02664499 | adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet,niklaskorz/pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet | experimental/directshow.py | rejected_duplicate | Near-duplicate of sample 6875 | true |
[
{
"role": "user",
"content": "Write python code for the following: Increase max length of author and genre fields"
},
{
"role": "assistant",
"content": "# Generated by Django 3.2.7 on 2021-10-28 18:58\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n ... | python | new_file | 1 | 0 | mit | 6a2313efdf440e0c73d4c40898e9d36c5949d044 | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | museum_site/migrations/0003_auto_20211028_1858.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [python] Call functions in C library, mutable buffer"
},
{
"role": "assistant",
"content": "from ctypes import CDLL, sizeof, create_string_buffer\n\ndef test_hello_world(workspace):\n workspace.src('greeting.c', r\"\"\"\n #... | python | new_file | 1 | 1 | mit | 08fe04425cfb92a65bfededc85ed372188c6042e | imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning,imsardine/learning | python/tests/test_ctypes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .plcorebase import PlCoreBase\nfrom .planetstack import PlanetStack\nfrom .project import Project\nfrom .singletonmodel import SingletonModel\nfrom .service import Service\nfrom .service import ServiceAttribute\nfrom .tag import Tag\nf... | python | edit | 55 | 0 | apache-2.0 | afc5b02f2520382fc0ebb3370538ca2baeb04dd4 | cboling/xos,zdw/xos,open-cloud/xos,open-cloud/xos,open-cloud/xos,zdw/xos,cboling/xos,opencord/xos,opencord/xos,cboling/xos,zdw/xos,cboling/xos,zdw/xos,cboling/xos,opencord/xos | planetstack/core/models/__init__.py | rejected_lint | Too many lint violations: 55 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create program that fethes code from leetcode."
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\n\nimport json\nimport requests\nimport argparse\nfrom typing import Tuple\nfrom os.path import exists\n\n\nBASE_URL = 'ht... | python | new_file | 1 | 3 | mit | 365d61ee5620f0743ffcdeb9c6b09f2b4d66940c | pisskidney/leetcode | grab.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport pywapi\n\nweather_com_result = pywapi.get_weather_from_weather_com('10001')\nyahoo_result = pywapi.get_weather_from_yahoo('10001')\nnoaa_result = pywapi.get_weather_from_noaa('KJFK')\n\nprint \"Weather.com sa... | python | edit | 2 | 0 | mit | 040a86941e20db4976850c3cfb046c58ff48d559 | nmbryant/python-weather-api,bethany1/python-weather-api,lorenzosaino/python-weather-api,littleboss/python-weather-api,tmw25/python-weather-api,ExtraordinaryBen/python-weather-api,n0012/python-weather-api,tectronics/python-weather-api,dubwoc/python-weather-api,prasadsidda107/python-weather-api,hdiwan/python-weather-api | examples/pywapi-example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add more unit test cases"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nimport unittest\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfro... | python | new_file | 1 | 1 | mit | 2a59a06880e8e382aee3452be19a9ac2b193df8e | ymyzk/python-gyazo | tests/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create constant module with DATA_DIRECTORY"
},
{
"role": "assistant",
"content": "\"\"\"\nConstants for mots-vides\n\"\"\"\nimport os\n\nDATA_DIRECTORY = os.path.join(\n os.path.dirname(\n os.path.abspath(__file__)),\n ... | python | new_file | 1 | 0 | bsd-3-clause | 9f91a62afb313684215987a54ddb043bdbc46fde | Fantomas42/mots-vides,Fantomas42/mots-vides | mots_vides/constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some unicode tests for Menu()"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom dynmen import Menu, MenuResult\nfrom functools import partial\nimport unittest\n\n\nclass TestFirstItem(unittest.TestCase):\n ... | python | new_file | 3 | 1 | mit | f2a049f918c9753e88699e0cb1574e7b10c0cb82 | frostidaho/dynmen | tests/test_unicode.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add better glowing line script; uses alpha to create the line out of solid green; handles intersections well"
},
{
"role": "assistant",
"content": "from PIL import Image, ImageDraw\n\nimport random\n\nW = 500\nim = Image.new('RGB... | python | new_file | 1 | 3 | mit | 9af2c07a21e426d52abccb6cc92afcd8cef9e340 | redpig2/pilhacks | glowing-lines2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test fetching tweets from twitter works."
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport unittest\n\nsys.path.insert(0, os.path.abspath('./situation'))\nsys.path.insert(0, os.path.abspath('./'))\n\nfrom situa... | python | new_file | 5 | 2 | mit | 2d617ac87df76a6191f393e77c7f2330948cb0cc | chriskuehl/kloudless-status,chriskuehl/kloudless-status,balanced/status.balancedpayments.com,chriskuehl/kloudless-status,balanced/status.balancedpayments.com,balanced/status.balancedpayments.com | tests/test_twitter.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a BatchTiming callback for Keras.\n\nIt measure robust stats for timing of batches and epochs.\nUseful for measuring the training process."
},
{
"role": "assistant",
"content": "from __future__ import print_function\n\n... | python | new_file | 1 | 1 | mit | aef89cffbb3be71206e5822d079993feafdbf96a | rossumai/keras-multi-gpu,rossumai/keras-multi-gpu | callbacks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for backup mechanism"
},
{
"role": "assistant",
"content": "import unittest\nfrom robotide.controller.chiefcontroller import Backup\n\n\nclass BackupTestCase(unittest.TestCase):\n\n def setUp(self):\n self._ba... | python | new_file | 1 | 2 | apache-2.0 | d24e6930966d66939583be44e33dc4e75f35a6bf | HelioGuilherme66/RIDE,fingeronthebutton/RIDE,caio2k/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,robotframework/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,robotframework/RIDE,caio2k/RIDE,caio2k/RIDE,HelioGuilherme66/RIDE | utest/controller/test_backup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add efficient mesh processing class using numpy"
},
{
"role": "assistant",
"content": "\"\"\"Efficient mesh processing using numpy\"\"\"\n\nimport numpy as np\nimport json\nimport maya.api.OpenMaya as OpenMaya\nimport cmt.shortcu... | python | new_file | 1 | 4 | mit | aa7c14f5c93cc03137c4939d348a21ee2255ea00 | chadmv/cmt,chadmv/cmt,chadmv/cmt | scripts/cmt/deform/np_mesh.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update meta data for core models"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-04-23 08:41\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\... | python | new_file | 1 | 0 | bsd-2-clause | de1cc61e9b88d50b4b54a2ec81607ab4c33b3053 | Leahelisabeth/timestrap,Leahelisabeth/timestrap,overshard/timestrap,Leahelisabeth/timestrap,muhleder/timestrap,Leahelisabeth/timestrap,cdubz/timestrap,overshard/timestrap,overshard/timestrap,muhleder/timestrap,muhleder/timestrap,cdubz/timestrap,cdubz/timestrap | core/migrations/0002_auto_20170423_0441.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example of the intended implementation of the feature"
},
{
"role": "assistant",
"content": "\"\"\"Provides an example of attaching an action on hug server startup\"\"\"\nimport hug\n\ndata = []\n\n\n@hug.startup()\ndef a... | python | new_file | 1 | 1 | mit | 29f7dcbe4f3469d051d92344963821a4199644cb | timothycrosley/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug | examples/on_startup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the basic main program for the Pycon"
},
{
"role": "assistant",
"content": "import time\nimport Edison.i2c as I2C\nimport Edison.gpio as GPIO\nimport Edison.spi as SPI\nimport ads1015\nimport sharp2y0a21\nimport screen\nimpor... | python | new_file | 7 | 2 | mit | e50490d9bcce4604a4b30212611f1550da2604e1 | fjacob21/pycon2015 | elpiwear/pycon.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add tests for _query in baseapi.\n\nThese tests check that _query ends up generating and querying the right\nurl depending on the different options passed to it."
},
{
"role": "assistant",
"content": "import pytest\nfrom p... | python | new_file | 4 | 1 | apache-2.0 | 3cde2060825449ae91e2e7172bde8c47680c42c7 | jcastillocano/pypuppetdb,jorik041/pypuppetdb,voxpupuli/pypuppetdb,amwilson/pypuppetdb,jcastillocano/pypuppetdb,puppet-community/pypuppetdb,dforste/pypuppetdb,vicinus/pypuppetdb | tests/baseapi/test_query.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate lognormal fits of GIS response data."
},
{
"role": "assistant",
"content": "import click\nimport pandas\nfrom scipy.stats import lognorm\n\n@click.command()\n@click.argument('filename')\n@click.option('--co... | python | new_file | 1 | 1 | mit | 0ee9372ee9034314853d6215d6b3c0be48796ca6 | FireCARES/fire-risk,FireCARES/fire-risk | scripts/response_time_dist.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to fix int16 files."
},
{
"role": "assistant",
"content": "from os import listdir, path\nimport numpy as np\n\nfrom patch_headers import fix_int16_images, compare_data_in_fits\nfrom triage_fits_files import ImageFileCo... | python | new_file | 6 | 0 | bsd-3-clause | fbf6e40eee370ff5bc61e79334c76e76cd2032e4 | mwcraig/msumastro | fix_int16.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script for cropping logo"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport numpy as np\nimport os\n\nTRAIN_DIR = 'flickr_logos_27_dataset'\nTRAIN_IMAGE_DIR = os.path.join(TRAIN_DI... | python | new_file | 1 | 1 | mit | c81d1534084673680ae313296bfae64c13899bcc | satojkovic/DeepLogo | crop_logo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a base parameterized object class."
},
{
"role": "assistant",
"content": "\"\"\"\nParameters and parameterizable objects.\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ imp... | python | new_file | 1 | 3 | bsd-2-clause | fcba965521f601d862bfb4968bedad7e2c56123c | mwhoffman/reggie | models/params.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate inputs of all star-index related processes"
},
{
"role": "assistant",
"content": "from django.db import migrations\n\nfrom resolwe.flow.utils.iterators import iterate_schema\n\n\ndef migrate_star_downstream_processes(apps... | python | new_file | 1 | 4 | apache-2.0 | 35b9153d1eefb1312d12f69d821cefd0814059d0 | genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio | resolwe_bio/migrations/0014_star_index2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for coord.simplify()."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom coral import coord\n\nclass TestCoord(unittest.TestCase):\n\n def test_simplify(self):\n poly = [(-10, -10), (-10, 10), (0,... | python | new_file | 1 | 1 | mit | 07624ba907d66e734c9098149b62d2ea8c76392a | lecram/coral | tests/test_coord.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 68 Calkin Wilf Sequence from CodeFights"
},
{
"role": "assistant",
"content": "# The Calkin-Wilf tree is a tree in which the vertices correspond 1-for-1 to the positive rational numbers. The tree is rooted at the number 1, an... | python | new_file | 1 | 2 | mit | 412dc5aad04bfa3d3ece140e711b45fafe9c1b64 | aenon/OnlineJudge,aenon/OnlineJudge | codefights/arcade_py/68.CalkinWilf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for ChatworkOAuth2 backend"
},
{
"role": "assistant",
"content": "import json\n\nfrom .oauth import OAuth2Test\n\n\nclass ChatworkOAuth2Test(OAuth2Test):\n backend_path = 'social_core.backends.chatwork.ChatworkOAuth2'... | python | new_file | 1 | 1 | bsd-3-clause | 8c05529f93dfe4fb3fffbf1d5f46b1d38adc6fce | python-social-auth/social-core,python-social-auth/social-core | social_core/tests/backends/test_chatwork.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for \"runtest test/somedir\" case"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software an... | python | new_file | 1 | 0 | mit | 86b710e87666ff20be8cfd78648eb67a9637dfaf | timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons,timj/scons | test/runtest/testargv.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 592. Fraction Addition and Subtraction\n\n592. Fraction Addition and Subtraction: https://leetcode.com/problems/fraction-addition-and-subtraction/"
},
{
"role": "assistant",
"content": "import re\nclass Soluti... | python | new_file | 1 | 4 | apache-2.0 | 0aafd10663f42c02d290949453946afe9f1e2f88 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/fraction-addition-and-subtraction.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add list comprehensions with zips"
},
{
"role": "assistant",
"content": "\"\"\"Show how to use list comprehensions and zip\"\"\"\n\nsunday_temps = [76, 78, 86, 54, 88, 77, 66, 55, 44, 57, 58, 58, 78, 79, 69, 65]\nmonday_temps = [... | python | new_file | 1 | 4 | mit | 5d2246cac222cd035924d2e68acaddca3a726fb7 | kentoj/python-fundamentals | list_comprehensions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to upload dump to s3\n\nThis is a simple python script which uses the signed url previously\ngenerated to upload the encrypted dump to s3 using the requets library.\n\nIf the response from s3 is not successful, an error is raised ... | python | new_file | 1 | 2 | mit | bb103cd384702b68e36b4588e679f86568565551 | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | snapshot/upload-dump-to-s3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add method to calculate hole card combinations in game"
},
{
"role": "assistant",
"content": "import scipy.misc\nimport scipy.special\n\n\ndef get_num_hole_card_combinations(game):\n num_players = game.get_num_players()\n n... | python | new_file | 1 | 1 | mit | cba19fbadf8d69b567255a8282974749aff57835 | JakubPetriska/poker-cfr,JakubPetriska/poker-cfr | tools/game_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD EXPORT_PUID.PY * USER CAN USE IT TO GET PUID"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# coding: utf-8\n\nfrom wxpy import *\n\n'''\n使用 cache 来缓存登陆信息,同时使用控制台登陆\n'''\nbot = Bot('bot.pkl', console_qr=False)... | python | new_file | 3 | 0 | mit | 3f1353d48b688c65f9dec0b7e3b753b5c3cfc9bb | robot527/LCBot,Yinr/LCBot,LCTT/LCBot | export_puid.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that generates a random invalid HTTP request"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\nfrom twisted.python import usage\n\nfrom ooni.utils import randomStr\nfrom ooni.templates import tcpt\n\nclas... | python | new_file | 1 | 3 | bsd-2-clause | ebf39da6ee59e2fb55226e5c256553ce1093006c | Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-prob... | nettests/core/http_invalid_requests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement simple tool to print proto descriptor files\n\nChange-Id: I6b2a2d399bd490a85668e4a53c84a87abe828a46"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# Copyright (C) 2021 The Android Open Source Project\n#\... | python | new_file | 1 | 1 | apache-2.0 | a586973dc63f56dfc180add0f0ae41b6c0475641 | google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto | tools/print_descriptor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix backward incompatility. This module is deprecated and will be removed in version 2.2"
},
{
"role": "assistant",
"content": "\"\"\"\nDeprecated; the PyCodeEdit class has been moved into pyqode.python.widgets.\n\nThis file will... | python | new_file | 1 | 0 | mit | 548fa6380fc0f76708e414a1a3165dde13a663d9 | pyQode/pyqode.python,zwadar/pyqode.python,pyQode/pyqode.python,mmolero/pyqode.python | pyqode/python/code_edit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to update the nysa-verilog path\n\nThis path is used to tell Nysa where to look for verilog modules"
},
{
"role": "assistant",
"content": "#! /usr/bin/python\nimport os\nimport json\nimport site\n\nPATH = os.path.abs... | python | new_file | 2 | 0 | mit | 98ee8824fcf8a9136b6a48a56108cc5c175f5d00 | CospanDesign/nysa-verilog,CospanDesign/nysa-verilog | nysa-path.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add y.a. script for showing except working"
},
{
"role": "assistant",
"content": "def take_beer(fridge, number=1):\n if \"beer\" not in fridge:\n raise Exception(\"No beer at all:(\")\n\n if number > fridge[\"beer\"]... | python | new_file | 1 | 3 | bsd-2-clause | fc89664fd75f787b03953d8eac3ec99b6fdf19de | drednout/letspython,drednout/letspython | lesson5/exceptions_except.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for label management"
},
{
"role": "assistant",
"content": "import steel\nimport unittest\n\n\nclass FieldTests(unittest.TestCase):\n def test_auto_label(self):\n # One word\n field = steel.Bytes(size=1... | python | new_file | 1 | 1 | bsd-3-clause | 620a58856a3051cb6522b94ef68900cdfbdac3b6 | gulopine/steel-experiment | tests/fields/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests showing problems with ctrlutil.unwrap\n\nThe routine ctrlutil.unwrap fails if there are large jumps in phase."
},
{
"role": "assistant",
"content": "import unittest\nimport numpy as np\nfrom control.ctrlutil import *\n\... | python | new_file | 5 | 2 | bsd-3-clause | 51536bfdd41c4814f51049fcb91e59327d1515c9 | murrayrm/python-control,roryyorke/python-control,python-control/python-control | control/tests/ctrlutil_test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new twine-upload functionality"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom twine.commands import upload\n\n\ndef test_find_dists_expands_globs():\n files = sorted(upload.find_dists(['twine/__*.py... | python | new_file | 1 | 1 | apache-2.0 | abe81ab36ec3468cc12243d16fe3d43d5d2752a4 | pypa/twine,warner/twine,reinout/twine,sigmavirus24/twine,beni55/twine,dstufft/twine,jamesblunt/twine,mhils/twine | tests/test_upload.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add draft of wrapper script"
},
{
"role": "assistant",
"content": "import sys\nimport os\nimport subprocess\nimport json\nfrom scipy import stats\nfrom argparse import ArgumentParser\n\nparser = ArgumentParser(description=\"Get I... | python | new_file | 5 | 0 | cc0-1.0 | 94ff998fbda79e3760f8ead366a88654512597b6 | NCBI-Hackathons/rnaseqview,NCBI-Hackathons/rnaseqview,NCBI-Hackathons/rnaseqview,NCBI-Hackathons/rnaseqview,NCBI-Hackathons/rnaseqview | get_ideogram_annots.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for Fortran version of `storm`\n\nI chose to use `nose` for testing because it's convenient, and\nI'm treating the original version of `storm` as a black box."
},
{
"role": "assistant",
"content": "#! /usr/bin/env ... | python | new_file | 10 | 3 | mit | 20745f81d89efd48b83d448bef60bf809999d32e | mdpiper/storm,csdms-contrib/storm,csdms-contrib/storm,mdpiper/storm | testing/test_storm_f.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add adjacency list data structure"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nif __name__ == '__main__':\n from os import getcwd\n from os import sys\n sys.path.append(getcwd())\n\nfrom helpers.disp... | python | new_file | 1 | 2 | apache-2.0 | f331780f48d9f053ba770cade487417537cc2a93 | christabor/MoAL,christabor/MoAL,christabor/MoAL,christabor/MoAL,christabor/MoAL | data_structures/graphs/adjacency_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migrations for image field in model"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.8 on 2018-02-19 14:33\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | new_file | 1 | 0 | mit | 71f7f9b344f6475dc86adf00757f265455112aa5 | nikolaystanishev/traffic-sign-recognition | web/Aovek/migrations/0002_video_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make fields of provenance not null, and fix other validation issues"
},
{
"role": "assistant",
"content": "\"\"\"migrate provenance to not null\n\nRevision ID: 469ece903d76\nRevises: 6b07e9a3589d\nCreate Date: 2021-05-02 09:48:57... | python | new_file | 3 | 1 | bsd-3-clause | 8006a9afbffc1636702802cf5613ba0aaf1c71ec | psi4/mongo_qcdb,psi4/mongo_qcdb | qcfractal/alembic/versions/469ece903d76_migrate_provenance_to_not_null.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights kth permutation problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Kth Permutation Problem\n\nfrom itertools import permutations\n\n\ndef kthPermutation(numbers, k):\n retur... | python | new_file | 3 | 3 | mit | 7d46787474dbc1902cf35fad0ad57c2336ef22f8 | HKuz/Test_Code | CodeFights/kthPermutation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example to list IAM users with service resource"
},
{
"role": "assistant",
"content": "# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \... | python | new_file | 1 | 0 | apache-2.0 | 31f2b8407a4a369dd79bf73f8a838d2bb22d2c19 | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | python/example_code/iam/list_users_with_resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fasta line break script"
},
{
"role": "assistant",
"content": "\"\"\"\nReformat a single entry fasta file.\n\nE.g. useful if a fasta file contains a sequence in a single long\nline. The Biopython SeqIO writer will generate a ... | python | new_file | 1 | 0 | isc | aab8426c7f917315c6d08dd4389b6c5bbcd53441 | konrad/kuf_bio_scripts | change_line_breaks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [vigir_ltl_specification] Add test suite for a-o formulas"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom activation_outcomes import *\n\nimport unittest\n\nclass FormulaGenerationTests(unittest.TestCase):\n\... | python | new_file | 3 | 1 | bsd-3-clause | ba92b42f0729b68648aa485e02314e2a7a7997cb | team-vigir/vigir_behavior_synthesis,team-vigir/vigir_behavior_synthesis | vigir_ltl_specification/src/vigir_ltl_specification/test_activation_completion.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [util] Implement a script for extracting profile data from device output\n\nThis change introduces a python script that extracts profile data from\ndevice output.\n\nSigned-off-by: Alphan Ulusoy <<EMAIL>>"
},
{
"role": "assistant",
... | python | new_file | 1 | 6 | apache-2.0 | df4e3d8a1db1b9195b70d95eb4fdcd45a7ca4b23 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | util/device_profile_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert arrows notebook to importable py file"
},
{
"role": "assistant",
"content": "import numpy as np\nimport plotly.graph_objs as go\n\n\ndef p2c(r, theta, phi):\n \"\"\"Convert polar unit vector to cartesians\"\"\"\n retu... | python | new_file | 1 | 3 | mit | a948e35ddc1121d26a851fe1f06032115302c038 | cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations,cydcowley/Imperial-Visualizations | visuals_EM/plotly_arrows.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Save cloud shell deploy template example"
},
{
"role": "assistant",
"content": "# deploytemplate.py\n# authenticates using CLI e.g. run this in the Azure Cloud Shell\n# takes a deployment template URI and a local parameters file ... | python | new_file | 1 | 0 | mit | f0d8821b42a017e95dc9528e051e7700bfde64e1 | gbowerman/azurerm | examples/deploytemplate-cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a template for making new tests."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n\"\"\" Template for writing new test classes.\n\"\"\"\n\nimport unittest\nimport sys, os, re\n\n# from multiqc import ...\n\n# This ... | python | new_file | 4 | 1 | mit | 3ea556af950be81db5b1eec7a78429e286715688 | ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData | unit_tests/test_template.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration for earlier changes"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\nimport mpt... | python | new_file | 1 | 0 | mit | 604a413173c1699e954bf689ea948f5fcc58c9d6 | tuomas777/linkedevents,aapris/linkedevents,tuomas777/linkedevents,tuomas777/linkedevents,aapris/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,aapris/linkedevents | events/migrations/0022_auto_20160229_2111.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing wrapper for dials.space_group"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\nimport os\nfrom xia2.Driver.DriverFactory import DriverFactory\nfrom xia2.Handlers... | python | new_file | 1 | 3 | bsd-3-clause | dbc6e2b41ca6afc759e7bdad102e40fc7404d7de | xia2/xia2,xia2/xia2 | Wrappers/Dials/SpaceGroup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Improve unit tests for python-glanceclient.glanceclient.common.base\n\nAdd several tests for glanceclient.common.base module\n\nFixes: bug #1144158\nChange-Id: Ifc288075c79849ee1384f09f513874ee08cd0248"
},
{
"role": "assistant",
... | python | new_file | 1 | 1 | apache-2.0 | ab36778ec3c8ed69ce798816161ee35a368e2dc2 | ntt-sic/python-glanceclient,citrix-openstack-build/python-glanceclient,metacloud/python-glanceclient,alexpilotti/python-glanceclient,metacloud/python-glanceclient,klmitch/python-glanceclient,klmitch/python-glanceclient,citrix-openstack-build/python-glanceclient,varunarya10/python-glanceclient,JioCloud/python-glanceclie... | tests/test_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a class that implements the IPv6 routing header."
},
{
"role": "assistant",
"content": "# Copyright (C) 2013, Neville-neil Consulting\n# All Rights Reserved.\n#\n# Redistribution And Use In Source And Binary Forms, With Or Wi... | python | new_file | 10 | 1 | bsd-3-clause | 51c954e49d19ebb5e707ec3cd164d3fd9ba5fbe0 | gvnn3/PCS,gvnn3/PCS | pcs/packets/ipv6ext.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ppc branch test suite"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Capstone by Nguyen Anh Quynnh <<EMAIL>>\n# PPC Branch testing suite by kratolp\nfrom __future__ import print_function\nimport sys\nfrom c... | python | new_file | 5 | 4 | bsd-3-clause | 39a65299bd72019cce3691cabd5f2d8afebc61ac | dynm/capstone,bughoho/capstone,pyq881120/capstone,zneak/capstone,capturePointer/capstone,NeilBryant/capstone,dynm/capstone,code4bones/capstone,pyq881120/capstone,pranith/capstone,sigma-random/capstone,xia0pin9/capstone,xia0pin9/capstone,techvoltage/capstone,8l/capstone,krytarowski/capstone,dynm/capstone,bowlofstew/caps... | suite/ppcbranch.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add list of users to staff/users\n\nReturn a list of users to staff/users index view"
},
{
"role": "assistant",
"content": "from django.shortcuts import get_object_or_404, render, redirect\nfrom django.shortcuts import render\nfr... | python | new_file | 7 | 4 | apache-2.0 | 4a561e594aa026ea038f0df4a65bd0438beaa112 | patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass-python,patrickspencer/compass,patrickspencer/compass,patrickspencer/compass | webapp/apps/staff/views.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy file contents into path"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function, absolute_import\nimport argparse\nimport logging\nimport ds9\n... | python | new_file | 3 | 1 | mit | af7a16eb085ae9a436dbd787e487a9228b66652f | mindriot101/srw | srw/find_object.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add substitution and scrape_header tests"
},
{
"role": "assistant",
"content": "from utils import LinkTest, main\nimport re\n\nclass SubstitutionTest(LinkTest):\n def testSubstititonFunction(self):\n text = \"\"\"\n ... | python | new_file | 3 | 1 | mit | 086aad14864ddeae8cf050f5ed2b0f57773a4fad | albert12132/templar,albert12132/templar | tests/link_tests/substitution_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fortran ABI mismatch test for scipy.linalg.\n\ngit-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@5023 d6536bca-fef9-0310-8506-e4c0a848fbcf"
},
{
"role": "assistant",
"content": "from subprocess import call, PIPE, Popen\nim... | python | new_file | 5 | 5 | bsd-3-clause | 0cad5e1673069d0fb8f2abb4eb6b062e3461fb70 | mikebenfield/scipy,ChanderG/scipy,chatcannon/scipy,juliantaylor/scipy,newemailjdm/scipy,sonnyhu/scipy,WarrenWeckesser/scipy,mhogg/scipy,arokem/scipy,newemailjdm/scipy,FRidh/scipy,Eric89GXL/scipy,mgaitan/scipy,pschella/scipy,larsmans/scipy,anntzer/scipy,pizzathief/scipy,chatcannon/scipy,mortonjt/scipy,vigna/scipy,sriki1... | scipy/linalg/tests/test_build.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix release - add missed file - forced"
},
{
"role": "assistant",
"content": "# -*- coding: utf8 -*-\n\"\"\"\n@author Sergey Dryabzhinsky\n\"\"\"\n\nfrom time import time\n\nclass TimedCache(object):\n \"\"\"\n Cache storag... | python | new_file | 1 | 3 | mit | de10ebd4192576a7a9f9fc73871cc56479f4d686 | sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs | dedupsqlfs/lib/cache/_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for organize views"
},
{
"role": "assistant",
"content": "from django.urls import reverse\n\n\ndef test_form_thank_you(client):\n # Access the thank you page\n resp = client.get(reverse('organize:form_thank_you'))... | python | new_file | 1 | 1 | bsd-3-clause | a78c0cec23365ed6861b68f40fd7481787aa2d81 | DjangoGirls/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls | tests/organize/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Revert \"fix deep night bugs :)\""
},
{
"role": "assistant",
"content": "from urllib.parse import quote, urlsplit, urlunsplit\n\n\ndef transform(iri): # преобразует кириллицу в URI\n parts = urlsplit(iri)\n uri = urlunspli... | python | new_file | 1 | 1 | mit | b7af9190f9edf015508665c9b257432434311279 | dimishpatriot/img_pars | iri_to_uri.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix the \"Feed Pigeon\" problem"
},
{
"role": "assistant",
"content": "def checkio(n):\n return feed(n, 1, 0)\n\n\ndef feed(n, pigeon, last):\n if n <= last:\n return last\n if last < n <= pigeon:\n return ... | python | new_file | 1 | 4 | mit | 4899fdff735e0dd099764327eb6e1c88ca40fb58 | edwardzhu/checkio-solution | Home/feedPigeons.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a custom testtools matcher for verifying invocations"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nfrom testtools im... | python | new_file | 1 | 1 | mit | 07da39fcc68027d4373a467cbb08c35a5d941545 | znerol/spreadflow-core,spreadflow/spreadflow-core | spreadflow_core/test/matchers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add LimitTabs plugin to replace ZenTabs"
},
{
"role": "assistant",
"content": "\"\"\"Same idea as ZenTabs, but simplified logic since we know tabs are already\nordered by MRU.\n\nUnlike ZenTabs, this also makes it much easier to ... | python | new_file | 1 | 7 | mit | fe65f99972a940b13652e98778fdaec8f98142bc | russelldavis/sublimerc | limit_tabs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a class to represent myria relation keys"
},
{
"role": "assistant",
"content": "\"\"\"Representation of a Myria relation key.\n\nMyria relations are identified by a tuple of user, program, relation_name.\"\"\"\n\nclass Relati... | python | new_file | 4 | 3 | bsd-3-clause | 6e878dae6669b7344723e5c49e0dec736b86fc19 | uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco | raco/relation_key.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example file to convert tv to rdf\n\nSigned-off-by: Tushar Mittal <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\nConverts an tag/value file to RDF format.\nUsage: tv_to_rdf <tagvaluefile> <r... | python | new_file | 4 | 2 | apache-2.0 | 1fcf95eb58a186f8fbb2d901a0242b3b39d960d2 | spdx/tools-python | examples/tv_to_rdf.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for echo server; unicode input not passing tests yet"
},
{
"role": "assistant",
"content": "from echo_client import client\n\n\ndef test_1():\n assert client('This is a unicode test') == 'This is a unicode test'\n\n\... | python | new_file | 1 | 1 | mit | 432a798f340dd9e0ecb47bf5661a606d2a078547 | jwarren116/network-tools,jwarren116/network-tools | test_echo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create app to record Pi Sense data"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nfrom Sensor import SenseController\nfrom KeyDispatcher import KeyDispatcher\nfrom Display import Display\nfrom DataLogger import ... | python | new_file | 1 | 2 | mit | 1a29e5ab7e58b8eef69358d2fdfb0e9e26367fe2 | thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x | app/sense.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial blivet unit test\n\nJust a super simple sanity check of the class constructor. More\ntests to follow."
},
{
"role": "assistant",
"content": "# Copyright 2014 Red Hat, Inc.\n#\n# Licensed under the Apache License, Ver... | python | new_file | 3 | 1 | apache-2.0 | da194d8c0b832a372d697ff4d3c87339334037d5 | rdo-management/os-disk-config,agroup/os-disk-config | os_disk_config/tests/test_impl_blivet.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for the filter module."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom numpy import all, allclose, array, float32\n\nfrom .. import filter\n\n\nx = array([\n [0, 1, 0],\n [1, 1, 1],\n ... | python | new_file | 1 | 1 | isc | 8bf9bb5929bd73699b7daacedbed6b2e54fa36e7 | eliteraspberries/avena | avena/tests/test-filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add problem 39, right triangle perimeter options"
},
{
"role": "assistant",
"content": "from time import time\nfrom math import pow, sqrt\n\n\nLIMIT = 1000\nPERIMETERS = [[0 for i in range(j)] for j in range(LIMIT/2)]\n\n\ndef mo... | python | new_file | 3 | 8 | mit | fbc71aa9efc1aba4f8bd9294af24d17574b614da | dimkarakostas/project-euler | problem_39.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new class to handle the valid states for the touch lamp"
},
{
"role": "assistant",
"content": "import unittest\n\n\nclass LampStateMachine(unittest.TestCase):\n OFF = 0\n LOW = 33\n MEDIUM = 66\n HIGH = 100\n\n NO_TOUC... | python | new_file | 1 | 1 | bsd-2-clause | e86ee27ec1142dcd44990c97f3531dd7940313b7 | thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp,thelukemccarthy/Wakeup-Lamp | lamp_state_machine.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add uncommitted migration from past changes\n\nRefs -"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2018-12-12 12:35\nfrom __future__ import unicode_literals\n\nfrom django.db imp... | python | new_file | 1 | 0 | mit | 09f5fb12074e419c82c76d856c208116e0f43a70 | andersinno/kuvaselaamo,andersinno/kuvaselaamo,andersinno/kuvaselaamo | hkm/migrations/0035_auto_20181212_1435.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for cuml & cudf to prevent regresssion.\n\nhttp://b/144522678"
},
{
"role": "assistant",
"content": "import unittest\n\nimport cudf\nfrom cuml.cluster import DBSCAN\n\nfrom common import gpu_test\n\n\nclass TestRapids(u... | python | new_file | 3 | 1 | apache-2.0 | 0219b1ad7e093ffc2e7c0f455e59be0294fc6175 | Kaggle/docker-python,Kaggle/docker-python | tests/test_rapids.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python implementation for problem 2"
},
{
"role": "assistant",
"content": "f1, f2, s, n = 0, 1, 0, 4000000\nwhile f2 < n:\n f2, f1 = f1, f1 + f2\n if f2 % 2 == 0:\n s += f2\nprint s\n"
}
] | python | new_file | 2 | 0 | mit | 66f05b105e9330dc213bc76c25f8c3b569dad3be | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | problem_2/solution.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to rename status enum values\n\nChange status values for requests and assessments"
},
{
"role": "assistant",
"content": "# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed und... | python | new_file | 1 | 3 | apache-2.0 | 40d5f91fc2577da74fcaec5efd4684927d1561bb | edofic/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc... | src/ggrc/migrations/versions/20160422143804_5599d1769f25_rename_status_field_values.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add util function for utcnow with pytz"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\nimport pytz\nfrom datetime import datetime\n\ndef utcnow():\n utc_now = datetime.utcnow()\n utc_now = utc_now.replace(... | python | new_file | 1 | 1 | bsd-3-clause | 864cf50cc543f53b21fced877baa3bdf4f582997 | Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith | lazyblacksmith/utils/time.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for configuration argument\n\nThis test do not use mock, and only searches the `configuration` option in\nthe help messages."
},
{
"role": "assistant",
"content": "import os\nimport subprocess\n\nPROJECT_DIR = os.getcw... | python | new_file | 1 | 1 | bsd-3-clause | 36a7061a61b5216499d3a284d6d41f1373b7e85e | blindroot/django-configurations,cato-/django-configurations,NextHub/django-configurations,jazzband/django-configurations,nangia/django-configurations,pombredanne/django-configurations,jezdez/django-configurations,seenureddy/django-configurations,jazzband/django-configurations,incuna/django-configurations,gatherhealth/d... | tests/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add extended version of argparse.ArgumentParser."
},
{
"role": "assistant",
"content": "import argparse\nimport logging\nimport sys\n\nimport bandoleers\n\n\nclass ArgumentParser(argparse.ArgumentParser):\n \"\"\"\n Impleme... | python | new_file | 1 | 3 | bsd-3-clause | 46b63025f982062af178dcbaa1f5a6843895371f | aweber/bandoleers | bandoleers/args.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [F] Add bigram and trigram analyzer"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\"\"\"\nThis receives text from stdin and does a collocation analysis\n\"\"\"\n\nimport sys\nimport nltk\nfrom nltk.collocations i... | python | new_file | 4 | 2 | mit | 0607730872442207574d166649b0dd6e0ce78509 | suchkultur/trumpeltier | analytics/nltk_collocations.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sieve of atkin in python"
},
{
"role": "assistant",
"content": "import sys\nimport math\n\nargs = sys.argv\n\nN = len(args) > 1 and int(sys.argv[1]) or 1000\nnsqrt = int((math.pow(N, 0.5)))\nis_prime = [False] * N\n\nfor x in... | python | new_file | 6 | 0 | mit | 675698600b600a27d02b29b91a0fc4a30e03de1a | Zorbash/linguaphone,Zorbash/linguaphone,Zorbash/linguaphone | python/sieve_atkin.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests for helper functions."
},
{
"role": "assistant",
"content": "import tempfile\nimport unittest\n\nimport ephem\nfrom pygcvs.helpers import dict_to_body, read_gcvs\n\n\nGCVS_CONTENTS = \"\"\"\n NNo GCVS ... | python | new_file | 1 | 1 | mit | be1f66af24e3a286cd82f092c3ee7e5b6ad9df69 | zsiciarz/pygcvs | tests/test_helpers.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.