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 correct migration file fo cve-fix-1553"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2.4 on 2019-11-18 19:06\n\nimport django.core.validators\nfrom django.db import migrations, models\n\n\nclass Migration(mig... | python | new_file | 1 | 0 | bsd-3-clause | 3050b09418ab7d807e8f1c136014cd8fb9f61148 | rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo | dojo/db_migrations/0023_cve_fix_1553.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert to apache 2.0 license."
},
{
"role": "assistant",
"content": "import os\n\nopening_dashes = \"\"\"\\\n/* -------------------------------------------------------------------------- *\n\"\"\"\ndashes = \"\"\"\... | python | new_file | 1 | 1 | apache-2.0 | bb9fb35d5a143fcd249780e224699413d26cf841 | opensim-org/opensim-gui,opensim-org/opensim-gui,opensim-org/opensim-gui,opensim-org/opensim-gui | Gui/change_license.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move logic for accessing the remote attribute of the namespace (and raising a meaningful error when it doesn't exist) into a separate function"
},
{
"role": "assistant",
"content": "\"\"\"\nUtilities that don't fit well anywhere ... | python | new_file | 1 | 2 | isc | cb9d7a92ca0a1e0202a9a1238a3b3ebd3882129c | crypto101/stanczyk | stanczyk/util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add support for reverse geocoding with Mapzen"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# coding: utf8\n\nfrom __future__ import absolute_import\nfrom geocoder.base import Base\nfrom geocoder.mapzen import Mapzen\... | python | new_file | 2 | 1 | mit | 0454b3e6463585ea3d643b0a9b5b8782d1dcb7d7 | akittas/geocoder,DenisCarriere/geocoder | geocoder/mapzen_reverse.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for Configuration class"
},
{
"role": "assistant",
"content": "import os\nfrom nose.tools import (raises, assert_equal, assert_is,\n assert_is_instance, assert_is_none)\nfrom ..config import ... | python | new_file | 1 | 1 | mit | 78a5dce20f5a1347f9d4e92143d2efbb8e52e61c | permamodel/bmi-ilamb | bmi_ilamb/tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script that makes the output of the scraper be valid GeoJSON"
},
{
"role": "assistant",
"content": "import json\nimport os\n\nfor root, dirs, files in os.walk('data'):\n for name in files:\n features = []\n ... | python | new_file | 2 | 0 | mit | 5331cfce73d4a5410191cfaee09bbc777c2fa243 | iandees/postboxes | geojsonify.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement basic DRUM reader agent"
},
{
"role": "assistant",
"content": "import sys\nimport random\nfrom indra.sources import trips\nfrom kqml import KQMLModule, KQMLPerformative, KQMLList\n\nclass DrumReader(KQMLModule):\n de... | python | new_file | 3 | 1 | bsd-2-clause | adfb3e433d0ce226aaa657c5f2ef0dc5b4d0fe2f | sorgerlab/indra,johnbachman/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,bgyori/indra,johnbachman/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy | indra/sources/trips/drum_reader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple command to generate automatic regressions"
},
{
"role": "assistant",
"content": "import bandicoot as bc\nfrom os.path import dirname, abspath, join\n\nif __name__ == '__main__':\n empty_user = bc.User()\n empty... | python | new_file | 1 | 0 | mit | 7dbdae4cbf8e4d78f84c2b8163cd62c7935d3890 | ulfaslak/bandicoot,yvesalexandre/bandicoot,econandrew/bandicoot,econandrew/bandicoot,yvesalexandre/bandicoot,econandrew/bandicoot,ulfaslak/bandicoot,yvesalexandre/bandicoot,ulfaslak/bandicoot | bandicoot/tests/generate_regressions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [tests] Add unit tests for memory module"
},
{
"role": "assistant",
"content": "# pylint: disable=C0103,C0111\n\nimport mock\nimport unittest\n\nimport tests.mocks as mocks\n\nfrom bumblebee.input import LEFT_MOUSE\nfrom bumblebe... | python | new_file | 1 | 1 | mit | e59a870a1e039e12da2097401f925146ecc1a5fb | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | tests/modules/test_memory.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move migration into main branch"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom dimagi.utils.couch.database import iter_docs\nfrom corehq.apps.users.models import CouchUser, CommCa... | python | new_file | 1 | 6 | bsd-3-clause | 01d35d13aaedea0ef87ae1d78ee1368e5e0f407c | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq | corehq/apps/locations/management/commands/set_location_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add rudimentary end to end tests\n\nOur subcommand tests bypass the click wrappers. I think it's a good idea\nto have these tests just to have a little more confidence that no silly\nbugs have gone unnoticed."
},
{
"role": "assistant... | python | new_file | 1 | 1 | bsd-3-clause | 01aedda05cbd6cbe98afa71496c5c09465f0e4e6 | scrapinghub/shub | tests/test_end_to_end.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utils functions for the crest api"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\nimport pycrest\nimport config\n\n\ndef get_crest():\n \"\"\" Return a CREST object initialized \"\"\"\n crest = pycrest... | python | new_file | 3 | 2 | bsd-3-clause | 27b74424e6a9193636bc533dbf758d40b5dc0d3e | Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith | lazyblacksmith/utils/crestutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate this version to new workstation."
},
{
"role": "assistant",
"content": "# Copyright 2014 Open Connectome Project (http://openconnecto.me)\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may... | python | new_file | 3 | 2 | apache-2.0 | b0cf9904023c5ee20c5f29b3e88899420405550b | neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore | examples/puttiff.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for item preprocessing"
},
{
"role": "assistant",
"content": "from datetime import date\n\nfrom populous.backends.base import Backend\nfrom populous.blueprint import Blueprint\nfrom populous.item import Item\n\n\ndef te... | python | new_file | 1 | 1 | mit | df0cf1ddbf236c6cf70563e6ddeb3b7cece80c92 | novafloss/populous | tests/test_generation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a datastore adapter to use by flask user"
},
{
"role": "assistant",
"content": "from flask_user import DBAdapter\n\n\nclass DataStoreAdapter(DBAdapter):\n \"\"\" An Wrapper to be use by Flask User to interact with\n ... | python | new_file | 1 | 4 | mit | 2355ebd04ed8b5c14c42966b71415ae638c50551 | oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog | app/models/datastore_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add affiliation property and update schema version"
},
{
"role": "assistant",
"content": "from contentbase.upgrader import upgrade_step\n\n\n@upgrade_step('pathogenicity', '1', '2')\ndef pathogenicity_1_2(value, system):\n # h... | python | new_file | 1 | 1 | mit | f84284b14d21669f9a9aae5d482f1e626f42df03 | ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded,ClinGen/clincoded | src/clincoded/upgrade/pathogenicity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create (empty) v2_alpha REST tests directory"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Copyright 2015 OpenMarket Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u... | python | new_file | 1 | 0 | apache-2.0 | d07dfe5392a0ea9bde4bff174c4dc4e4fdba33be | rzr/synapse,TribeMedia/synapse,matrix-org/synapse,illicitonion/synapse,howethomas/synapse,howethomas/synapse,TribeMedia/synapse,howethomas/synapse,illicitonion/synapse,illicitonion/synapse,matrix-org/synapse,iot-factory/synapse,rzr/synapse,matrix-org/synapse,rzr/synapse,TribeMedia/synapse,iot-factory/synapse,matrix-org... | tests/rest/client/v2_alpha/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add explicit BasicProperties equality test\n\nIn Python equality of objects, if not defined otherwise, is based on the\nobjects hash.\nBy extending amqp_objects with an __eq__ method we can now test equality\nof two BasicProperties objects a... | python | new_file | 1 | 1 | bsd-3-clause | 886dae7cbf433f2b0d65016164db62883cae0925 | pika/pika | tests/unit/spec_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move this test from metanl."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS\nimport unicodedata\n\n# Most single-character strings which have been misencode... | python | new_file | 2 | 3 | mit | 6d46c1beb8f5f916e3fb2e08d086e5b4167383be | rspeer/python-ftfy | ftfy/test_unicode.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for new Exam data_model_version default"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.20 on 2019-04-26 17:15\nfrom __future__ import unicode_literals\n\nfrom django.db im... | python | new_file | 1 | 0 | mit | 420a1a76c7c9460768e6d41e7508f36d3215fbfb | learningequality/kolibri,indirectlylit/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,lyw07/kolibri,lyw07/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri | kolibri/core/exams/migrations/0003_auto_20190426_1015.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for new assignments"
},
{
"role": "assistant",
"content": "import os\nimport pytest\nimport yaml\n\n\ndef test_new_without_repo(parse_and_run):\n \"\"\"Test vanilla assignment initialization\n \"\"\"\n pat... | python | new_file | null | null | mit | 58a3c9e6cbddba664c1c89c6039d9cc72fac526f | redkyn/grader,grade-it/grader,redkyn/grader | grader/grader/test/test_new.py | rejected_code_smell | Internal duplication: ~48% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: [example] Halt an asset, prevent people from transfers and trading"
},
{
"role": "assistant",
"content": "from grapheneapi.grapheneclient import GrapheneClient\nimport json\n\nsymbol = \"TOKEN\"\n\nclass Config():\n wallet_hos... | python | new_file | 1 | 0 | mit | 955856171a4d689d1db68eb46c17d6b3fe92c2fc | xeroc/python-graphenelib | examples/halt_asset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for extracting duplicate sets from SOLR dump"
},
{
"role": "assistant",
"content": "\"\"\"\nCopyright 2016 Ronald J. Nowling\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this fi... | python | new_file | 3 | 5 | apache-2.0 | 801c8c7463811af88f232e23d8496180d7b413ad | rnowling/article-deduplication,rnowling/article-deduplication | python/extract_duplicate_sets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Table object for representing phonetic inventory"
},
{
"role": "assistant",
"content": "import csv\n\nclass Table():\n '''A Table is an object which represents a 2-dimensional CSV file. Both rows\n and columns can be... | python | new_file | 1 | 4 | mit | 7a3e7365569c18c971db9698cd7cdd1a82756463 | kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve | table.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for forget function"
},
{
"role": "assistant",
"content": "import unittest\n\nimport numpy\n\nimport chainer\nfrom chainer import functions\nfrom chainer import gradient_check\nfrom chainer import testing\n\n\nclass Test... | python | new_file | 1 | 1 | mit | cdaeb420e0cd817ebf570d5eda46362f4c61c691 | wkentaro/chainer,keisuke-umezawa/chainer,okuta/chainer,wkentaro/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,niboshi/chainer,kiyukuta/chainer,okuta/chainer,okuta/chainer,cupy/cupy,keisuke-umezawa/chainer,ronekko/chainer,ktnyt/chainer,jnishi/chainer,hvy/chainer,tkerola/chainer,keisuke-umez... | tests/chainer_tests/functions_tests/utils_tests/test_forget.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Print basic json chart on command line"
},
{
"role": "assistant",
"content": "import click\nimport requests\n\nurl = 'http://ben-major.co.uk/labs/top40/api/singles/'\n\nresponse = requests.get(url)\n\nprint response.json()\n"
}... | python | new_file | 2 | 0 | mit | a2565d27a8fcfd4c1bfa414a39d7f90b99f5ece3 | kevgathuku/top40,andela-kndungu/top40 | top40.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to change versions of all components"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport glob\nimport shutil\nimport sys\n\ndef change(filename, oldversion, newversion):\n tempfile = filename + '.... | python | new_file | 3 | 2 | apache-2.0 | d01ad432080446d94028f3d1de76692354871a77 | zafarella/PredictionIO,dszeto/incubator-predictionio,net-shell/PredictionIO,alex9311/PredictionIO,arudenko/PredictionIO,thiagoveras/PredictionIO,himanshudhami/PredictionIO,jasonchaffee/PredictionIO,akaash-nigam/PredictionIO,wangmiao1981/PredictionIO,jlegendary/PredictionIO,tuxdna/PredictionIO,thiagoveras/PredictionIO,m... | bin/change-version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py2app script to todos_app"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nimport sys\nimport os\nimport shutil\n\n\ndef tree(src):\n return [(root, map(lambda f: os.path.join(root, f), filter(la... | python | new_file | 3 | 2 | bsd-3-clause | 442e141ba3695e32d19cb6a263c63a4d6c31de90 | shivaprsdv/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview | examples/todo_app/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Refactor code - PEP8 Style."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport optparse\nimport sys\n\n\ndef xorobfuscator(plaintext, keyid):\n '''XOR Operation on a plaintext using keyid'''\n\n encoded = \"... | python | new_file | 1 | 4 | cc0-1.0 | dd7d3f77b691922c44c489844b1f278d58a790f4 | JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology | xorry.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make preparation model tests actually work"
},
{
"role": "assistant",
"content": "from django.test import TestCase\nfrom django.conf import settings\n\nfrom whats_fresh.models import *\nfrom django.contrib.gis.db import models\n\... | python | new_file | 6 | 1 | apache-2.0 | f3b57ef7713086a86f51a8ed98d52367b02c8959 | iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api | project_fish/whats_fresh/test_models.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD Flask based RESTful API"
},
{
"role": "assistant",
"content": "from flask import Flask\nimport monroe\n\napi = Flask(__name__)\n\n@api.route('/')\ndef aping():\n return 'v0.1'\n\n\n@api.route('/start')\ndef start_monroe():... | python | new_file | 1 | 1 | apache-2.0 | 509d4f1e6d22a373cfa20944ef388f7155443d4a | ecelis/monroe | monroe/api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for floating_ip_pools_client\n\nThis patch adds unit test for floating_ip_pools_client.\n\nChange-Id: Iba1dc372867f70742b73b5f4502bb7e94e4dc312"
},
{
"role": "assistant",
"content": "# Copyright 2015 NEC Corporation... | python | new_file | 1 | 1 | apache-2.0 | d3bbdce883b2a3880970f1923367ca8498b34a8d | bigswitch/tempest,izadorozhna/tempest,xbezdick/tempest,openstack/tempest,Tesora/tesora-tempest,LIS/lis-tempest,sebrandon1/tempest,vedujoshi/tempest,zsoltdudas/lis-tempest,cisco-openstack/tempest,masayukig/tempest,flyingfish007/tempest,tonyli71/tempest,masayukig/tempest,xbezdick/tempest,Tesora/tesora-tempest,openstack/t... | tempest/tests/services/compute/test_floating_ip_pools_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport yaml\n\ndef generate(args):\n output = {\"version\" : \"0.9.0\", \"arguments\" : args}\n return yaml.safe_dump(output, default_flow_style = False)\n\ndef get_biobox_file_contents(dir_):\n with open(os.path.join(di... | python | edit | 1 | 2 | mit | 83f1dab96d5e9f82137dbe4142ed415a3e3e3f48 | michaelbarton/command-line-interface,michaelbarton/command-line-interface,bioboxes/command-line-interface,bioboxes/command-line-interface | biobox_cli/biobox_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of HF PES scanning"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n'''\nScan H2 molecule dissociation curve.\n'''\n\nimport numpy\nfrom pyscf import scf\nfrom pyscf import gto\n\nehf = []\ndm = None\n\... | python | new_file | 1 | 0 | apache-2.0 | 1ba3c03e6e68596dd969980af2c07d1d90ba83f6 | sunqm/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf,sunqm/pyscf | examples/scf/16-h2_scan.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for maximal cliques percolation using sa"
},
{
"role": "assistant",
"content": "from MaxCliquesPercolation import MaxCliquesPercolationWeighted\n\n\nclass MaxCliquesPercolationSA(MaxCliquesPercolationWeighted):\n def ... | python | new_file | 1 | 1 | mit | ce43d38cccd44464b1c777e99af540133033a3fc | studiawan/pygraphc | pygraphc/clustering/MaxCliquesPercolationSA.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of joblibed classifier"
},
{
"role": "assistant",
"content": "import os\nimport sys\nsys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))\n\nfrom sklearn import datasets\nfrom ... | python | new_file | 1 | 0 | apache-2.0 | 8486d506ac619b2bb6caceb435c20047d7398603 | fukatani/stacked_generalization | stacked_generalization/example/joblibed_classification.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for docker_secret backend"
},
{
"role": "assistant",
"content": "import os\nfrom unittest import TestCase\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfrom configstore.backends.docke... | python | new_file | 1 | 1 | mit | d5b155f51eb4b204e5812e8339579e9d91066103 | caravancoop/configstore | configstore/tests/test_docker_secret.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make working cached API call\n\nSigned-off-by: Adam Obeng <<EMAIL>>"
},
{
"role": "assistant",
"content": "import urllib2\nimport json\nimport yaml\nfrom os.path import expanduser, isfile\nimport datetime\nfrom dateutil import pa... | python | new_file | 1 | 6 | mit | bdbbddf86a6137c1edf96ab8505611a4fc2ab30e | adamobeng/sunbrella | sunbrella.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add OBSolve class and from_json methods"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport os\nimport sys\n\nimport json\n\nimport qutip as qu\n\nfrom maxwellbloch import ob_atom\n\n# Main\n\nclass OBSolve(o... | python | new_file | 6 | 2 | mit | bcb30dbad2f86781ddd1ee9f38b16c4d68ac57da | tommyogden/maxwellbloch,tommyogden/maxwellbloch | maxwellbloch/ob_solve.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for ensuring that the history functions are able to return"
},
{
"role": "assistant",
"content": "\"\"\"\n.. Copyright 2017 EMBL-European Bioinformatics Institute\n\n Licensed under the Apache License, Version 2.0 (the \"L... | python | new_file | 1 | 3 | apache-2.0 | d216f2c2f6f6a8e94dbe0c79dafe03f1a4f9a886 | Multiscale-Genomics/mg-rest-dm | tests/test_rest_track_history.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to print Linux information."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Print information about the current computer.\n#\nimport os\nimport re\nfrom socket import gethostname\nfrom platfor... | python | new_file | 6 | 4 | apache-2.0 | 5535fa4d9c5b70347bf16931887e3c5141698e31 | sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-opensource,sergev/vak-o... | languages/python/linux-info.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to download and unzip files for all years"
},
{
"role": "assistant",
"content": "import os\nimport datetime\n\ncurrent_year = datetime.datetime.now().year\nyears_with_data = range(2011, current_year + 1)\nremote_path =... | python | new_file | 2 | 0 | bsd-3-clause | 1e3853c231facac6e590b66de8d9c2cc37e7f540 | daguar/netfile-etl,daguar/netfile-etl | download_and_unzip_files.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a git superproject and add submodules\n\nIt does the following in order:\n1. Generate a manifest.xml for repo\n2. Create a git superproject\n3. Add repo project as git submodules"
},
{
"role": "assistant",
"content": "#!/u... | python | new_file | 4 | 3 | apache-2.0 | e095cbdc5f6c74b54a518131692d5ab993c4fc9c | clarkli86/repo_to_submodule | repo_to_submodule.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Set metrics command (regex based metric enabling)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n__cmdname__ = 'set_metrics'\n__cmdopts__ = ''\n\nimport re\nimport sys\n\nimport log\nimport util\n\nclass Module(obj... | python | new_file | 2 | 10 | isc | 97074e1bf452f12821058c035aca15c692092074 | omniti-labs/circus,omniti-labs/circus | src/circus/module/set_metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snippet (Python OpenCV)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n\"\"\"\nOpenCV - Hough Circle Transform: find ci... | python | new_file | 1 | 5 | mit | 87818a138408752217d6a90041db5273116db228 | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/image_precessing/hough_circle_transform.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for most of Config class"
},
{
"role": "assistant",
"content": "import logging\nimport socket\n\nimport pytest\n\nfrom uvicorn import protocols\nfrom uvicorn.config import Config\nfrom uvicorn.middleware.debug import De... | python | new_file | 1 | 1 | bsd-3-clause | 388ca425168572cbcbaa3638d78e5f9933380fb7 | encode/uvicorn,encode/uvicorn | tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add database dump convert tool."
},
{
"role": "assistant",
"content": "from sys import argv\nfrom xml.dom.minidom import parse\nfrom base64 import b64decode\n\ndef Escape(text):\n\ttext = text.replace('\\\\', '\\\\\\\\')\n\tfor s... | python | new_file | 4 | 2 | mit | 077699976adb8a6a25f5cb8c4ff3cbb1ae95440c | thewizardplusplus/wizard-diary,thewizardplusplus/wizard-diary,thewizardplusplus/wizard-diary,thewizardplusplus/wizard-diary,thewizardplusplus/wizard-diary | tools/database_dump_converter.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add config file parse test\n\nIncreases coverage to 73% on Python 2.x and 74% on Python 3.x."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport os\nimport binascii\nimp... | python | new_file | 1 | 1 | mit | 41f6dd8259a8e56a157930e809426f5e0e8113eb | imiric/timebook | tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add read categories permission to authenticated users"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2019-02-22 08:58\nfrom __future__ import unicode_literals\n\nfrom django.db imp... | python | new_file | 1 | 1 | bsd-3-clause | 042844d918d34a16f18ea9ab2c09694e81c25623 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/categories/migrations/0008_authenticated-permissions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool to convert hdf5 to bigfile.\n\nThis shall work for a lot of cases but not all. It's incomplete."
},
{
"role": "assistant",
"content": "import h5py\nimport bigfile\nimport logging\nimport argparse\n\nap = argparse.Argum... | python | new_file | 3 | 6 | bsd-2-clause | de44f28e266a9e8a730030029d47d6a262e7cf3c | rainwoodman/bigfile,rainwoodman/bigfile,rainwoodman/bigfile | utils/h5tobigfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Build stacks, wait for completion, show status of each"
},
{
"role": "assistant",
"content": "__author__ = 'ayost'\n\nimport os\nimport re\nimport sys\nfrom time import sleep\nimport boto.cloudformation\nimport boto.cloudformatio... | python | new_file | 3 | 7 | apache-2.0 | a4f9f724e1a9b292abd9df46293d14759b864dc4 | careerbuilder/CloudSeed,careerbuilder/CloudSeed,careerbuilder/CloudSeed,careerbuilder/CloudSeed | Send_Stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create crop and region model"
},
{
"role": "assistant",
"content": "# models.py\n#\n# Copyright(c) Exequiel Ceasar Navarrete <<EMAIL>>\n# Licensed under MIT\n# Version 0.0.0\n\nfrom app import db\nfrom slugify import slugify\n\nc... | python | new_file | 1 | 1 | mit | 1293b101683462225f7c5f150b3c98767d032639 | ecsnavarretemit/sarai-interactive-maps-backend,ecsnavarretemit/sarai-interactive-maps-backend | app/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to chapter-3 collatzsequence"
},
{
"role": "assistant",
"content": "# Collatz Sequence practice project from Automate Boring Stuff - Chapter 3\n# https://automatetheboringstuff.com/chapter3/\n\ndef collatz(number):\n... | python | new_file | 1 | 2 | mit | 91f90d5edd89a10cb652af001d6c076fdcf557d8 | anirudhvarma12/learning-python | chapter3/collatzSequence.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Android SDK packages"
},
{
"role": "assistant",
"content": "# MIT licensed\n# Copyright (c) 2013-2017 lilydjwg <<EMAIL>>, et al.\n\nimport pytest\npytestmark = pytest.mark.asyncio\n\nasync def test_android_addon(get... | python | new_file | 1 | 1 | mit | bb3fa58481d58ac7fe9a55e7fabd2b37ce9df7ac | lilydjwg/nvchecker | tests/test_android.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add django command for updating ERF areas"
},
{
"role": "assistant",
"content": "import os\nimport argparse\nfrom django.core.management.base import BaseCommand\nfrom firecares.firestation.models import FireDepartment\nfrom firec... | python | new_file | 4 | 4 | mit | e084f83aea9c89b5fff0289dedf7bd6cd7434dcf | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firestation/management/commands/update-erf-areas.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of Salt output analyzer script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n#\n\nimport sys\nimport yaml\nimport logging\n\n##################################################################... | python | new_file | 1 | 5 | apache-2.0 | 258bf91456db1f9c5c2b90bfdaf32a4af13de7df | uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states | states/common/bootstrap/bootstrap.dir/modules/utils/salt_output.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Handle withdrawal of a player\n\nAdded function to handle all the changes after a player quits withdraws\nfrom the game"
},
{
"role": "assistant",
"content": "import pygame\nimport sys\nfrom pygame.locals import *\n\nfrom variabl... | python | new_file | 14 | 3 | mit | dd30a2c655e1f0fca4be0de8de1775b7ab5c8b85 | idnaninitesh/monopoly_python | handle_quit_player.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a second python implementation for problem 3"
},
{
"role": "assistant",
"content": "roots = []; product = 1; x = 2; n = 600851475143; y = n;\nwhile product != n:\n\twhile (y % x == 0):\n\t\troots.append(x)\n\t\ty /= x\n\t\tpr... | python | new_file | 2 | 0 | mit | 6b4489e9e0362b75433f8a75fcfd041bab4e8a08 | 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_3/solution2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add extraction script as per request"
},
{
"role": "assistant",
"content": "\"\"\" Extract some data for Colin \n\n1951-2010 Annual GDDs by climate district Apr 1 - Oct 31\n1951-2010 Frost-free days ...\n\n\"\"\"\nimport psycopg... | python | new_file | 1 | 0 | mit | 8261098405f4279209388f91e6fbc0d48600b129 | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/cscap/wx/extract_colin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for generating headers from glsl"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\n\nwith open(sys.argv[1], 'w') as outfile:\n with open(sys.argv[2], 'r') as infile:\n outfile.write(... | python | new_file | 1 | 0 | bsd-3-clause | 356d11b5bce94e356fa39c6709375655cae105b7 | mikezackles/gn_build | scripts/file_to_string_literal.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to merge a bunch of quake style traces and write some summary statistics."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n# Converts a bunch of processedTrace files from Second Life into a\n# single trace... | python | new_file | 3 | 0 | bsd-3-clause | e6ceac9c547c9fae78d6cac57d62a510fddc9096 | sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata | scripts/traces/merge_traces.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: DOC: Add simple buy and hold example."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Copyright 2015 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use t... | python | new_file | 1 | 3 | apache-2.0 | 84d8cc4d41ce6ff18f1f96f21749332e980a86f0 | nborggren/zipline,alphaBenj/zipline,quantopian/zipline,umuzungu/zipline,humdings/zipline,Scapogo/zipline,magne-max/zipline-ja,florentchandelier/zipline,enigmampc/catalyst,umuzungu/zipline,nborggren/zipline,bartosh/zipline,enigmampc/catalyst,bartosh/zipline,grundgruen/zipline,wilsonkichoi/zipline,grundgruen/zipline,alph... | zipline/examples/buy_and_hold.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests to image_xpress module"
},
{
"role": "assistant",
"content": "from microscopium.screens import image_xpress\nimport collections as coll\n\n\ndef test_ix_semantic_filename():\n test_fn = \"./Week1_22123/G10_s2_w11C3B9... | python | new_file | 1 | 1 | bsd-3-clause | a7ce715d184e11f7fe6d20bc22cd8b9a4733e04d | jni/microscopium,Don86/microscopium,microscopium/microscopium,Don86/microscopium,jni/microscopium,starcalibre/microscopium,microscopium/microscopium | tests/test_image_xpress.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate templates"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python3\n\nfrom argparse import ArgumentParser\nfrom argparse import ArgumentTypeError\nimport itertools\nimport os\nimport string\nfrom shu... | python | new_file | 4 | 3 | mit | 7e3811666e224dc2030f625f04db8a4e55529322 | szekizoli/GoogleCodeJamPractice,szekizoli/GoogleCodeJamPractice,szekizoli/GoogleCodeJamPractice | create.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up command with arguments"
},
{
"role": "assistant",
"content": "import sys\nimport traceback\nimport argparse\nfrom PIL import Image\n\ndef binterpret(filename, abx, aby):\n try:\n img = Image.open(filename)\n e... | python | new_file | 2 | 2 | apache-2.0 | 8760c50de32353664bb5291ac24205186e557de4 | flammified/binterpret | binterpret.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: :new: Add change encoding add on"
},
{
"role": "assistant",
"content": "# -*- coding:utf-8 -*-\n\nfrom owlmixin import OwlMixin\nfrom modules.models import ResponseAddOnPayload\nimport logging\n\nlogger = logging.getLogger(__name... | python | new_file | 1 | 2 | mit | 40b704b64ca1a4bf6f686710586c0856e9a8cf94 | tadashi-aikawa/gemini | addons/response-encoding-converter-addon/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to dynamically deploy adapters"
},
{
"role": "assistant",
"content": "import requests\nimport json\nimport argparse\nimport uuid\nimport pprint\n\n\ndef main():\n parser = argparse.ArgumentParser(\n descripti... | python | new_file | 1 | 2 | bsd-3-clause | 498637bc947eb0e68b4a153fb5fa859bfa52ff75 | OpenChemistry/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,thewtex/tomviz,cryos/tomviz,thewtex/tomviz,OpenChemistry/tomviz,cjh1/tomviz,cjh1/tomviz,cryos/tomviz,thewtex/tomviz,mathturtle/tomviz,cjh1/tomviz,OpenChemistry/tomviz,mathturtle/tomviz,cryos/tomviz | acquisition/devops/deploy_adapter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: DEBUG and TEST. Plenty of Typos"
},
{
"role": "assistant",
"content": "import dpkt, socket, pygeoip, optparse\n\n\ndef banner():\n\tprint \"#### Use Python to build a Google Map #####\"\n\tprint \"\"\n\ndef retKML(ip):\n\trec... | python | new_file | 5 | 3 | mit | f16eb9e0dea35a2cb49c1e9cb879af1faa1f0c6a | n1cfury/ViolentPython | PyGoogleMap.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for Receipt model"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.conf import settings\n\n\nclass Migr... | python | new_file | 1 | 0 | mit | fa23f66fcae37731672f4cf646ad52964b4b206a | trimailov/finance,trimailov/finance,trimailov/finance | table/migrations/0001_initial.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create NeblinaCore to handle sending and receiving packet."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n###################################################################################\n#\n# Copyright (c) ... | python | new_file | 5 | 1 | mit | 89f75bb894a6dee2d53708b8f4f5f3302d54a010 | Motsai/neblina-python,Motsai/neblina-python | neblinaCore.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example on subclassing commands.Context"
},
{
"role": "assistant",
"content": "import random\n\nimport discord\nfrom discord.ext import commands\n\n\nclass MyContext(commands.Context):\n async def tick(self, value):\n ... | python | new_file | 1 | 3 | mit | 1fd87ad0cab5d45602192c83681340d5da27a6db | Rapptz/discord.py,Harmon758/discord.py,khazhyk/discord.py,rapptz/discord.py,Harmon758/discord.py | examples/custom_context.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for demostrating cathicng multiple exceptions"
},
{
"role": "assistant",
"content": "def take_beer(fridge, number=1):\n if not isinstance(fridge, dict):\n raise TypeError(\"Invalid fridge\")\n\n if \"beer\... | python | new_file | 1 | 4 | bsd-2-clause | 9f11190cbd7ac97ab5e57c3af8c23b9884279cfa | drednout/letspython,drednout/letspython | lesson5/catch_multiple.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for Cython functions that mirror pure Python tests"
},
{
"role": "assistant",
"content": "from unittest import TestCase\nimport numpy as np\nimport numpy.testing as npt\nfrom nimble import Events\nimport nimble.cyf... | python | new_file | 1 | 1 | mit | 811d3e3c13cac36b6dd16e49690fca4a31a74266 | rwhitt2049/trouve,rwhitt2049/nimble | tests/test_cython_funcs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Nubank class for handling the requests"
},
{
"role": "assistant",
"content": "import json\nimport requests\n\n\nclass NuException(BaseException):\n pass\n\n\nclass Nubank:\n headers = {\n 'Content-Type': 'applica... | python | new_file | 1 | 2 | mit | a64f3cf9c10d79576cc70d385f9124b7beda040e | andreroggeri/pynubank | nubank.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example from listing 7.8"
},
{
"role": "assistant",
"content": "'''\nListing 7.8: Testing atomic operations\n'''\n\nimport numpy as np\nimport pyopencl as cl\nimport utility\n\nkernel_src = '''\n__kernel void atomic(__global ... | python | new_file | 1 | 0 | mit | 5a0e28212e186b61138fa725cd2c22f475b245d7 | oysstu/pyopencl-in-action | ch7/atomic.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration needed to support Variable value encryption"
},
{
"role": "assistant",
"content": "\"\"\"add is_encrypted column to variable table\n\nRevision ID: 1968acfc09e3\nRevises: bba5a7cfc896\nCreate Date: 2016-02-02... | python | new_file | 1 | 1 | apache-2.0 | 422057651acf510f6c4c5ccb54781a9b85d4a5ad | caseyching/incubator-airflow,N3da/incubator-airflow,gtoonstra/airflow,owlabs/incubator-airflow,lyft/incubator-airflow,dmitry-r/incubator-airflow,ty707/airflow,modsy/incubator-airflow,sdiazb/airflow,nathanielvarona/airflow,adamhaney/airflow,dgies/incubator-airflow,gtoonstra/airflow,jwi078/incubator-airflow,dhuang/incuba... | airflow/migrations/versions/1968acfc09e3_add_is_encrypted_column_to_variable_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool-info moduel for ABC"
},
{
"role": "assistant",
"content": "# This file is part of BenchExec, a framework for reliable benchmarking:\n# https://github.com/sosy-lab/benchexec\n#\n# SPDX-FileCopyrightText: 2007-2020 Dirk ... | python | new_file | 4 | 4 | apache-2.0 | ae9532fe2cf76a8d3f219093f373c05dc2eafc1d | sosy-lab/benchexec,dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,sosy-lab/benchexec | benchexec/tools/abc.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to generate bearer keys for twitter"
},
{
"role": "assistant",
"content": "import requests\nimport base64\nimport sys\n\nif len(sys.argv) < 3:\n print \"Usage: twitter_application_auth.py <consumer key> <consumer s... | python | new_file | 4 | 0 | bsd-3-clause | 3663a732727d2a2198b2fe1c77a3d73abb531d8e | huqa/pyfibot,aapa/pyfibot,huqa/pyfibot,EArmour/pyfibot,lepinkainen/pyfibot,EArmour/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,aapa/pyfibot | pyfibot/util/twitter_application_auth.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Add test for repr mixin"
},
{
"role": "assistant",
"content": "from ...orm import SetupTrump, SymbolManager\n\nclass TestToolsSQLA(object):\n \n def setup_method(self, test_method):\n self.eng = SetupTrump()\n ... | python | new_file | 1 | 1 | bsd-3-clause | 46b7667bf704e98c52dbd9eb41a7ccbf6de9229e | Equitable/trump,Asiant/trump,jnmclarty/trump | trump/tools/tests/test_sqla.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the fix_entities parameter"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\nfrom ftfy import fix_text, fix_text_segment\nfrom nose.tools import eq_\n\ndef test_entities():\n example... | python | new_file | 1 | 1 | mit | 1316ed65550b47d694b870093c38fef47e88a06c | rspeer/python-ftfy | tests/test_entities.py | rejected_duplicate | Near-duplicate of sample 5940 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functions to test LIF IO"
},
{
"role": "assistant",
"content": "import os\nfrom lesion import lifio\n\nfrom numpy.testing.decorators import skipif\nfrom numpy.testing import assert_equal, assert_allclose\n\ncurrdir = os.path.... | python | new_file | 1 | 1 | bsd-3-clause | a209ee1f7ab3be06d03e0eaa926dca5e4811ecc6 | jni/lesion | lesion/tests/test_lifio.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for 'position_tolerance' when symmetrizing."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik\n# Author: Dominik Gresc... | python | new_file | 1 | 5 | apache-2.0 | 9d02b311504c8babf876ce8c45262b7394650d14 | Z2PackDev/TBmodels,Z2PackDev/TBmodels | tests/test_symmetrize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migrations for boring articles."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\ndef make_articles_boring(apps, schema_edit... | python | new_file | 3 | 9 | mit | af5b12f4fdda3f9ccfee19d2a7589fed6a7faee5 | flupzor/newsdiffs,flupzor/newsdiffs,flupzor/newsdiffs,flupzor/bijgeschaafd,flupzor/bijgeschaafd,flupzor/bijgeschaafd,flupzor/bijgeschaafd,flupzor/newsdiffs | news/migrations/0004_auto_20160301_2235.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check that mideu package config exists (assumes that home and current dir do not have config present)"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\nimport unittest\nimport os\n\nfrom mciutil.cli.c... | python | new_file | 1 | 1 | bsd-3-clause | 4b193e59a53717c80c6835374048ba71c5bfa208 | adelosa/mciutil | tests/test_cli_common.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for processing COCA ngrams."
},
{
"role": "assistant",
"content": "from data import data, process_common\n\nUNIGRAM_REFERENCE = 'data/g1m_1gram.txt'\nSRCS_PATTERN = 'data/corpus/coca/w%s_.txt'\nOUTS_PATTERN = 'data/coc... | python | new_file | 1 | 7 | mit | 75aec1cbc64c667b0528cfc66ed087d7ea84db20 | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | bin/process_coca_ngrams.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a quick check that we can preprocess strings."
},
{
"role": "assistant",
"content": "import chstrings\nimport config\n\nimport unittest\n\nclass CHStringsTest(unittest.TestCase):\n @classmethod\n def add_smoke_test(cls,... | python | new_file | 1 | 1 | mit | ea1b55dcd3d174888b7d0214fb1fa780cb9a4ebe | guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt | chstrings/chstrings_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write a simple adapter in functest project to run TESTON\nJIRA:FUNCTEST-46\n\nChange-Id: I146ec926da6cbbd2535d0997326a13bd545f42c6\nSigned-off-by: Qinglong Lan <<EMAIL>>"
},
{
"role": "assistant",
"content": "\"\"\"\nDescription:... | python | new_file | 2 | 1 | apache-2.0 | 05db0c76a2eefd2a490573973d417f29eb1303c9 | opnfv/functest,mywulin/functest,mywulin/functest,opnfv/functest | testcases/Controllers/ONOS/Teston/CI/adapters/foundation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first tests for `FeatureProducer()`\n\nThese tests do not test all code paths, but it is a start. We still need\nto add a test file to read."
},
{
"role": "assistant",
"content": "import collections\nimport datetime\nimport p... | python | new_file | 5 | 2 | apache-2.0 | cd6efedc59924cef44dbddaa304483e09fe62d4e | dave-lab41/pelops,dave-lab41/pelops,Lab41/pelops,Lab41/pelops,d-grossman/pelops,d-grossman/pelops | testci/test_featureproducer.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test module where canvas unit tests will go\n\nOnly a simple line drawing test there for now..."
},
{
"role": "assistant",
"content": "import numpy as np\nfrom numpy.testing import assert_equal\n\nfrom pyagg import Graphics... | python | new_file | 1 | 1 | mit | 77917be83586e1963fb3b11cdb9631a766acb294 | celiagg/celiagg,celiagg/celiagg,celiagg/celiagg,celiagg/celiagg,celiagg/celiagg | pyagg/tests/test_canvas.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update last commit: add act-experience-update example"
},
{
"role": "assistant",
"content": "# Copyright 2020 Tensorforce Team. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m... | python | new_file | 1 | 3 | apache-2.0 | fb0e9e0d6de608a255cac00acbecdc445b2da93c | reinforceio/tensorforce | examples/act_experience_update.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the merge sort algorithm."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''\nMerge Sort.\n\nBest, Average, Worst: O(nlogn).\n'''\n\n\ndef merge_sort(array, result, left, right,... | python | new_file | 3 | 15 | mit | 8ac380905f969eab9be64cc97d8e5ec4d7c53e26 | weichen2046/algorithm-study,weichen2046/algorithm-study | sorting/merge_sort.py | rejected_complexity | Cyclomatic complexity too high: 15 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for empty LogEndogTransformer"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal\nfrom scipy import stats\nimport pytest\n\nfrom pmda... | python | new_file | 5 | 1 | mit | f118339ae2e55ed5d07480094f5706eef6ed858d | tgsmith61591/pyramid,tgsmith61591/pyramid,alkaline-ml/pmdarima,alkaline-ml/pmdarima,tgsmith61591/pyramid,alkaline-ml/pmdarima | pmdarima/preprocessing/endog/tests/test_log.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add database migrations and creation script"
},
{
"role": "assistant",
"content": "from flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom app import db, create_app\nfrom app.models import User... | python | new_file | 5 | 1 | mit | bfbeee63deecb424a528b44225b2dd4c67bbbc23 | brayoh/bucket-list-api | manage.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add quick and dirty script to generate a fake postage stamp cue (PSC)."
},
{
"role": "assistant",
"content": "from datetime import datetime as dt\nfrom datetime import timedelta as tdelta\nimport numpy as np\nfrom astropy.io impo... | python | new_file | 1 | 0 | mit | 067c256fb9df4170c129b2bc36d1b1323fad6d25 | panoptes/PIAA | generate_PSC.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add cascade for easier deletion of users from database."
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 577ad345788e\nRevises: 3b655c2d1a85\nCreate Date: 2015-11-17 11:18:22.685983\n\n\"\"\"\n\n# revisi... | python | new_file | 3 | 1 | bsd-3-clause | 911cb1838dcb974dfa1e28712a1f884c89c2b600 | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | migrations/versions/577ad345788e_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool to upload a build"
},
{
"role": "assistant",
"content": "\"\"\"This script upload a newly-build version of CocoMUD for Windows.\n\nThe Download wiki page on Redmine are updated.\n\nRequirements:\n This script needs... | python | new_file | 10 | 0 | bsd-3-clause | 099c0af192cabb11fad220296c327654b4c10b3e | vlegoff/cocomud | tools/upload_build.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Riak counter datatype tests"
},
{
"role": "assistant",
"content": "import unittest\nfrom aioriak.bucket import Bucket, BucketType\nfrom aioriak import datatypes\nfrom aioriak.tests.base import IntegrationTest, AsyncUnitTestCa... | python | new_file | 1 | 2 | mit | 5e19645b4917bf2f0bc9c987ef6148a5833ff05c | rambler-digital-solutions/aioriak | aioriak/tests/test_datatypes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add django command for triggering campaigns scheduler"
},
{
"role": "assistant",
"content": "from datetime import datetime\nfrom django.core.management.base import BaseCommand\n\nfrom SMSFlyCRM.SMSApp.tasks import scheduleRecurri... | python | new_file | 1 | 1 | mit | a4aea5e34f44d5f9183258978c85e20fb0fbc0b7 | wk-tech/crm-smsfly,wk-tech/crm-smsfly,wk-tech/crm-smsfly | SMSFlyCRM/SMSApp/management/commands/sms_campaign_scheduler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for HelloController"
},
{
"role": "assistant",
"content": "import unittest\nimport sys\nimport os\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\", \"..\"))\n\nfrom pkg_resources import require\nrequi... | python | new_file | 1 | 1 | apache-2.0 | 51a7d69b6c8cd1cceaccbb0288e1d9e222619b61 | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | tests/test_controllers/test_hellocontroller.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Revert \"Hold off on migration\"\n\nThis reverts commit d0cd939e90917bc06b71fb6a6a5aedd881f24840."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.14 on 2018-10-09 19:24\nfrom __future__ ... | python | new_file | 1 | 0 | bsd-3-clause | 302e267c0f1374a11a661418c49aa63f25a38bf9 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/export/migrations/0006_delete_dailysavedexportnotification.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.