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 Weather class (use forecastio, geopy) - forecase(current/daily)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport datetime\nimport forecastio\nfrom geopy.geocoders import GoogleV3\n\nfrom kino.template ... | python | new_file | 3 | 3 | mit | 955bca3beb7808636a586bed43c37e5f74fba17f | DongjunLee/kino-bot | kino/functions/weather.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool to regenerate JSON files from P4 progs\n\ntools/update_test_bmv2_jsons.py can be used to regenerate all the bmv2\nJSON files from their P4 counterpart"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimpo... | python | new_file | 7 | 5 | apache-2.0 | a8274a5d5e4ec68f3ee594ffa741e90f11cf24db | p4lang/PI,p4lang/PI,p4lang/PI,p4lang/PI | tools/update_test_bmv2_jsons.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to count labels in a data set\n\n(Moved from embodied emotions ml code.)"
},
{
"role": "assistant",
"content": "\"\"\"Count HEEM labels in data set.\n\nUsage: python count_labels.py <dir with train and test files>\n\"\... | python | new_file | 2 | 3 | apache-2.0 | 6789f2ea1862f4c30e8d60bd0b47640b7e5835c1 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | count_labels.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [algorithm] Solve hackerrank linked list problem"
},
{
"role": "assistant",
"content": "# https://www.hackerrank.com/challenges/delete-duplicate-value-nodes-from-a-sorted-linked-list/problem\n\ndef RemoveDuplicates(head):\n if... | python | new_file | 1 | 4 | mit | 897843932937faa841220cde90bdc89603d95615 | honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice,honux77/practice | hackerrank/linked-list/dedup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for legislator change"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n... | python | new_file | 1 | 0 | mit | e19097216c090c0e3f4b68c743d6427f012ab69e | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | txlege84/legislators/migrations/0004_auto_20141201_1604.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Print the left view of a BST"
},
{
"role": "assistant",
"content": "class BST:\n def __init__(self,val):\n self.left = None\n self.right = None\n self.data = val\n\ndef insertToBst(root,value):\n if roo... | python | new_file | 2 | 5 | mit | a9609a500a65cc0efb787f5d90e164bd6fa48c1a | arunkumarpalaniappan/algorithm_tryouts | leftViewofBST.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add toy example of reading a large XML file"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport xml.etree.cElementTree as ET\nfrom sys import argv\n\ninput_file = argv[1]\n\nNAMESPACE = \"{http://www.mediawiki.... | python | new_file | 2 | 0 | apache-2.0 | 50dded21e316b6b8e6cb7800b17ed7bd92624946 | tiffanyj41/hermes,tiffanyj41/hermes,tiffanyj41/hermes,tiffanyj41/hermes | xml_to_json.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script for storing a config variable"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\"\"\"\nStore a config variable in SSM under the key structure\n\n /{project_id}/config/{label}/{c... | python | new_file | 1 | 2 | mit | 48eb4604673513b771b6def05a1652ae1b66d4d0 | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | scripts/add_ssm_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add taxonomy model and initiation"
},
{
"role": "assistant",
"content": "import json\nimport os\n\nfrom website import settings\n\nfrom modularodm import fields, Q\nfrom modularodm.exceptions import NoResultsFound\n\nfrom framewo... | python | new_file | 1 | 4 | apache-2.0 | b9034ca499ae8c0366ac8cd5ee71641f39c0ffba | Nesiehr/osf.io,binoculars/osf.io,pattisdr/osf.io,mattclark/osf.io,caseyrollins/osf.io,leb2dg/osf.io,baylee-d/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,acshi/osf.io,icereval/osf.io,adlius/osf.io,leb2dg/osf.io,aaxelb/osf.io,chrisseto/osf.io,binoculars/osf.io,rdhyee/osf.io,alexschiller/osf.io,chennan47/osf.io,m... | website/project/taxonomies/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests for custom_urls system"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom djangosanetesting import UnitTestCase\n\nfrom django.http import Http404\n\nfrom ella.core.custom_urls import DetailDispa... | python | new_file | 1 | 1 | bsd-3-clause | dc7cf288c5c5c9733a59184770fbaa26db036833 | whalerock/ella,petrlosa/ella,WhiskeyMedia/ella,whalerock/ella,whalerock/ella,MichalMaM/ella,petrlosa/ella,MichalMaM/ella,ella/ella,WhiskeyMedia/ella | tests/unit_project/test_core/test_custom_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add benchmarks for custom generators"
},
{
"role": "assistant",
"content": "from tohu.v6.primitive_generators import Integer, HashDigest, FakerGenerator\nfrom tohu.v6.derived_generators import Apply, Lookup, SelectOne, SelectMult... | python | new_file | 3 | 1 | mit | 7491f500c75850c094158b4621fdef602bce3d27 | maxalbert/tohu | benchmarks/benchmarks/benchmark_custom_generators.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add local dev settings module"
},
{
"role": "assistant",
"content": "from .base_settings import *\n\nDEBUG = True\n\nLANGUAGE_CODE = 'en'\n\nTIME_FORMAT = [\n\n '%I:%M %p',\n '%H:%M %p',\n]\n\n\nTIME_INPUT_FORMATS = [\n ... | python | new_file | 2 | 0 | mit | d410fb26d3fb8bbd843234e90891bee5a5fff7e7 | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | halaqat/settings/local_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for problem 4"
},
{
"role": "assistant",
"content": "from itertools import combinations_with_replacement\nfrom operator import mul\n\nthree_digit_numbers = tuple(range(100, 1000))\n\ncombinations = combinations_with_... | python | new_file | 1 | 0 | bsd-3-clause | 63f9f87a3f04cb03c1e286cc5b6d49306f90e352 | gidj/euler,gidj/euler | python/004_largest_palindrome_product/palindrome_product.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create sitemap for google news"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib.sitemaps import GenericSitemap\nfrom django.contrib.sites.models import Site\n\n\nclass Goo... | python | new_file | 1 | 5 | mit | 8fd466ecd16db736177104902eb84f661b2b62cc | jeanmask/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps | opps/sitemaps/googlenews.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy SBSolarcell tests into individual file"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport numpy as np\nimport ibei\nfrom astropy import units\nimport unittest\n\ntemp_sun = 5762.\ntemp_earth = 288.\nbandg... | python | new_file | 3 | 1 | mit | ea11ae8919139eae8eaa6b9b1dfe256726d3c584 | jrsmith3/ibei,jrsmith3/tec,jrsmith3/tec | test/test_SBSolarcell.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for run_nohw"
},
{
"role": "assistant",
"content": "\"\"\"\nTest the \"snabb lwaftr run_nohw\" subcommand.\n\"\"\"\n\nimport unittest\n\nfrom random import randint\nfrom subprocess import call, check_call\nfrom test... | python | new_file | 3 | 3 | apache-2.0 | 1c2c7d5134780e58bd69f24ee06050b2f405d946 | Igalia/snabb,eugeneia/snabbswitch,eugeneia/snabbswitch,eugeneia/snabbswitch,alexandergall/snabbswitch,Igalia/snabb,alexandergall/snabbswitch,snabbco/snabb,dpino/snabb,eugeneia/snabb,heryii/snabb,alexandergall/snabbswitch,snabbco/snabb,snabbco/snabb,alexandergall/snabbswitch,Igalia/snabbswitch,Igalia/snabb,snabbco/snabb... | src/program/lwaftr/tests/subcommands/run_nohw_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a few unit tests for libvirt_conn."
},
{
"role": "assistant",
"content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright 2010 OpenStack LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"Licens... | python | new_file | 1 | 4 | apache-2.0 | c153bc9422308599d1354abf782273ca7bd78952 | n0ano/ganttclient | nova/tests/virt_unittest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool for generating the JSONP required by the documentation versions."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Copyright © 2014 Cask Data, Inc.\n#\n# Used to generate JSONP... | python | new_file | 5 | 10 | apache-2.0 | d9be3f189fc34117bdec6e0c7856f7a7dc5f902a | chtyim/cdap,mpouttuclarke/cdap,anthcp/cdap,chtyim/cdap,hsaputra/cdap,chtyim/cdap,hsaputra/cdap,caskdata/cdap,chtyim/cdap,caskdata/cdap,mpouttuclarke/cdap,mpouttuclarke/cdap,hsaputra/cdap,caskdata/cdap,hsaputra/cdap,mpouttuclarke/cdap,caskdata/cdap,anthcp/cdap,anthcp/cdap,chtyim/cdap,caskdata/cdap,anthcp/cdap,caskdata/c... | cdap-docs/tools/versionscallback-gen.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add organisation for TFL Dial a Ride\n\nReferences image added in:\n- [ ] https://github.com/alphagov/notifications-admin/pull/1321"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0098_tfl_dar\nRevises:... | python | new_file | 4 | 1 | mit | 87565c1e6032bff2cc3e20f5c4f46b7a17977f7c | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0098_tfl_dar.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add default value for the fields object and field of the social network app model"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations... | python | new_file | 1 | 0 | mit | 3091555ca7fc421f886a1df1ac28f677feb70a53 | rebearteta/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,joausaga/social-ideation,joausaga/social-ideation | app/migrations/0006_auto_20150825_1513.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to write lib svm expected data format from my collected data"
},
{
"role": "assistant",
"content": "\"\"\"\nA script to write out lib svm expected data format from my collecting data\n\"\"\"\nimport os\nimport s... | python | new_file | 2 | 11 | bsd-3-clause | bf3f14692b6e2a348f5a0171ad57e494801ed4f4 | Wayne82/libsvm-practice,Wayne82/libsvm-practice,Wayne82/libsvm-practice | scripts/writelibsvmdataformat.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make SurfaceHandler (for sfc data)"
},
{
"role": "assistant",
"content": "from glob import glob\n# Third-party modules\nimport pandas as pd\n# Hand-made modules\nfrom base import LocationHandlerBase\n\nSFC_REGEX_DIRNAME = \"sfc[1... | python | new_file | 1 | 5 | mit | 1b00a597d8145b2df05054fef8d072d452209463 | gciteam6/xgboost,gciteam6/xgboost | src/data/surface.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration version? Not sure if this is right"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 3025c44bdb2\nRevises: None\nCreate Date: 2014-12-16 12:13:55.759378\n\n\"\"\"\n\n# revision identifiers, ... | python | new_file | 4 | 1 | bsd-2-clause | 22585d29220709dc3a3de16b03c626ca27c715ca | brianwolfe/robotics-tutorial,brianwolfe/robotics-tutorial,brianwolfe/robotics-tutorial | migrations/versions/3025c44bdb2_.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for tests of start symbol as not nonterminal"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 10.08.2017 23:12\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom uni... | python | new_file | 2 | 0 | mit | 289ce4a720c5863f6a80e1b86083fd2919b52f14 | PatrikValkovic/grammpy | tests/startsymbol_tests/NotNonterminalTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helpful script for ascii checking - fyi @bruskiza"
},
{
"role": "assistant",
"content": "import json\nfiles = [\"go-ussd_public.ibo_NG.json\"]\n\n\ndef is_ascii(s):\n return all(ord(c) < 128 for c in s)\n\ncurrent_message_... | python | new_file | 3 | 2 | bsd-3-clause | 64c70f3f73d14d5bdd18cf5c4ad8b15ec745f517 | praekelt/mama-ng-jsbox,praekelt/mama-ng-jsbox | config/check_ascii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to create a historic->modern dictionary\n\nThe script takes as input a modern->historic variants dictionary in a\njson file (created by the generate_historic_liwc script) and\nreverses it to a dictionary that can be used to replac... | python | new_file | 7 | 0 | apache-2.0 | e075b0b1c8d581107209e869eda7f6ff07a7321c | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | reverse_dict.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a few tests for docparse.\n\ngit-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@338 ead46cd0-7350-4e37-8683-fc4c6f79bf00"
},
{
"role": "assistant",
"content": "from nipype.testing import *\n\nfrom nipype.utils.docparse impo... | python | new_file | 4 | 1 | bsd-3-clause | fb6eee18b2bf48dd0063623515ced00e980bdf10 | carolFrohlich/nipype,carolFrohlich/nipype,sgiavasis/nipype,gerddie/nipype,christianbrodbeck/nipype,glatard/nipype,grlee77/nipype,satra/NiPypeold,arokem/nipype,wanderine/nipype,mick-d/nipype,carlohamalainen/nipype,rameshvs/nipype,dgellis90/nipype,blakedewey/nipype,glatard/nipype,gerddie/nipype,grlee77/nipype,Leoniela/ni... | nipype/utils/tests/test_docparse.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove old notification status column"
},
{
"role": "assistant",
"content": "\"\"\"\n\nRevision ID: 0109_rem_old_noti_status\nRevises: 0108_change_logo_not_nullable\nCreate Date: 2017-07-10 14:25:15.712055\n\n\"\"\"\nfrom alembic... | python | new_file | 1 | 1 | mit | 555dac76a8810cfeaae96f8de04e9eb3362a3314 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0109_rem_old_noti_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an index on notifications for (service_id, created_at) to improve the performance of the notification queries. We've already performed this update on production since you need to create the index concurrently, which is not allowed from t... | python | new_file | 1 | 1 | mit | 21a67556b83b7905134439d55afe33c35e4b3422 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0246_notifications_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution class for Ghia et al. (1982)"
},
{
"role": "assistant",
"content": "\"\"\"\nImplementation of the class `GhiaEtAl1982` that reads the centerline velocities\nreported in Ghia et al. (1982).\n\n_References:_\n* Ghia, U... | python | new_file | 1 | 2 | mit | 5acc7d50cbe199af49aece28b95ea97484ae31c7 | mesnardo/snake | snake/solutions/ghiaEtAl1982.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: NN: Add smile detection example script."
},
{
"role": "assistant",
"content": "# Simle detection using Haar Cascade + CNN.\nimport sensor, time, image, os, nn\n\nsensor.reset() # Reset and initialize the ... | python | new_file | 3 | 0 | mit | 14068a2e3ca445c02895aed38420baf846338aae | iabdalkader/openmv,iabdalkader/openmv,iabdalkader/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv | scripts/examples/25-Machine-Learning/nn_haar_smile_detection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for CI fix"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.29 on 2021-09-22 07:29\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimpo... | python | new_file | 1 | 0 | mit | 699469342179fdc4319b5f39ea201015860ef09d | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data | infrastructure/migrations/0020_auto_20210922_0929.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests on cache handler\n\nChange-Id: Ife6600da240f830aa0080e3f214cedf1389ea512"
},
{
"role": "assistant",
"content": "# Copyright (c) 2020 OpenStack Foundation.\n# All Rights Reserved.\n\n# Licensed under the Apache L... | python | new_file | 1 | 1 | apache-2.0 | 4065a08ea401e0d95e8d40d9d735edf92edda861 | openstack/oslo.policy | oslo_policy/tests/test_cache_handler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Work on defining RegEx to find and format molecular geometries in Gaussian output files."
},
{
"role": "assistant",
"content": "__author__ = 'Thomas Heavey'\n\nimport re\n\nfilename = \"testg.out\"\n\ndef findgeoms(filename):\n ... | python | new_file | 1 | 5 | apache-2.0 | af3ba846a8074132c64568c420ecb9b6ade9c6ea | thompcinnamon/QM-calc-scripts | geomRegexTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add stub for qiprofile update test."
},
{
"role": "assistant",
"content": "import os\nimport glob\nimport shutil\nfrom nose.tools import (assert_equal, assert_is_not_none)\nimport qixnat\nfrom ... import (project, ROOT)\nfrom ...... | python | new_file | 11 | 1 | bsd-2-clause | 3661ca3947763656165f8fc68ea42358ad37285a | ohsu-qin/qipipe | test/unit/helpers/test_qiprofile.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add decorator to make a Node class from a regular function"
},
{
"role": "assistant",
"content": "\"\"\"\nNodetree decorators.\n\"\"\"\n\nimport inspect\nimport textwrap\nimport node\n\n\ndef underscore_to_camelcase(value):\n ... | python | new_file | 1 | 3 | apache-2.0 | 139123ddb81eec12d0f932ff6ff73aadb4b418cc | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | ocradmin/lib/nodetree/decorators.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to parse JSON output"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2.7\nimport json\nimport socket\nimport sys\n\ndef readOutput(host, port):\n\tdata = None\n\ts = None\n\ttry:\n\t\ts = socket.socket(s... | python | new_file | 8 | 7 | apache-2.0 | 32a79573b38c6d2ea7f5b81363610a5d9332ed4e | leo27lijiang/app-monitor,leo27lijiang/app-monitor | src/main/resources/jsonformat.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to send unregister user emails\n\n...to unregistered contributors who didn't receive the email\nafter 568413a77cc51511a0f7afe081a218676a36ebb6 was deployed\n\nRelates to [OSF-7935]"
},
{
"role": "assistant",
"content":... | python | new_file | 4 | 5 | apache-2.0 | c63144242d9cf2ecf02d58eb9a93cfe426acc6dc | laurenrevere/osf.io,Nesiehr/osf.io,cwisecarver/osf.io,leb2dg/osf.io,crcresearch/osf.io,leb2dg/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,chennan47/osf.io,chrisseto/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,Nesiehr/osf.io,caseyrollins/osf.io,sloria/osf.io,baylee-d/osf.io,cslzchen/osf.io,hmoco/osf.io,TomBaxter/osf.i... | scripts/send_preprint_unreg_contributor_emails.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add default ordering of progress outcome groups"
},
{
"role": "assistant",
"content": "# Generated by Django 2.1.5 on 2019-07-31 07:12\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n depende... | python | new_file | 1 | 0 | mit | c2b69a51faac56689edc88e747a00b60cf08cc04 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | dthm4kaiako/poet/migrations/0003_auto_20190731_1912.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for layers module."
},
{
"role": "assistant",
"content": "import theanets\nimport numpy as np\n\n\nclass TestLayer:\n def test_build(self):\n layer = theanets.layers.build('feedforward', nin=2, nout=4)\n ... | python | new_file | 3 | 1 | mit | 36af45d88f01723204d9b65d4081e74a80f0776b | chrinide/theanets,devdoer/theanets,lmjohns3/theanets | test/layers_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run tests"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport argparse\nimport sys\n\nimport django\nfrom django.conf import settings\nfrom django.test.utils import get_runner\n\n\ndef runtests(test... | python | new_file | 1 | 1 | mit | 379aef7e3aebc05352cacd274b43b156e32de18b | lamarmeigs/django-clean-fields | runtests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for gabor filter"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_almost_equal\n\nfrom skimage.filter import gabor_kernel, gabor_filter\n\n\ndef... | python | new_file | 1 | 5 | bsd-3-clause | aeaf2e1a1207f2094ea4298b1ecff015f5996b5a | blink1073/scikit-image,dpshelio/scikit-image,emon10005/scikit-image,ofgulban/scikit-image,Britefury/scikit-image,chriscrosscutler/scikit-image,keflavich/scikit-image,Hiyorimi/scikit-image,keflavich/scikit-image,warmspringwinds/scikit-image,chintak/scikit-image,vighneshbirodkar/scikit-image,ClinicalGraphics/scikit-image... | skimage/filter/tests/test_gabor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to count parameters of PyTorch model\n\nSigned-off-by: Tushar Pankaj <<EMAIL>>"
},
{
"role": "assistant",
"content": "import sys\nimport numpy as np\nimport torch\n\nmodel = torch.load(sys.argv[1])\nparams = 0\nfor key... | python | new_file | 1 | 0 | mit | a70f46aac52be5b38b869cfbe18c0421a0032aee | sauhaardac/training,sauhaardac/training | count_params.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create masked version based on pbcov cutogg"
},
{
"role": "assistant",
"content": "\n'''\nCut out noisy regions by imposing a mask of the primary beam coverage.\n'''\n\nfrom astropy.io import fits\nfrom spectral_cube import Spect... | python | new_file | 5 | 0 | mit | fe6ece236e684d76441280ba700565f7fbce40cc | e-koch/VLA_Lband,e-koch/VLA_Lband | 14B-088/HI/analysis/pbcov_masking.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: tools: Add some simple MediaWiki importer."
},
{
"role": "assistant",
"content": "import os\nimport os.path\nimport argparse\nfrom sqlalchemy import create_engine\n\n\ndef main():\n parser = argparse.ArgumentParser()\n pars... | python | new_file | 2 | 9 | apache-2.0 | 35e76ec99a3710a20b17a5afddaa14389af65098 | ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked | tools/import_mediawiki.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for APS2 instruction merging.\n\nA reduced example of the failing situation from issue #90."
},
{
"role": "assistant",
"content": "import h5py\nimport unittest\nimport numpy as np\nfrom copy import copy\n\nfrom QGL impor... | python | new_file | 17 | 2 | apache-2.0 | abf39931331f54aff5f10345939420041bd2039d | Plourde-Research-Lab/PyQLab,BBN-Q/PyQLab,rmcgurrin/PyQLab,calebjordan/PyQLab | tests/test_APS2Pattern.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Write python code for the following: Check consecutive elements in an array"
},
{
"role": "assistant",
"content": "import unittest\n\"\"\"\nGiven an unsorted array of numbers, return true if the array only contains consecutive elements.\nInput: 5 2 3 1 4\nOuput: Tru... | python | new_file | 1 | 4 | mit | b3e6855489eba5d59507ef6fb4c92f8284526ec1 | prathamtandon/g4gproblems | Arrays/check_consecutive_elements.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration script for changing users with None as email_verifications to {}"
},
{
"role": "assistant",
"content": "\"\"\" Ensure that users with User.email_verifications == None now have {} instead\n\"\"\"\n\nimport logging\ni... | python | new_file | 4 | 4 | apache-2.0 | e251aff9a232a66b2d24324f394da2ad9345ce79 | rdhyee/osf.io,samanehsan/osf.io,barbour-em/osf.io,saradbowman/osf.io,haoyuchen1992/osf.io,brandonPurvis/osf.io,jolene-esposito/osf.io,emetsger/osf.io,laurenrevere/osf.io,HarryRybacki/osf.io,haoyuchen1992/osf.io,CenterForOpenScience/osf.io,samchrisinger/osf.io,jnayak1/osf.io,caneruguz/osf.io,reinaH/osf.io,binoculars/osf... | scripts/migration/migrate_none_as_email_verification.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom robot.utils.asserts import assert_true, assert_raises\n\nfrom robotide.application.chiefcontroller import ChiefController\nfrom robotide.namespace import Namespace\n\nfrom resources import MINIMAL_SUITE_PATH, RESOURCE_... | python | edit | 1 | 1 | apache-2.0 | 4a179825234b711a729fce5bc9ffc8de029c0999 | robotframework/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE,caio2k/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,fingeronthebutton/RIDE,fingeronthebutton/RIDE,fingeronthebutton/RIDE,caio2k/RIDE,caio2k/RIDE | utest/controller/test_loading.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add intial unit test file\n\nCurrently just tests the two primary functions, the results are a bit\nbrittle but that will allow us to detect regressions for future work."
},
{
"role": "assistant",
"content": "import pytest\nfrom ... | python | new_file | 6 | 2 | mit | 4c8ea40eeec6df07cf8721c256ad8cc3d35fb23e | masterkoppa/whatodo | src/test_main.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alternate example for `match_template`."
},
{
"role": "assistant",
"content": "\"\"\"\n=================\nTemplate Matching\n=================\n\nIn this example, we use template matching to identify the occurrence of an\nima... | python | new_file | 1 | 0 | bsd-3-clause | 5e49eb4fb6bce9cdeae515590530b78e4dde89d9 | emmanuelle/scikits.image,warmspringwinds/scikit-image,bennlich/scikit-image,rjeli/scikit-image,ofgulban/scikit-image,GaZ3ll3/scikit-image,rjeli/scikit-image,ClinicalGraphics/scikit-image,dpshelio/scikit-image,pratapvardhan/scikit-image,michaelpacer/scikit-image,chintak/scikit-image,michaelaye/scikit-image,chintak/sciki... | doc/examples/plot_match_face_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add regression test with non ' ' space character as token"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\nfrom io import StringIO\n\nword2vec_str = \"\"\", -0.046107 -0.035951 -0.560418\nde -0.648927 -0.400976 -0.527124... | python | new_file | 1 | 1 | mit | 3ba109622c24bd52f32e605c523249e1c26b0207 | banglakit/spaCy,banglakit/spaCy,explosion/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,banglakit/spaCy,banglakit/spaCy,oroszgy/spaCy.hu,explosion/spaCy,recognai/spaCy,explosion/spaCy,oroszgy/spaCy.hu,explosion/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,explosion/spaCy,banglakit/spaCy,recognai/spaC... | spacy/tests/regression/test_issue834.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing python 3 only file.\n\nAs title."
},
{
"role": "assistant",
"content": "\"\"\"\nUsecases with Python 3 syntax in the signatures. This is a separate module\nin order to avoid syntax errors with Python 2.\n\"\"\"\n\n\nc... | python | new_file | 1 | 1 | bsd-2-clause | 55b33bff9856cc91943f0a5ae492db1fdc7d8d5a | cpcloud/numba,stonebig/numba,gmarkall/numba,numba/numba,seibert/numba,seibert/numba,stonebig/numba,cpcloud/numba,stuartarchibald/numba,stuartarchibald/numba,IntelLabs/numba,sklam/numba,IntelLabs/numba,sklam/numba,numba/numba,numba/numba,seibert/numba,jriehl/numba,cpcloud/numba,jriehl/numba,IntelLabs/numba,seibert/numba... | numba/tests/jitclass_usecases.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: lib: Add a script for generating unicode name table\n\nGLib doesn't have a way to get unicode char names, so we'll have to\nreimplement this."
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\n# Input: https://www.unico... | python | new_file | 5 | 5 | bsd-3-clause | 86baa4f437cf3892c15a56e8331c19b6d2e63b1d | GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters | lib/gen-names.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the run() function"
},
{
"role": "assistant",
"content": "import sys\nimport tempfile\nimport unittest\n\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\nimport icon_font... | python | new_file | 1 | 1 | mit | 3b66fbc844b023003420db7a9986811110f55489 | Pythonity/icon-font-to-png | tests/test_run.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a sample python file interesting to debug"
},
{
"role": "assistant",
"content": "import sys\nimport os\nimport time\nimport threading\nimport ikpdb\n\nTEST_MULTI_THREADING = False\nTEST_EXCEPTION_PROPAGATION = False\nTEST_POS... | python | new_file | 11 | 4 | mit | 578de6c57f9698c7e273af06d1e815f71269bb18 | audaxis/ikpdb,audaxis/ikpdb | tests/to_debug.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tenant exporter for accounting"
},
{
"role": "assistant",
"content": "import json\n\nfrom rest_framework.authtoken.models import Token\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.core.management.b... | python | new_file | 2 | 5 | bsd-3-clause | c0b05a43e10693f8aab87a7f86726d512b7494fc | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/clients/management/commands/export_tenants.py | rejected_duplicate | Near-duplicate of sample 1 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a solution to the phone number problem: can a phone number be represented as words in a dictionary?"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport unittest\n\nwords = set([\"dog\", \"clog\", \"cat\", \... | python | new_file | 1 | 6 | apache-2.0 | edc5116472c49370e5bf3ff7f9f7872732b0285e | aww/cs_practice | phone_numbers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tsstats/event.py for easy event-initialization"
},
{
"role": "assistant",
"content": "from collections import namedtuple\n\nEvent = namedtuple(\n 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client']\n)\n\... | python | new_file | 1 | 1 | mit | da2b773bf6e669b3ec50bbd6af73e1d80bb0b5a5 | Thor77/TeamspeakStats,Thor77/TeamspeakStats | tsstats/events.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script that tests AI players"
},
{
"role": "assistant",
"content": "from AI import *\nimport random\n\ndef RandomPlayer(game):\n return 0, random.choice(game.get_available_moves())\n\ndef ABPlayer(game):\n return alpha_... | python | new_file | 7 | 1 | mit | f6f2c6fc2a51bb3243d9b99ab1093809a2d1a5bb | giovannipcarvalho/dots-and-boxes | test_players.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom r2.lib.pages import Reddit\nfrom r2.lib.wrapped import Templated\n\n\nclass DonatePage(Reddit):\n extra_stylesheets = Reddit.extra_stylesheets + [\"donate.less\"]\n\n def __init__(self, title, content, **kwargs):\n Reddit.... | python | edit | 1 | 1 | bsd-3-clause | 1396ff4ab4e6664c265f97958951815a525f7823 | reddit/reddit-plugin-donate,madbook/reddit-plugin-donate,reddit/reddit-plugin-donate,madbook/reddit-plugin-donate,madbook/reddit-plugin-donate,reddit/reddit-plugin-donate | reddit_donate/pages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of the script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n#stdlib\nimport json\nimport os\nimport subprocess\nfrom xml.dom.minidom import parseString\n\ndef which(cmd):\n \"\"\"Python implem... | python | new_file | 4 | 8 | mit | 1a4052deb8e0ab2deb7038220ae23d7bb9311ce9 | agarstang/vmware-ofv-to-facter | ovf_to_facter.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create BT Comm wrapper class"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2016 F Dou<<EMAIL>>\n# See LICENSE for details.\n\n\nimport bluetooth\nimport logging\n\nclass RxBtCo... | python | new_file | 2 | 2 | apache-2.0 | fa55ceb71ff254f8ed3413a35acfe20da7c03a91 | javatechs/RxCmd,javatechs/RxCmd,javatechs/RxCmd | rxbtcomm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for redis test helper"
},
{
"role": "assistant",
"content": "import json\n\nfrom twisted.trial.unittest import TestCase\nfrom twisted.internet.defer import inlineCallbacks\n\nfrom vumi_http_retry.tests.redis import creat... | python | new_file | 1 | 1 | bsd-3-clause | 0ede4e22370a3f8217fee8ff995a9c7057d8b00b | praekelt/vumi-http-retry-api,praekelt/vumi-http-retry-api | vumi_http_retry/tests/test_redis.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a place to put random stuff and a list of components as a python module."
},
{
"role": "assistant",
"content": "COMPONENTS = [\t\n \"AdaBoost\",\n\t\"AutoInvert\",\n\t\"AutoMlpClassifier\",\n\t\"BiggestCcExtractor\",\n\t\"... | python | new_file | 1 | 0 | apache-2.0 | 4db13bdab18934bebcfe5b102044f936e0eab892 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | etc/component_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Find the Celebrity sol for Leetcode"
},
{
"role": "assistant",
"content": "# The knows API is already defined for you.\n# @param a, person a\n# @param b, person b\n# @return a boolean, whether a knows b\n# def knows(a, b):... | python | new_file | 4 | 8 | mit | 25ff8c6f8bc9d70886d004f8b64f08facb8c12cf | Chasego/cod,cc13ny/algo,cc13ny/Allin,Chasego/cod,cc13ny/Allin,cc13ny/algo,Chasego/codirit,Chasego/codirit,cc13ny/algo,cc13ny/Allin,cc13ny/algo,Chasego/codirit,cc13ny/algo,Chasego/codi,Chasego/codi,Chasego/codi,cc13ny/Allin,Chasego/codirit,Chasego/codi,Chasego/cod,Chasego/codi,Chasego/codirit,Chasego/cod,cc13ny/Allin,Ch... | leetcode/277-Find-the-Celebrity/FindtheCelebrity_sol.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to exercis 3.6."
},
{
"role": "assistant",
"content": "# 3-6 Guest List\n\nguest_list = [\"Albert Einstein\", \"Isac Newton\", \"Marie Curie\", \"Galileo Galilei\"]\n\nmessage = \"Hi \" + guest_list[0] + \" you are i... | python | new_file | 1 | 0 | mit | 877a7b7449a1d88c14633376a2dfaca8c619c26a | HenrikSamuelsson/python-crash-course | exercises/chapter_03/exercise_03_06/exercise_03_06.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime #for checking renewal date range.\n\nfrom django import forms\nfrom django.core.exceptions import ValidationError\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom .models import (Patient, AdmissionNote, FluVa... | python | edit | 9 | 0 | mit | 60b5948508a67cb213ca04b5faacb77e27d8f84c | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys,gcrsaldanha/fiocruz,gcrsaldanha/fiocruz | samples/forms.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights extract each kth problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Extract Each Kth Problem\n\n\ndef extractEachKth(inputArray, k):\n return [e for i, e in enumerate(inputA... | python | new_file | 1 | 3 | mit | 3de2e625af9047b64cc2718e6e79be0c428b6ae7 | HKuz/Test_Code | CodeFights/extractEachKth.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration removing generated objects with factories"
},
{
"role": "assistant",
"content": "# Generated by Django 2.0.13 on 2020-04-06 13:40\n\nfrom django.conf import settings\nfrom django.contrib.gis.geos import Point, LineS... | python | new_file | 5 | 1 | bsd-2-clause | a8db8c0448d98e2de0e662581542bd644e673c7c | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin | geotrek/core/migrations/0018_remove_other_objects_from_factories.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test file for graph.py and add test of Greengraph class constructor"
},
{
"role": "assistant",
"content": "from greengraph.map import Map\nfrom greengraph.graph import Greengraph\nfrom mock import patch\nimport geopy\nfrom no... | python | new_file | 3 | 1 | mit | 49c673c5c8374867fc9bf026717fe137bdba84bc | MikeVasmer/GreenGraphCoursework | greengraph/test/test_graph.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a data analyzer class.\n\nMight come in handy to get statistical data of image datasets."
},
{
"role": "assistant",
"content": "\"\"\"\nDataAnalyzer\n\n:Authors:\n\tBerend Klein Haneveld\n\"\"\"\n\n\nclass DataAnalyzer(object... | python | new_file | 1 | 5 | mit | 82e4c67bd7643eed06e7cd170ca1d0de41c70912 | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | core/data/DataAnalyzer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ci settings file for postgresql database"
},
{
"role": "assistant",
"content": "\"\"\"\nConfiguration file for running tests against a MySQL database.\n\"\"\"\n\nfrom InvenTree.settings import *\n\n# Override the 'test' datab... | python | new_file | 5 | 0 | mit | 92ec849fc18d7cb610839abe2213ce30ceced46b | inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | InvenTree/InvenTree/ci_postgresql.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add connect2 wifi via pyobjc"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\"\"\"\nI didn't create this but I'm storing it so I can reuse it.\nhttp://stackoverflow.com/a/34967364/4811765\n\"\"\"\nimport objc\n\nSSID =... | python | new_file | 2 | 0 | mit | 8e8e11990e430302eca24d32ba0b88dcc66233d6 | clburlison/scripts,clburlison/scripts,clburlison/scripts | clburlison_scripts/connect2_wifi_pyobjc/connect2_wifi_pyobjc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new sms message generator"
},
{
"role": "assistant",
"content": "def generate_new_procedure_message(procedure, ward, timeframe, doctor):\n unique_reference = str(1)\n message = str.format(\"{0} is available on {1}. Atte... | python | new_file | 1 | 1 | mit | 3f85610873d88592970c64661e526b2a576e300f | bsharif/SLOT,nhshd-slot/SLOT,bsharif/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT,bsharif/SLOT | sms_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for user manager"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.13 on 2018-02-22 20:44\nfrom __future__ import unicode_literals\n\nimport kolibri.auth.models\nfrom django.d... | python | new_file | 1 | 0 | mit | 16275938769c16c79b89349612e8e7b2891de815 | benjaoming/kolibri,jonboiser/kolibri,christianmemije/kolibri,lyw07/kolibri,mrpau/kolibri,mrpau/kolibri,DXCanas/kolibri,mrpau/kolibri,benjaoming/kolibri,lyw07/kolibri,mrpau/kolibri,christianmemije/kolibri,learningequality/kolibri,jonboiser/kolibri,learningequality/kolibri,lyw07/kolibri,indirectlylit/kolibri,DXCanas/koli... | kolibri/auth/migrations/0008_auto_20180222_1244.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility class for evaluation"
},
{
"role": "assistant",
"content": "\nclass EvaluationUtility(object):\n @staticmethod\n def convert_to_text(graph, clusters):\n # convert clustering result from graph to text\n ... | python | new_file | 1 | 4 | mit | a6d6b833e33dc465b0fa828018e2cbba748f8282 | studiawan/pygraphc | pygraphc/evaluation/EvaluationUtility.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy of Ryan's PCMToWave component.\n\nMatt"
},
{
"role": "assistant",
"content": "from Axon.Component import component\nimport string\nimport struct\nfrom Axon.Ipc import producerFinished, shutdown\n\nclass PCMToWave(component):... | python | new_file | 2 | 10 | apache-2.0 | e304aae71617cdba0ffcb720a24406375fb866a1 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/MH/audio/ToWAV.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add validation function removed from main script."
},
{
"role": "assistant",
"content": "from schema import Schema\n\n\ndef validate_file_option(file_option, msg):\n msg = \"{msg} '{file}'.\".format(msg=msg, file=file_option)\... | python | new_file | 1 | 1 | mit | 7b40a4902d1dc43c73a7858fc9286a641b3a9666 | COMBINE-lab/piquant,lweasel/piquant,lweasel/piquant | assess_isoform_quantification/options.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for invoice status\n\n- ITACLOUD-4886"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(... | python | new_file | 1 | 0 | mit | a3df0567c295f0b2879c9a4f095a31108359d531 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/billing/migrations/0003_invoice_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add framework for own SVM from scratch"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Support Vector Machine (SVM) classification for machine learning.\n\nSVM is a binary classifier. The objective of the SV... | python | new_file | 1 | 0 | mit | 6a6abadc2395810076b89fb38c759f85426a0304 | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | supportVectorMachine/howItWorksSupportVectorMachine.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights different rightmost bit problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Different Right-most Bit (Core) Problem\n\n\ndef differentRightmostBit(n, m):\n return (n ^ m) & -(n ^ m)... | python | new_file | 1 | 3 | mit | c84ce4b2494771c48890c122420e4665828ac4f8 | HKuz/Test_Code | CodeFights/differentRightmostBit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [dynamic-ast] Add test case for dynamic ast"
},
{
"role": "assistant",
"content": "#=======================================================================\n# verilog_from_ast_test.py\n#===========================================... | python | new_file | 41 | 2 | bsd-3-clause | 95edeaa711e8c33e1b431f792e0f2638126ed461 | cornell-brg/pymtl,cornell-brg/pymtl,cornell-brg/pymtl | pymtl/tools/translation/dynamic_ast_test.py | rejected_lint | Too many lint violations: 41 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for 136_Single Number with XOR operation."
},
{
"role": "assistant",
"content": "class Solution(object):\n def singleNumber(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: int\n ... | python | new_file | 2 | 2 | mit | e6181c5d7c95af23ee6d51d125642104782f5cf1 | comicxmz001/LeetCode,comicxmz001/LeetCode | Python/136_SingleNumber.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: DEMO: Add a demo about learning the shape parameter of gamma dist"
},
{
"role": "assistant",
"content": "\n\nfrom bayespy import nodes\nfrom bayespy.inference import VB\n\n\ndef run():\n\n a = nodes.GammaShape(name='a')\n b... | python | new_file | 1 | 1 | mit | 95f5b7cd2325a61f537bffb783e950b30c97da5f | bayespy/bayespy,fivejjs/bayespy,jluttine/bayespy,SalemAmeen/bayespy | bayespy/demos/gamma_shape.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Tools: Add script for gameifying testing"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport os\nimport subprocess\nimport re\n\nparser = argparse.ArgumentParser()\nparser.... | python | new_file | 2 | 0 | apache-2.0 | 1b6fecb5819fbead0aadcc1a8669e915542c5ea0 | spotify/testing-game,spotify/testing-game,spotify/testing-game,spotify/testing-game | other/testing-game.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ut for fused ops"
},
{
"role": "assistant",
"content": "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file ex... | python | new_file | 7 | 1 | apache-2.0 | dc0ecffd6c4115019cfcbcc13b17a20511888c9b | chengduoZH/Paddle,baidu/Paddle,tensor-tang/Paddle,chengduoZH/Paddle,baidu/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,luotao1/... | python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Time Conversion in python"
},
{
"role": "assistant",
"content": "import sys\n\nh = 0\nm = 0\n\nfor t in sys.stdin:\n t = int(t)\n\n if t >= 60 * 60:\n h = t // (60 * 60)\n t %= 60 * 60\n\n if t >= 60:... | python | new_file | 1 | 0 | mit | 28696b671a5f80f781c67f35ae5abb30efd6379c | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1019/1019.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a merge migration and bring up to date"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-04-26 14:30\nfrom __future__ import unicode_literals\n\nfrom django.db import migrat... | python | new_file | 1 | 0 | apache-2.0 | 0ac0c81a3427f35447f52c1643229f5dbe607002 | mfraezz/osf.io,erinspace/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,adlius/osf.io,erinspace/osf.io,cslzchen/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,icereval/osf.io,mfraezz/osf.io,icereval/osf.io,caseyrollins/osf.io,caseyrollins/osf.io,baylee-d/osf.io,HalcyonCh... | osf/migrations/0099_merge_20180426_0930.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 2D helmholtz convergence test"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division\nfrom firedrake import *\nimport numpy as np\n\n\ndef helmholtz_mixed(x, V1, V2):\n # Create mesh and de... | python | new_file | 3 | 1 | mit | d8fff759f2bff24f20cdbe98370ede9e5f3b7b13 | thomasgibson/firedrake-hybridization | convergence_tests/2D_helmholtz.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Tests: Add construct test for known bad inplace string operations."
},
{
"role": "assistant",
"content": "# Copyright 2015, Kay Hayen, mailto:<EMAIL>\n#\n# Python test originally created or extracted from other peoples wo... | python | new_file | 2 | 2 | apache-2.0 | a852de81afdf8426cb243115a87856e2767a8d40 | kayhayen/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka | tests/benchmarks/constructs/InplaceOperationStringAdd.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test of removing unreachable terminals"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 17.08.2017 14:23\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\n\nfrom u... | python | new_file | 18 | 1 | mit | b260040bc3ca48b4e76d73c6efe60b964fa5c108 | PatrikValkovic/grammpy | tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate pairs of LIWC categories\n\nAdded a script that generates pairs of LIWC categories for Body and\nPosemo words. The pairs are added to the index. And data about the pairs\nis written to std out.\nThe LIWC categories for... | python | new_file | 4 | 5 | apache-2.0 | 940299a7bfd967653899b176ce76e6f1cf02ca83 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | liwcpairs2es.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility script for database setup"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setup.create_teams import migrate_teams\nfrom setup.create_divisions import create_divisions\n\n\... | python | new_file | 1 | 0 | mit | 7922b24882894cbc83bd4247c11d8c4a66b4b218 | leaffan/pynhldb | _setup_database.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: <EMAIL>\n# Maintained By: <EMAIL>\n\n\"\"\"A module for extended i... | python | edit | 1 | 2 | apache-2.0 | ea0087970b0c0adfd8942123899ff0ec231afa03 | AleksNeStu/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,selahsse... | test/selenium/src/lib/page/extended_info.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for command-line interface"
},
{
"role": "assistant",
"content": "import argparse\n\nparser = argparse.ArgumentParser(description=\"Run the HUSC functions.\")\nsubpar = parser.add_subparsers()\n\nstitch = subpar.add_pa... | python | new_file | 2 | 1 | bsd-3-clause | 69005d995aa0e6d291216101253197c6b2d8260a | starcalibre/microscopium,jni/microscopium,microscopium/microscopium,microscopium/microscopium,Don86/microscopium,jni/microscopium,Don86/microscopium | husc/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the migration for designations."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n... | python | new_file | 1 | 0 | apache-2.0 | b88b97c7d56506804fc9eb93ce7074454fc492f3 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/apps/people/migrations/0002_auto_20141223_0316.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nAcoustics\n=========\n\nThe acoustics module...\n\n\"\"\"\nimport acoustics.ambisonics\nimport acoustics.utils\nimport acoustics.octave\nimport acoustics.doppler\nimport acoustics.signal\nimport acoustics.directivity\nimport acousti... | python | edit | 4 | 0 | bsd-3-clause | 0cabf3c4dae3599e2d1627ff41707cf36b4d2ddd | python-acoustics/python-acoustics,antiface/python-acoustics,FRidh/python-acoustics,felipeacsi/python-acoustics,giumas/python-acoustics | acoustics/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport base64\nfrom Kamaelia.File.ReadFileAdaptor import ReadFil... | python | new_file | 3 | 0 | apache-2.0 | 665b3372e089fda3dde104b0754efa65a87a9bd2 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/MPS/Bookmarks/TestHTTPResponseHandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting"
},
{
"role": "assistant",
"content": "from django import forms\nfrom django.test import SimpleTestCase, override_settings\n\nfrom corehq.apps... | python | new_file | 1 | 1 | bsd-3-clause | 513af3716c596bb67c0f6552824b854b3735858c | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/domain/tests/test_password_strength.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.