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 files for rule's invalid syntax validation"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest i... | python | new_file | 3 | 0 | mit | 307e4fda61f92e344bfd90c1a43f5a9076e7b832 | PatrikValkovic/grammpy | tests/rules_tests/isValid_tests/InvalidSyntaxTest.py | rejected_duplicate | Near-duplicate of sample 5873 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper script for getting plaso timeline in to timesketch"
},
{
"role": "assistant",
"content": "# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you... | python | new_file | 5 | 0 | apache-2.0 | 01710f18efbe29dc5cf187726d5c686beec7e6e7 | armuk/timesketch,armuk/timesketch,google/timesketch,armuk/timesketch,google/timesketch,armuk/timesketch,google/timesketch,lockhy/timesketch,google/timesketch,lockhy/timesketch,lockhy/timesketch,lockhy/timesketch | utils/add_plaso_timeline.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add super-simple deduplication filter that uses a dictionary"
},
{
"role": "assistant",
"content": "# Pull URL\n# Strip query string\n# Query exists\n# IFN save to sqlite\n# IFN push to queue\n# IFY do nothing\n\nseen = {}\n\nif ... | python | new_file | 3 | 0 | mit | 2c0fc3387a6dbd54bbcd4c47952ce8739d0b2152 | ryansb/zaqar-webscraper-demo | dedup_worker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add beginnings of a Python driver. Currently just prints out input file."
},
{
"role": "assistant",
"content": "import ctypes\nimport sys\n\ndef parse_warc(filename):\n pass\n\ndef parse_file(filename):\n with open(filename) a... | python | new_file | 3 | 1 | apache-2.0 | 3a9807fd14257c49490ec429d7365c902209508c | nostrademons/GumboStats,nostrademons/GumboStats | gumbo_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script that uses the JSON metadata to create ordered symlinks."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Copyright (C) 2013 Tobias Gruetzmacher\n\"\"\"\nThis script takes the JSON file created by 'dosa... | python | new_file | 1 | 7 | mit | 1314da3ffbaa42aca4a917aef8a230478a22be68 | webcomics/dosage,mbrandis/dosage,peterjanes/dosage,Freestila/dosage,wummel/dosage,wummel/dosage,blade2005/dosage,Freestila/dosage,mbrandis/dosage,peterjanes/dosage,webcomics/dosage,blade2005/dosage | scripts/order-symlinks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new Levenshtein alignment"
},
{
"role": "assistant",
"content": "import pytest\nfrom .._align import align\n\n\n@pytest.mark.parametrize('string1,string2,cost', [\n (b'hello', b'hell', 1),\n (b'rat', b'cat', 1... | python | new_file | 2 | 1 | mit | 8180c84a98bec11308afca884a4d7fed4738403b | explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,recognai/spaCy,honnibal/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/spaCy,spacy-io/spaCy,spacy-io/spaC... | spacy/tests/test_align.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split images into bf and bc bears. Defaults to images."
},
{
"role": "assistant",
"content": "#! /usr/bin/python3\n\nimport sys\nimport argparse\nimport xml_utils as u\nimport datetime\nfrom argparse import RawTextHelpFormatter\... | python | new_file | 4 | 2 | mit | 36d7bc4719490b046d8782465ddeba6e8240233e | hypraptive/bearid,hypraptive/bearid,hypraptive/bearid | tools/xml_split_images_locale.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce a live camera viewer with Qt."
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- coding:utf-8 -*- \n\n\n#\n# Qt interface to display AVT cameras\n#\n\n\n#\n# External dependencies\n#\nfrom PyQt4 import... | python | new_file | null | null | mit | d782809746cfb403358bdfb10215b70c96498264 | microy/PyStereoVisionToolkit,microy/VisionToolkit,microy/VisionToolkit,microy/StereoVision,microy/StereoVision,microy/PyStereoVisionToolkit | QtViewer.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add imgadm beacons for SmartOS"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\nBeacon that fires events on image import/delete.\n\n.. code-block:: yaml\n\n ## minimal\n # - check for new images every 1 ... | python | new_file | 3 | 13 | apache-2.0 | 0781d105e4182bdd8abf1a8c7185311a48273c28 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/beacons/smartos_imgadm.py | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create script to pad and trim fastq reads to one length"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | python | new_file | 3 | 0 | mit | d251a2b2cd449ed5078b41b09f50003786f3bbde | alliemacleay/misc | seq_pad.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create helper script providing multiprocessing support."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding: utf-8\n\nimport argparse\nimport subprocess as sub\n\n\n### Parse command line arguments\nparser = ... | python | new_file | 1 | 0 | mit | 8b63dc73b4e3303d1b86faf42f635f3ce01e9da4 | kubkon/des-in-python | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add date updated to Owner"
},
{
"role": "assistant",
"content": "\"\"\"Added date updated to Owner\n\nRevision ID: 20087beff9ea\nRevises: 2dc72d16c188\nCreate Date: 2014-03-09 01:43:00.648013\n\n\"\"\"\n\n# revision identifiers, ... | python | new_file | 1 | 1 | apache-2.0 | 845615f2a34c5680ed22a2f4eafa5febe7cd7246 | CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords | alembic/versions/20087beff9ea_added_date_updated_t.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add organisation values for the Enterprise Europe Network."
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0101_een_logo\nRevises: 0100_notification_created_by\nCreate Date: 2017-06-26 11:43:30.374723\n... | python | new_file | 1 | 1 | mit | 4fe62ac1211e68f1d9c656453bdf71d6849c3daf | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0101_een_logo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to download data from MDCS"
},
{
"role": "assistant",
"content": "\"\"\"Fetch images from MDCS.\n\"\"\"\n\nimport json\nimport requests\nimport xmltodict\n\n\ndef download_mdcs_data():\n user = \"dwheeler\"\n pas... | python | new_file | 1 | 5 | mit | d25af87006ac21f55706c3a5579aec3c961b88e8 | wd15/sem-image-stats | download_mdcs_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use indexed text with sqlite"
},
{
"role": "assistant",
"content": "import csv\nimport sqlite3\n\nconn = sqlite3.connect('processed-lines.db')\nc = conn.cursor()\n# c.execute('CREATE TABLE processed (cadastral_designation text, b... | python | new_file | 1 | 0 | mit | 5be91f4e7b3607090e94fbf221628a359063823d | PDOK/data.labs.pdok.nl,PDOK/data.labs.pdok.nl,PDOK/data.labs.pdok.nl,PDOK/data.labs.pdok.nl,PDOK/data.labs.pdok.nl | data/bag-brk/create_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a little to models\n\nAdd a little to models\n(Should I upload migrations?)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2016-01-06 15:07\nfrom __future__ import unicode_literal... | python | new_file | 1 | 0 | mit | 1a6818d4829c3da42750f6d0f042df203434595c | LeeYiFang/Carkinos,LeeYiFang/Carkinos,LeeYiFang/Carkinos,LeeYiFang/Carkinos | Carkinos/probes/migrations/0002_auto_20160106_2307.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration that had conflict from merge with master"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.18 on 2019-01-09 19:35\nfrom __future__ import unicode_literals\n\nfrom django.db i... | python | new_file | 1 | 0 | bsd-3-clause | e0c82bec30568eb845c71fb0335d6ac5edef18e9 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/translations/migrations/0002_transifexblacklist.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ENH: Add some tests for polynomial printing."
},
{
"role": "assistant",
"content": "import numpy.polynomial as poly\nfrom numpy.testing import TestCase, run_module_suite, assert_\n\nclass test_str(TestCase):\n def test_polynom... | python | new_file | 1 | 1 | bsd-3-clause | 64fce7c67849f44492d55ccf8a745b252bf1368b | jakirkham/numpy,bertrand-l/numpy,githubmlai/numpy,SiccarPoint/numpy,jorisvandenbossche/numpy,ChristopherHogan/numpy,GrimDerp/numpy,simongibbons/numpy,pizzathief/numpy,ahaldane/numpy,argriffing/numpy,sigma-random/numpy,kirillzhuravlev/numpy,MSeifert04/numpy,NextThought/pypy-numpy,matthew-brett/numpy,astrofrog/numpy,ogri... | numpy/polynomial/tests/test_printing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for getting all toilets"
},
{
"role": "assistant",
"content": "import json\nimport requests\nfrom requests_testadapter import TestAdapter\nimport unittest\n\nimport migrate_toilet_codes\n\n\nclass TestCreateSession(unit... | python | new_file | 1 | 1 | bsd-3-clause | b35e780364ca2d06902302b165ce2261ec6795a1 | praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js,praekelt/go-imali-yethu-js | ona_migration_script/test_migrate_toilet_codes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add failing test for index route\n\nCurrently the index route gloms every other route."
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nclass TestIndex(TestCase):\n \"\"\"Verify the index page is serv... | python | new_file | 1 | 3 | mit | 80c749e8b8395f20305c04c480fbf39400f1b5a4 | wkevina/feature-requests-app,wkevina/feature-requests-app,wkevina/feature-requests-app | features/tests/test_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add usb bridge test(CDC & HID)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2.7\n\n# This script aim to make a loopback test on cdc or hid.\n# The statics is used for comparison, it is not accurate.\n\nfrom serial ... | python | new_file | 9 | 7 | unlicense | 0202f0bd4358d68917af19910bb4e1f0a3dda602 | archangdcc/avalon-extras,archangdcc/avalon-extras,Canaan-Creative/Avalon-extras,archangdcc/avalon-extras,Canaan-Creative/Avalon-extras,qinfengling/Avalon-extras,qinfengling/Avalon-extras,qinfengling/Avalon-extras,Canaan-Creative/Avalon-extras,archangdcc/avalon-extras,Canaan-Creative/Avalon-extras,qinfengling/Avalon-ext... | scripts/avalon-usb2iic-test.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add New Test Which Monitors Output\n\nThis test monitors STDERR to detect progress of the progressbar"
},
{
"role": "assistant",
"content": "pytest_plugins = \"pytester\"\n\n\ndef test_simple_example(testdir):\n \"\"\" Run the... | python | new_file | 1 | 1 | bsd-3-clause | c4c52c98f4c8596b4f19c88fb64e1b0af4f9c4cd | WoLpH/python-progressbar | tests/test_monitor_progress.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first-party JavaScript build rule library"
},
{
"role": "assistant",
"content": "\"\"\"Helpers for writing rules for first-party JavaScript packages.\"\"\"\n\n__all__ = [\n 'define_package',\n 'find_package',\n]\n\nimpo... | python | new_file | 1 | 4 | mit | 3f7b54496826f496863de545a601c23c2c06427a | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | shipyard2/shipyard2/rules/javascripts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for _validate_key_file_permissions in ec2 module"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# Import Python libs\nfrom __future__ import absolute_import\nimport os\nimport tempfile\n\n# Import... | python | new_file | 4 | 1 | apache-2.0 | 313e9cae068192fe11ad10ea0b5c05061b0e5c60 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/cloud/clouds/ec2_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for datetime change.\n\nThis should have been done when we changed this in the model, but it\nwasn't."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom so... | python | new_file | 4 | 1 | bsd-3-clause | 2c651b7083ec368ebf226364a1a1aba5f5ec147e | hoosteeno/fjord,DESHRAJ/fjord,staranjeet/fjord,hoosteeno/fjord,lgp171188/fjord,DESHRAJ/fjord,hoosteeno/fjord,Ritsyy/fjord,staranjeet/fjord,lgp171188/fjord,rlr/fjord,rlr/fjord,staranjeet/fjord,hoosteeno/fjord,lgp171188/fjord,staranjeet/fjord,rlr/fjord,mozilla/fjord,mozilla/fjord,lgp171188/fjord,Ritsyy/fjord,Ritsyy/fjord... | fjord/feedback/migrations/0003_auto__chg_field_simple_created.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add client sample for test - Connect to server - Receive data from server - Strip the data and print"
},
{
"role": "assistant",
"content": "from socket import *\n\nhost = '127.0.0.1'\nport = 1234\nbufsize = 1024\naddr = (host, po... | python | new_file | 2 | 0 | apache-2.0 | 635ed78543b3e3e8fe7c52fa91ee8516d617249d | peitaosu/motion-tools | data-travel/test_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a first small file watcher that counts words\n\n- Requires installing python watchdog framework"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport time\nimport logging\nfrom watchdog.observers import Observe... | python | new_file | 2 | 5 | mit | 162e7dd6595b0d9303ecb1da66893ee353ba413b | Kadrian/paper-gamification | tracker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a thread helper module"
},
{
"role": "assistant",
"content": "from threading import Thread, Lock\n\nlist_lock = Lock()\n\ndef run_in_thread(app):\n def wrapper(fn):\n def run(*args, **kwargs):\n app.logger.info('Star... | python | new_file | 1 | 1 | mit | d680d6a20890d3bbce96792fa1e86df28956a859 | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | helpers/threading.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple markov chain to compare output with RNN"
},
{
"role": "assistant",
"content": "# Simple Markov chain model for character-based text generation.\n#\n# Only tested with Python 3.6+\n#\n# Eli Bendersky (http://eli.thegr... | python | new_file | 1 | 5 | unlicense | 0cf2ce2331120c20de0cab384c5fdec763c25c68 | eliben/deep-learning-samples,eliben/deep-learning-samples | min-char-rnn/markov-model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create templatetag for put a settings var into context"
},
{
"role": "assistant",
"content": "from django import template\nfrom django.conf import settings\n\nregister = template.Library()\n\n\n@register.assignment_tag()\ndef set... | python | new_file | 1 | 1 | bsd-3-clause | 02d7e423416ab90bdc4db6428c51efaf6f33a4c6 | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/dbaas/templatetags/settings_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to delete existing cache values"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.7 on 2017-09-08 10:23\nfrom __future__ import unicode_literals\n\nfrom django.db import migr... | python | new_file | 1 | 1 | bsd-3-clause | 6a74915c3f197ef197a34514c7ff313ac0a68d2f | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/fixtures/migrations/0002_rm_blobdb_domain_fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for new service util"
},
{
"role": "assistant",
"content": "# Import Python Libs\nimport os\n\n# Import Salt Libs\nimport salt.utils.platform\n\n# Import Salt Testing Libs\nfrom tests.support.mock import patch, Mag... | python | new_file | 8 | 2 | apache-2.0 | 27f187d3cc5725b6ed912e15ecafb38a44cc4992 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/utils/test_win_service.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for the Document class"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom clippings.parser import Document\n\n\nclass DocumentTest(unittest.TestCase):\n\n def test_create_document(self):\n tit... | python | new_file | 1 | 1 | mit | e184b806c6170aad2bdee87c051ea6400e1d954e | samueldg/clippings | tests/parser_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a very simple performance testing tool."
},
{
"role": "assistant",
"content": "\"\"\"\nSimple peformance tests.\n\"\"\"\n\nimport sys\nimport time\n\nimport couchdb\n\n\ndef main():\n\n print 'sys.version : %r' % (sys.vers... | python | new_file | 4 | 5 | bsd-3-clause | b01076381ebc91f20c527f1632c7b3f2aa82d39a | ajmirsky/couchdb-python | perftest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test if C changes with more examples."
},
{
"role": "assistant",
"content": "\"\"\"\nObserve if C varies when we use more examples \n\"\"\"\nimport logging \nimport numpy \nimport sys \nimport multiprocessing \nfrom apgl.util.Pat... | python | new_file | 1 | 0 | bsd-3-clause | 93b2d93098c395d866f18e51b6ac42a9ba81a9b5 | charanpald/APGL | exp/modelselect/RealDataSVMExp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add class balance checking code"
},
{
"role": "assistant",
"content": "# Lint as: python3\n\"\"\"This script checks the balance of classes in the FDC dataset.\n\nClasses are split based on LOW_CALORIE_THRESHOLD and\nHIGH_CALORIE_... | python | new_file | 1 | 4 | apache-2.0 | fbf91352da4cf16be8462f57c71aa9f86f21746f | googleinterns/amaranth,googleinterns/amaranth | amaranth/data_analysis/class_balance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for counting DNA nucleotides"
},
{
"role": "assistant",
"content": "from collections import Counter\n\nif __name__ == '__main__':\n\n with open('data/rosalind_dna.txt', mode='r') as f:\n sequence = f.read()... | python | new_file | 2 | 0 | mit | 8da927a0a196301ce5fb2ef2224e556b4d414729 | MichaelAquilina/rosalind-solutions | problem1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for 500 error with slow responses\n\nwhen using redis as the rate limit storage and the response\nis slower than the rate limit window, 500 errors occur as the\nkey is not available post request for constructing the rate limit... | python | new_file | 1 | 2 | mit | 404c9b70cf9b6c27e0fb16be1556d01b5077a4f4 | alisaifee/flask-limiter,joshfriend/flask-limiter,alisaifee/limits,alisaifee/limits,joshfriend/flask-limiter,alisaifee/flask-limiter | tests/test_regressions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for creating numeric passwordlists using permutation & combination."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport itertools\nimport sys\n\n\ndef combination(elements,items):\n for combination in... | python | new_file | 6 | 2 | cc0-1.0 | f3eb1c8efbcd3695dba0037faa4f90328625f547 | JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology | permcomb.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to check the performance"
},
{
"role": "assistant",
"content": "import csv\nfrom os import listdir\nfrom pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation\n\n# read result and ground truth\nresult_dir = ... | python | new_file | 2 | 0 | mit | 39de01462baf3db60c5a0f5d8a3b529f798730ab | studiawan/pygraphc | pygraphc/bin/Check.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python tests for cosine squared angles"
},
{
"role": "assistant",
"content": "# -*- coding: iso-8859-1 -*-\n# Maintainer: joaander\n\nfrom hoomd import *\nfrom hoomd import md\ncontext.initialize()\nimport unittest\nimport os... | python | new_file | 16 | 3 | bsd-3-clause | 2585b44484b175bb116c228496069cc4269440c0 | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/md/test-py/test_angle_cosinesq.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add VSYNC GPIO output example."
},
{
"role": "assistant",
"content": "# VSYNC GPIO output example.\n#\n# This example shows how to toggle the IR LED pin on VSYNC interrupt.\n\nimport sensor, image, time\nfrom pyb import Pin\n\nse... | python | new_file | 3 | 0 | mit | 7997d02e52172b8ad0e96a845f953f90a6e739b7 | iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv | scripts/examples/02-Board-Control/vsync_gpio_output.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add scrapper of Bureau of Labor Statistis Employment status"
},
{
"role": "assistant",
"content": "#user/local/bin/python\n#uses python3\nimport urllib.request\nfrom bs4 import BeautifulSoup\n\nurl = \"http://www.bls.gov/cps/cpsa... | python | new_file | 1 | 0 | mit | d168256dd4b75375770b3391f716ceaba2cf722e | lexieheinle/python-productivity | cpsScrap.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sdb driver for etcd"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\netcd Database Module\n\n:maintainer: SaltStack\n:maturity: New\n:depends: python-etcd\n:platform: all\n\nThis module ... | python | new_file | 1 | 2 | apache-2.0 | cbb182ff0e999954c7a5c8fd19097a441762666b | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/sdb/etcd_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dodgy NetCDF creation example"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nfrom datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands\nfrom datacube.api.query ... | python | new_file | 8 | 0 | bsd-3-clause | 4bfc3f650bd5560f2e2e469252ea1166496a4b6b | omad/datacube-experiments | example1.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add methods for loading data sets"
},
{
"role": "assistant",
"content": "import os\nimport numpy as np\n\nimport sgf_wrapper\n\ndef load_sgf_positions(*dataset_names):\n for dataset in dataset_names:\n dataset_dir = os.... | python | new_file | 1 | 6 | apache-2.0 | 4316122225d2e523ff310f65479ea676e0aa02e3 | brilee/MuGo | load_data_sets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add exercise horse racing duals"
},
{
"role": "assistant",
"content": "N = int(raw_input())\nlst = []\n# Read the list\nfor i in xrange(N):\n lst.append(int(raw_input()))\n\n# Sort the list, ascending order\na = sorted(lst)\n#... | python | new_file | 2 | 0 | mit | c27685da10c85cb9876b4c73012da3ebff1915dc | AntoineAugusti/katas,AntoineAugusti/katas,AntoineAugusti/katas | codingame/easy/horse-racing_duals.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add premise of Bench Manager"
},
{
"role": "assistant",
"content": "from contextlib import contextmanager\n\nfrom ktbs_bench.utils.decorators import bench as util_bench\n\n\nclass BenchManager:\n def __init__(self):\n s... | python | new_file | 1 | 1 | mit | bbf28b1c7fa3fb9f9074b9d4879c30e810ab3f31 | ktbs/ktbs-bench,ktbs/ktbs-bench | ktbs_bench/utils/bench_manager.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for shell command"
},
{
"role": "assistant",
"content": "\"\"\"\ntests.test_shell_command\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nTests demo component.\n\"\"\"\nimport os\nimport tempfile\nimport unittest\n\nfrom homeassistant impo... | python | new_file | 1 | 1 | mit | 916c453d2ba939fb7eb15f4d87557c37bfc57a21 | Julian/home-assistant,ct-23/home-assistant,mezz64/home-assistant,pottzer/home-assistant,joopert/home-assistant,FreekingDean/home-assistant,eagleamon/home-assistant,betrisey/home-assistant,eagleamon/home-assistant,open-homeautomation/home-assistant,aequitas/home-assistant,open-homeautomation/home-assistant,bdfoster/blum... | tests/components/test_shell_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for newly refactored literal rule"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom mygrations.core.parse.rule_literal import rule_literal\n\nclass test_parse_regexp( unittest.TestCase ):\n\n def get_rule( se... | python | new_file | 1 | 1 | mit | 029de4a3a10f31b2d300e100db7767722698f00a | cmancone/mygrations,cmancone/mygrations | tests/core/parse/test_parse_literal.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for `communities` app.\n\nIt was created independently of changes to `events` app; probably because of some old code changes in `communities` app."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Ge... | python | new_file | 1 | 0 | mit | 5178b104993401f47b1c4d8e3c796bef379e389e | letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click | letsmeet/communities/migrations/0011_auto_20160318_2240.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test database.common for full coverage of database"
},
{
"role": "assistant",
"content": "import mock\nfrom linkr import db\nimport database.common\nfrom test.backend.test_case import LinkrTestCase\n\n\nclass TestCommon(LinkrTest... | python | new_file | 1 | 1 | mit | 717f3c5d4babe9feeb4e0d82fb2ea839d735c4b4 | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | test/backend/test_database/test_common.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an auto join script"
},
{
"role": "assistant",
"content": "__module_name__ = \"autojoin on invite\"\n__module_version__ = \"1.0\"\n\nimport hexchat\n\n\ndef join(word, word_eol, userdata):\n\thexchat.command('join ' + word[0]... | python | new_file | 1 | 1 | apache-2.0 | 612fb44b33c4f52488f3565c009188d61a8343c2 | arai-wa/hexchat-addons | python/autojoin_on_invite.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first example test of using h2o python API to gradle build regression suite."
},
{
"role": "assistant",
"content": "import sys\nsys.path.insert(1, '../../h2o-py/src/main/py')\n\nfrom h2o import H2OConnection\nfrom h2o import ... | python | new_file | 6 | 0 | apache-2.0 | e41ce4338334794466ba6918fc3b8a1f118d6b41 | mrgloom/h2o-3,brightchen/h2o-3,kyoren/https-github.com-h2oai-h2o-3,nilbody/h2o-3,madmax983/h2o-3,jangorecki/h2o-3,pchmieli/h2o-3,kyoren/https-github.com-h2oai-h2o-3,madmax983/h2o-3,YzPaul3/h2o-3,ChristosChristofidis/h2o-3,brightchen/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,printedheart/h2o-3,h2oai/h2o-3,PawarPawan/h2o-... | py/testdir_multi_jvm/test_gbm_prostate.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration script to fix templated orphans.\n\nRestore parents to orphaned nodes created during templating.\nSee scripts/fix_templated_orphans.py for details."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\... | python | new_file | 6 | 3 | apache-2.0 | 3fd3b376b1334dba0ffea3641dcbb32d788f4083 | amyshi188/osf.io,fabianvf/osf.io,mluke93/osf.io,GaryKriebel/osf.io,KAsante95/osf.io,ckc6cz/osf.io,revanthkolli/osf.io,cslzchen/osf.io,Nesiehr/osf.io,zkraime/osf.io,reinaH/osf.io,mluke93/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,asanfilippo7/osf.io,laurenrevere/osf.io,zkraime/osf.io,aaxelb/osf.io,emetsger/osf.io,Ghalko/... | scripts/fix_templated_orphans.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create tests for custom exceptions and warnings"
},
{
"role": "assistant",
"content": "import pytest\nimport warnings\n\nfrom .. import (PlasmaPyError,\n PhysicsError,\n RelativityError,\n ... | python | new_file | 1 | 1 | bsd-3-clause | 0ad8d8665f064542346c3788cecaffdcb68f168a | StanczakDominik/PlasmaPy | plasmapy/utils/tests/test_exceptions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a hybridization example using Slate manually"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, print_function, division\n\nfrom firedrake import *\n\nqflag = False\ndegree = 1\n\nmesh = UnitSquare... | python | new_file | 47 | 0 | mit | df17f792faab74955f5e9573bf7dd9812b489bd3 | thomasgibson/firedrake-hybridization | hybridization_solver.py | rejected_lint | Too many lint violations: 47 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add check for 'not guilty beyond a reasonable doubt'\n\nCloses issue #242"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Not guilty beyond a reasonable doubt.\n\n---\nlayout: post\nsource: Garner's ... | python | new_file | 1 | 1 | bsd-3-clause | 6cd12f2aaa6170daef88a913ee78b725b6450d61 | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | proselint/checks/garner/not_guilty.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add recognize decoding typedef or local type"
},
{
"role": "assistant",
"content": "from pida_types import IDA_TYPES\nfrom pida_tlocal_type import IdaTLocalType\n\n\ndef decode_step(ida_type):\n # TODO :\n pass\n\n\ndef dec... | python | new_file | 1 | 4 | mit | 8a844b78c5ded93ce7a75585a6ad2b86d8b4cb13 | goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator | pida_type_decoder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add result classes for update/insert/delete ops"
},
{
"role": "assistant",
"content": "try:\n from pymongo.results import InsertOneResult\n from pymongo.results import InsertManyResult\n from pymongo.results import Updat... | python | new_file | 1 | 2 | bsd-3-clause | 80f35ad0d3a6a1f04eb0339bb1088ebe6eb27af5 | vmalloc/mongomock,marcinbarczynski/mongomock,mdomke/mongomock,drorasaf/mongomock,magaman384/mongomock,StarfishStorage/mongomock,julianhille/mongomock | mongomock/results.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Rename test module and add test for login page content"
},
{
"role": "assistant",
"content": "import unittest\nfrom unittest import TestCase\nfrom user import User\nfrom bucketlist import BucketList\nfrom flask import url_for\n\n... | python | new_file | 5 | 1 | mit | 4681ee081f5600cebf7540862efc60dbf1d190d7 | mkiterian/bucket-list-app,mkiterian/bucket-list-app,mkiterian/bucket-list-app | test_app.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Graham's Scan in Python"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport Tkinter as tk\nfrom random import random\n\ndef make_a_right_turn(a, b, c):\n \"\"\"Going from a to b to c involves a right tur... | python | new_file | 1 | 7 | cc0-1.0 | 17cc4de3c0d6b7e3c843085a1f7f6694930a7e84 | Deepak345/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/... | geometry/graham_scan/python/graham_scan.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix - add missed migrations"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.5 on 2016-05-13 13:34\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\... | python | new_file | 1 | 0 | mit | 94d8adf9d48c6118a3467947ad8b1ae0b6dd3d63 | fidals/refarm-site,fidals/refarm-site,fidals/refarm-site | blog/migrations/0006_auto_20160513_1634.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ip-restriction plugin to declare ip whitelists/blacklists and restrict api access"
},
{
"role": "assistant",
"content": "import ipaddress\n\nfrom django.http import JsonResponse\n\nfrom ..models import Plugin\n\n\ndef get_cli... | python | new_file | 1 | 6 | apache-2.0 | 9d44e4eb4c8d2c2f10152894f7c53d9feaae528c | menecio/django-api-bouncer | api_bouncer/middlewares/ip_restriction.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for audit app."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\... | python | new_file | 1 | 0 | bsd-3-clause | 2c9760da48caaf9656c8b1e3f81e70671b7e7c5e | wlanslovenija/django-postgres | postgres/audit/migrations/0003_auditlog_app_session.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a couple of simple tests for LPD geometry"
},
{
"role": "assistant",
"content": "from matplotlib.figure import Figure\nimport numpy as np\n\nfrom karabo_data.geometry2 import LPD_1MGeometry\n\ndef test_inspect():\n geom = ... | python | new_file | 1 | 1 | bsd-3-clause | a466a89cd18252c6d90fd3b590148ca3268ff637 | European-XFEL/h5tools-py | karabo_data/tests/test_lpd_geometry.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for iteration loop bytecode generation"
},
{
"role": "assistant",
"content": "from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID\nfrom thinglang.compiler.opcodes import OpcodePu... | python | new_file | 1 | 1 | mit | 1d311f7e53ac1081d801e902d8cb1d9a0ad8d1ec | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/compiler/test_loop_compilation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some source cache tests."
},
{
"role": "assistant",
"content": "import pytest\n\nimport large_image\nfrom large_image.cache_util import cachesClear\n\nfrom .datastore import datastore\n\n\n@pytest.mark.singular\ndef testCache... | python | new_file | 1 | 1 | apache-2.0 | 7c609188df1ef457440543beb9dc4dbf286abd87 | girder/large_image,girder/large_image,girder/large_image | test/test_cache_source.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test ConfigItem created in __init__ goes to parent"
},
{
"role": "assistant",
"content": "# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT\n# All rights reserved. This work is under a BSD license, see LICENSE.TXT.\n\nfrom ... | python | new_file | 1 | 1 | bsd-3-clause | 5d58788f75a7334def3dc5a2471c9e0ed2893589 | lhupfeldt/multiconf | test/item_in_init_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement tests for a new _config_file fixture"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\ndef test_config(testdir):\n \"\"\"Make sure that pytest accepts the `cookies` fixture.\"\"\"\n\n # create a ... | python | new_file | 1 | 1 | mit | 7593923070766f53a35d3c404523199f68accd3e | hackebrot/pytest-cookies | tests/test_user_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example that uses the interators"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\ntry:\n import binaryninja\nexcept ImportError:\n sys.path.append(\"/Applications/Binary Ninja.app/Contents/... | python | new_file | 13 | 0 | mit | 399568bbb0c88b2aa3919ac3552483a9dd8f01ab | Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api | python/examples/instruction-iterator.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test prototype for WOA from a netCDF file."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n\"\"\"\n\nfrom datetime import datetime\n\nfrom WOA.woa import WOA\n\ndef test_import():\... | python | new_file | 3 | 2 | bsd-3-clause | 8618c68046487d475c077cb30070c9080cc4fbc7 | castelao/oceansdb,castelao/pyWOA | tests/test_WOA_from_nc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for nova-compute and nova-network main database blocks\n\nWe block the database objects when conductor is not local for compute\nand network, but we don't test this code anywhere because it's in the\nmain() function of the actual ex... | python | new_file | 1 | 2 | apache-2.0 | 54c5f4f476cebec063652f5e4c6acd30bf2dee2e | klmitch/nova,gooddata/openstack-nova,hanlind/nova,mahak/nova,Juniper/nova,phenoxim/nova,vmturbo/nova,phenoxim/nova,mahak/nova,vmturbo/nova,rajalokan/nova,rajalokan/nova,openstack/nova,mikalstill/nova,gooddata/openstack-nova,mikalstill/nova,alaski/nova,sebrandon1/nova,sebrandon1/nova,openstack/nova,alaski/nova,mahak/nov... | nova/tests/unit/cmd/test_cmd_db_blocks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add marker for 105 error"
},
{
"role": "assistant",
"content": "\"\"\"Marks all fixed errors #105 on ruwiki's CheckWikipedia.\"\"\"\nimport re\nimport pywikibot\nfrom checkwiki import load_page_list, mark_error_done, log\n\nNUMBE... | python | new_file | 1 | 6 | mit | 214c81265db7dc23a805717126fad6f97d391fe8 | Facenapalm/NapalmBot | scripts/markers/mark_error_105.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple tests for DAP validator wrappers.\n\nIncidentally, add the test file `distarray/tests/test_testing.py`."
},
{
"role": "assistant",
"content": "# encoding: utf-8\n# ------------------------------------------------------... | python | new_file | 1 | 1 | bsd-3-clause | d0f92caf504e78a3fd7257ac9fab1fbd9c039212 | enthought/distarray,RaoUmer/distarray,enthought/distarray,RaoUmer/distarray | distarray/tests/test_testing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 605. Can Place Flowers\n\n605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/"
},
{
"role": "assistant",
"content": "from itertools import groupby\nclass Solution(object):\n def canPlac... | python | new_file | 3 | 6 | apache-2.0 | 4973cf7fda38168c8189d77ced2ee2a2c89cadfa | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/can-place-flowers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for clickthrough"
},
{
"role": "assistant",
"content": "import openliveq as olq\nimport os\n\nclass TestClickthrough(object):\n\n def test_load(self):\n filepath = os.path.join(os.path.dirname(__file__),\n ... | python | new_file | 1 | 2 | mit | 86c13905a616fe74ea1264b3e462ada3ca7b4e04 | mpkato/openliveq | tests/test_clickthrough.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new utility script to add sample feeds as files"
},
{
"role": "assistant",
"content": "from smoke_signal import app, init_db\nfrom smoke_signal.database.helpers import add_feed\nfrom utils.generate_feed import SampleFeed\n\nf... | python | new_file | 1 | 3 | mit | 5dc2ad1bf129ba2b4f77602678f8e62d26d132a9 | flacerdk/smoke-signal,flacerdk/smoke-signal,flacerdk/smoke-signal | utils/add_sample_feeds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement Naive Bayes Classifier builder method"
},
{
"role": "assistant",
"content": "import numpy as np\nimport cv2\n\n# pos and neg are positive and negative instances\n# each is a list of files of nparray dumps,\n# nparray of... | python | new_file | 1 | 3 | mit | 6dfa189bdab536ecfa2c14e4893017363923ee6a | ah450/ObjectRecognizer | bayes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fake limited composite example"
},
{
"role": "assistant",
"content": "# -----------------------------------------------------------------------------\n# User configuration\n# --------------------------------------------------... | python | new_file | 3 | 0 | bsd-3-clause | a2e18f9b10e5e6bbcad6c13cdc5c76047d319fc2 | Kitware/tonic-data-generator,Kitware/tonic-data-generator | python/tests/test_pv_composite_wavelet.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement`"
},
{
"role": "assistant",
"content": "\"\"\"FABS created_at and FPDS updated_at indexes\n... | python | new_file | 3 | 1 | cc0-1.0 | 6a2bd578cc22231bce66a4d110b4ff1536743097 | fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/7597deb348fb_fabs_created_at_and_fpds_updated_at_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: feat: Add scripts which Define a function to compute color histogram features"
},
{
"role": "assistant",
"content": "# Code given by Udacity, complete by Andres Guijarro\n# Purpose: Define a function to compute color histogram fe... | python | new_file | 1 | 2 | mit | f46361d1009665e87543b56d69212b04b9b14993 | aguijarro/SelfDrivingCar | VehicleDetectionTracking/histo_colors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test users app URL patterns\n\nFor the sake of completeness, and since regular expressions can be error-prone."
},
{
"role": "assistant",
"content": "from django.core.urlresolvers import reverse, resolve\n\nfrom test_plus.test im... | python | new_file | 1 | 1 | bsd-3-clause | 9013f072a8b82ab65ad2c599fe331f7835ebee47 | hackebrot/cookiecutter-django,topwebmaster/cookiecutter-django,trungdong/cookiecutter-django,thisjustin/cookiecutter-django,luzfcb/cookiecutter-django,webyneter/cookiecutter-django,aleprovencio/cookiecutter-django,hackebrot/cookiecutter-django,hairychris/cookiecutter-django,gappsexperts/cookiecutter-django,asyncee/cook... | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for sonify submodule"
},
{
"role": "assistant",
"content": "\"\"\" Unit tests for sonification methods \"\"\"\n\nimport mir_eval\nimport numpy as np\n\n\ndef test_clicks():\n # Test output length for a variety of par... | python | new_file | 1 | 3 | mit | 71b6246dda3e4812490a5c2936eac44e063806c0 | faroit/mir_eval,faroit/mir_eval,bmcfee/mir_eval,craffel/mir_eval,bmcfee/mir_eval,rabitt/mir_eval,craffel/mir_eval,rabitt/mir_eval | tests/test_sonify.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add (simple) test cases for Stock API\n\n- Still a lot of work to do here"
},
{
"role": "assistant",
"content": "from rest_framework.test import APITestCase\nfrom rest_framework import status\nfrom django.urls import reverse\nfro... | python | new_file | 4 | 1 | mit | e7685951e1d271b07df0e4a0681a2404806f4028 | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree | InvenTree/stock/test_api.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make a simple infinite while loop to run tests."
},
{
"role": "assistant",
"content": "import time\nimport subprocess\n\n\nif __name__ == \"__main__\":\n while True:\n subprocess.call([\n \"python\", \"setup.... | python | new_file | 1 | 0 | bsd-3-clause | 29d0797540461f8c021ecad6e5d1e724dcc3e378 | orbitfold/tardis,kaushik94/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis,kaushik94/tardis | tardis/tests/tests_slow/runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create attr-utils module; create attribute memoization helper"
},
{
"role": "assistant",
"content": "def _set_attr( obj, attr_name, value_to_set ):\n setattr( obj, attr_name, value_to_set )\n return getattr( obj, attr_name )\n\... | python | new_file | 1 | 1 | mit | a142472b86044395e428abea2fa5ff28b892d1fb | fire-uta/iiix-data-parser | attr_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create dynamic image & draw some text on it"
},
{
"role": "assistant",
"content": "import requests\nimport json\n\n# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.\n#... | python | new_file | 3 | 0 | bsd-2-clause | 5c142d7e7a311013dd940a6d6900b5d9984dc0fe | symisc/pixlab,symisc/pixlab,symisc/pixlab | python/dynamic_image_meme.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for cleaning up old SMS/MMS text messages"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\n''' Deletes old messages from a backup file created by Titanium Backup Pro\n'''\n\nimport datetime\nimport lxml... | python | new_file | 1 | 0 | mit | 88877163201ce32d28633b833e1ec17cd3429650 | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | python/misc/clean-sms-mms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add GDB pretty-printer for short_vector<T,N>"
},
{
"role": "assistant",
"content": "import gdb\nimport re\n \nclass ShortVectorPrinter:\n def __init__(self, val):\n self.val = val\n\n def to_string(self):\n si... | python | new_file | 1 | 3 | bsd-3-clause | ba907a0c12c5bf90fa796d36fe18218df12281ae | devinamatthews/marray,devinamatthews/marray,devinamatthews/marray | printers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to find out click annotations missing help text"
},
{
"role": "assistant",
"content": "import ast\nimport argparse\nimport sys\n\n\ndef stringify_name(name: ast.AST):\n if isinstance(name, ast.Attribute):\n r... | python | new_file | 3 | 5 | mit | 6080a7475daef38037b8e8462a7a734380179e3f | valohai/valohai-cli | scripts/ensure_click_help.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n'''Generates the main page.'''\n\nimport re\n\nfrom google.appengine.ext import webapp\n\nimport vkfeed.util\n\n\nclass MainPage(webapp.RequestHandler):\n '''Generates the main page.'''\n\n\n def get(self):\... | python | edit | 1 | 2 | bsd-2-clause | ca30516df8037cfb0745f84481f7ada936447a8a | zhenkyn/vkfeedd,zhenkyn/vkfeedd,tol1k/vkfeed,kostkost/vkfeed,ALERTua/vkfeed,flyer2001/vkrss,KonishchevDmitry/vkfeed,antonsotin/vkfeedtrue,Densvin/RSSVK,ALERTua/vkfeed,Evorvian/vkfeed,KonishchevDmitry/vkfeed,flyer2001/vkrss,greengeez/vkfeed,schelkovo/rss,greengeez/vkfeed,lokineverdie/parservkrss1488,lokineverdie/parserv... | vkfeed/pages/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a model-based form for whitelist requests"
},
{
"role": "assistant",
"content": "from django.forms import ModelForm\nfrom whitelist.models import Player\n\n\nclass WhitelistForm(ModelForm):\n \"\"\" Automatically genera... | python | new_file | 1 | 0 | mit | 1b6966cf0e90da0ac060a43349bbe4ce0f5fc365 | Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web | src/whitelist/whitelist_form.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a script to parse .mat and write .csv file"
},
{
"role": "assistant",
"content": "\nimport csv\n\nimport numpy as np\nimport scipy.io as sio\n\ndef process_gridworld_data(input, imsize):\n # run training from input matlab... | python | new_file | null | null | mit | 08a3317d577e0ee5dfa07f8a81b7a4a018297b4a | ToniRV/Learning-to-navigate-without-a-map,ToniRV/Learning-to-navigate-without-a-map | dstar-lite/scripts/python_pipe.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test of utils module.\n\nSigned-off-by: Kouhei Maeda <<EMAIL>>"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport unittest\nimport re\nimport sys\nimport os.path\nsys.path.insert(0, os.path.dirname(os... | python | new_file | 1 | 2 | mit | 72ffe438270fb54a1ce163faff6d2083079c77e2 | gvkalra/python-anydo,gvkalra/python-anydo | anydo/lib/tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new complext date time field."
},
{
"role": "assistant",
"content": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# thi... | python | new_file | 1 | 4 | apache-2.0 | 0a0a9addea16d5adf4d9edb3d56e1d890b6214e5 | nzlosh/st2,punalpatel/st2,pixelrebel/st2,dennybaa/st2,StackStorm/st2,lakshmi-kannan/st2,nzlosh/st2,jtopjian/st2,peak6/st2,pinterb/st2,Plexxi/st2,tonybaloney/st2,jtopjian/st2,grengojbo/st2,emedvedev/st2,dennybaa/st2,armab/st2,StackStorm/st2,dennybaa/st2,tonybaloney/st2,jtopjian/st2,tonybaloney/st2,armab/st2,pixelrebel/s... | st2common/tests/unit/test_db_fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dependency function (not finished yet)"
},
{
"role": "assistant",
"content": "import networkx as nx\n\n\nclass Dependency(object):\n def __init__(self, package_name):\n self.package_name = package_name\n\n se... | python | new_file | 1 | 2 | mit | 36a2f0de9f525ea030e4cc805b8ccc7eb29c8098 | howl-anderson/vimapt,howl-anderson/vimapt | src/vimapt/library/vimapt/Dependency.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for uploading bdists"
},
{
"role": "assistant",
"content": "from __future__ import (division, print_function, absolute_import,\n unicode_literals)\n\nimport os\nimport glob\n\nfrom conda import c... | python | new_file | 3 | 3 | bsd-3-clause | e78e93d5f2a3c35e92b03ba85f0cdad9a5f893d2 | bmorris3/conda-builder-affiliated,Cadair/conda-builder-affiliated,astropy/conda-build-tools,astropy/conda-builder-affiliated,cdeil/conda-builder-affiliated,astropy/conda-build-tools,cdeil/conda-builder-affiliated,kbarbary/conda-builder-affiliated,mwcraig/conda-builder-affiliated,astropy/conda-builder-affiliated,kbarbar... | affiliate-builder/upload_bdists.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 platform\nif platform.python_implementation() != 'PyPy' and platform.python_version... | python | edit | 5 | 0 | apache-2.0 | 504e2321a001144d5466cb492c77f01e045c89d5 | emilevauge/official-images,chorrell/official-images,docker-solr/official-images,davidl-zend/official-images,jperrin/official-images,docker-solr/official-images,davidl-zend/official-images,31z4/official-images,nodejs-docker-bot/official-images,emilevauge/official-images,davidl-zend/official-images,chorrell/official-imag... | test/tests/python-imports/container.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add common tests for query endpoint"
},
{
"role": "assistant",
"content": "'''\r\n Biothings Query Component Common Tests\r\n'''\r\n\r\nimport os\r\n\r\nfrom nose.core import main\r\n\r\nfrom biothings.tests import BiothingsTe... | python | new_file | 1 | 1 | apache-2.0 | 48984b9ab60c14c5d47ee329ef906d47b35b8ade | biothings/biothings.api,biothings/biothings.api | biothings/tests/test_query.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.