messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Write python code for the following: Add a script to normalize user accounts\n\nPatch by: Sverre Rabbelier\n\n--HG--\nextra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%402240"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2.5\n#\n#... | 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 | rejected_duplicate | Near-duplicate of sample 8924 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration for box file guids"
},
{
"role": "assistant",
"content": "import logging\nfrom website.app import init_app\nfrom website.addons.box.model import BoxFile\nfrom scripts import utils as scripts_utils\n\n\nlogger = lo... | python | new_file | 1 | 2 | apache-2.0 | c94aefed7b260b7ae05c56f02253cba44f03b602 | brandonPurvis/osf.io,rdhyee/osf.io,mattclark/osf.io,alexschiller/osf.io,adlius/osf.io,TomHeatwole/osf.io,sbt9uc/osf.io,MerlinZhang/osf.io,petermalcolm/osf.io,mfraezz/osf.io,brandonPurvis/osf.io,aaxelb/osf.io,crcresearch/osf.io,sbt9uc/osf.io,adlius/osf.io,lyndsysimon/osf.io,ZobairAlijan/osf.io,cosenal/osf.io,laurenrever... | scripts/migrate_boxfiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic framework for W2V"
},
{
"role": "assistant",
"content": "import sys\nfrom os.path import isdir, isfile\nfrom corpus import Corpus\n\n\nclass W2VCorpus(Corpus):\n\n def __init__(self, dict_loc, vec_loc):\n Corp... | python | new_file | 2 | 5 | mit | 8b4e49f5aae691a5b3f3b77190356f70f9f23bb8 | PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project | src/project/word2vec_corpus.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to test the Thorlabs polarization rotator."
},
{
"role": "assistant",
"content": "# Import a whole load of stuff\r\nfrom System.IO import *\r\nfrom System.Drawing import *\r\nfrom System.Runtime.Remoting import *\r\n... | python | new_file | 13 | 2 | mit | 1455d5109efb64aa1c2579a97c0d84a60da22708 | ColdMatter/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite,ColdMatter/EDMSuite,Stok/EDMSuite,Stok/EDMSuite,jstammers/EDMSuite,jstammers/EDMSuite,ColdMatter/EDMSuite | EDMScripts/test_rotator.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run a mongo shell in the MongoLab environment"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n\nfrom os import environ\nfrom subprocess import check_call\nfrom urlparse import urlparse\n\nif 'MONGOLAB... | python | new_file | 2 | 0 | bsd-3-clause | ff0fa3d3aaa7de147571330a16895befb272440a | taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend,taarifa/taarifa_backend | mongoshell.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split functions to avoid eventlet import.\n\nSome of these functions are used in setup.py. In a virtualenv\nbased workflow, python setup.py sdist is called to create a\ntarball which is then installed into the virtualenv. These\nfunctions ne... | python | new_file | 4 | 5 | apache-2.0 | e0e7ccbea4a0c55533e27e595b59e442a9da263d | markmc/oslo.packaging,markmc/oslo.packaging | openstack/common/setup.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for seat map"
},
{
"role": "assistant",
"content": "import unittest\nimport datetime\nimport json\nimport sys\n\nsys.path.append('..')\nimport sabre_dev_studio\nimport sabre_dev_studio.sabre_exceptions as sabre_exceptio... | python | new_file | 4 | 1 | mit | 847f38e75e4ec79dbdd10a9627ec6b5a15ba2e41 | Jamil/sabre_dev_studio | tests/seat_map_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to generate a universe resource\n\nThe generate_universe_resource.py script can be used to generate\nresource files for universe. It takes as argument a plugin name and a\nversion and uses them to download the plugins from their... | python | new_file | 1 | 0 | apache-2.0 | 0add6b09c268b87a9f7007f80934418cbdee6d2c | kensipe/dcos-cli,kensipe/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,dcos/dcos-cli,kensipe/dcos-cli,kensipe/dcos-cli,kensipe/dcos-cli | ci/generate_universe_resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add valid and invalid xml Invalid XML is currently only invalid due to an incorrect version number."
},
{
"role": "assistant",
"content": "\"\"\"A module containing tests for the library representation of validation.\"\"\"\n\n\nv... | python | new_file | null | null | mit | 804086ef7fe50d8b710406dd0efb614733779912 | IATI/iati.core,IATI/iati.core | iati/core/tests/test_validate.py | rejected_code_smell | Internal duplication: ~176% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: Tests: Add a set of advection tests for meridional and zonal advection"
},
{
"role": "assistant",
"content": "from parcels import Grid, Particle, JITParticle, AdvectionRK4, Geographic, GeographicPolar\nimport numpy as np\nimport ... | python | new_file | 1 | 3 | mit | 8a3b9c2b3a25bda85cf3d961758a986dbdc19084 | OceanPARCELS/parcels,OceanPARCELS/parcels | tests/test_advection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add epub to file preset and localfile extension"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-04-10 18:39\nfrom __future__ import unicode_literals\n\nfrom django.db import m... | python | new_file | 1 | 0 | mit | 60e31ba20a596346031396fcd34796dc96f9ffdf | lyw07/kolibri,DXCanas/kolibri,mrpau/kolibri,benjaoming/kolibri,learningequality/kolibri,indirectlylit/kolibri,benjaoming/kolibri,learningequality/kolibri,jonboiser/kolibri,learningequality/kolibri,indirectlylit/kolibri,jonboiser/kolibri,indirectlylit/kolibri,mrpau/kolibri,DXCanas/kolibri,indirectlylit/kolibri,jonboiser... | kolibri/content/migrations/0009_auto_20180410_1139.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 454. 4Sum II\n\n454. 4Sum II: https://leetcode.com/problems/4sum-ii/"
},
{
"role": "assistant",
"content": "from collections import Counter\nclass Solution(object):\n def fourSumCount(self, A, B, C, D):\n ... | python | new_file | 1 | 5 | apache-2.0 | d2ff3f0905ded1dcbffd7ebd9cada423d44767d6 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/4sum-ii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add URLs for demo project"
},
{
"role": "assistant",
"content": "\"\"\"Urls for the zinnia-ckeditor demo\"\"\"\nfrom django.conf import settings\nfrom django.contrib import admin\nfrom django.conf.urls import url\nfrom django.con... | python | new_file | 1 | 0 | bsd-3-clause | 269a40987bcda02109ea9b53157056c43ff6ab58 | django-blog-zinnia/zinnia-wysiwyg-ckeditor | demo_zinnia_ckeditor/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ENH: Add initial Python package configuration"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nfrom os import sys, path\n\ntry:\n from skbuild import setup\nexcept ImportError:\n print('scikit-b... | python | new_file | 3 | 0 | apache-2.0 | 5b1a84a73abc6fc95d453cfbb78cf58bfc9c8310 | InsightSoftwareConsortium/ITKTextureFeatures,InsightSoftwareConsortium/ITKTextureFeatures | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper for Python 2/3 compatibility."
},
{
"role": "assistant",
"content": "# Copyright Least Authority Enterprises.\n# See LICENSE for details.\n\n\"\"\"\nHelpers for Python 2/3 compatibility.\n\"\"\"\n\nfrom twisted.python.... | python | new_file | 1 | 3 | mit | 92171a1bbccdfac0fd962f046f72faa681244c98 | LeastAuthority/txkube | src/txkube/test/_compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add recipe & source base classes and fake recipe generator"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport random\n\nclass Recipe:\n '''\n Represents an individual recipe, made up of the following attr... | python | new_file | 3 | 7 | bsd-2-clause | 28af24002e410c27d5d09c301bd8b8b6bf4683dd | kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes,kkelk/MeanRecipes | meanrecipes/sources.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new tests for sqlcache.py"
},
{
"role": "assistant",
"content": "from botbot import sqlcache\n\nimport os\nfrom itertools import combinations\nfrom string import ascii_letters\n\ndef get_dbpath():\n return os.path.join('.'... | python | new_file | 1 | 2 | mit | 3bf5f09f61cfe3e1bd4d8c736a014f05c1bd940e | jackstanek/BotBot,jackstanek/BotBot | tests/test_sqlcache.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to add an arbitrary service instance to the deploy_queue"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Copyright 2015-2020 Yelp Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License... | python | new_file | 1 | 2 | apache-2.0 | 7ee31b444556a70fb1d6fca27545ad1fbc317347 | Yelp/paasta,Yelp/paasta | paasta_tools/contrib/add_to_deploy_queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Segmenter. Not working yet"
},
{
"role": "assistant",
"content": "import copy\nimport package.app as app\nimport cv2\nimport numpy as np\nfrom package.image import Image, CS_BGR\n\n__author__ = 'luigolas'\n\n\nclass Segmenter... | python | new_file | 1 | 6 | mit | 894cbd1f7439fd6aca5a2f54a8111d22143c10f8 | Luigolas/PyReID | package/segmenter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create migration for the models."
},
{
"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\n ... | python | new_file | 1 | 0 | bsd-3-clause | 979347a3af800229701d3a48ea2ca5e9aec709df | donnywdavis/Django-faq-views,donnywdavis/Django-faq-views | faq/migrations/0001_initial.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test the repr() of object"
},
{
"role": "assistant",
"content": "from butter.eventfd import Eventfd\nfrom butter.fanotify import Fanotify\nfrom butter.inotify import Inotify\nfrom butter.signalfd import Signalfd\nfrom butter.time... | python | new_file | 1 | 1 | bsd-3-clause | ee0cda1dea775e58e5416b57fc0d96114f075128 | wdv4758h/butter,dasSOZO/python-butter | tests/unit/test_repr.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 120"
},
{
"role": "assistant",
"content": "class Solution:\n # @param start, a string\n # @param end, a string\n # @param dict, a set of string\n # @return an integer\n def ladderL... | python | new_file | 1 | 7 | mit | 3c898782f8b51c4af9bff2c566adb80c1f740e53 | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Medium/120_Word_Ladder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new command line tool for injesting from YAML description to NetCDF"
},
{
"role": "assistant",
"content": "\nimport click\nimport os\nimport os.path\nimport yaml\nfrom create_tiles import calc_target_names, create_tiles\nfrom... | python | new_file | 1 | 4 | bsd-3-clause | 8fa6beb9bd3fe866be11c97bed4fbe2532198dfc | omad/datacube-experiments | ingestor/ingest_from_yaml.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python utility to adjust timelines\n\nIt's kind of a pain to adjust all the times in a file or a section by a\nparticular amount, so this python file will do it for you."
},
{
"role": "assistant",
"content": "#!/usr/bin/pytho... | python | new_file | 1 | 3 | apache-2.0 | 70e55da36982217e5bcd983128a984be1aae84ab | quisquous/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot | util/timeline_adjust.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 650. 2 Keys Keyboard\n\n650. 2 Keys Keyboard: https://leetcode.com/problems/2-keys-keyboard/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def minSteps(self, n):\n \"\"\"\n ... | python | new_file | 3 | 3 | apache-2.0 | 5898822218500487419256676ac57c70a7d40367 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/2-keys-keyboard.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to aggregate metrics"
},
{
"role": "assistant",
"content": "import sys\nimport csv\nimport os\nSRC_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/src'\nsys.path.append(SRC_DIR)\nfrom aggregator ... | python | new_file | 6 | 4 | mit | 44971ec8f96302a04dbb9d4e66299462f245fb1d | Datafable/gbif-dataset-metrics,Datafable/gbif-dataset-metrics,Datafable/gbif-dataset-metrics | bin/aggregate_metrics.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to validate identification section date and filename date"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport glob\nimport sys, os\nsys.path.append(os.path.join(os.path.dirname(__file__), '..', 'pcc... | python | new_file | 5 | 5 | mit | 800e5514d0e641a09a3539c6425309e1f149621b | kinow/pccora | scripts/validate_pccora_filename_dates.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add time-sensitive test for compound generator for a large scan.\n\nTests that point preparation for ~100 million points (before region\nfiltering) happens within a few seconds."
},
{
"role": "assistant",
"content": "import os\ni... | python | new_file | 1 | 1 | apache-2.0 | ae15b8db30d726990b3ba2ee1885e093b0b933bf | dls-controls/scanpointgenerator | tests/test_core/test_compoundgenerator_performance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add configuration file for Andrew to test changes on"
},
{
"role": "assistant",
"content": "from experiment_config_lib import ControllerConfig\nfrom sts.topology import MeshTopology\nfrom sts.control_flow import Fuzzer\nfrom sts.... | python | new_file | 1 | 0 | apache-2.0 | 798394af2580cc755dac4d70892c150bc0e69d32 | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | config/andrew_list_violation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple distutils script for modules"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nsetup(name='dimreducer',\n version='1.0',\n description='Dimension reduction methods',\n py_modules... | python | new_file | 1 | 0 | mit | 6e805995a165f923c1c4f71c163c64a245f9a3d5 | epierson9/multiphenotype_methods | setup.py | rejected_duplicate | Near-duplicate of sample 6735 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# vim:fileencoding=utf-8:noet\nfrom __future__ import (unicode_literals, division, absolute_import, print_function)\n\nimport os\nimport sys\n\n\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))\nsys.path.i... | python | edit | 1 | 0 | mit | f073437f02737568b7d12cba6050afda92933a87 | DoctorJellyface/powerline,lukw00/powerline,cyrixhero/powerline,bezhermoso/powerline,QuLogic/powerline,Luffin/powerline,bartvm/powerline,s0undt3ch/powerline,darac/powerline,junix/powerline,seanfisk/powerline,darac/powerline,IvanAli/powerline,DoctorJellyface/powerline,Liangjianghao/powerline,Liangjianghao/powerline,wfsch... | docs/source/conf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test the Request and Response classes"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2016 <>\n#\n# Distributed under terms of the MIT license.\n\n\"\"\"... | python | new_file | 1 | 7 | mit | 5f15edde5d753423f70bfd7401c215053cbe746c | alexandriagroup/fnapy,alexandriagroup/fnapy | tests/test_http_messages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test interface for showing plots"
},
{
"role": "assistant",
"content": "from PySide import QtCore, QtGui\nimport os,sys\nfrom bgsub import SpectrumData\nfrom matplotlib import pyplot as plt\n\npath = \"/home/danielle/Documents/LM... | python | new_file | 2 | 0 | mit | c90bde47b1faab13396052fa474bc802ea5b2438 | danushkana/pyspectrum | testscroll.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a utility for diffing dicts"
},
{
"role": "assistant",
"content": "class DictDiffer(object):\n \"\"\"\n Calculate the difference between two dictionaries as:\n\n (1) items added\n (2) items removed\n ... | python | new_file | 1 | 3 | bsd-2-clause | 0032cfba11665de9200410cc132eb8aa368c7601 | crateio/carrier | conveyor/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce Port resource request extension\n\nThe resources needed by a port are expressed to nova via\nresource_request extending the port.\nIf the port requested by nova boot has resource_request attribute, that\nmeans that placement must e... | python | new_file | 1 | 0 | apache-2.0 | eb4221e6f0b48b131f2009168b3b22f5a3d4dd8f | mahak/neutron,noironetworks/neutron,mahak/neutron,openstack/neutron,openstack/neutron,mahak/neutron,noironetworks/neutron,openstack/neutron | neutron/extensions/port_resource_request.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Package with shell specific actions, each shell class should\nimplement `from_shell`, `to_shell`, `app_alias`, `put_to_history` and\n`get_aliases` methods.\n\"\"\"\nimport os\nfrom psutil import Process\nfrom .bash import Bash\nfrom .... | python | edit | 1 | 5 | mit | 2207dd266887e812cae9da67ca00bef80c9985fd | mlk/thefuck,SimenB/thefuck,SimenB/thefuck,mlk/thefuck,nvbn/thefuck,Clpsplug/thefuck,scorphus/thefuck,Clpsplug/thefuck,scorphus/thefuck,nvbn/thefuck | thefuck/shells/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mgmt cmd to re-save a list of form/case IDs\n\nhttps://manage.dimagi.com/default.asp?263644"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__... | python | new_file | 3 | 6 | bsd-3-clause | fcde68e954eab9f1b158928f9d30633523d41d94 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/userreports/management/commands/resave_couch_forms_and_cases.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to run experiment"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nif __name__ == '__main__':\n import argparse\n from glob import glob\n import os.path\n\n from sklearn.feature_extraction.te... | python | new_file | 1 | 0 | mit | ca440877fd1b28157393c480d6fed8f5dd9e4238 | kemskems/otdet | run_experiment.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 'senedd' to choices for organisation_type"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2.16 on 2020-12-18 09:12\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n ... | python | new_file | 1 | 0 | bsd-3-clause | 32ea27cfa3994984d8d8f8db09522f6c31b0524f | DemocracyClub/EveryElection,DemocracyClub/EveryElection,DemocracyClub/EveryElection | every_election/apps/organisations/migrations/0059_add_sennedd_to_org_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Save daily vertically integrated moisture transport for HOWI index"
},
{
"role": "assistant",
"content": "import sys\nsys.path.append('/home/jwalker/dynamics/python/atmos-tools')\nsys.path.append('/home/jwalker/dynamics/python/at... | python | new_file | 6 | 1 | mit | e30ce1adf4e9c8504ae1816f0078c744e63c836c | jenfly/monsoon-onset,jenfly/monsoon-onset | scripts/save-vimt.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import print_function\n\nimport argparse\nimport sys\n\nimport simplejson\n\n\ndef check_json(argv=None):\n parser = argparse.ArgumentParser()\n parser.add_argument('filenames', nargs='*', help='JSON filenames to check... | python | edit | 1 | 3 | mit | 6b9265c96adb8ba9fc7f2d04edcb02398566e1b9 | Harwood/pre-commit-hooks,pre-commit/pre-commit-hooks | pre_commit_hooks/check_json.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example post body processer"
},
{
"role": "assistant",
"content": "'''A simple post reading server example.\n\nTo test run this server with `hug -f post_body_example`\nthen run the following from ipython:\n import requests... | python | new_file | 1 | 1 | mit | dc1118525e47854d8185d4d46db5a12ec3e93aea | MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug | examples/post_body_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove original permissions from broadcast users\n\nThe broadcast user permissions are changing, so to avoid confusion and\npermissions which exist in the database but don't display on the\nfrontend we are going to remove all existing permis... | python | new_file | 1 | 1 | mit | d708b64dd45b824bada255054df3988efa0f21fe | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0361_new_user_bcast_permissions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow running with \"python -m html_sanitizer\""
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nimport io\nimport sys\n\nfrom .sanitizer import Sanitizer\n\n\nsanitizer = Sanitizer()\n\nif len(sy... | python | new_file | 1 | 0 | bsd-3-clause | 5d749e09eeef87ad91f2255ab80305a26dd85989 | matthiask/html-sanitizer | html_sanitizer/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for RESTful server"
},
{
"role": "assistant",
"content": "import datetime\n\nfrom flask.ext.testing import TestCase\nimport mongomock\nimport mock\n\nfrom server import app, get_db\n\nclass BaseTest(TestCase):\n def ... | python | new_file | 1 | 1 | bsd-2-clause | 76ced10ebc0c7ef36924ca4e123ba637a53e0784 | AAzza/geonaut,AAzza/geonaut | test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for the new ActionResourceManager methods"
},
{
"role": "assistant",
"content": "# Copyright 2019 Extreme Networks, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use th... | python | new_file | 1 | 1 | apache-2.0 | fcf6fe09abcb448ec6071f5a92b1d44621fb2a49 | nzlosh/st2,nzlosh/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,Plexxi/st2 | st2client/tests/unit/test_client_actions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional test to ensure response keys are not shadowed"
},
{
"role": "assistant",
"content": "# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (t... | python | new_file | 1 | 3 | apache-2.0 | fa9b27bd8e58b17a2d072fdf2b173f14d5f15a33 | boto/botocore,pplu/botocore | tests/functional/test_response_shadowing.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for running fits with OpenMPI"
},
{
"role": "assistant",
"content": "\"\"\"\nScript to run all redshift fits in parallel with OpenMPI\n\nUsage: \n\n mpiexec -n 10 python -m mpi4py.futures $GRIZLICODE/grizli/pipeline/... | python | new_file | 4 | 4 | mit | 62009e7ea13360a71a5294d73411f4b802610aae | albertfxwang/grizli | grizli/pipeline/run_MPI.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple test for setuptools.command.build"
},
{
"role": "assistant",
"content": "from setuptools.dist import Distribution\nfrom setuptools.command.build import build\n\n\ndef test_distribution_gives_setuptools_build_obj(tmpd... | python | new_file | 1 | 1 | mit | fe3e93a0b74a987fa4545f75f3f6301fc15f571e | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/tests/test_build.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for np.empty 1d case"
},
{
"role": "assistant",
"content": "from __future__ import print_function, absolute_import, division\n\nimport numpy as np\n\nfrom numba import unittest_support as unittest\nfrom numba import njit... | python | new_file | 1 | 2 | bsd-2-clause | 6cd0721a953a0708a99828dc8276c510b1b57c11 | cpcloud/numba,pitrou/numba,pombredanne/numba,pombredanne/numba,gdementen/numba,cpcloud/numba,cpcloud/numba,seibert/numba,sklam/numba,ssarangi/numba,stefanseefeld/numba,jriehl/numba,stuartarchibald/numba,sklam/numba,stuartarchibald/numba,stonebig/numba,sklam/numba,stefanseefeld/numba,pitrou/numba,stonebig/numba,GaZ3ll3/... | numba/tests/test_dyn_array.py | rejected_duplicate | Near-duplicate of sample 8238 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an early gpio testing script"
},
{
"role": "assistant",
"content": "# from www.thirdeyevis.com/pi-page-2.php\n\nimport RPi.GPIO as GPIO\nimport time\n\nGPIO.setmode(GPIO.BOARD)\nGPIO.setup(7, GPIO.OUT)\nGPIO.setup(11, GPIO.OU... | python | new_file | 1 | 2 | mit | 7f01e9e622eb14db003d125bd7041671452fc9c6 | joadavis/rpi-coding | hacks/gpiotesting.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add preliminary test suite for core.py"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Testing CLI module\n\nOnly supports Python 3.x now\"\"\"\n\nimport unittest\n\n# Resolve import problem\nimport os\nos.c... | python | new_file | 3 | 1 | mit | 8525b50385a8b18333ad557ab66029d467c3e915 | RihanWu/vocabtool | test/test_core.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 'smoke test' for single blog post page"
},
{
"role": "assistant",
"content": "from tests import PMGLiveServerTestCase\nfrom tests.fixtures import dbfixture, PostData\nimport urllib2\n\n\nclass TestBlogPages(PMGLiveServerTestC... | python | new_file | 4 | 1 | apache-2.0 | 22dc87589131a86b4d2e38eaf67ec4601b1436ee | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | tests/views/test_blog_post_page.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add aws s3 into tests"
},
{
"role": "assistant",
"content": "import pytest\nfrom into import into, resource, S3, discover, CSV, s3\nimport pandas as pd\nimport pandas.util.testing as tm\nimport datashape\n\nsa = pytest.importorsk... | python | new_file | 1 | 1 | bsd-3-clause | c464c509b69b4c61364b62ac584619744c4f6113 | blaze/odo,Dannnno/odo,quantopian/odo,cowlicks/odo,ywang007/odo,alexmojaki/odo,cowlicks/odo,quantopian/odo,blaze/odo,alexmojaki/odo,ContinuumIO/odo,Dannnno/odo,cpcloud/odo,cpcloud/odo,ContinuumIO/odo,ywang007/odo | into/backends/tests/test_aws.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic working prototype of SMACH/Jinja2 template-based code generation."
},
{
"role": "assistant",
"content": "#----------------------------------------------------------------------------------------\n# BEGIN: READ_HEXAPOD_C... | python | new_file | 12 | 0 | bsd-3-clause | 3ceddeed21abe277224750764eaf10f6c8f49a60 | ReconCell/smacha,ReconCell/smacha | py/statemachines/simple_state_machine_script_test.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a few basic tests for Experiment code."
},
{
"role": "assistant",
"content": "import theanets\nimport numpy as np\n\nimport util\n\n\nclass TestExperiment(util.MNIST):\n def test_create_autoencoder(self):\n exp = th... | python | new_file | 4 | 1 | mit | 47a11b49d79829e97ed8ca0ca4d6dde115b96d08 | lmjohns3/theanets,devdoer/theanets,chrinide/theanets | test/main_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement unit tests for logger class"
},
{
"role": "assistant",
"content": "import pytest\nfrom mugloar import dragon, logger\n\n@pytest.fixture\ndef log_instance():\n \"\"\"Returns a Logger instance\"\"\"\n return logger.... | python | new_file | 1 | 1 | mit | 7aab4b3e2761209aae312512ec6582a83865c912 | reinikai/mugloar | tests/test_logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move python test script to tests (part 2)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport sys, dbus, dbus.glib\n\n#import pdb\n\n# Get the D-Bus Session Bus\nbus = dbus.SessionBus()\n\n#Access the ICEcore Dae... | python | new_file | 3 | 0 | mit | 726b8d169923e31e1efbd1385e9f29f5fd8793f4 | mono-soc-2012/Tasque,mono-soc-2012/Tasque,mono-soc-2012/Tasque | tests/create-task.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for parsing IRC messages"
},
{
"role": "assistant",
"content": "from collections import namedtuple\n\nIRCMsg = namedtuple('IRCMsg', 'prefix cmd params postfix')\n\ndef parse(line):\n \"\"\" Parses line and returns a... | python | new_file | 1 | 6 | mit | ade8079d2e455899381bba1738373f734e2d3508 | aalien/mib | parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement two methods in the USResident class"
},
{
"role": "assistant",
"content": "## DO NOT MODIFY THE IMPLEMENTATION OF THE Person CLASS ##\r\nclass Person(object):\r\n def __init__(self, name):\r\n #create a person... | python | new_file | 1 | 4 | mit | 9a3d3e70c193cd0dfef51d4a0d02ebc21b7933bc | Kunal57/MIT_6.00.1x | final/usresident.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alt implementation to try and see if it works better"
},
{
"role": "assistant",
"content": "import requests\nfrom datetime import date\nfrom urlparse import urljoin\nfrom bs4 import BeautifulSoup\n\n\ndef find_csrf_token(text... | python | new_file | 1 | 1 | apache-2.0 | a0771954902d6c4af2709d871a115680f89a0497 | tmobile/jazz-installer,tmobile/jazz-installer,tmobile/jazz-installer,tmobile/jazz-installer | installer/terraform/jazz-terraform-unix-noinstances/scripts/gitlab_privatetoken.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [svn] Add a reminder to write a HTML formatter test."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"\n Pygments HTML formatter tests\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: 2006 by Georg Br... | python | new_file | 7 | 1 | bsd-2-clause | c8af96f89ca218c0c49b90b39fe6ea4339e39321 | aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygments,aswinpj/Pygmen... | tests/test_html_formatter.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some initial tests. These require the server to be running."
},
{
"role": "assistant",
"content": "import os\nimport time\n\nimport pytest\nimport requests\nimport json\nimport yaml\n\n\nHERE = os.path.dirname(os.path.abspath... | python | new_file | 1 | 1 | bsd-3-clause | f6f13b4ff52fbe9346e9f60ba054b305da122d36 | ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd | tests/test_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add string to callable util functions"
},
{
"role": "assistant",
"content": "def get_class(class_string, exception=Exception):\n \"\"\"\n Convert a string version of a function name to the callable object.\n \"\"\"\n ... | python | new_file | 1 | 4 | bsd-3-clause | 5276206be1698e9adb231e61c2686f640825f6a7 | SheepDogInc/django-dynamicforms,SheepDogInc/django-dynamicforms | dynamicforms/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for init function."
},
{
"role": "assistant",
"content": "from flexmock import flexmock\nimport flask_uploads\nfrom flask_uploads import Upload\nfrom . import TestCase\n\n\nclass TestWithoutResizer(TestCase):\n def t... | python | new_file | 1 | 1 | mit | 76aae555aefa154ad30aec6d63669c6b0b520087 | FelixLoether/flask-uploads,FelixLoether/flask-image-upload-thing | tests/test_init.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add custom text2svm preprocessor with a blvd-minded tokenizer."
},
{
"role": "assistant",
"content": "import os\nimport re\nimport unicodedata\n\nfrom libshorttext.converter import *\n\n\ndef tokenizer(text):\n\n def trim_link... | python | new_file | 5 | 6 | bsd-3-clause | bad1a775e54ab2681adbeec483a7035b1d966ded | izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext | blvd_text2svm.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for capturing meeting report nids from dump."
},
{
"role": "assistant",
"content": "import os\nimport json\nimport time, datetime\nimport parsers\nimport logging\nimport csv\nimport re\nimport requests\nfrom sqlalchemy... | python | new_file | 6 | 10 | apache-2.0 | 4da778d9f0705505a6e38989ac55cf4cbc7db83a | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | capture_nids.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 572. Subtree of Another Tree\n\n572. Subtree of Another Tree: https://leetcode.com/problems/subtree-of-another-tree/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# class TreeNod... | python | new_file | 1 | 7 | apache-2.0 | 96101d6158d7cf3e3e0efd287cefa27230d2f556 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/subtree-of-another-tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for random number generators."
},
{
"role": "assistant",
"content": "\"\"\"\nRandom and quasi-random generator tests.\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ im... | python | new_file | 1 | 3 | bsd-2-clause | d3bcd60c92939211716e82718871559c38ddc19d | mwhoffman/mwhutils | tests/test_random.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\nimport unittest\n\nfrom mycroft.skills.scheduled_skills import ScheduledSkill\nfrom mycroft.util.log import getLogger\n\n__author__ = 'eward'\n\nlogger = getLogger(__name__)\n\n\nclass ScheduledSkil... | python | edit | 1 | 1 | apache-2.0 | 26b3423fb2ff9c05f00cba6e57b47174ec248804 | linuxipho/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core,MycroftAI/mycroft-core,Dark5ide/mycroft-core,aatchison/mycroft-core,MycroftAI/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,forslund/mycroft-core | test/skills/scheduled_skills.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create scripts making downstream aggragation and stats easier."
},
{
"role": "assistant",
"content": "import camoco as co\nimport glob\nimport pandas as pd\nimport os\n\ndef read_FDR(glob_path):\n dfs = []\n for x in glob.g... | python | new_file | 3 | 7 | mit | f94f2ee4e61c683d2e05e1797ca3752d46b27a47 | schae234/Camoco,schae234/Camoco | scripts/CalculateLocalityFDR.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add multiline echo server example script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom gaidaros import *\nserver = Gaidaros(end_request = lambda x: '\\n\\n' in x, split_request = lambda x: return(x[:x.find(... | python | new_file | null | null | mit | 9a36a91a9fff8b6ce0deaf8c1aee259e2abc911e | rowanthorpe/gaidaros | examples/multiline_echo_server.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: api: Add test cases for X-TBA-App-Id"
},
{
"role": "assistant",
"content": "import unittest2\nimport webtest\nimport json\nimport webapp2\n\nfrom google.appengine.ext import testbed\n\nfrom controllers.api.api_event_controller im... | python | new_file | 3 | 1 | mit | 103090f79c30ef018be383df745998601626f918 | jaredhasenklein/the-blue-alliance,synth3tk/the-blue-alliance,fangeugene/the-blue-alliance,josephbisch/the-blue-alliance,synth3tk/the-blue-alliance,1fish2/the-blue-alliance,jaredhasenklein/the-blue-alliance,1fish2/the-blue-alliance,josephbisch/the-blue-alliance,bdaroz/the-blue-alliance,bvisness/the-blue-alliance,tstewar... | tests/test_apiv2_controller.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add forgotten migration for Organization.admin_users field's blank=True."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom dj... | python | new_file | 1 | 0 | mit | e614115b8b31220c5d577d42fdf9ac4202874c8e | City-of-Helsinki/linkedevents,City-of-Helsinki/linkedevents,tuomas777/linkedevents,tuomas777/linkedevents,aapris/linkedevents,kooditiimi/linkedevents,kooditiimi/linkedevents,kooditiimi/linkedevents,kooditiimi/linkedevents,tuomas777/linkedevents,City-of-Helsinki/linkedevents,aapris/linkedevents,aapris/linkedevents | events/migrations/0008_auto_20151127_1019.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python answer to q3"
},
{
"role": "assistant",
"content": "import sys\n\ndef prependAbbrev(front, abbr):\n if type(front) is type(abbr[0]):\n return [front + abbr[0]] + abbr[1:]\n else:\n return [front] + ... | python | new_file | 2 | 2 | mit | 8e1ebcad18ddde87cdf6a46d673f90030cfe4e26 | UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016,UW-UPL/InterviewPrepJan2016 | q3/FindAllAbbreviations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a helper script which will transform a file full of SQL commands into a\nheader file suitable for inclusion in a standard C file and use with the\nSubversion SQLite APIs. The goal here is that we can maintain our SQL schema\ndirectly as... | python | new_file | 4 | 3 | apache-2.0 | 3bb0563daed1660bbede02737b1d3a38e306e9bc | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | build/transform-sql.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple tests for __import__ for future optimizations to importlib."
},
{
"role": "assistant",
"content": "from . import util\nfrom .source import util as source_util\nimport gc\nimport decimal\nimport imp\nimport importlib\ni... | python | new_file | 3 | 5 | mit | 36fd334a4b7a1adbe578a680d7d79e338452ea1a | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/importlib/test/benchmark.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a few fizz buzz attempts"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# pylint: disable=C0111\n# pylint: disable=C0103\n# pylint: disable=C0330\n\nMAX = 31\n\ndef simple():\n print ('--- SIMPLE -----')\n ... | python | new_file | 1 | 5 | mit | 9ae8dcb6eca400e4d58a652a0d949087f321c307 | petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox | python/misc/fizzbuzz.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add view for bct analysis"
},
{
"role": "assistant",
"content": "from flask import session, render_template, Blueprint\nfrom lexos.helpers import constants\nfrom lexos.views.base_view import detect_active_docs\nfrom lexos.models.... | python | new_file | 1 | 3 | mit | b03d28d21f73e8f8fabab5edcb9a0317e20c19c4 | WheatonCS/Lexos,WheatonCS/Lexos,WheatonCS/Lexos | lexos/views/bct_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: 完成了第83题: Remove Duplicates from Sorted List"
},
{
"role": "assistant",
"content": "# Definition for singly-linked list.\n# class ListNode(object):\n# def __init__(self, x):\n# self.val = x\n# self.next = None\... | python | new_file | 1 | 4 | mit | 4b45f50c3321dc6b79ad6fbc167a4f895aaac869 | ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground | src/83_Remove_Duplicates_from_Sorted_List.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unfinished scripts that assist in deft disambiguation\n\ngit history was completley farbed through carelessness. the original deft\nbranch was deleted and a new branch was created"
},
{
"role": "assistant",
"content": "import... | python | new_file | 7 | 6 | bsd-2-clause | f4fa2d526f6f9c8b972c20ac073ed8f0682871ea | bgyori/indra,pvtodorov/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/belpy,johnbachman/indra,johnbachman/belpy,johnbachman/belpy,bgyori/indra | indra/tools/disambiguate.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alexa skill basic functionality"
},
{
"role": "assistant",
"content": "import json\r\nimport time\r\n\r\nimport requests\r\nimport unidecode\r\nfrom flask import Flask\r\nfrom flask_ask import Ask, question, session, statemen... | python | new_file | 2 | 2 | mit | bc1faaa6265f70254702709efb7f8410fbe07286 | Sorsby/alexa-british-problems | alexa-british-problems.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example on the library usage"
},
{
"role": "assistant",
"content": "# Example on how to use the ofxclient library without the\n# web interface. It's admittedly clunky but doable -- it's\n# free so get over it >=)\nimport ... | python | new_file | 2 | 0 | mit | 9cd5226f64b93d19f6af7cfd76436118b00bd781 | jbms/ofxclient,captin411/ofxclient | example/amex.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new ordered set class"
},
{
"role": "assistant",
"content": "\"\"\"\nCode from http://code.activestate.com/recipes/576694/\n\"\"\"\n\nimport collections\n\nclass OrderedSet(collections.MutableSet):\n\n def __init__(self, i... | python | new_file | 1 | 3 | apache-2.0 | 38a07f395ffa6bfe20cf4c205c8b4cf30411fab5 | amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt | evaluation/packages/orderedSet.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for telemetry alarm crud\n\nChange-Id: I77399eb47761c8de04095c06cd67d5d09e644df4"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use t... | python | new_file | 1 | 2 | apache-2.0 | 218848f916ffe55bed2e914ee5aa7be459d0ff4a | briancurtin/python-openstacksdk,stackforge/python-openstacksdk,dtroyer/python-openstacksdk,briancurtin/python-openstacksdk,mtougeron/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,dudymas/python-openstacksdk,dudymas/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-opens... | openstack/tests/functional/telemetry/v2/test_alarm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to shutdown Raspberry Pi on button press\n\nSigned-off-by: Greg Meiste <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Copyright (C) 2014 Gregory S. Meiste <http://gregmeiste.com>\n#\n# Lic... | python | new_file | 3 | 0 | apache-2.0 | 48ec3105c0dafaa3595b0ee565fef24d35ed6194 | meisteg/RaspberryPiTempAlarm,meisteg/RaspberryPiTempAlarm,meisteg/RaspberryPiTempAlarm | scripts/shutdown_button.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add road sort key tests"
},
{
"role": "assistant",
"content": "import unittest\n\n\nclass RoadSortKeyTest(unittest.TestCase):\n\n def _call_fut(self, props, zoom=15, shape=None, fid=None):\n from TileStache.Goodies.VecT... | python | new_file | 1 | 1 | mit | 153618fbd1bb23d57f14e52f09dc19720df83fd4 | mapzen/tilequeue,tilezen/tilequeue | tests/test_transform.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the IATI Datastore This adds a 200 response and link checks for the IATI Datastore"
},
{
"role": "assistant",
"content": "import pytest\nfrom web_test_base import *\n\nclass TestIATIDatastore(WebTestBase):\n urls... | python | new_file | 5 | 1 | mit | 110445d89f230cc71bfd970845e0e63c13eeaff0 | IATI/IATI-Website-Tests | tests/test_datastore.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a jinja2 env for rendering templates"
},
{
"role": "assistant",
"content": "from jinja2 import (\n select_autoescape,\n Environment,\n FileSystemLoader,\n)\n\n\ntemplate_env = Environment(\n loader=FileSystemLo... | python | new_file | 1 | 0 | mit | a4ed98ddec2afd5121f90db3ed6927c078958f81 | ana-balica/classy-django-forms,ana-balica/classy-django-forms,ana-balica/classy-django-forms | cdf/jinja_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snippet (Python OpenCV)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n\"\"\"\nOpenCV - Display image: display an image... | python | new_file | 1 | 1 | mit | d07f0ab7f437809a2811f0f1fdab396cbcac740f | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/display_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add custom time picker control"
},
{
"role": "assistant",
"content": "\"\"\"Custom time picker that allows us control of the control's color.\"\"\"\nfrom wx.lib.masked import TimeCtrl\nfrom ... util import rgba\nimport wx\n\n\ncl... | python | new_file | 1 | 2 | mit | 13c3190c6e89c2037c9b2bcce8a89dd43a58b53f | facelessuser/Rummage,facelessuser/Rummage,facelessuser/Rummage | rummage/lib/gui/controls/time_picker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple signal-based Python callstack sampler for debugging"
},
{
"role": "assistant",
"content": "\"\"\"A simple Python callstack sampler.\"\"\"\n\nimport contextlib\nimport datetime\nimport signal\nimport traceback\n\n\ncl... | python | new_file | 1 | 3 | apache-2.0 | 830a17eca3550c3f4d9f4878d90405b288c10a42 | alexgorban/models,tombstone/models,tombstone/models,alexgorban/models,tombstone/models,alexgorban/models,tombstone/models,tombstone/models,tombstone/models,alexgorban/models,alexgorban/models | official/utils/misc/callstack_sampler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Kivy version of live audio stream"
},
{
"role": "assistant",
"content": "'''\nkivy requires some library installation\n'''\n\n\nimport matplotlib\nmatplotlib.use('module://kivy.garden.matplotlib.backend_kivy')\n\nimport matpl... | python | new_file | 3 | 1 | bsd-3-clause | 22102598e98371aed70866d8d8b48d96fb889708 | torebutlin/cued_datalogger | liveplotkivy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [py] Allow driver fixtures to be used in Chrome only tests"
},
{
"role": "assistant",
"content": "# Licensed to the Software Freedom Conservancy (SFC) under one\n# or more contributor license agreements. See the NOTICE file\n# d... | python | new_file | 1 | 3 | apache-2.0 | c6e15f8e66fe542c459ac75f1ef6db080249e9d0 | titusfortner/selenium,HtmlUnit/selenium,Ardesco/selenium,joshmgrant/selenium,HtmlUnit/selenium,titusfortner/selenium,SeleniumHQ/selenium,valfirst/selenium,HtmlUnit/selenium,HtmlUnit/selenium,valfirst/selenium,SeleniumHQ/selenium,Ardesco/selenium,HtmlUnit/selenium,HtmlUnit/selenium,Ardesco/selenium,Ardesco/selenium,Sele... | py/test/selenium/webdriver/chrome/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example to compare Gamma and Spline"
},
{
"role": "assistant",
"content": "\"\"\"\nThis test file is meant for developing purposes. Providing an easy method to\ntest the functioning of Pastas during development.\n\n\"\"\"\... | python | new_file | 1 | 0 | mit | f0d1f7d5ff57b3359aa26f17297e6de9ff533eb1 | pastas/pasta,pastas/pastas | examples/example_spline.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a test the RepositoryNotFound exception"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom cookiecutter import main, exceptions\n\n\ndef test_should_raise_error_if_repo_does_not_exis... | python | new_file | 1 | 1 | bsd-3-clause | 6fed44e26539e607e60acdc39aa73a69e769ec5f | Springerle/cookiecutter,stevepiercy/cookiecutter,willingc/cookiecutter,luzfcb/cookiecutter,luzfcb/cookiecutter,terryjbates/cookiecutter,Springerle/cookiecutter,michaeljoseph/cookiecutter,hackebrot/cookiecutter,willingc/cookiecutter,audreyr/cookiecutter,hackebrot/cookiecutter,audreyr/cookiecutter,pjbull/cookiecutter,mic... | tests/test_repo_not_found.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a single-line code golf example"
},
{
"role": "assistant",
"content": "print (reduce(lambda string, tup: string + tup[0] + ' - ' + str(tup[1]) + '\\n', sorted( filter(lambda tup: tup[0] not in open('../stop_words.txt').read(... | python | new_file | 3 | 0 | mit | a5e05c411c229b128f56eddd027efc05230778f9 | kranthikumar/exercises-in-programming-style,kranthikumar/exercises-in-programming-style,aaron-goshine/exercises-in-programming-style,crista/exercises-in-programming-style,crista/exercises-in-programming-style,aaron-goshine/exercises-in-programming-style,crista/exercises-in-programming-style,aaron-goshine/exercises-in-p... | 06-code-golf/tf-06-bm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 372. Super Pow\n\n372. Super Pow: https://leetcode.com/problems/super-pow/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def superPow(self, a, b):\n \"\"\"\n :type a: int\n ... | python | new_file | 1 | 3 | apache-2.0 | 374dc84359bb41bbc94116b3a7662255fa5d147a | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/super-pow.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a helper script to generate a changelog from git log"
},
{
"role": "assistant",
"content": "# Writes a changelog in trac WikiFormatting based on a git log\nfrom __future__ import unicode_literals, division, absolute_import\n\... | python | new_file | 2 | 0 | mit | 42bb37178827669e89e9222c24f79de38c5b75b8 | tsnoam/Flexget,OmgOhnoes/Flexget,v17al/Flexget,ZefQ/Flexget,qvazzler/Flexget,ianstalk/Flexget,LynxyssCZ/Flexget,malkavi/Flexget,tarzasai/Flexget,jacobmetrick/Flexget,ibrahimkarahan/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,Danfocus/Flexget,jawilson/Flexget,cvium/Flexget,Flexget/Flexget,poulpito/Flexget,vfrc2/Flexge... | gen-changelog.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for improved exception messages"
},
{
"role": "assistant",
"content": "from io import BytesIO\nfrom unittest import TestCase\n\nimport bigjson\n\n\nMISSING_OPEN_QUOTE_JSON_FILE = b\"\"\"\n{\n \"object\": {\n \... | python | new_file | 1 | 1 | mit | ca056b16d5a39d5c8e95d8f2fe4d8678a0dfea0c | henu/bigjson | tests/test_corruption.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.