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 first implementation of virtual ontology"
},
{
"role": "assistant",
"content": "import requests\nfrom .ontology_graph import IndraOntology\n\n\nclass VirtualOntology(IndraOntology):\n def __init__(self, url, ontology='bio'... | python | new_file | 1 | 1 | bsd-2-clause | 3501462ebafa15b19ef436231a5a0d9e3b5d430a | johnbachman/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra,johnbachman/indra | indra/ontology/virtual_ontology.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functionality to load and test a saved model"
},
{
"role": "assistant",
"content": "# import os\nimport sys\nimport tensorflow as tf\n# sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))\n\nfrom Model... | python | new_file | 1 | 3 | mit | 6b1be6883ead01cc226226499644adb7e99542f8 | harpribot/representation-music,harpribot/representation-music | Experiments/evaluate_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ClamAV script to analyze HTTPS traffic for viruses"
},
{
"role": "assistant",
"content": "import pyclamd\nfrom libmproxy.flow import decoded\n\n#http://www.eicar.org/85-0-Download.html\n\nclamd = pyclamd.ClamdUnixSocket()\ntr... | python | new_file | 4 | 2 | mit | f13045b5f933078225b89405a786c14da34d0af5 | mhils/HoneyProxy,mhils/HoneyProxy,mhils/HoneyProxy,mhils/HoneyProxy | scripts/clamav.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test implementation of convex hull"
},
{
"role": "assistant",
"content": "import math\n\nclass Vector:\n def __init__(self, x, y):\n self.x = x\n self.y = y\n \n # add theta, so we can sort by it la... | python | new_file | 1 | 3 | mit | 05a5599fd0cf08cf33c8a90673e8c71b4c1d6c36 | tylerburnham42/ProgrammingTeam,MercerBinaryBears/Slides,tylerburnham42/ProgrammingTeam,MercerBinaryBears/Slides,MercerBinaryBears/Slides,MercerBinaryBears/Slides,MercerBinaryBears/Slides,tylerburnham42/ProgrammingTeam | slides/ComputationalGeometry/convex-hull.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 384. Shuffle an Array\n\n384. Shuffle an Array: https://leetcode.com/problems/shuffle-an-array/"
},
{
"role": "assistant",
"content": "from random import randint\nclass Solution(object):\n\n def __init__(se... | python | new_file | 2 | 3 | apache-2.0 | d692508e9c6fba847f3bb179bbfd3684e6ebcef0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/shuffle-an-array.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add catapult presubmit with list of trybots.\n\nThis should make 'git cl try' work correctly\n\nReview URL: https://codereview.chromium.org/1162013002"
},
{
"role": "assistant",
"content": "# Copyright (c) 2015 The Chromium Autho... | python | new_file | 1 | 1 | bsd-3-clause | 3283c9ac640112ab7a26ec3f82e051394ca72ecf | catapult-project/catapult-csm,dstockwell/catapult,sahiljain/catapult,catapult-project/catapult,zeptonaut/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,modulexcite/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult,catapult-project/catapult-csm,dstockwell/cata... | PRESUBMIT.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make `publication_date` column not nullable.\n\nBEFORE: It was nullable (an artifact of us having added it after the\ntable was initially created and populated).\n\nAFTER: It is not nullable (because we just ran a script to populate the\nnew... | python | new_file | 3 | 1 | isc | 6a9b6f0227b37d9c4da424c25d20a2b7e9397a9f | gthank/pytips,gthank/pytips,gthank/pytips,gthank/pytips | alembic/versions/3800f47ba771_publication_date_not_nullable.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a mobile device test of the Skype website"
},
{
"role": "assistant",
"content": "\"\"\"\nThis is a mobile device test for Chromium-based browsers (such as MS Edge)\nUsage: pytest test_skype_site.py --mobile --browser=edge\n\... | python | new_file | 1 | 2 | mit | c8271b02c3636aa9620cce8b85c823ff0ec35c4a | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase | examples/test_skype_site.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tapiriik.database import db\nfrom tapiriik.messagequeue import mq\nfrom tapiriik.sync import Sync\nfrom datetime import datetime\nfrom pymongo.read_preferences import ReadPreference\nimport kombu\nimport time\n\nSync.InitializeWorkerBi... | python | edit | 3 | 0 | apache-2.0 | 95ceeb0af4e549e0d211b4e1ba6157d26ad5e44d | cgourlay/tapiriik,cheatos101/tapiriik,cmgrote/tapiriik,abhijit86k/tapiriik,dmschreiber/tapiriik,cpfair/tapiriik,abhijit86k/tapiriik,cpfair/tapiriik,mjnbike/tapiriik,abs0/tapiriik,gavioto/tapiriik,mjnbike/tapiriik,cheatos101/tapiriik,brunoflores/tapiriik,marxin/tapiriik,brunoflores/tapiriik,dlenski/tapiriik,abs0/tapirii... | sync_scheduler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add work-in-progress script to fixup a standalone plugin library."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport subprocess\nimport os\n\nplugin = 'libVelodyneHDLPlugin.dylib'\nparaviewBuildDir = '/source/... | python | new_file | 2 | 9 | apache-2.0 | 2616d8f3ef51a8551ac14a9e83b0298b8165093a | frizaro/Veloview,frizaro/Veloview,Kitware/VeloView,Kitware/VeloView,Kitware/VeloView,Kitware/VeloView,frizaro/Veloview,frizaro/Veloview,Kitware/VeloView | Superbuild/Projects/apple/fixup_plugin2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that, if we failed to open the log file, we don't try to write to it."
},
{
"role": "assistant",
"content": "\"\"\"Test IPython.core.logger\"\"\"\n\nimport nose.tools as nt\n\n_ip = get_ipython()\n\ndef test_logstart_ina... | python | new_file | 2 | 3 | bsd-3-clause | 13fdc81cb32842dc5e0f05d2aa84c997cd59daa3 | ipython/ipython,ipython/ipython | IPython/core/tests/test_logger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new provider migration for osf registrations"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.7 on 2016-07-08 16:17\nfrom __future__ import unicode_literals\n\nfrom django.db import mi... | python | new_file | 1 | 0 | apache-2.0 | 76c25395590aa9dee64ca138633f01b62ac0d26b | aaxelb/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,zamattiac/SHARE,zamattiac/SHARE,zamattiac/SHARE,laurenbarker/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE | providers/io/osf/registrations/migrations/0001_initial.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create command for generating prices for flavors\n\n - itacloud-5319"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.core.m... | python | new_file | 1 | 3 | mit | 7c755e7839f7c602a6c93b1aa2f5011e89d15c85 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/iaas/management/commands/addmissingpricelistflavors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate data from contact_for_research_via and into contact_for_research_methods many to many field"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import ... | python | new_file | 1 | 4 | mit | 735135c5570edd38324fe3e94aa2f4c2f3043627 | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/legalaid/migrations/0023_migrate_contact_for_research_via_field.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create existing comments' owners records"
},
{
"role": "assistant",
"content": "# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICE... | python | new_file | 1 | 1 | apache-2.0 | 815ef4b4b0dce640077e1f8ecd2fbe95598bf539 | kr41/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,jo... | src/ggrc/migrations/versions/20160608132526_170e453da661_add_comments_owners_info.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test to validate the user creation"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\nfrom django.core.urlresolvers import reverse\nfrom django.test import TestCase\nfrom rest_framework import status\nfrom rest_frame... | python | new_file | 1 | 1 | mit | 57fe1a44c2285f39cc1454bbd6cfb3ce621348c3 | aligot-project/aligot,aligot-project/aligot,aligot-project/aligot,skitoo/aligot | aligot/tests/test_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new image moments functions"
},
{
"role": "assistant",
"content": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import (absolute_import, division, print_function,\n u... | python | new_file | 1 | 4 | bsd-3-clause | c9690cabe3c4d1d02307e3594a2cac505f4a166d | astropy/photutils,larrybradley/photutils | photutils/utils/_moments.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for auth service pre-run time validation checks."
},
{
"role": "assistant",
"content": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distribut... | python | new_file | 1 | 1 | apache-2.0 | 4afd2553625db404cdfedfcf336079b3d9d723e3 | StackStorm/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,tonybaloney/st2,tonybaloney/st2,nzlosh/st2,nzlosh/st2,tonybaloney/st2 | st2auth/tests/unit/test_validation_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix ProgramEditor permissions to not include Program delete"
},
{
"role": "assistant",
"content": "\n\"\"\"Fix ProgramEditor permissions\n\nRevision ID: 10adeac7b693\nRevises: 8f33d9bd2043\nCreate Date: 2013-10-10 00:12:57.391754... | python | new_file | 1 | 1 | apache-2.0 | 763680e57b28a9746050206cd63450bf11c3e512 | VinnieJohns/ggrc-core,prasannav7/ggrc-core,prasannav7/ggrc-core,AleksNeStu/ggrc-core,vladan-m/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,prasannav7/ggrc-core,hyperNURb/ggrc-core,selahssea/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,uskudnik/ggrc-core,NejcZupec/... | src/ggrc_basic_permissions/migrations/versions/20131010001257_10adeac7b693_fix_programeditor_pe.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for simple enums"
},
{
"role": "assistant",
"content": "import unittest\nfrom richenum import EnumConstructionException, enum\n\n\nBreakfast = enum(\n COFFEE=0,\n OATMEAL=1,\n FRUIT=2)\n\n\nclass SimpleEnumTest... | python | new_file | 1 | 2 | mit | 4a48b8dd804f9a287d35b697d851a660eec80a75 | adepue/richenum,hearsaycorp/richenum | tests/richenum/test_simple_enums.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create RequestHandler related to GCI.\n\n--HG--\nextra : rebase_source : 2b29958cb5939f0ea5b52fac58c7d18d7716299b"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2.5\n#\n# Copyright 2011 the Melange authors.\n#\n# Lic... | python | new_file | 1 | 2 | apache-2.0 | fde083c87f0e2582fbf57415e957b93d116ad67a | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gci/views/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test with many envs and large groups"
},
{
"role": "assistant",
"content": "# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT\n# All rights reserved. This work is under a BSD license, see LICENSE.TXT.\n\nfrom .. import Conf... | python | new_file | 1 | 1 | bsd-3-clause | 6857624e9d6633038f0565a520de856ee40def09 | lhupfeldt/multiconf | test/many_envs_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate existing platform admin services to not be counted\n\nIf a service has been created by someone on our team, it’s probably a\ntest service, which shouldn’t be included in the count of live services.\n\nThis commit adds a migration to ... | python | new_file | 3 | 1 | mit | 1f12da3d049527f838ab21c042b8f18e1977af49 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0283_platform_admin_not_live.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for switching to postgres search backend"
},
{
"role": "assistant",
"content": "from wolis.test_case import WolisTestCase\n\nclass SearchBackendPostgresTest(WolisTestCase):\n def test_set_search_backend(self):\n se... | python | new_file | 1 | 1 | bsd-2-clause | 0106355df43bc35a75aafc6b9070f78131e89bef | p/wolis-phpbb,p/wolis-phpbb | tests/search_backend_postgres.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make permission name more consistent."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.1 on 2016-10-15 15:36\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n... | python | new_file | 1 | 0 | mit | a4b242ebd107f9321cc5b87aee2cf608940007f4 | borderitsolutions/amadaa,borderitsolutions/amadaa,borderitsolutions/amadaa | product/migrations/0005_auto_20161015_1536.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ex2.2: multiple simple requests"
},
{
"role": "assistant",
"content": "from urllib.request import urlopen\nimport time\n\nURLS = [\n 'http://127.0.0.1:8000',\n 'http://127.0.0.1:8000',\n 'http://127.0.0.1:8000',\n]\n... | python | new_file | 1 | 2 | mit | 42af700af58588fccaa84f5348a5c854d095d1a9 | MA3STR0/PythonAsyncWorkshop | code/ex2.2-simple_requests.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 | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: DOC: Add an example for HybridContentsManager."
},
{
"role": "assistant",
"content": "# This example shows how to configure Jupyter/IPython to use the more complex\n# HybridContentsManager.\n\n# A HybridContentsManager implements... | python | new_file | 2 | 0 | apache-2.0 | ff2b86d90ecbc2da25ddc05b0430555861104cac | quantopian/pgcontents | examples/hybrid_manager_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for populating elasticsearch."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport json\nimport requests\nimport multiprocessing\nimport mwparserfromhell as mwp\n\nES_URL = 'htt... | python | new_file | 2 | 4 | mit | 1d55ad8fb8309918e7d41b4f443e16ebefbb1895 | eggpi/similarity,eggpi/similarity,eggpi/similarity | populate_elasticsearch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add outputter to display overstate stages"
},
{
"role": "assistant",
"content": "'''\nDisplay clean output of an overstate stage\n'''\n\n\n#[{'group2': {'match': ['fedora17-2', 'fedora17-3'],\n# 'require': ['group1'],... | python | new_file | 2 | 4 | apache-2.0 | 36af8c98005bfb6d51344b80a59cb6e48c8b55fb | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/overstatestage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Sin, Cos and Tan function classes"
},
{
"role": "assistant",
"content": "import function\nimport math\n\n\nclass Sin(function.Function):\n\n def _evaluate(self, x):\n return math.sin(x)\n\n\nclass Cos(function.Funct... | python | new_file | 1 | 2 | mit | 5fc6d9fc05bc4cae5588489c576744a518155461 | jackromo/mathLibPy | trig.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper method for execute a commands"
},
{
"role": "assistant",
"content": "\"\"\"Update conda packages on binstars with latest versions\"\"\"\nimport os\nimport six\nimport subprocess\nimport time\n\nATTEMPTS = 3\nRETRY_INTE... | python | new_file | 1 | 12 | mit | 5dfa4397a282ddbafb57d990bc7d630fb6f927de | alexandrucoman/bcbio-dev-conda,alexandrucoman/bcbio-dev-conda | build.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, cPickle as pickle\n\nfrom scrapy import signals\n\nclass SpiderState(object):\n \"\"\"Store and load spider state during a scraping job\"\"\"\n\n def __init__(self, jobdir=None):\n self.jobdir = jobdir\n\n @classm... | python | edit | 1 | 3 | bsd-3-clause | 626662f0f3ef2ce7de63c424da89263443243e97 | yarikoptic/scrapy,godfreyy/scrapy,coderabhishek/scrapy,coderabhishek/scrapy,yidongliu/scrapy,yusofm/scrapy,hectoruelo/scrapy,csalazar/scrapy,Timeship/scrapy,wangjun/scrapy,Zephor5/scrapy,profjrr/scrapy,Geeglee/scrapy,olafdietsche/scrapy,Geeglee/scrapy,beni55/scrapy,kimimj/scrapy,mlyundin/scrapy,amboxer21/scrapy,ramiro/... | scrapy/contrib/spiderstate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make start of ongoing and deadline activities just a date"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.17 on 2020-10-23 12:43\nfrom __future__ import unicode_literals\n\nfrom django.d... | python | new_file | 1 | 0 | bsd-3-clause | ba8be59db72c958e2ff20b9ae7fe81c400b40f9c | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/time_based/migrations/0008_auto_20201023_1443.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing module for merge script"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# coding=utf-8\n\nimport subprocess\n\nclass DiffMatcher(object):\n \n def __init__(self, listA, listB):\n self.listA = li... | python | new_file | 4 | 4 | mit | f4bb4d17214f4e359455cf7b5fb7ab973508049b | comphist/cora,comphist/cora,comphist/cora,comphist/cora,comphist/cora | bin/diffMatcher.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of using lower-level plotting methods directly"
},
{
"role": "assistant",
"content": "\"\"\"\nExample of how `ax.scatter` can be used to plot linear data on a stereonet\nvarying color and/or size by other variables.\n... | python | new_file | 1 | 0 | mit | 1b3d7078a4ca91ef07f90d1645f26761d1f7abac | joferkington/mplstereonet | examples/scatter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some Feed test cases"
},
{
"role": "assistant",
"content": "from tw.api import Widget\nfrom moksha.feed import Feed\n\nclass TestFeed(object):\n\n def test_feed_subclassing(self):\n class MyFeed(Feed):\n ... | python | new_file | 3 | 3 | apache-2.0 | e7e37e9b1fd56d18711299065d6f421c1cb28bac | pombredanne/moksha,lmacken/moksha,pombredanne/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha | moksha/tests/test_feed.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add needed track known class."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python \n'''\n@author jstober\n\nSimple class to track knowledge of states and actions. Based on \n\nL. Li, M. L. Littman, and C. R. Mansley, “On... | python | new_file | 3 | 2 | bsd-2-clause | d2a80a76fdf28625ad36b2fd71af56938b9b9506 | stober/lspi | src/trackknown.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make non-commtrack location types administrative"
},
{
"role": "assistant",
"content": "# One-off migration from 2016-04-04\nfrom optparse import make_option\nfrom time import sleep\nfrom django.core.management.base import BaseCo... | python | new_file | 2 | 3 | bsd-3-clause | 226cf36e4b4d069a920785b492804b78eebc34a5 | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/apps/locations/management/commands/migrate_admin_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2008-2009 Nokia Siemens Networks Oyj\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n... | python | edit | 1 | 2 | apache-2.0 | 5828823d505aae1425fd2353f898c5b18722e6e5 | caio2k/RIDE,fingeronthebutton/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,robotframework/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,caio2k/RIDE,caio2k/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE | src/robotide/ui/progress.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test passed for week day"
},
{
"role": "assistant",
"content": "(day, month, year) = input().split()\n\nday = int(day); month = int(month); year = int(year)\n\nif month < 3:\n month += 12\n year -= 1\n\nc = year / 100\nk = ... | python | new_file | 1 | 0 | mit | 2059aa7776a8e0c947b68e9401d74bdd146a59cd | sitdh/com-prog | ch03_04.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Notify-osd option for linux based systems"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals, division, absolute_import\nimport logging\n\nfrom flexget.plugin import register_plugin, priority, Depe... | python | new_file | 2 | 6 | mit | 9f443a5af6537867712f12419d93a5b8c824858a | jacobmetrick/Flexget,ratoaq2/Flexget,thalamus/Flexget,X-dark/Flexget,patsissons/Flexget,asm0dey/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,tobinjt/Flexget,poulpito/Flexget,sean797/Flexget,thalamus/Flexget,OmgOhnoes/Flexget,camon/Flexget,gazpachoking/Flexget,tsnoam/Flexget,v17al/Flexget,vfrc2/Flexget,drwyrm/Flexget,tsno... | flexget/plugins/output/notify_osd.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add 2 instance with EBS test.\n\nSeems to work even.\n\nChange-Id: Ie09d97dc86a68525783f1f9c080fed13e651ef78\nSigned-off-by: Ian Main <<EMAIL>>"
},
{
"role": "assistant",
"content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#... | python | new_file | 4 | 1 | apache-2.0 | d24e8c746359169058e9c0577c2f843695ca3b55 | citrix-openstack-build/heat,JioCloud/heat,dragorosson/heat,rh-s/heat,rickerc/heat_audit,noironetworks/heat,pshchelo/heat,jasondunsmore/heat,rh-s/heat,NeCTAR-RC/heat,cwolferh/heat-scratch,cryptickp/heat,miguelgrinberg/heat,varunarya10/heat,pratikmallya/heat,takeshineshiro/heat,ntt-sic/heat,pratikmallya/heat,redhat-opens... | heat/tests/functional/test_WordPress_2_Instances_With_EBS.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first version of Day One entry splitter"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nday_one_entry_splitter.py\n\nCreated by Rod Docking on 2017-01-01.\nAll rights reserved.\n\"\"\"... | python | new_file | 2 | 3 | mit | 2ae6f4183b2096287f8155d7db7e2ed0444618c4 | rdocking/bits_and_bobs | day_one_entry_splitter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Call the new presubmit checks from chrome/ code, with a blacklist.\n\nReview URL: http://codereview.chromium.org/400014\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98"
},
{
"role": ... | python | new_file | 1 | 1 | bsd-3-clause | 93b2d737407389a1c4dbc67836a949663eeba948 | junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,Jo... | chrome/PRESUBMIT.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create migration for draft dos1 briefs to dos2\n\nWhen DOS1 is closed for brief submissions and DOS2 opened, any supplier\nwho has a draft DOS1 brief will effectively lose it, as they'll be\nunable to publish it.\n\nThis migration will move ... | python | new_file | 1 | 1 | mit | 9f46cf4836ad555a54dc9c47b8b2843643a878f2 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/840_migrate_draft_dos1_briefs_to_draft_dos2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a help script to clear the test bucket"
},
{
"role": "assistant",
"content": "import os\nfrom qiniu import Auth, BucketManager\n\n\nQINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')\nQINIU_SECRET_KEY = os.environ.get('QIN... | python | new_file | 4 | 6 | mit | 673dac79cbab6de0be5650d46840a3bc9858b2b4 | glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,Mark-Shine/django-qiniu-storage,jackeyGao/django-qiniu-storage | tests/clear_qiniu_bucket.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for automatically updating schemas"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport re\nimport sys\nimport subprocess as sp\n\n\ndef get_schemas(pattern):\n\n cmd = ['git', 'grep', '... | python | new_file | 1 | 5 | bsd-3-clause | 51e516f260858e699ee828ac6fc91af39c67254c | spacetelescope/asdf-standard | update-schemas.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for the status server"
},
{
"role": "assistant",
"content": "import os\nimport select\nimport socket\nimport time\nimport unittest\n\nfrom jobmon.protocol import *\nfrom jobmon import protocol, status_server, transport... | python | new_file | 7 | 2 | bsd-2-clause | 666d9c467806782827edac4b2c0c13d494e41250 | adamnew123456/jobmon | jobmon/test/test_status_server.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for main\n\nMore to follow"
},
{
"role": "assistant",
"content": "from git_lang_guesser import main\nfrom git_lang_guesser import git_requester\n\n\nLANGUAGE = \"language\"\n\ntest_username = \"TestUser\"\nexample_data... | python | new_file | 1 | 1 | mit | 45b0e958aa377afed2c62bf1e6f7c4933ccde39b | robbie-c/git-lang-guesser | test/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix variable referenced before assginment in vmwareapi code.\n\nAdd unitests for VMwareapi vm_util.\nfix bug #1177689\n\nChange-Id: If16109ee626c197227affba122c2e4986d92d2df"
},
{
"role": "assistant",
"content": "# vim: tabstop=4... | python | new_file | 1 | 1 | apache-2.0 | b418ff779c79afd0eca85ed1479ba633f25ce73c | n0ano/ganttclient | nova/tests/test_vmwareapi_vm_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a new file to calculate features from sets of points"
},
{
"role": "assistant",
"content": "# Standard imports\nimport math\nimport logging\nimport numpy as np\nimport emission.core.common as ec\n\ndef calSpeed(point1, poi... | python | new_file | 4 | 2 | bsd-3-clause | 6988dab0256ce6b6e0d5cbb4b3ac06727956ee37 | shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-mission-server,shankari/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mi... | emission/analysis/point_features.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mgmt cmd to fix bad loc-type references"
},
{
"role": "assistant",
"content": "from optparse import make_option\n\nfrom django.core.management.base import BaseCommand\n\nfrom corehq.apps.locations.models import SQLLocation, L... | python | new_file | 4 | 6 | bsd-3-clause | 68e5bdc3c3a8a59f820ea15e706e85e14f2a654b | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/locations/management/commands/fix_loc_type_reference.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Verify computer executing the script is of OS X 10.6.1 or higher type"
},
{
"role": "assistant",
"content": "import platform\n\n\nclass OSXDodger(object):\n allowed_version = \"10.12.1\"\n\n def __init__(self, applications_... | python | new_file | 1 | 3 | mit | e1993d4d3c3199dce2be2b475a9236e95732a0f0 | yoda-yoda/osx-dock-dodger,denisKaranja/osx-dock-dodger | dodge.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for action groups."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom traits.testing.unittest_tools import UnittestTools, unittest\n\nfrom ...image_cache import ImageCache\nfrom ...win... | python | new_file | 4 | 1 | bsd-3-clause | 852ecb67e11f4ad9662c832d8be5f5bf1b8327b1 | geggo/pyface,brett-patterson/pyface,geggo/pyface | pyface/action/tests/test_group.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add vanilla sequential face detection example."
},
{
"role": "assistant",
"content": "\"\"\"Sequential, vanilla face detection.\"\"\"\n\nimport datetime\nimport sys\nimport cv2\nimport numpy as np\n\nimport util\nimport cascade\n... | python | new_file | 1 | 0 | mit | 8d38a72548f3bfc62bac9f49d537fa2cdee7a6df | vmlaker/sherlock | face1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first test for update_language_list function"
},
{
"role": "assistant",
"content": "# test_update_language_list\n\nfrom __future__ import unicode_literals\n\nimport json\nimport os\nimport os.path\n\nimport nose.tools as nose... | python | new_file | 1 | 3 | mit | a11d33f5e1df23f044cac709ebbbb5d369d0e6ca | caleb531/youversion-suggest,caleb531/youversion-suggest | tests/test_add_language/test_update_language_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of multi-layer chart"
},
{
"role": "assistant",
"content": "\"\"\"\nMultiple Marks\n==============\nThis example demonstrates creating a single chart with multiple markers\nrepresenting the same data.\n\"\"\"\nimport ... | python | new_file | 1 | 0 | bsd-3-clause | bd5fc565c5106d609a7dc65a663515920e29caa4 | jakevdp/altair,altair-viz/altair,ellisonbg/altair | altair/vegalite/v2/examples/multiple_marks.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom setuptools import setup\nfrom djangocms_link import __version__\n\n\nINSTALL_REQUIRES = [\n #'Django-Select2',\n]\n\nCLASSIFIERS = [\n 'Development Status :: 5 - Production/Stable',... | python | edit | 1 | 0 | bsd-3-clause | 092bf8bc2e558420ca51384a3dd1019ab1115ad2 | grigno/djangocms-link,brente/djangocms-link,addgene/djangocms-link,garmoncheg/djangocms-link,yakky/djangocms-link,yakky/djangocms-link,brente/djangocms-link,addgene/djangocms-link,grigno/djangocms-link,garmoncheg/djangocms-link | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add post-hook to handle the difference between project name and role name."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\n\n# Use symlink to handle the difference between proje... | python | new_file | 1 | 0 | mit | 76f636d38d6f3947efe6d58eacbd655027fc1a0e | FGtatsuro/cookiecutter-ansible-role,FGtatsuro/cookiecutter-ansible-role | hooks/post_gen_project.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD FEATURE : simple C/C++ compiler"
},
{
"role": "assistant",
"content": "from apps.decorators import on_command\nfrom apps.slackutils import cat_token\nfrom subprocess import check_output, CalledProcessError, STDOUT\nimport os\... | python | new_file | 1 | 6 | mit | e7c6a1d5ca6c6ebd85976698e8c00ca761747b59 | dgu-dna/DNA-Bot | apps/simple_compiler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Event class as well as connect and fire methods."
},
{
"role": "assistant",
"content": "class Event:\n def __init__(self):\n self.listeners = []\n\n def connect(self, listener):\n self.listeners.append(lis... | python | new_file | 1 | 2 | mit | bf6cfcaa1ac20c1cb65d2d803f64f35026c099f3 | bsmukasa/stock_alerter | event.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial block list for ad_block functionality"
},
{
"role": "assistant",
"content": "\"\"\"\nFor use with SeleniumBase ad_block functionality.\n\nUsage:\n On the command line:\n \"pytest SOME_TEST.py --ad_block\"\n\n ... | python | new_file | 1 | 0 | mit | 87172e2b9e0143cf164dc34c26c69fc4eda7dd1e | seleniumbase/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase | seleniumbase/config/ad_block_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a small tool to answer questions like \"Why does target A depend on target B\".\n\nBUG=none\nTEST=none\n\nReview URL: http://codereview.chromium.org/8672006\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@111430 0039d316-1c4b-428... | python | new_file | 12 | 7 | bsd-3-clause | 2d4f09fe8c31aa2b996e71565292d5ef249986c7 | yitian134/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/... | tools/gyp-explain.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper to run requested Python script"
},
{
"role": "assistant",
"content": "import pyseidon\nimport sys\n\ndef handle_script():\n import runpy\n \"\"\"\nAllow the client to run an arbitrary Python script.\n\nHere's sam... | python | new_file | 2 | 2 | mit | 7e7bd440a1e3f585464df3458070528d0100d456 | gdb/pyseidon,gdb/pyseidon | pyseidon/handlers/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add clustering metrics calculator file."
},
{
"role": "assistant",
"content": "\"Calculates Silhouette coefficient and Calinski-Harabaz index for a kmeans model.\"\nimport os, sys\nimport argparse, joblib\nfrom sklearn import met... | python | new_file | 1 | 3 | mit | f2044b0771f278c2a0de5cb69783b264a2d2363d | theovasi/browsewiki,theovasi/browsewiki,theovasi/browsewiki | cluster_metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Policy: Add new users to all deployments"
},
{
"role": "assistant",
"content": "from core.models import *\n\ndef handle(user):\n\tdeployments = Deployment.objects.all()\n\tsite_deployments = SiteDeployments.objects.all()\n\tsite_... | python | new_file | 11 | 7 | apache-2.0 | 3b182032ae092560b2423e77f657ec0794ce38e6 | cboling/xos,wathsalav/xos,cboling/xos,open-cloud/xos,opencord/xos,xmaruto/mcord,open-cloud/xos,wathsalav/xos,opencord/xos,wathsalav/xos,opencord/xos,zdw/xos,jermowery/xos,jermowery/xos,zdw/xos,zdw/xos,cboling/xos,wathsalav/xos,open-cloud/xos,xmaruto/mcord,zdw/xos,jermowery/xos,xmaruto/mcord,xmaruto/mcord,cboling/xos,cb... | planetstack/model_policies/model_policy_User.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plot of days per year with precip"
},
{
"role": "assistant",
"content": "import matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nimport psycopg2.extras\nimport pyiem.nws.vtec as vtec\nfrom pyiem.network imp... | python | new_file | 5 | 2 | mit | 72af391ec00facfbabc8ac89ff3bea1b54799d97 | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | htdocs/plotting/auto/scripts/p50.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test fail cases for custom codegen"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom numba import boolean, njit, int64, TypingError\nfrom slumba.numbaext import not_null, sizeof, unsafe_cast\n\n\ndef test_sizeof_invali... | python | new_file | 1 | 1 | apache-2.0 | a3f23b804265bd59473873c2aa071188a73a9a9e | cpcloud/slumba,cpcloud/slumba | slumba/tests/test_numbaext.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [New] :: Check if a given sequence of moves for a robot is circular or not (py)"
},
{
"role": "assistant",
"content": "from operator import add\nimport math\n\nmoves = raw_input(\"Enter the moves: \")\n\nstart_position = [0,0]\nc... | python | new_file | 3 | 0 | apache-2.0 | 5e32d890fe0762163f1edab6672df91e7d461d8f | MayankAgarwal/GeeksForGeeks | check-if-a-given-sequence-of-moves-for-a-robot-is-circular-or-not.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the serial python test"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom serial import Serial\nfrom time import sleep\n\nser = Serial('/dev/ttyUSB0', 9600)\nsleep(3) # wait for the board to reset\n\nprint \... | python | new_file | 10 | 0 | apache-2.0 | a1ae01bada1d500bd7f9f7f0f2deb458bfa6d2d1 | Pitchless/arceye,Pitchless/arceye | bin/serial_test.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the IPython version helper"
},
{
"role": "assistant",
"content": "from __future__ import (division, print_function, absolute_import,\n unicode_literals)\n\nfrom IPython import version_info\n\n\ndef ipyt... | python | new_file | 1 | 2 | bsd-3-clause | bfd85c18e788c4e89569f7a35fa85d80d3bcd031 | astrofrog/reducer,astrofrog/reducer,StuartLittlefair/reducer,StuartLittlefair/reducer,mwcraig/reducer | reducer/ipython_version_helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom billy import __version__\n\nlong_description = open('README.rst').read()\n\nsetup(name='billy',\n version=__version__,\n packages=find_packages(),\n pac... | python | edit | 1 | 0 | bsd-3-clause | 6e601d9720139bbb04c1fd30dc6552730270ba0a | sunlightlabs/billy,loandy/billy,mileswwatkins/billy,sunlightlabs/billy,openstates/billy,loandy/billy,loandy/billy,openstates/billy,mileswwatkins/billy,mileswwatkins/billy,sunlightlabs/billy,openstates/billy | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Tasks sample that demonstrates Service accounts.\n\nReviewed in http://codereview.appspot.com/5685068/.\n\nIndex: samples/service_account/books.py\n===================================================================\nnew file mode 1006... | python | new_file | 2 | 1 | apache-2.0 | 4c46b7b86171b89f0c85f6d48eaf6d24e702c6f9 | jonparrott/oauth2client,clancychilds/oauth2client,googleapis/oauth2client,jonparrott/oauth2client,clancychilds/oauth2client,googleapis/google-api-python-client,googleapis/google-api-python-client,googleapis/oauth2client,google/oauth2client,google/oauth2client | samples/service_account/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove the IR target type in migration."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration... | python | new_file | 1 | 0 | apache-2.0 | 1f043dd959fa1e1d243a3278abeb66838a2f9305 | justineaster/interop,auvsi-suas/interop,justineaster/interop,justineaster/interop,auvsi-suas/interop,justineaster/interop,auvsi-suas/interop,auvsi-suas/interop,justineaster/interop | server/auvsi_suas/migrations/0013_remove_ir_as_target_type.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom __future__ import unicode_literals\n\nfrom .auth.jwt_auth import JWTAuth\nfrom .auth.oauth2 import OAuth2\nfrom .client import Client\nfrom .object import * # pylint:disable=wildcard-import,redefined-builtin\n\n```\... | python | edit | 5 | 0 | apache-2.0 | f301dd2366f53a6cf4b0949942b8520502f54351 | Tusky/box-python-sdk,sanketdjain/box-python-sdk,sanketdjain/box-python-sdk,Frencil/box-python-sdk,samkuehn/box-python-sdk,lkabongoVC/box-python-sdk,Frencil/box-python-sdk,box/box-python-sdk,lkabongoVC/box-python-sdk,samkuehn/box-python-sdk | boxsdk/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initializer for top-level '_gcloud_vendor' package."
},
{
"role": "assistant",
"content": "\"\"\"Dependencies \"vendored in\", due to dependencies, Python versions, etc.\n\nCurrent set\n-----------\n\n``apitools`` (pending... | python | new_file | 1 | 0 | apache-2.0 | 334961054d875641d150eec4d6938f6f824ea655 | optimizely/gcloud-python,jgeewax/gcloud-python,lucemia/gcloud-python,tseaver/google-cloud-python,dhermes/google-cloud-python,elibixby/gcloud-python,tseaver/gcloud-python,daspecster/google-cloud-python,GrimDerp/gcloud-python,blowmage/gcloud-python,jonparrott/google-cloud-python,tseaver/google-cloud-python,GoogleCloudPla... | _gcloud_vendor/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests - now very simple and primitive"
},
{
"role": "assistant",
"content": "import unittest\nfrom saw.saw import Saw\n\nclass Test_Saw(unittest.TestCase):\n\n def setUp(self):\n text = \"Starting right this second,... | python | new_file | 1 | 1 | mit | 54eca489024d3d8f354a44d161797edb8e916600 | diNard/Saw | tests/test_saw.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add auto fixture to make sure that output dir does not exists when tests are run"
},
{
"role": "assistant",
"content": "from static_precompiler.settings import ROOT, OUTPUT_DIR\nimport shutil\nimport os\nimport pytest\n\n\n@pytes... | python | new_file | 1 | 2 | mit | 61677566ce685379456e7853c69a78ea32353422 | liumengjun/django-static-precompiler,liumengjun/django-static-precompiler,paera/django-static-precompiler,jaheba/django-static-precompiler,paera/django-static-precompiler,jaheba/django-static-precompiler,paera/django-static-precompiler,jaheba/django-static-precompiler,paera/django-static-precompiler,jaheba/django-stati... | static_precompiler/tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fibonacci search in python"
},
{
"role": "assistant",
"content": "#Fibonacci search for sorted algorithm\ndef fibSearch(arr,x):\n\n #fibonacci numbers initialization\n fib2 = 0\n fib1 = 1\n fib = fib2 + fib1\n\n ... | python | new_file | 1 | 7 | cc0-1.0 | 30f704c3e767462fefb5086bbf6b5f190cec7c1b | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | search/fibonacci_search/python/fibonacci_search.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that data volumes now survive a crash when recreating\n\nSigned-off-by: Aanand Prasad <<EMAIL>>"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\nfrom __future__ import absolute_import\n\nimport... | python | new_file | 1 | 1 | apache-2.0 | ff151c8ea04268d2060cf8d281294a0d500ecbba | marcusmartins/compose,alexandrev/compose,alunduil/fig,sanscontext/docker.github.io,dopry/compose,aanand/fig,tangkun75/compose,danix800/docker.github.io,cclauss/compose,tiry/compose,joaofnfernandes/docker.github.io,Yelp/docker-compose,BSWANG/denverdino.github.io,twitherspoon/compose,alunduil/fig,rillig/docker.github.io,... | tests/integration/resilience_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test that fails if using an old version of chromedriver"
},
{
"role": "assistant",
"content": "from seleniumbase import BaseCase\n\n\nclass ChromedriverTests(BaseCase):\n\n def test_fail_if_using_an_old_chromedriver(self... | python | new_file | 1 | 4 | mit | dc3ee951363116b235ec96bef34b06a661fc4795 | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | examples/fail_if_old_driver_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check for multiple outcome codes occurring today"
},
{
"role": "assistant",
"content": "# coding=utf-8\nimport logging\nfrom django.core.management.base import BaseCommand\nfrom django.db.models import Count, Max, Min\nfrom djang... | python | new_file | 1 | 4 | mit | 1bd21c7b35a100e0f72f03bd9e0d783dc136c41e | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/cla_butler/management/commands/monitor_multiple_outcome_codes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for sdnvpn\n\nChange-Id: Ie4ebc4e2bc6f2e66f5f567f45f44c073cd9d313d\nSigned-off-by: Cédric Ollivier <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Copyright (c) 2017 Orange and others.\n... | python | new_file | 1 | 1 | apache-2.0 | 48fc7cad7eb4cec0b928aba3daca7e934d46d87c | opnfv/functest,mywulin/functest,mywulin/functest,opnfv/functest | functest/tests/unit/features/test_sdnvpn.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small python script which calculates how much disk space we save by using CAS"
},
{
"role": "assistant",
"content": "import os\nimport pymongo\nfrom collections import Counter\n\ndb_uri = os.getenv('SCITRAN_PERSISTENT_DB_URI'... | python | new_file | 1 | 4 | mit | 8e175782c3b79e64d543fb478b146d308d2a2ad8 | scitran/api,scitran/core,scitran/core,scitran/core,scitran/core,scitran/api | bin/oneoffs/cas_statistic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom nose2.tests._common import FunctionalTestCase\n\nclass CollectOnlyFunctionalTest(FunctionalTestCase):\n def test_collect_tests_in_package(self):\n self.assertTestRunOutputMatches(\n self.runIn('scenari... | python | edit | 1 | 1 | bsd-2-clause | 0f9f4f1ee325d72d09625850ba6a153ae5616ab0 | ptthiem/nose2,little-dude/nose2,little-dude/nose2,leth/nose2,ojengwa/nose2,ezigman/nose2,ojengwa/nose2,ezigman/nose2,leth/nose2,ptthiem/nose2 | nose2/tests/functional/test_collect_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an extra file to the surrogates experiments."
},
{
"role": "assistant",
"content": "import darch.search_logging as sl\nimport darch.visualization as vi\nimport numpy as np\nimport seaborn as sns; sns.set()\n\n# checking these... | python | new_file | 1 | 0 | mit | 422b9458d26866b9f6692ddb0ccf2305c3ac6ea7 | negrinho/deep_architect,negrinho/deep_architect | dev/surrogates/plots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool script to print errors statistics in output JSON files."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nMake statistics on score files (stored in JSON files).\n\"\"\"\n... | python | new_file | 3 | 5 | mit | a91b633ba88a01b12305fdfafd570c0b3776b42d | jdhp-sap/sap-cta-data-pipeline,jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/sap-cta-data-pipeline,jdhp-sap/data-pipeline-standalone-scripts | utils/print_num_errors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Add a test of spline filtering vs. matrix solving."
},
{
"role": "assistant",
"content": "\"\"\"Tests for spline filtering.\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport numpy as np\nimpor... | python | new_file | 1 | 8 | bsd-3-clause | 660e0955979b7d11b7442a00747673700413bf1d | mdhaber/scipy,rgommers/scipy,andyfaff/scipy,lhilt/scipy,mdhaber/scipy,jamestwebber/scipy,grlee77/scipy,jamestwebber/scipy,aeklant/scipy,perimosocordiae/scipy,perimosocordiae/scipy,person142/scipy,zerothi/scipy,WarrenWeckesser/scipy,anntzer/scipy,perimosocordiae/scipy,Stefan-Endres/scipy,andyfaff/scipy,vigna/scipy,jor-/... | scipy/ndimage/tests/test_splines.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to normalize image using Ops"
},
{
"role": "assistant",
"content": "# @Dataset data\n# @OpService ops\n# @OUTPUT Img normalized\n\n# Create normalized image to the [0, 1] range.\n#\n# Stefan Helfrich (University of Kon... | python | new_file | 10 | 0 | bsd-2-clause | 06e7dd815a77739089b2ad0aed5cb9f01a194967 | bic-kn/imagej-scripts | Normalize_Image.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test case to exercise the 'target stop-hook add' command without relying on pexpect\nto spawn an lldb child command. The test is not \"correct\" in that the '** Stop Hooks **'\nmessage emitted by the Target implementation is invoked a... | python | new_file | 13 | 1 | apache-2.0 | dc1d43acb5730bd9b555b63aa589b0eeceb14e52 | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | test/stop-hook/TestStopHookCmd.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some example client code"
},
{
"role": "assistant",
"content": "\"\"\"\nCopyright 2015 Red Hat, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the... | python | new_file | 1 | 4 | apache-2.0 | 250e0d2d0e2264b83a82548df3b30dbc784a4fe5 | twaugh/docker-registry-client,yodle/docker-registry-client | docker-registry-show.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for file storage engine"
},
{
"role": "assistant",
"content": "from jacquard.storage.file import FileStore\n\n\ndef test_get_nonexistent_key():\n # Just test this works without errors\n store = FileStore(':memory:... | python | new_file | 1 | 2 | mit | 0b47397b91fec94910f18ea1711184ecfd0f6bf0 | prophile/jacquard,prophile/jacquard | jacquard/storage/tests/test_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration to drop mandatory assessment methods from brief data\n\nRemoves work history and written proposal from all briefs, since\nthey're no longer a valid option for evaluationType and are added\nautomatically to all briefs.\n\nDown... | python | new_file | 1 | 7 | mit | 4a404709081515fa0cc91683b5a9ad8f6a68eae6 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/630_remove_mandatory_assessment_methods_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for generic hash"
},
{
"role": "assistant",
"content": "# Import nacl libs\nimport libnacl\n\n# Import python libs\nimport unittest\n\n\nclass TestGenericHash(unittest.TestCase):\n '''\n Test sign functions\n '... | python | new_file | 1 | 1 | apache-2.0 | 83bcb62c98c406e2aa6ce6a9a98750d0b565f750 | mindw/libnacl,johnttan/libnacl,cachedout/libnacl,coinkite/libnacl,saltstack/libnacl,RaetProtocol/libnacl | tests/unit/test_raw_generichash.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add problem delete note in a linked list"
},
{
"role": "assistant",
"content": "# https://leetcode.com/problems/delete-node-in-a-linked-list/\n\n# Definition for singly-linked list.\n# class ListNode(object):\n# def __init__(... | python | new_file | 1 | 3 | mit | 75131bdf806c56970f3160de3e6d476d9ecbc3a7 | guozengxin/myleetcode,guozengxin/myleetcode | python/deleteNodeInALinkedList.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to generate JSON bigram frequencies for English"
},
{
"role": "assistant",
"content": "import json\nimport lxml.html\nfrom lxml.cssselect import CSSSelector\nimport requests\nimport sys\n\n\ndef main():\n raw = re... | python | new_file | 2 | 3 | apache-2.0 | 064124d09973dc58a444d22aa7c47acf94f8fa81 | Kitware/clique,Kitware/clique,XDATA-Year-3/clique,XDATA-Year-3/clique,Kitware/clique,XDATA-Year-3/clique | data/bigramfreq.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Client class to abstract from different datbase clients"
},
{
"role": "assistant",
"content": "import importlib\nimport os\n\nclass DBClient:\n\n db_defaults = {'mongo': 'mongodb://localhost:27017/',\n 'r... | python | new_file | 3 | 2 | mit | 6fdf7cc68e05ce6e8e18306eca7d8e36d1a166ea | wearhacks/hackathon_hotline | hotline/db/db_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a view that serves a single static file"
},
{
"role": "assistant",
"content": "import os\n\nimport tornado.web\nimport tornado.ioloop\n\n\nclass SingleStatic(tornado.web.StaticFileHandler):\n def initialize(self, path):\n ... | python | new_file | 1 | 1 | mit | 1ede9bd211cd8ea6aac4db6f8818804cb778a022 | chrisseto/dinosaurs.sexy,chrisseto/dinosaurs.sexy | dinosaurs/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example of force https"
},
{
"role": "assistant",
"content": "\"\"\"An example of using a middleware to require HTTPS connections.\n requires https://github.com/falconry/falcon-require-https to be installed via\n pip in... | python | new_file | 1 | 1 | mit | 190df1378844c6294c6f48ad6cb0272f2146fc48 | timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug | examples/force_https.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.