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 migration script to add indexes"
},
{
"role": "assistant",
"content": "import logging\nimport migrations\n\nlogging.basicConfig()\n\nlog = logging.getLogger()\n\nconn = migrations.connect()\n\ncur = conn.cursor()\n\ndef drop_... | python | new_file | 1 | 2 | apache-2.0 | d7c958299382ec3177318cf818d0c90d467a2369 | pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics,pegasus-isi/pegasus-metrics | migrations/006_add_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a quicky Abbyy recogniser node. Doesn't seem to work yet, but can't be sure 'cos our license has run out of pages..."
},
{
"role": "assistant",
"content": "\"\"\"\nCuneiform Recogniser\n\"\"\"\n\nfrom nodetree import node, m... | python | new_file | 2 | 3 | apache-2.0 | b6b617fe24f39bf4000977d4171349aee2a729b5 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | ocradmin/plugins/abbyy_nodes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for artist serializers"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom ..models import Artist, Hyperlink\nfrom ..serializers import ArtistSerializer, HyperlinkSerializer\n\n\nclass Hyperlink... | python | new_file | 1 | 1 | bsd-3-clause | 25c2502fce4556b5b72e96116745c83d1689677f | FreeMusicNinja/api.freemusic.ninja | artists/tests/test_serializers.py | rejected_duplicate | Near-duplicate of sample 6797 | true |
[
{
"role": "user",
"content": "Write python code for the following: Move out Apache specific Objects"
},
{
"role": "assistant",
"content": "\"\"\"Module contains classes used by the Apache Configurator.\"\"\"\n\nclass Addr(object):\n \"\"\"Represents an Apache VirtualHost address.\"\"\"\n d... | python | new_file | 4 | 7 | apache-2.0 | 7b6081ac2918ca8a6c3400a3284129e1329c1cac | mrb/letsencrypt,dietsche/letsencrypt,tdfischer/lets-encrypt-preview,hlieberman/letsencrypt,lbeltrame/letsencrypt,ruo91/letsencrypt,rutsky/letsencrypt,skynet/letsencrypt,Sveder/letsencrypt,stweil/letsencrypt,g1franc/lets-encrypt-preview,rutsky/letsencrypt,BillKeenan/lets-encrypt-preview,jtl999/certbot,Jadaw1n/letsencryp... | letsencrypt/client/apache_obj.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to extract the shape of all blocks contained in the 2000 MSA"
},
{
"role": "assistant",
"content": "\"\"\"shape_msa_block.py\n\nOutput one shapefile per MSA featuring all the blocks it contains\n\"\"\"\nimport os\nimpo... | python | new_file | 1 | 0 | bsd-2-clause | b1076f68a33b1358b0de1825e683537bfd58979e | scities/2000-us-metro-atlas | bin/2000/shape_msa_block.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD Domain groups unit tests"
},
{
"role": "assistant",
"content": "\ndef test_create_group(client):\n result = client.post(\"/groups/\", data={\"group_name\": \"group test\", \"members\": [\"239y94asd\", \"whor244123\"]})\n ... | python | new_file | 1 | 1 | apache-2.0 | 48c942e89e343cbd7de009a87302396a077054b4 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | apps/domain/tests/test_routes/test_groups.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for Output class."
},
{
"role": "assistant",
"content": "import numpy as np\nimport pyfds as fds\n\n\ndef test_output():\n out = fds.Output(fds.LineRegion([0, 1, 2], [0, 0.2], 'test output'))\n out.signals = [... | python | new_file | 1 | 2 | bsd-3-clause | 9ebd1ed784bbd91ac06a401e3c0e4113a09436f1 | emtpb/pyfds | test/test_regions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test err handling in Py glue.\n\nCheck that a Clownfish exception gets transformed into a Python\nexception."
},
{
"role": "assistant",
"content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contribut... | python | new_file | 1 | 2 | apache-2.0 | 674721cc3e0f7fac030cf75fcdcfc4ee3d2f539f | rectang/lucy-clownfish,apache/lucy-clownfish,rectang/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish,rectang/lucy-clownfish,nwellnhof/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish,apache/lucy-clownfish,nwellnhof/lucy-clownfish,apache/lucy-clownfish,apache/lucy-clownfish,rectang/lucy-clownf... | runtime/python/test/test_err.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix bad chip ID error when using MPU9250 class with MPU9255 sensor"
},
{
"role": "assistant",
"content": "# mpu9255.py MicroPython driver for the InvenSense MPU9255 inertial measurement unit\n# Authors Peter Hinch, Sebastian Plam... | python | new_file | 1 | 0 | mit | c1f01676e63280c379bd6b39f30d8b42750bda68 | micropython-IMU/micropython-mpu9x50 | mpu9255.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create tests for basic angle computations"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom flatlib import angle\n\n\nclass AngleTests(unittest.TestCase):\n\n def setUp(self):\n pass\n\n def test_norm(se... | python | new_file | 1 | 1 | mit | fba89c72c13279c0709b0967a597427ee177665b | flatangle/flatlib | tests/test_angles.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add compute swap when needed"
},
{
"role": "assistant",
"content": "# The MIT License (MIT)\n#\n# Copyright (c) 2015 Taio Jia (jiasir) <<EMAIL>>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n... | python | new_file | 10 | 2 | mit | 59c7a33693bfc45eca95a0bd3bd271f6ec904a3d | nofdev/playback,jiasir/playback | libs/playback/config/add_swap.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for handling hyphenated agents in biopax\n\nAlso agents including spaces, etc."
},
{
"role": "assistant",
"content": "from belpy.biopax import biopax_api\nfrom belpy.pysb_assembler import PysbAssembler\n\ndef test_hyphenated... | python | new_file | 1 | 1 | bsd-2-clause | 01b0afde57aa109f7b5fa6fccce0d67cdeeec7dc | sorgerlab/belpy,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,decarlin/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,jmuhlich/indra,bgyori/indra,decarlin/indra,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,bgyori/indra,bgyori/indra,pvtodorov/indra,jmuhlich/indra,decar... | belpy/tests/test_biopax.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a function to say whether or not chef is the current host."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\ndef is_this_chef():\n from socket import gethostname\n return gethostname() == 'chef.compbio.uc... | python | new_file | 1 | 2 | mit | f99682315fd5a50523fc28baf89710fe9a0ec18e | Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab,Kortemme-Lab/klab | cluster/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for gpu datetime"
},
{
"role": "assistant",
"content": "from __future__ import print_function\n\nimport numpy as np\n\nfrom numba import cuda\nfrom numba import unittest_support as unittest\nfrom numba.tests.support impo... | python | new_file | 1 | 2 | bsd-2-clause | 8651febe42d49d535095d07c27143331b0285b93 | seibert/numba,stonebig/numba,IntelLabs/numba,stonebig/numba,sklam/numba,cpcloud/numba,cpcloud/numba,seibert/numba,IntelLabs/numba,jriehl/numba,IntelLabs/numba,gmarkall/numba,stonebig/numba,sklam/numba,cpcloud/numba,sklam/numba,stuartarchibald/numba,numba/numba,jriehl/numba,gmarkall/numba,stuartarchibald/numba,gmarkall/... | numba/cuda/tests/cudapy/test_datetime.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement h264 and png as ext hooks"
},
{
"role": "assistant",
"content": "import os\nfrom . import hooks\nfrom .viewport import playblast\n\n\ndef default_handler(data, options):\n\n _, ext = os.path.splitext(data['filename']... | python | new_file | 1 | 2 | mit | fbc7622ffba8a527c45efed11f7044580deb3072 | danbradham/mvp | mvp/extensions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add letter to possible template types in DB\n\nA letter type was added to the `enum` in the `Template` model at the\nsame it was added to the `Notification` model. But the migration was\nonly done for the `notifications` table, not the `temp... | python | new_file | 1 | 1 | mit | 6501a871bc26981e274b3780206175be9db5c027 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0059_add_letter_template_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unique keys for non locking model\n\nThe unique key colums are part of the new non locking model.\nThe migration scripts adds 2 unique key columns to 2 tables.\n\nOne of the new columns is already in the model and the other is\nunder rev... | python | new_file | 1 | 1 | apache-2.0 | 8e221ddbd84b11364208fd505c9a7854aca1c854 | StackStorm/mistral,openstack/mistral,openstack/mistral,StackStorm/mistral | mistral/db/sqlalchemy/migration/alembic_migrations/versions/015_add_unique_keys_for_non_locking_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new example test"
},
{
"role": "assistant",
"content": "\"\"\"\nThis test demonstrates the use of encryption/decryption.\n(Technically, obfuscation/unobfuscation.)\n\"\"\"\n\nfrom seleniumbase import BaseCase\nfrom selenium... | python | new_file | 1 | 1 | mit | 1eced53f26bffd42df81fc7c655da46591204136 | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase | examples/decryption_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add testbed file for mlab"
},
{
"role": "assistant",
"content": "from fabric.api import env\n\n#Management ip addresses of hosts in the cluster\nhost1 = 'root@10.84.19.42'\nhost2 = 'root@10.84.19.43'\nhost3 = 'root@10.84.19.44'\n... | python | new_file | 1 | 0 | apache-2.0 | 5782fc5cb505ff6af8d20411004a05ad53e82b90 | Juniper/contrail-fabric-utils,Juniper/contrail-fabric-utils | fabfile/testbeds/testbed_mlab.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for proposal method getter methods\n\ncloses #448"
},
{
"role": "assistant",
"content": "# Third Party Stuff\nimport pytest\nfrom tests import factories as f\n\n\n@pytest.mark.parametrize('method', [\n 'get_abso... | python | new_file | 1 | 1 | mit | 4002e0088a50d1a4ac5c20e52425c9f78d6761c6 | ChillarAnand/junction,ChillarAnand/junction,pythonindia/junction,ChillarAnand/junction,ChillarAnand/junction,pythonindia/junction,pythonindia/junction,pythonindia/junction | tests/unit/proposals/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new skeleton class"
},
{
"role": "assistant",
"content": "import os, sys\nfrom collections import defaultdict\nimport numpy as np\nfrom numpy.testing import assert_equal, assert_allclose\nfrom skan.csr import Skelet... | python | new_file | 12 | 3 | bsd-3-clause | 7295c18179870db944f0496d521a7031e483d1e2 | jni/skan | skan/test/test_skeleton_class.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional test for command-line interface"
},
{
"role": "assistant",
"content": "# Copyright (c) 2013, Sascha Peilicke <<EMAIL>>\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the term... | python | new_file | 1 | 1 | apache-2.0 | 0457c1d56e210db960f84f78d90ead3736056eb4 | saschpe/rapport | test/functional/test_cli.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to project\n\nTemperature measurement using raspberry pi. Temperatures are save to MySql database."
},
{
"role": "assistant",
"content": "import os\nimport glob\nimport time\nimport datetime\nimport MySQLdb as m... | python | new_file | 18 | 3 | mit | cb62cea248d217504947ff76bdd0af9306f508ce | tnisula/IoT_Kurssi,tnisula/IoT_Kurssi,tnisula/IoT_Kurssi,tnisula/IoT_Kurssi | temperature_measurement_to_db.py | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add db data correcting script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2014 Google Inc. All Rights Reserved.\n\nimport models\nimport uma\n\n\ndef CorrectPropertyName(bucke... | python | new_file | 4 | 4 | apache-2.0 | 41e2cd0802a5fc8fb247a5063b08aaec5e701797 | mdittmer/chromium-dashboard,modulexcite/chromium-dashboard,beaufortfrancois/chromium-dashboard,jeffposnick/chromium-dashboard,modulexcite/chromium-dashboard,beaufortfrancois/chromium-dashboard,GoogleChrome/chromium-dashboard,GoogleChrome/chromium-dashboard,jeffposnick/chromium-dashboard,jeffposnick/chromium-dashboard,G... | scripts/fix_data.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Korean example test"
},
{
"role": "assistant",
"content": "# Korean Language Test - Python 3 Only!\nfrom seleniumbase.translate.korean import 셀레늄_테스트_케이스 # noqa\n\n\nclass 테스트_클래스(셀레늄_테스트_케이스): # noqa\n\n def test_실시예_... | python | new_file | 1 | 1 | mit | c08b4d2922d366e6078e6d6dda542de79031918d | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | examples/translations/korean_test_1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Hamming Distance in Python"
},
{
"role": "assistant",
"content": "def HammingDistance(s1, s2):\n\tif len(s1) != len(s2):\n\t\traise ValueError(\"ERROR: Strings must have the same length\")\n\treturn sum(c1 != c2 for c1, c2 in... | python | new_file | 1 | 3 | apache-2.0 | 6ef4254e1167185598a31bfb6c0deb52388fa42a | maazsq/Algorithms_Example,alok760/Algorithms_Example,churrizo/Algorithms_Example,Thuva4/Algorithms_Example,maazsq/Algorithms_Example,AtoMc/Algorithms_Example,pranjalrai/Algorithms_Example,AtoMc/Algorithms_Example,maazsq/Algorithms_Example,Astrophilic/Algorithms_Example,Anat-Port/Algorithms_Example,Astrophilic/Algorithm... | HammingDistance/Python/HammingDistance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove forward slashes from wiki page names"
},
{
"role": "assistant",
"content": "\"\"\"\nRemove forward slashes from wiki page titles, since it is no longer an allowed character and\nbreaks validation.\n\"\"\"\nimport logging\n... | python | new_file | 1 | 7 | apache-2.0 | 8f0443c35e25c69ec4216e6d5c6717b3c069ebd0 | binoculars/osf.io,cslzchen/osf.io,RomanZWang/osf.io,alexschiller/osf.io,TomBaxter/osf.io,leb2dg/osf.io,rdhyee/osf.io,baylee-d/osf.io,wearpants/osf.io,hmoco/osf.io,HalcyonChimera/osf.io,felliott/osf.io,acshi/osf.io,aaxelb/osf.io,acshi/osf.io,DanielSBrown/osf.io,doublebits/osf.io,monikagrabowska/osf.io,TomHeatwole/osf.io... | scripts/remove_wiki_title_forward_slashes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for hybrid properties"
},
{
"role": "assistant",
"content": "from pytest import raises\nimport sqlalchemy as sa\nfrom sqlalchemy.ext.hybrid import hybrid_property\nfrom wtforms_alchemy import ModelForm\nfrom wtforms_alc... | python | new_file | 1 | 1 | bsd-3-clause | 2048ec26a2218e6060e1fd03ab876b59bd576a07 | kelvinhammond/wtforms-alchemy,williamwu0220/wtforms-alchemy,quantus/wtforms-alchemy | tests/test_hybrid_properties.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility/example for downloading single sciobj from CN or MN"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# This work was created by participants in the DataONE project, and is\n# jointly copyrighted by part... | python | new_file | 1 | 3 | apache-2.0 | e02b7e4dc0d6ba94f63ee2ed48db120c52eb11cd | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | utilities/src/d1_util/download_sciobj.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add spider for Loves Travel Stops"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport scrapy\nimport json\n\nfrom locations.items import GeojsonPointItem\n\nHEADERS = {'Content-Type': 'application/json'}\n\n\nc... | python | new_file | 1 | 2 | mit | c6e628fe12397a57afa9c7744a3feb6667315987 | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | locations/spiders/loves.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up module to map to the correct package manager for the OS"
},
{
"role": "assistant",
"content": "'''\nTop level package command wrapper, used to translate the os detected by facter\nto the correct package manager\n'''\nimpor... | python | new_file | 4 | 2 | apache-2.0 | e71f3ab92ffe0e6a32833855347f1ada9e773ede | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/pkg.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing test from functionality in previous commit"
},
{
"role": "assistant",
"content": "\"\"\"\r\nTests for https://github.com/jic-dtool/dtoolcore/issues/20\r\n\"\"\"\r\n\r\nimport os\r\nimport time\r\n\r\nfrom . import tmp... | python | new_file | 1 | 1 | mit | e976c426bef01cc9abdc985e36eae3695d8ee384 | JIC-CSB/dtoolcore | tests/test_frozen_at_when_copying_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for aiodataloader"
},
{
"role": "assistant",
"content": "from collections import namedtuple\nfrom unittest.mock import Mock\nfrom pytest import mark\nfrom aiodataloader import DataLoader\n\nfrom graphene import Obj... | python | new_file | 1 | 2 | mit | 3e4305259b9f7b0842bac99c4d3a70014e01ac15 | graphql-python/graphene,graphql-python/graphene | tests_asyncio/test_dataloader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add useful script for standartizing data in beta simulator and the normal one"
},
{
"role": "assistant",
"content": "import sys\nimport os\nimport pandas as pd\n\nfrom utils import get_driving_log_dataframe\nfrom utils import img... | python | new_file | 1 | 3 | mit | 78137a7d276eed39b885754256c1601e5941f62c | hristo-vrigazov/behavioral-cloning,hristo-vrigazov/behavioral-cloning | convert_to_recovery_and_remove_useless.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add parsing for describing UIElement start/stop\n\nSigned-off-by: xcgspring <<EMAIL>>"
},
{
"role": "assistant",
"content": "'''\nIn app map, sometimes need to describe how to start and close one UI element\nSo create a simple co... | python | new_file | 2 | 1 | apache-2.0 | 05e07c6f2dd5b334e917696ff13f57a426272014 | xcgspring/AXUI,xcgspring/AXUI,xcgspring/AXUI | parsing/command_parsing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration script that appends node and client IPs to indy env file.\n\nSigned-off-by: Sergey Shilov <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3.5\nimport os\nimport sys\nimport traceback\n\nfrom indy_c... | python | new_file | 1 | 6 | apache-2.0 | 2a54042645a651c9c578517743f7267720e9d6b9 | spivachuk/sovrin-node,spivachuk/sovrin-node,spivachuk/sovrin-node,spivachuk/sovrin-node | data/migrations/deb/1_3_433_to_1_3_434.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add proper view_osfuser permission to read_only and admin groups"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2017-04-05 17:30\nfrom __future__ import unicode_literals\n\nfrom djang... | python | new_file | 3 | 1 | apache-2.0 | 4cb674093c95ebbe3f7dc61d0b6a262995337100 | chennan47/osf.io,adlius/osf.io,leb2dg/osf.io,binoculars/osf.io,mattclark/osf.io,icereval/osf.io,Johnetordoff/osf.io,chrisseto/osf.io,caseyrollins/osf.io,sloria/osf.io,saradbowman/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,chennan47/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,Nesiehr/osf.io,mfraezz/osf.io,HalcyonChimer... | osf/migrations/0012_auto_20170411_1548.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move the Python end of blog-fetch to LASS."
},
{
"role": "assistant",
"content": "\"\"\"Fetches the blogs configured on the website to local files.\n\nThe local files dumped to are 'BLOGNAME.incoming.yml' in the\nassets/blogs dir... | python | new_file | 1 | 0 | bsd-2-clause | 86cede2c228e2e6bccb4adbdfe81d9d4bd34ac6f | UniversityRadioYork/lass-pyramid | teams/blog_fetch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example CTL Prep Plug-in\n\nCan be referenced or used to save CTL credentials in CB and add a public\nIP."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\nUsed to configure some prerequisites that a Cen... | python | new_file | 2 | 2 | apache-2.0 | 78a32a311d5578cb1bdf8e7d0c7f0ab567b6b986 | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | actions/cloudbolt_plugins/prep_ctl_server_for_remote_scripts/prep_ctl_for_remote_scripts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 450. Delete Node in a BST\n\n450. Delete Node in a BST: https://leetcode.com/problems/delete-node-in-a-bst/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# class TreeNode(object)... | python | new_file | 1 | 11 | apache-2.0 | 89612a126b7df58022554df439bef2988e504643 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/delete-node-in-a-bst.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for a simple test"
},
{
"role": "assistant",
"content": "import earthpy.io as eio\nimport rasterio as rio\n\nwith rio.open(eio.path_to_example('rmnp-dem.tif')) as src:\n dem = src.read()\n"
}
] | python | new_file | 1 | 0 | bsd-3-clause | fca7a5923a412745e428fc9435fb2d7c7d376d11 | dschreij/staged-recipes,chrisburr/staged-recipes,isuruf/staged-recipes,scopatz/staged-recipes,ocefpaf/staged-recipes,ReimarBauer/staged-recipes,birdsarah/staged-recipes,birdsarah/staged-recipes,Juanlu001/staged-recipes,mcs07/staged-recipes,igortg/staged-recipes,igortg/staged-recipes,johanneskoester/staged-recipes,kwilc... | recipes/earthpy/run_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add elliptope manifold test skeleton."
},
{
"role": "assistant",
"content": "import unittest\n\nimport numpy as np\nimport numpy.linalg as la\nimport numpy.random as rnd\nimport numpy.testing as np_testing\n\nfrom pymanopt.manifo... | python | new_file | 6 | 1 | bsd-3-clause | edf2ebfec6b6a5ddde418590ad8d775a393675bc | nkoep/pymanopt,tingelst/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,j-towns/pymanopt | tests/test_manifold_elliptope.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run/test the mojo media renderer.\n\nThe script follows mojo/services/html_viewer/view_url.py. See the script for\nhow to use it.\n\nBUG=410451\nTEST=Run the script to test.\n\nReview URL: https://codereview.chromium.org/991963... | python | new_file | 2 | 3 | bsd-3-clause | 837e35e1ecd8c4ab62a7011471d56c7b9283fb4d | chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,axinging/chromium-crosswa... | media/mojo/scripts/run_mojo_media_renderer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement MissingInteger (microsoft oa demo)"
},
{
"role": "assistant",
"content": "'''\nhttps://app.codility.com/demo/results/demoHZEZJ5-D8X/\n\n\n\nThis is a demo task.\nWrite a function:\n\n def solution(A)\n\nthat, given a... | python | new_file | 1 | 5 | mit | d821e62e343150ee57daa4e5ac6ad203cb4d9708 | Chasego/codirit,cc13ny/algo,Chasego/codi,Chasego/cod,Chasego/codi,cc13ny/algo,Chasego/codi,Chasego/cod,Chasego/codi,Chasego/codirit,Chasego/codi,cc13ny/algo,Chasego/codirit,cc13ny/algo,Chasego/cod,Chasego/cod,cc13ny/algo,Chasego/codirit,Chasego/cod,Chasego/codirit | comp/microsoft/000_missinteger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 116"
},
{
"role": "assistant",
"content": "class Solution:\n # @param A, a list of integers\n # @return a boolean\n def canJump(self, A):\n # write your code here\n\n # Bru... | python | new_file | 1 | 5 | mit | 05e95158055e869be3bf4e98af8521afc8321ec4 | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Medium/116_Jump_Game.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: resources: Add git hook to auto-stage docs files"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nThis script provides automatic update and staging of documentation files when\n\"r... | python | new_file | 1 | 3 | bsd-3-clause | e1d268d1d7ad63c0c9db6ff3b6645b835ef4513f | khalim19/gimp-plugin-export-layers,khalim19/gimp-plugin-export-layers | resources/git/hooks/pre_commit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command for accepting invites"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\n\nfrom corehq.apps.users.models import WebUser\n\nfrom corehq.apps.users.models import Inv... | python | new_file | 3 | 3 | bsd-3-clause | ffef9ccb5b7aa4c4ef8e06879c3ab7fd8030c882 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/users/management/commands/accept_invite.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for the console module\n\n... better late than never?\n\nSigned-off-by: Zack Cerza <<EMAIL>>"
},
{
"role": "assistant",
"content": "from teuthology.config import config as teuth_config\n\nfrom .. import console\n\n... | python | new_file | 1 | 1 | mit | 4a817aff14ca6bc9717bd617d5bc49d15e698272 | ceph/teuthology,dmick/teuthology,SUSE/teuthology,dmick/teuthology,SUSE/teuthology,ktdreyer/teuthology,dmick/teuthology,ktdreyer/teuthology,ceph/teuthology,SUSE/teuthology | teuthology/orchestra/test/test_console.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test AutoML usage of Backend to load models"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\nfrom __future__ import print_function\nimport unittest\nimport mock\nfrom autosklearn.automl import AutoML\nfrom autosk... | python | new_file | 1 | 2 | bsd-3-clause | 85aaa8d8ec3bc179729d4a3d731153406560dd2c | automl/auto-sklearn,automl/auto-sklearn,hmendozap/auto-sklearn,hmendozap/auto-sklearn | test/automl/test_models.py | rejected_duplicate | Near-duplicate of sample 8853 | true |
[
{
"role": "user",
"content": "Write python code for the following: Clean up old, incomplete jobs"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0203_fix_old_incomplete_jobs\nRevises: 0202_new_letter_pricing\nCreate Date: 2017-06-29 12:44:16.815039\n\n\"\"\"\n\n# revis... | python | new_file | 1 | 1 | mit | 1c54ef090dddb67e52dda00a6fd816807b33b5a3 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0203_fix_old_incomplete_jobs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove drafts with no serviceName\n\nIn production we have 1237 draft services from 806 suppliers that only have a lot selected but no other data.\n\nThese have never been counted or shown to suppliers, but with the new lot changes for DOS t... | python | new_file | 1 | 1 | mit | 66cfc30621c7a2bc5ed8685cd25ec4973a21e6c5 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/410_remove_empty_drafts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to build cutline map"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nfrom osgeo import ogr\nfrom osgeo import osr\nfrom glob import glob\nimport os.path\n\ndriver = ogr.GetDriverByName(\"ESRI Shapefile\")... | python | new_file | 1 | 0 | mit | 449089dc4a62ca73c1f5022535e5cbd6a92445f4 | simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic | build-cutline-map.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add letter logo for Welsh Revenue Authority\n\nDepends on:\n- [ ] https://github.com/alphagov/notifications-template-preview/pull/94"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0165_another_letter_o... | python | new_file | 1 | 2 | mit | f55f555e4df4cc7423a76b1c73160250a1a279ab | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0165_another_letter_org.py | rejected_duplicate | Near-duplicate of sample 4921 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to create statedecoded index"
},
{
"role": "assistant",
"content": "\n\nsettings = {\n \"mappings\": {\n \"law\": {\n \"properties\": {\n \"text\": {\n \"type\": \"string\",\n ... | python | new_file | 1 | 0 | apache-2.0 | 0e91d401848918043b23a3921de54c0eda618d00 | o19s/semantic-search-course | createStateDecoded.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for Schulze method"
},
{
"role": "assistant",
"content": "from mclearn.aggregators import schulze_method\n\n\nclass TestAggregators:\n @classmethod\n def setup_class(cls):\n cls.voters = \\\n ... | python | new_file | 1 | 1 | bsd-3-clause | 88d2b3f21b318559172e1595ba9209bd9d2a373f | chengsoonong/mclass-sky,chengsoonong/mclass-sky,alasdairtran/mclearn,alasdairtran/mclearn,chengsoonong/mclass-sky,chengsoonong/mclass-sky,alasdairtran/mclearn,alasdairtran/mclearn | mclearn/tests/test_aggregators.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create example for Counting Bloom Filter"
},
{
"role": "assistant",
"content": "\"\"\"Example how to use Counting Bloom Filter.\"\"\"\n\nfrom pdsa.membership.counting_bloom_filter import CountingBloomFilter\n\n\nLOREM_IPSUM = (\n... | python | new_file | 1 | 0 | mit | 2d951505dd210357921ee65004e24b33dbf47c43 | gakhov/pdsa,gakhov/pdsa,gakhov/pdsa | examples/membership/counting_bloom_filter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for certificates_client\n\nThis patch adds unit tests for certificates_client module\n\nChange-Id: If5427832a7446590c3a4b5d62bfe61d70bd1d112"
},
{
"role": "assistant",
"content": "# Copyright 2015 NEC Corporation. ... | python | new_file | 1 | 2 | apache-2.0 | 048f5b9d8abc9c768db5714d343718e283dc4d4b | sebrandon1/tempest,xbezdick/tempest,vedujoshi/tempest,xbezdick/tempest,cisco-openstack/tempest,zsoltdudas/lis-tempest,bigswitch/tempest,pczerkas/tempest,bigswitch/tempest,izadorozhna/tempest,masayukig/tempest,pczerkas/tempest,zsoltdudas/lis-tempest,sebrandon1/tempest,rakeshmi/tempest,cisco-openstack/tempest,Tesora/teso... | tempest/tests/services/compute/test_certificates_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for listing available / installed action runners."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See... | python | new_file | 1 | 0 | apache-2.0 | 85cc8916012d9ba53c46ee827d16d08fd06d39ac | nzlosh/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2 | tools/enumerate-runners.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a brew house yield calculator"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom .sugar import sg_to_gu\n\n__all__ = [\n u'calculate_brew_house_yield',\n]\n\n\ndef calculate_brew_house_yield(wort_volume... | python | new_file | 1 | 2 | mit | 3d937a2438a3ae7b417561031de2bfe632802720 | chrisgilmerproj/brewday,chrisgilmerproj/brewday | brew/utilities/efficiency.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pdf render file to VCS"
},
{
"role": "assistant",
"content": "from io import BytesIO\nfrom django.http import HttpResponse\nfrom django.template.loader import get_template\nimport xhtml2pdf.pisa as pisa\n\n\nclass Render:\n\n... | python | new_file | 1 | 2 | mit | 13480e3aeb9955d82db742030b85b1621a2ecb7c | toms3t/Propalyzer,toms3t/Propalyzer,toms3t/Propalyzer | propalyzer_site/propalyzer_app/pdf_render.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tempest config for swift compact environment"
},
{
"role": "assistant",
"content": "import unittest\nfrom devops.helpers import ssh\nfrom fuel_test.helpers import safety_revert_nodes, tempest_write_config, make_tempest_object... | python | new_file | 1 | 1 | apache-2.0 | 9b730bf54c807fbdc71d56fb1758b27cee6a13a9 | eayunstack/fuel-library,ddepaoli3/fuel-library-dev,ddepaoli3/fuel-library-dev,SmartInfrastructures/fuel-library-dev,huntxu/fuel-library,Metaswitch/fuel-library,zhaochao/fuel-library,eayunstack/fuel-library,huntxu/fuel-library,xarses/fuel-library,huntxu/fuel-library,ddepaoli3/fuel-library-dev,slystopad/fuel-lib,ddepaoli... | fuel_test/openstack_swift_compact/prepare_for_tempest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command for listing opt outs."
},
{
"role": "assistant",
"content": "from optparse import make_option\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.contrib.auth.models import Use... | python | new_file | 5 | 2 | bsd-3-clause | d5347701e21bf13a2bca15978a8f5a81e2d2061a | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/base/management/commands/go_list_opt_outs.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a warning things have been moved back."
},
{
"role": "assistant",
"content": "raise DeprecationWarning(\"\"\"DEPRECATED:\n\nAfter Popular request and decision from the BDFL:\n`IPython.terminal.ptshell` has been moved back to ... | python | new_file | 1 | 0 | bsd-3-clause | a3332387eea89daaecd9400c5555657132a2cd9c | ipython/ipython,ipython/ipython | IPython/terminal/ptshell.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functions for reading MNIST dataset int numpy arrays."
},
{
"role": "assistant",
"content": "# this file defines function for parsing the MNIST dataset as available to\n# download here:\n# http://yann.lecun.com/exdb/mnist/ind... | python | new_file | 7 | 2 | mit | 653bf95527724393c8b18409fbf8addc20484072 | drsstein/PyRat | mnist.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add CLI entry point for cluster management."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport argparse\nimport sys\n\nimport ipcluster_tools\nimport purge_cluster\n\n\nclass ArgumentParser(argparse.ArgumentPa... | python | new_file | 1 | 1 | bsd-3-clause | ac9d7c4af5221aac94b0d599e77abd8738b63611 | RaoUmer/distarray,enthought/distarray,enthought/distarray,RaoUmer/distarray | distarray/apps/dacluster.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to add correct provider_name"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Migration to add the correct provider_name for Zotero and Mendeley ExternalAccounts that\nare missing it.\n\"\"\"\ni... | python | new_file | 1 | 3 | apache-2.0 | b452683c2324b2ca7a1b43dbc8dc83354530d04a | DanielSBrown/osf.io,jeffreyliu3230/osf.io,bdyetton/prettychart,mfraezz/osf.io,lamdnhan/osf.io,kch8qx/osf.io,GaryKriebel/osf.io,MerlinZhang/osf.io,jinluyuan/osf.io,lyndsysimon/osf.io,emetsger/osf.io,cldershem/osf.io,caneruguz/osf.io,MerlinZhang/osf.io,SSJohns/osf.io,felliott/osf.io,GageGaskins/osf.io,cldershem/osf.io,To... | scripts/migrate_zendeley_provider_names.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights primary school problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Primary School Problem\n\n\nclass Rectangle(object):\n def __init__(self, height, width):\n self.hei... | python | new_file | 1 | 3 | mit | 5fccb7cb7059847dbac5f78ee438a8f31ab78430 | HKuz/Test_Code | CodeFights/primarySchool.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for doing MI pivots the original blitzer way."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\nfrom sklearn.datasets import load_svmlight_file\nfrom sklearn.feature_selection import mutual_in... | python | new_file | 3 | 4 | apache-2.0 | 1d9746cc1fc6b0885aa721748c0dbc97cea88b2d | tmills/uda,tmills/uda | scripts/create_blitzermi_pivots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix missing quoting module for schema."
},
{
"role": "assistant",
"content": "##\n# Copyright (c) 2016 MagicStack Inc.\n# All rights reserved.\n#\n# See LICENSE for details.\n##\n\n\nimport re\n\nfrom .parser.grammar import keywo... | python | new_file | 1 | 3 | apache-2.0 | fc6c7a743d4f177e76caa282c31c4cf11f2fb0bc | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/schema/quote.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example simulation setup for an ultracold neutral plasma."
},
{
"role": "assistant",
"content": "import ucilib.Sim as Sim\nimport ucilib.BorisUpdater as BorisUpdater\nimport numpy as np\n\n\n# Some helpful constants.\nfund... | python | new_file | 1 | 0 | mit | 450c79939e20f6d9d49729f6c941e7fc8e06950b | Tech-XCorp/ultracold-ions,hosseinsadeghi/ultracold-ions,hosseinsadeghi/ultracold-ions,Tech-XCorp/ultracold-ions | examples/ultracoldNeutralPlasma.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to get categories and their IDs from NFLC sites"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport argparse\nimport json\nfrom urllib.request import urlopen\n\n\ndef get_data(domain):\n respons... | python | new_file | 1 | 5 | mit | 4428fb8dc8e81d9b3ff32c5d93e79c431434e4d3 | Tenzer/plugin.video.nfl-teams | utils/nflc-get-categories.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add inbound pifacedigitalio module which uses twisted"
},
{
"role": "assistant",
"content": "import argparse\nimport json\nfrom datetime import datetime\n\nimport pifacedigitalio as pfdio\nfrom twisted.internet import reactor\nfr... | python | new_file | 6 | 5 | unlicense | 7d52ef0136a3984da8d14db133220c1d4d1ab16e | flyte/zmq-io-modules,flyte/zmq-io-modules | zmq_io/in_pifacedigitalio.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example usage of DNS Test Template"
},
{
"role": "assistant",
"content": "from ooni.templates.dnst import DNSTest\n\nclass ExampleDNSTest(DNSTest):\n def test_a_lookup(self):\n def gotResult(result):\n # ... | python | new_file | 2 | 1 | bsd-2-clause | 3e364fa31d7659692ed3c6a2c4bd3387a336524e | Karthikeyan-kkk/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,kdmurray91/... | nettests/examples/example_dnst.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple example for extracting comments via pyslang"
},
{
"role": "assistant",
"content": "from pyslang import *\n\ntestfile = \"\"\"\n//! Module description\n//! ***this is code*** sample\n//! | Tables | Are | Coo... | python | new_file | 8 | 9 | mit | 0f0a23268368d5313f041e649fe58e3d123ccc64 | MikePopoloski/slang,MikePopoloski/slang | pyslang/tests/test_extractcomments.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for index view"
},
{
"role": "assistant",
"content": "import pytest\n\n\n@pytest.mark.django_db\nclass TestIndexView(object):\n\n def test_index(self, client):\n response = client.get('/')\n assert respo... | python | new_file | 1 | 1 | bsd-3-clause | 30dbded69a535d4730fe8bb9c8706f809f841e9c | keybar/keybar | src/keybar/tests/web/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add incomplete _pruning function for IteratedTverberg."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nfrom .interfaces import CenterpointAlgo\n\n\nclass IteratedTverberg(CenterpointAlgo):\... | python | new_file | 1 | 2 | mit | 0deb3f006746d86ed4ed56ccfa2a93ac53d0d968 | fu-berlin-swp-2014/center-points,fu-berlin-swp-2014/center-points | centerpoints/iterated_tverberg.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for parent grouping function."
},
{
"role": "assistant",
"content": "import unittest\n\n\nclass TestCoordsByParent(unittest.TestCase):\n\n def test_empty(self):\n from tilequeue.utils import CoordsByParent\n\n ... | python | new_file | 1 | 4 | mit | 017ed0c2e8edf0599fa27dcc281b2c93e3ddd67a | tilezen/tilequeue,mapzen/tilequeue | tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial (non-working) ApiRequest class."
},
{
"role": "assistant",
"content": "import enum\nimport requests\n\n_defaults = {\n 'page': 1,\n 'per_page': 20,\n}\n\n@enum.unique\nclass RequestType(Enum):\n GET = 1\n ... | python | new_file | 4 | 4 | mit | 611852c39f23bc3117c17df5ba911617605fa60f | sloede/pyglab,sloede/pyglab | pyglab/apirequest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create tool to count morph length from annotation file\n\nSmall bit a quick hack at the moment, should be tranformed to a real script maybe?"
},
{
"role": "assistant",
"content": "from __future__ import division\nimport fileinput... | python | new_file | 1 | 5 | bsd-2-clause | 9f68956abafd93c109f7304e393dd7424916b8bb | aalto-speech/morfessor | scripts/tools/morphlength_from_annotations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test data generator tool"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom getopt import getopt, GetoptError\nfrom random import randint\nimport os\n\nSUITE=\\\n\"\"\"*** Settings ***\nResource resource.... | python | new_file | 5 | 8 | apache-2.0 | 210695ab755a9c1d1d863eec0fedb4ac63931fda | HelioGuilherme66/RIDE,caio2k/RIDE,HelioGuilherme66/RIDE,fingeronthebutton/RIDE,HelioGuilherme66/RIDE,robotframework/RIDE,robotframework/RIDE,caio2k/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,caio2k/RIDE,HelioGuilherme66/RIDE,fingeronthebutton/RIDE,robotframework/RIDE | utest/resources/robotdata/datagenerator.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up cli executor for salt command lin"
},
{
"role": "assistant",
"content": "'''\nThe management of salt command line utilities are stored in here\n'''\n# Import python libs\nimport optparse\nimport os\nimport sys\n\n# Import ... | python | new_file | 2 | 1 | apache-2.0 | cf8897e28024171e94e0d83f2026166ab9537f0b | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/cli/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to normalize user accounts\n\nPatch by: Sverre Rabbelier"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2.5\n#\n# Copyright 2008 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the... | python | new_file | 3 | 3 | apache-2.0 | 9f82e6b96bf4702901f86374e8a05c3d550091e7 | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | app/soc/logic/helper/convert_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test some of the digest building functions."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom collections import OrderedDict\n\nfrom exam import fixture\n\nfrom sentry.digests import Record\nfr... | python | new_file | 3 | 3 | bsd-3-clause | 736412dc51711b41ea45f993d80d5ae3895306e9 | zenefits/sentry,daevaorn/sentry,BuildingLink/sentry,beeftornado/sentry,jean/sentry,BuildingLink/sentry,zenefits/sentry,nicholasserra/sentry,JackDanger/sentry,JamesMura/sentry,fotinakis/sentry,zenefits/sentry,daevaorn/sentry,gencer/sentry,alexm92/sentry,ifduyue/sentry,gencer/sentry,ifduyue/sentry,BuildingLink/sentry,mva... | tests/sentry/digests/test_notifications.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example test for the \":contains()\" selector"
},
{
"role": "assistant",
"content": "from seleniumbase import BaseCase\r\n\r\n\r\nclass MyTestClass(BaseCase):\r\n\r\n def test_contains_selector(self):\r\n self.op... | python | new_file | 1 | 1 | mit | ff61653ff66123eb6e445f400855825e0aeb5882 | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | examples/test_contains_selector.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for session authentication"
},
{
"role": "assistant",
"content": "\"\"\"\nTests for session-based authentication.\n\"\"\"\nfrom axiom import store\nfrom exponent.auth import errors, session, user\nfrom twisted.tria... | python | new_file | 1 | 3 | isc | 9e975d97a45022d8e18cb67c33af2f8f03ce94de | lvh/exponent | exponent/test/auth/test_session.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add rudimentary status check for memcached"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport os\nimport socket\nimport subprocess\nimport telnetlib\n\n\ndef can_connect(host, port):\n \"\"\"Check that we can... | python | new_file | 3 | 4 | apache-2.0 | 77ef603520652ab894128bf55f1f435bc17927c5 | prometheanfire/rpc-openstack,jpmontez/rpc-openstack,andymcc/rpc-openstack,xeregin/rpc-openstack,robb-romans/rpc-openstack,stevelle/rpc-openstack,nrb/rpc-openstack,byronmccollum/rpc-openstack,briancurtin/rpc-maas,cloudnull/rpc-maas,nrb/rpc-openstack,cloudnull/rpc-maas,darrenchan/rpc-openstack,briancurtin/rpc-maas,stevel... | memcached_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for linalg\n\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@2818 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "\"\"\" Test functions for linalg module\n\"\"\"\n\nfrom numpy.te... | python | new_file | 8 | 2 | bsd-3-clause | c73fc2993ab3af594812ae901ff8439b4eddf187 | Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,efiring/numpy-work,Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,illume/numpy3k,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,efiring/numpy-wo... | numpy/linalg/tests/test_linalg.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for generate resource view"
},
{
"role": "assistant",
"content": "import os\nfrom django.test import tag\nfrom django.urls import reverse\nfrom tests.BaseTestWithDB import BaseTestWithDB\nfrom tests.resources.ResourcesT... | python | new_file | 1 | 1 | mit | 2a34dd198110401bd485552ad857c3d4f26c7b8c | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/tests/resources/views/test_generate_resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test which lets us see what's in our module."
},
{
"role": "assistant",
"content": "import pyQuantuccia\n\n\ndef test_not_a_real_test():\n _dir = str(pyQuantuccia.__dir__())\n _dict = str(pyQuantuccia.__dict__)\n s... | python | new_file | 1 | 1 | bsd-3-clause | 2ec6da5fbb69d322d89b972210d3a521cd17b275 | jwg4/pyQuantuccia,jwg4/pyQuantuccia | pyQuantuccia/tests/test_module.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n####################################################################\n#Dtool_funcToMethod(func, class) \n#del func\n#####################################################################\n\nfrom panda3d.core import HTTPChannel\nfrom .... | python | edit | 2 | 3 | bsd-3-clause | 883f1b1c28e76ade6632f762391cbb4a97918e12 | brakhane/panda3d,grimfang/panda3d,chandler14362/panda3d,grimfang/panda3d,brakhane/panda3d,mgracer48/panda3d,grimfang/panda3d,brakhane/panda3d,mgracer48/panda3d,chandler14362/panda3d,chandler14362/panda3d,tobspr/panda3d,tobspr/panda3d,brakhane/panda3d,grimfang/panda3d,tobspr/panda3d,chandler14362/panda3d,brakhane/panda3... | direct/src/extensions_native/HTTPChannel_extensions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a short script for plotting successive trials."
},
{
"role": "assistant",
"content": "import climate\nimport lmj.plot\nimport source\n\n\ndef main(subject):\n subj = source.Subject(subject)\n ax = lmj.plot.axes(111, pro... | python | new_file | 1 | 2 | mit | 49ffec0b634990a99d60326dbe9a1f2583300b5d | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | analysis/plot-trial-progress.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove dixon and asterisk test"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.6 on 2016-05-18 22:22\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclas... | python | new_file | 1 | 0 | bsd-2-clause | 6fcfd8d09db54996a9651f1ed8b82222e36d0673 | dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore | project/apps/api/migrations/0011_auto_20160518_1522.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Optional support for sqlalchemy.sql dynamic query generation.\"\"\"\n\nfrom .engine import create_engine, dialect\nfrom .connection import SAConnection\nfrom .exc import (Error, ArgumentError, InvalidRequestError,\n N... | python | edit | 1 | 0 | bsd-2-clause | 44fb076a04388b57e8d517eb4835fe7b4b6720d5 | luhn/aiopg,nerandell/aiopg,eirnym/aiopg,graingert/aiopg,aio-libs/aiopg,hyzhak/aiopg | aiopg/sa/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom scrapi.processing.osf import crud\nfrom scrapi.processing.osf import collision\nfrom scrapi.processing.base import BaseProcessor\n\n\nclass OSFProcessor(BaseProcessor):\n NAME = 'osf'\n\n def process_normalized(self, raw_doc, nor... | python | edit | 1 | 6 | apache-2.0 | fa6c2c43289eeee1c0efab45101149b49be1b5cb | ostwald/scrapi,mehanig/scrapi,felliott/scrapi,alexgarciac/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,icereval/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,jeffreyliu3230/scrapi,fabianvf/scrapi,erinspace/scrapi,mehanig/scrapi | scrapi/processing/osf/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file with premium dates task"
},
{
"role": "assistant",
"content": "from datetime import date\n\n\ndef get_first_payment_date(signup_date, previous_premium):\n raise NotImplementedError()\n\n\ndef get_end_date(sign_up_date... | python | new_file | 3 | 1 | mit | 3742545d6b2c13198bd1ecb3f7c675a8e6dad948 | coolshop-com/coolshop-application-assignment | premium_and_date.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add trivial pricing handler - Product/Variant field getter"
},
{
"role": "assistant",
"content": "from django.db.models import Min, Max\nfrom ...pricing import Price\n\nclass FieldGetter(object):\n def __init__(self, field_nam... | python | new_file | 1 | 4 | bsd-3-clause | a1a74dc33ef90dbb833e8490b2bd8cfc33915dce | fusionbox/satchless,taedori81/satchless,fusionbox/satchless,fusionbox/satchless | satchless/contrib/pricing/field/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for special tokens"
},
{
"role": "assistant",
"content": "from tests import TestCase\n\n\nclass SignedIntegerTokenTestCase(TestCase):\n def setup_method(self, method):\n TestCase.setup_method(self, method)... | python | new_file | 1 | 1 | bsd-3-clause | e9d5143b8751bee1d74a5cfebeca848225426d68 | cristen/sqlalchemy-searchable | tests/test_special_tokens.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for removing deadline"
},
{
"role": "assistant",
"content": "\"\"\"removed deadline column pimpy\n\nRevision ID: 299d2746edd\nRevises: 40f1fd0d52\nCreate Date: 2015-07-18 13:21:16.172796\n\n\"\"\"\n\n# revision iden... | python | new_file | 1 | 1 | mit | e2c9f4bba4ebe80b15026ccb1bb35ef1bf1f199d | viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct | migrations/versions/299d2746edd_removed_deadline_column_pimpy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to build OpenSpace with no modules enabled"
},
{
"role": "assistant",
"content": "import os\nfrom subprocess import call\n\n# To be called from the build folder in the OpenSpace\nmodules = os.listdir(\"../modules\")\n\... | python | new_file | 1 | 0 | mit | c418536827c523bb87dcdc893458e08ddba18102 | OpenSpace/OpenSpace,OpenSpace/OpenSpace,OpenSpace/OpenSpace,OpenSpace/OpenSpace | support/jenkins/buildNoModules.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sample smart tool for testing purposes"
},
{
"role": "assistant",
"content": "import argparse\n\nfrom dtoolcore import DataSet\n\ndef main(dataset_path, identifier, output_path):\n dataset = DataSet.from_path(dataset_path)... | python | new_file | 1 | 1 | mit | 7fb8b719a89adae9f4d094983fc4c0e946580389 | JIC-CSB/jobarchitect,JIC-CSB/jobarchitect | tests/sample_smart_tools/shasum.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.