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 test for eye and identity"
},
{
"role": "assistant",
"content": "import unittest\n\nimport numpy\n\nfrom cupy import testing\n\n\n@testing.parameterize(*testing.product({\n 'dtype': [numpy.float32, numpy.float64],\n 'fo... | python | new_file | 1 | 1 | mit | 597938ad9fd4117fd5bd43f492983a0364cdf276 | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | tests/cupy_tests/sparse_tests/test_construct.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple example of using VDS"
},
{
"role": "assistant",
"content": "'''A simple example of building a virtual dataset.\n\nThis makes four 'source' HDF5 files, each with a 1D dataset of 100 numbers.\nThen it makes a single 4x10... | python | new_file | 1 | 0 | bsd-3-clause | 9b38539c1828af1c45ac736fccda907cded65c24 | h5py/h5py,h5py/h5py,h5py/h5py | examples/vds_simple.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add connect_to_region to beanstalk module."
},
{
"role": "assistant",
"content": "# Copyright (c) 2013 Mitch Garnaat http://garnaat.org/\n# Copyright (c) 2013 Amazon.com, Inc. or its affiliates.\n# All Rights Reserved\n#\n# Permi... | python | new_file | 1 | 3 | mit | 4f6fde8329b0873f3568ce7153dc64017f5bc0cb | jamesls/boto,appneta/boto,rjschwei/boto,SaranyaKarthikeyan/boto,drbild/boto,lra/boto,weebygames/boto,revmischa/boto,s0enke/boto,pfhayes/boto,drbild/boto,khagler/boto,dimdung/boto,Timus1712/boto,trademob/boto,alex/boto,nishigori/boto,jindongh/boto,janslow/boto,garnaat/boto,alfredodeza/boto,jameslegg/boto,disruptek/boto,... | boto/beanstalk/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the type map builder"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom polygraph.types.decorators import field\nfrom polygraph.types.object_type import ObjectType\nfrom polygraph.types.sca... | python | new_file | 1 | 1 | mit | 12f51ce0d5e6c67e15ba3d60c21523a28d29b964 | polygraph-python/polygraph | polygraph/types/tests/test_type_map.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for asserting text in a PDF file"
},
{
"role": "assistant",
"content": "from seleniumbase import BaseCase\n\n\nclass PdfTestClass(BaseCase):\n\n def test_assert_pdf_text(self):\n\n # Assert PDF contains the e... | python | new_file | 1 | 1 | mit | c18519b4f5f7cbac24e053df422d83733d6963f6 | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | examples/test_pdf_asserts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add loader for spaCy, with singleton"
},
{
"role": "assistant",
"content": "import spacy\n\nSPACY_MODELS = {}\n\ndef get_spacy(lang, parser=False, tagger=False, entity=False):\n global SPACY_MODELS\n if spacy is None:\n ... | python | new_file | 1 | 3 | mit | 27d975bf84122ec62f96ddae4777e177d562bf7e | spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | thinc/extra/load_nlp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up test file and add tests on quoted_split()."
},
{
"role": "assistant",
"content": "# Copyright 2013 Rackspace\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# ... | python | new_file | 3 | 1 | apache-2.0 | f665fd7c8e3100427d589c9f82c847526aa41c86 | klmitch/aversion | test_aversion.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an appengine users API auth backend"
},
{
"role": "assistant",
"content": "from django.contrib.auth.models import User, UserPermissionStorage\n\nclass AppEngineUserAPI(object):\n \"\"\"\n A custom Django authenticat... | python | new_file | 1 | 5 | bsd-3-clause | 9e8bce87c10e14a1961cab1a6a0275d8008b590e | armirusco/djangae,jscissr/djangae,stucox/djangae,stucox/djangae,leekchan/djangae,jscissr/djangae,pablorecio/djangae,asendecka/djangae,kirberich/djangae,martinogden/djangae,pablorecio/djangae,potatolondon/djangae,jscissr/djangae,chargrizzle/djangae,pablorecio/djangae,chargrizzle/djangae,trik/djangae,leekchan/djangae,grz... | djangae/contrib/auth/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Anytown Maps utils library"
},
{
"role": "assistant",
"content": "\"\"\"Functions to retrieve images for the maps.\"\"\"\n\n\ndef _retrieve_google_maps_image_url(coords, zoom_level):\n lat, lng = coords\n return (\n ... | python | new_file | 1 | 1 | mit | c466242d652683f8d22164f7b322399100961bcc | andrewyang96/AnytownMapper,andrewyang96/AnytownMapper,andrewyang96/AnytownMapper | anytownlib/maps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for SCP operations."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom jarn.mkrelease.scp import SCP\n\n\nclass HasHostTests(unittest.TestCase):\n\n def test_simple(self):\n scp = SCP()\n se... | python | new_file | 1 | 1 | bsd-2-clause | 79dc92f7089e26f7751fdd8ef53543922750e41d | Jarn/jarn.mkrelease | jarn/mkrelease/tests/test_scp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a default variable plugin\n\nAs it stands right now, there are a number of scenarios where we would\nlike to be more DRY. We have multiple environments that we support and\ncopying and pasting variables from one environment to the next i... | python | new_file | 1 | 3 | mit | 31a42391445846cf2c8c4ace5319df92df8e5e96 | nirajdp76/ursula,narengan/ursula,pbannister/ursula,nirajdp76/ursula,pgraziano/ursula,davidcusatis/ursula,edtubillara/ursula,j2sol/ursula,MaheshIBM/ursula,masteinhauser/ursula,knandya/ursula,blueboxjesse/ursula,twaldrop/ursula,sivakom/ursula,nirajdp76/ursula,blueboxgroup/ursula,greghaynes/ursula,rongzhus/ursula,blueboxj... | plugins/vars/default_vars.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test on basic PCH behavior: bulid a simple executable and a simple shared lib"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# __COPYRIGHT__\n#\n# Permission is hereby granted, free of charge, to any perso... | python | new_file | 3 | 0 | mit | 58c55d65cc32f673a378a65772e7ae447907994e | timj/scons,timj/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,timj/scons,timj/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,timj/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons | test/MSVC/pch-basics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce Keras TF atrous bug"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom keras.models import Model\nfrom keras.layers import Input, AtrousConvolution1D\n\ninp = Input((100, 1))\nM = AtrousConvolution1D(1, 2, ... | python | new_file | 1 | 0 | apache-2.0 | b9a28ad7358b64211905957ef854026cf03764c8 | israelg99/eva | keras_tf_atrous_bug.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to generate PaaS manifest with environment variables\n\n`./scripts/generate_manifest.py` takes a path to a PaaS manifest file\nand a list of variable files and prints a single CloudFoundry manifest.\n\nThe generated manifest rep... | python | new_file | 1 | 5 | mit | da1a7ceb0dafdeb14b366139e0ec13fe95c55c00 | alphagov/notifications-api,alphagov/notifications-api | scripts/generate_manifest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to identify stale custom modules"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport csv\n... | python | new_file | 1 | 7 | bsd-3-clause | 86de63f819a67aafd71e1565266e1bec09bc62c2 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/accounting/management/commands/find_inactive_custom_modules.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add monitoring daemon for correlator control state"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- mode: python; coding: utf-8 -*-\n# Copyright 2018 the HERA Collaboration\n# Licensed under the 2-clause BSD l... | python | new_file | 5 | 0 | bsd-2-clause | d70f973b8b77ad30f6c6d893adda90d2a084d7bb | HERA-Team/hera_mc,HERA-Team/Monitor_and_Control,HERA-Team/hera_mc | scripts/mc_monitor_correlator.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a fixture for dealing with mock patching.\n\nQuantum uses a pattern all over their test base, which can be\ncollapsed down into a simple re-usable fixture.\n\nChange-Id: I5944505ce44ce8b79a685c3ea392f001307b5319"
},
{
"role": "as... | python | new_file | 1 | 1 | apache-2.0 | b1af7e4d1a6ee0b954406af5a65936a011db3269 | openstack/oslotest,openstack/oslotest | openstack/common/fixture/mockpatch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add monitored model auth backend"
},
{
"role": "assistant",
"content": "from django.contrib.auth.backends import ModelBackend\n\nfrom .decorators import monitor_login\n\n\nclass MonitoredModelBackend(ModelBackend):\n\n @monito... | python | new_file | 1 | 1 | bsd-3-clause | 2d88b2ffaa3c6348fcc246185e48abc52ee8804d | mysociety/django-failedloginblocker | backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Dargonflow DFDaemon base class\n\nChange-Id: Ie84681792cdc13b3127a95a18121d4b9a8ff8dba"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file ex... | python | new_file | 1 | 3 | apache-2.0 | b47bf6a862075af25d7dbfa022f403997474414d | FrankDuan/df_code,openstack/dragonflow,openstack/dragonflow,FrankDuan/df_code,FrankDuan/df_code,openstack/dragonflow | dragonflow/common/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that spawns of primitive generators produce the same elements as the original"
},
{
"role": "assistant",
"content": "import pytest\nfrom .exemplar_generators import EXEMPLAR_PRIMITIVE_GENERATORS\n\n\n@pytest.mark.paramet... | python | new_file | 1 | 1 | mit | 551f3de948b6b0a7338dbb2e1783a407b724fc04 | maxalbert/tohu | tests/v6/test_spawn_primitive_generators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport re\nimport sys\n\n\ndef main(argv):\n examples = {}\n requires = set()\n for filename in argv[1:]:\n lines = open(filename, 'rU').readlines()\n if len(lines) > 0 and lines[0].startswith('//... | python | edit | 3 | 11 | bsd-2-clause | 55755871c240289238072602eefd9eed14d7e70e | elemoine/ol3,gingerik/ol3,itayod/ol3,stweil/ol3,bill-chadwick/ol3,epointal/ol3,adube/ol3,denilsonsa/ol3,fblackburn/ol3,xiaoqqchen/ol3,bogdanvaduva/ol3,landonb/ol3,tsauerwein/ol3,klokantech/ol3,landonb/ol3,bjornharrtell/ol3,llambanna/ol3,gingerik/ol3,gingerik/ol3,Distem/ol3,bjornharrtell/ol3,Distem/ol3,richstoner/ol3,kl... | bin/combine-examples.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to delete old launch configuration"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport re\nimport sys\nimport boto.ec2.autoscale\nfrom boto.ec2.autoscale import LaunchConfiguration\n\ndef main(REGION... | python | new_file | 3 | 2 | mit | a840dfbcfbefd2827226c4b27aa29cf7854dc36a | tendant/aws-script | autoscaling/delete-old-launch-configuration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use instructor instead of professor"
},
{
"role": "assistant",
"content": "\"\"\"professor => instructor\n\nRevision ID: 3fab9480c190\nRevises: 31ded1f6ad6\nCreate Date: 2014-02-17 00:56:12.566690\n\n\"\"\"\n\n# revision identifi... | python | new_file | 1 | 1 | bsd-2-clause | b39d03cf5e4ca514da6e8d0f20e0d5e8960c191c | morelab/weblabdeusto,zstars/weblabdeusto,weblabdeusto/weblabdeusto,porduna/weblabdeusto,weblabdeusto/weblabdeusto,morelab/weblabdeusto,weblabdeusto/weblabdeusto,zstars/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,porduna/weblabdeusto,zstars/weblabdeusto,weblabdeusto/weblabdeusto,porduna/w... | server/src/weblab/db/upgrade/regular/versions/3fab9480c190_professor_instructor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a python script to schedule runs on browserstack"
},
{
"role": "assistant",
"content": "\"\"\"\nSubmits the apks to BrowserStack to run the instrumentation tests.\n\"\"\"\n\nimport os\nimport shlex\nimport subprocess\nfrom su... | python | new_file | 3 | 1 | apache-2.0 | 3ba0b1cde749d92a6966e45e29c1dcf8fee54a0d | dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android | scripts/instrumentationRunner.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove customer billing backend id\n\n - nc-1554"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.... | python | new_file | 3 | 0 | mit | 4c4bf05e34d46a396c3ac124c5f78bf37d142580 | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/migrations/0037_remove_customer_billing_backend_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the published keyword search proggy"
},
{
"role": "assistant",
"content": "import sys\nimport xml.etree.ElementTree as ET\n\n\n\n\ndef getkeywords(filename):\n\n with open(filename) as kwfile:\n terms = ()\n ... | python | new_file | 13 | 8 | mit | ecf0105a48c479f28d2e83a5816ab9b021186562 | ijjorama/Impact | REF/search-by-keyword.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for easy ipython imports"
},
{
"role": "assistant",
"content": "import numpy as np\nimport pandas as pd\nimport matplotlib_venn\nimport matplotlib.pyplot as plt\nimport brewer2mpl\n\nset1 = brewer2mpl.get_map('Set1', 'qu... | python | new_file | 6 | 0 | mit | 2192cf4caa93a2b9c2a4332ba59c40175e8f977b | YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts | gscripts/ipython_imports.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add largedatatest for testing a large data set from an hdf5 file"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport h5py\nimport random\n\n\nX = 500\nY = 500\n\nf = h5py.File('/tmp/test-datafile.hdf5', 'w')\nd... | python | new_file | 3 | 0 | apache-2.0 | 149c546cb70f45ee8128966bfe1af8e8a10958b0 | matyasselmeci/dask_condor,matyasselmeci/dask_condor | largedatatest/createdata.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a split violin example script"
},
{
"role": "assistant",
"content": "\"\"\"\nGrouped violinplots with split violins\n======================================\n\n\"\"\"\nimport seaborn as sns\nsns.set(style=\"darkgrid\", palette... | python | new_file | 1 | 0 | bsd-3-clause | 790163173efb34e2b9b0ad0d8927057836f0ad51 | jat255/seaborn,clarkfitzg/seaborn,bsipocz/seaborn,uhjish/seaborn,mwaskom/seaborn,ashhher3/seaborn,sinhrks/seaborn,sauliusl/seaborn,q1ang/seaborn,nileracecrew/seaborn,lypzln/seaborn,phobson/seaborn,mwaskom/seaborn,arokem/seaborn,lukauskas/seaborn,olgabot/seaborn,parantapa/seaborn,muku42/seaborn,anntzer/seaborn,kyleam/se... | examples/grouped_violinplots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for shuffling the first axis of each entry in a h5 file"
},
{
"role": "assistant",
"content": "from __future__ import division\n\nimport argparse\nimport numpy as np\nimport h5py\n\ndef main():\n parser = argparse.A... | python | new_file | 1 | 3 | mit | fa5d8bbd194a7903d1f6cdc8057a76a4f3752b21 | alexlee-gk/visual_dynamics | h5shuffle.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 553. Optimal Division\n\n553. Optimal Division: https://leetcode.com/problems/optimal-division/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def optimalDivision(self, nums):\n \"\... | python | new_file | 3 | 13 | apache-2.0 | 1098f43d5fb02328ce4708bd5a8c1b5f8ac23f51 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/optimal-division.py | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a class for getting meta info from a songlist"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom __future__ import absolute_import\n\nimport re\n\nimport requests\nfrom lxml import... | python | new_file | 1 | 3 | mit | 0ebd6e8e5e8c09f15e6170de03965de150edca22 | lord63/wangyi_music_top100,lord63/wangyi_music_top100,lord63/wangyi_music_top100 | crawler/crawler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unittest for spacegroup. Still very basic."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n'''\nCreated on Mar 12, 2012\n'''\n\nfrom __future__ import division\n\n__author__=\"Shyue Ping Ong\"\n__copyright__... | python | new_file | 3 | 5 | mit | ad5f851b7959f7bf09d7cd669d8db126fa962982 | migueldiascosta/pymatgen,yanikou19/pymatgen,sonium0/pymatgen,migueldiascosta/pymatgen,ctoher/pymatgen,sonium0/pymatgen,Dioptas/pymatgen,rousseab/pymatgen,Bismarrck/pymatgen,yanikou19/pymatgen,Bismarrck/pymatgen,sonium0/pymatgen,rousseab/pymatgen,Bismarrck/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,mig... | pymatgen/symmetry/tests/test_spacegroup.py | rejected_duplicate | Near-duplicate of sample 6001 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Iterative deepening depth-first algorithm"
},
{
"role": "assistant",
"content": "\"\"\"\npynpuzzle - Solve n-puzzle with Python\n\nIterative deepening depth-first search algorithm\n\nVersion : 1.0.0\nAuthor : Hamidreza Mahdav... | python | new_file | 1 | 5 | mit | 669a2edf8fd92b8473a8e4fe45ff2afb41babfbb | mahdavipanah/pynpuzzle | algorithms/ids.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration for unaccent\n\nThis is on top of https://github.com/caktus/django-opendebates/pull/88"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.core.ma... | python | new_file | 3 | 1 | apache-2.0 | f25275dd2a65c9b962df3b522981d595c2d3809f | ejucovy/django-opendebates,ejucovy/django-opendebates,ejucovy/django-opendebates,caktus/django-opendebates,ejucovy/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates | opendebates/migrations/0017_enable_unaccent.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial URL history importer"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Copyright 2009 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n... | python | new_file | 3 | 0 | apache-2.0 | b8a410bc2f54a89e0e44100a890183fcd6a88e3e | jimmsta/namebench-1,catap/namebench | tools/convert-url-history.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example script that downloads DEP daily shapefiles"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"Example script to download daily shapefiles from the dailyerosion site\"\"\"\nimport datetime\nimport urll... | python | new_file | 1 | 0 | mit | 609b27736728ce17f7f05594a2a44ed1cb0a9fd2 | akrherz/idep,akrherz/dep,akrherz/dep,akrherz/idep,akrherz/dep,akrherz/idep,akrherz/dep,akrherz/idep,akrherz/idep,akrherz/dep,akrherz/idep | scripts/util/dl_daily_shapefiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Check for checking a static route is present for multi subnets"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Checks static route for specific subnet\n#\n# Return CRITICAL if no route found\n#\n# Jose L Coello... | python | new_file | 3 | 4 | apache-2.0 | a5487a417d53645bb33bf4f4b466965679813890 | blueboxgroup/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,blueboxgroup/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,blueboxgroup/ursula-monitoring,sivakom/ursula-monitoring,sivakom/ursula-monitoring,sivakom/ursula-monitoring,blueboxgroup/ursula-monitoring,sivakom/ursula-mon... | sensu/plugins/check-static-route.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add blocking migration to ensure all rules have been migrated"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\nfrom django.db import ... | python | new_file | 1 | 2 | bsd-3-clause | 3e50e0cd6c55730bd2d2ed1c22b71ce67723a0d5 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/data_interfaces/migrations/0018_check_for_rule_migration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test d'un bout de code de GeeksForGeeks"
},
{
"role": "assistant",
"content": "# Code from https://www.geeksforgeeks.org/g-fact-34-class-or-static-variables-in-python/\r\n# Copy - Paste here to test it directly\r\n# Python progra... | python | new_file | 1 | 1 | mit | 2759119ea8a2afe6c47575825aef9ae59c1ce921 | TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-workouts,TGITS/programming-worko... | python/misc/oo/CSStudent.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Tag using alchemy api. As request by costaclayton"
},
{
"role": "assistant",
"content": "import copy\nimport requests\n\nfrom urllib import quote_plus\nfrom optparse import OptionParser\n\nfrom pocketpy.auth import auth\nfrom poc... | python | new_file | 2 | 4 | mit | 2f25825812e38318076984a83a1d602d3d33bc9d | Newky/PocketPy | bin/tag_using_alchemy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add NHS logo for letters\n\nMatches: https://github.com/alphagov/notifications-template-preview/pull/192"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 0218_another_letter_org\nRevises: 0217_default_em... | python | new_file | 1 | 2 | mit | a71ce9fb543c7108f8c606bc46674cfad0ff8cc7 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0218_another_letter_org.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set proposal updated date to the mod date of most recent Document"
},
{
"role": "assistant",
"content": "import django.contrib.gis.db.models.fields\nfrom django.db import migrations\nfrom django.contrib.gis.db.models import Max\n... | python | new_file | 3 | 3 | mit | ca11355cb4ece27ffb9fee8e9df304b43dd6b6b8 | cityofsomerville/cornerwise,cityofsomerville/citydash,cityofsomerville/cornerwise,codeforboston/cornerwise,cityofsomerville/citydash,cityofsomerville/citydash,cityofsomerville/cornerwise,cityofsomerville/citydash,cityofsomerville/cornerwise,codeforboston/cornerwise,codeforboston/cornerwise,codeforboston/cornerwise | server/proposal/migrations/0034_fix_updated.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update cluster database to make local spark work"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 306f880b11c3\nRevises: 255f81eff867\nCreate Date: 2018-08-03 15:07:44.354557\n\n\"\"\"\nimport sqlalchemy... | python | new_file | 3 | 1 | apache-2.0 | e49331122001bf142e7478037d9ad8e932103657 | eubr-bigsea/stand,eubr-bigsea/stand | migrations/versions/306f880b11c3_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test case for ninefold loadbalancer driver."
},
{
"role": "assistant",
"content": "import sys\nimport unittest\n\nfrom libcloud.loadbalancer.types import Provider\nfrom libcloud.loadbalancer.providers import get_driver\n\n\... | python | new_file | 1 | 1 | apache-2.0 | 4e48b4587d8af6cce0cc083db10287c8a9f933e3 | mtekel/libcloud,Kami/libcloud,briancurtin/libcloud,mistio/libcloud,briancurtin/libcloud,Jc2k/libcloud,t-tran/libcloud,t-tran/libcloud,vongazman/libcloud,mgogoulos/libcloud,jimbobhickville/libcloud,cryptickp/libcloud,carletes/libcloud,wrigri/libcloud,sahildua2305/libcloud,munkiat/libcloud,thesquelched/libcloud,mtekel/li... | libcloud/test/loadbalancer/test_ninefold.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for tinyMCE (WYSIWYG editor)."
},
{
"role": "assistant",
"content": "from . import TheInternetTestCase\nfrom helium.api import click, Text, press, CONTROL, COMMAND, write\nfrom sys import platform\n\nclass WYSIWYGEd... | python | new_file | 1 | 2 | mit | 6aa2e5d3b8519ae3b8e21431e4eaf34dd9d34f9f | bugfree-software/the-internet-solution-python | tests/test_wysiwyg_editor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add strategy error handling tests"
},
{
"role": "assistant",
"content": "from mock import patch\nfrom django.utils import timezone\nfrom django.test import TestCase\nfrom breach.strategy import Strategy\nfrom breach.models import... | python | new_file | 1 | 2 | mit | 04a93e33afd41405fcc660e9cfd7de191def4657 | dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture | backend/breach/tests/test_error_handling.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a test to make sure output_dir is passed along to generate_files"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom cookiecutter import main\n\n\n@pytest.fixture\ndef context():\n ... | python | new_file | 1 | 1 | bsd-3-clause | 5ca5736ec9c3357f7b68ed44b3154970561a8c3d | willingc/cookiecutter,pjbull/cookiecutter,luzfcb/cookiecutter,pjbull/cookiecutter,terryjbates/cookiecutter,stevepiercy/cookiecutter,dajose/cookiecutter,michaeljoseph/cookiecutter,cguardia/cookiecutter,hackebrot/cookiecutter,dajose/cookiecutter,willingc/cookiecutter,audreyr/cookiecutter,michaeljoseph/cookiecutter,cguard... | tests/test_specify_output_dir.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ast matcher for pattern recognition"
},
{
"role": "assistant",
"content": "\"\"\" Module to looks for a specified pattern in a given AST. \"\"\"\n\nfrom ast import AST, iter_fields\nimport ast\n\n\nclass AST_no_cond(object):\... | python | new_file | 1 | 10 | bsd-3-clause | c27f7651a933fa831f936ca90fd25ede3f79aa50 | artas360/pythran,pbrunet/pythran,pbrunet/pythran,hainm/pythran,artas360/pythran,artas360/pythran,hainm/pythran,pombredanne/pythran,pombredanne/pythran,serge-sans-paille/pythran,pombredanne/pythran,hainm/pythran,serge-sans-paille/pythran,pbrunet/pythran | pythran/analyses/ast_matcher.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to save track proto to zip files for efficient storage and usage."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport zipfile\nimport cPickle\nimport numpy as np\n\n\"\"\"\n track_obj: {\n ... | python | new_file | 4 | 9 | mit | cac3636a2e49e088c2a43b2f21a7aa31af66d215 | myfavouritekk/TPN | src/tpn/data_io.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n... | python | edit | 1 | 0 | apache-2.0 | bb578d4237ccaf16fe5c38842cc100cdbefc0119 | openstack/senlin,stackforge/senlin,tengqm/senlin-container,stackforge/senlin,openstack/senlin,tengqm/senlin-container,Alzon/senlin,Alzon/senlin,openstack/senlin | senlin/tests/functional/drivers/openstack/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add code to lift text out of images"
},
{
"role": "assistant",
"content": "import numpy as np\nimport cv\nfrom pytesser import *\nfrom common import *\n\n\ndef proc_ex (ex):\n try:\n text = (image_file_to_string(img_fil... | python | new_file | 3 | 3 | mit | 0485a265c5076402acc482db6789fb46bc313451 | hausdorff/i-like-you,hausdorff/i-like-you | proc_images.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for cli.task\n\nCLOUDBLD-6300\n\nSigned-off-by: Adam Cmiel <<EMAIL>>"
},
{
"role": "assistant",
"content": "\"\"\"\nCopyright (c) 2021 Red Hat, Inc\nAll rights reserved.\n\nThis software may be modified and distrib... | python | new_file | 1 | 1 | bsd-3-clause | bb8774152e63ce8a09dbb75d43579ba145bbe08f | fr34k8/atomic-reactor,projectatomic/atomic-reactor,projectatomic/atomic-reactor,fr34k8/atomic-reactor | tests/cli/test_task.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for converting XML datasets to CSV"
},
{
"role": "assistant",
"content": "from bs4 import BeautifulSoup\nimport csv\nimport sys\n\nXML_FILE_PATH = sys.argv[1]\nCSV_FILE_PATH = sys.argv[2]\n\nxml_file = open(XML_FILE_PA... | python | new_file | 1 | 0 | mit | 2c175426c93f446cad6846bee141cbd9b29c5593 | wisner23/serenata-de-amor,marcusrehm/serenata-de-amor,wisner23/serenata-de-amor,datasciencebr/serenata-de-amor,datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor | src/xml2csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read a set of FITS files and calculate the mean (average). Based on code from two previous exercizes."
},
{
"role": "assistant",
"content": "# Write your mean_fits function here:\nfrom astropy.io import fits\nimport numpy as np\n... | python | new_file | 3 | 3 | mit | 45eb018082d035f36d6b5d207f6f44e77a65a895 | lokijota/datadrivenastronomymooc | wk1/MeanOfASetOfFITSFiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport copy\n\nfrom django.utils.functional import LazyObject, empty\n\nfrom .default import HORIZON_CONFIG as DEFAULT_CONFIG\n\n\nclass LazySettings(LazyObject):\n def _setup(self, name=None):\n from django.conf import settings\n... | python | edit | 1 | 5 | apache-2.0 | 50c21151b54759d297fdbef222aaa45c17f70027 | dan1/horizon-x509,rickerc/horizon_audit,Tesora/tesora-horizon,tuskar/tuskar-ui,maestro-hybrid-cloud/horizon,orbitfp7/horizon,VaneCloud/horizon,CiscoSystems/horizon,nvoron23/avos,openstack-ja/horizon,tqtran7/horizon,JioCloud/horizon,promptworks/horizon,Mirantis/mos-horizon,FNST-OpenStack/horizon,Tesora/tesora-horizon,Fr... | horizon/conf/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple examples test for HelloService RPC"
},
{
"role": "assistant",
"content": "from pyon.util.int_test import IonIntegrationTestCase\nfrom interface.services.examples.hello.ihello_service import HelloServiceClient\n\nclass ... | python | new_file | 1 | 1 | bsd-2-clause | 81cba73a64e72fc10170cd8a5082a109037ad27e | mkl-/scioncc,scionrep/scioncc,scionrep/scioncc,ooici/pyon,crchemist/scioncc,crchemist/scioncc,mkl-/scioncc,crchemist/scioncc,scionrep/scioncc,mkl-/scioncc,ooici/pyon | examples/service/test_hello_service.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add failing webtest for user settings page"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport unittest\n\nfrom nose.tools import * # PEP8 asserts\nfrom webtest_plus import TestApp\nfrom website.app import ini... | python | new_file | 8 | 1 | apache-2.0 | a6db84b191f5df54bab66615d48d9d0ade903229 | amyshi188/osf.io,asanfilippo7/osf.io,samchrisinger/osf.io,jnayak1/osf.io,brandonPurvis/osf.io,mluo613/osf.io,felliott/osf.io,kch8qx/osf.io,mfraezz/osf.io,caseyrollins/osf.io,dplorimer/osf,jnayak1/osf.io,asanfilippo7/osf.io,dplorimer/osf,binoculars/osf.io,Nesiehr/osf.io,TomBaxter/osf.io,doublebits/osf.io,billyhunt/osf.i... | website/addons/dropbox/tests/webtest_tests.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file with tests for main module"
},
{
"role": "assistant",
"content": "# Copyright (c) 2016 Kirill 'Kolyat' Kiselnikov\n# This file is the part of vpoker, released under modified MIT license\n# See the file LICENSE.txt includ... | python | new_file | 1 | 1 | mit | d99dd117c41e850781056371043ef7de546f0c18 | kolyat/vpoker | test_vpoker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing database migration script for srpm_commit_hash and srpm_commit_branch.\n\nSigned-off-by: Jan Kaluza <<EMAIL>>"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\n... | python | new_file | 1 | 0 | mit | 444a6d3a53e2e373e5abe2156b875f5342f371ae | release-engineering/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,release-engineering/product-definition-center,product-definition-center/product-definition-center,release-engineering/product-definition-center,release-engineering/produc... | pdc/apps/package/migrations/0014_auto_20170412_1331.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a benchmark for the aggregator"
},
{
"role": "assistant",
"content": "import timeit\nimport time\n\nfrom carbon.aggregator.processor import AggregationProcessor, RuleManager, settings\nfrom carbon.aggregator.buffers import Bu... | python | new_file | 3 | 3 | apache-2.0 | 431292036e591e037ce83ce84173d17e86ff80d1 | graphite-project/carbon,deniszh/carbon,deniszh/carbon,obfuscurity/carbon,obfuscurity/carbon,criteo-forks/carbon,criteo-forks/carbon,piotr1212/carbon,graphite-project/carbon,piotr1212/carbon | lib/carbon/tests/benchmark_aggregator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: AppVeyor: Add helper script to download build artifacts"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Author: Lisandro Dalcin\n# Contact: <EMAIL>\n\nimport os\nimport requests\n\nAPIURL = 'https://ci.appveyor.... | python | new_file | 1 | 0 | bsd-2-clause | 2acfc552c42846628304e54a3b87e2bf3a59af07 | mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py | conf/ci/appveyor/get-artifacts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create mapping for ING Direct"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# vim: sw=4:ts=4:expandtab\n# pylint: disable=invalid-name\n\"\"\"\ncsv2ofx.mappings.ingdirect\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nProvides a ... | python | new_file | 1 | 0 | mit | 4fe9d2ceb7b1d8be1b89167944c06c6c2c92d1c4 | reubano/csv2ofx,reubano/csv2ofx | csv2ofx/mappings/ingdirect.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Complete register window for widget"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport wx\n\nID_BUTTON_CLOSE_MSG = 1000\nID_LABLE_TEXT_INFO = 1001\nID_ICON_INFO = 1002\n\n\nclass CompleteRegCtrl(wx.Frame):\n\n... | python | new_file | 1 | 1 | mit | e7a46e772aa09e760b9c817afb618860eeb7e33c | Relrin/Helenae,Relrin/Helenae,Relrin/Helenae | helenae/gui/widgets/CompleteRegCtrl.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for executing RPCs over UNIX sockets"
},
{
"role": "assistant",
"content": "import socket\nimport struct\nimport json\nimport os\n\nRPC_VERSION = 1\n\ndef msg_send(sock, msg):\n j = json.dumps(msg)\n header = str... | python | new_file | 1 | 8 | apache-2.0 | 4233919f94296e1e4986345d876b3f2ebf14e0e4 | sagelywizard/dlex | unix_rpc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Temp & Humi API"
},
{
"role": "assistant",
"content": "#TH02 by Trent Monahan, 2015\n#ported from Intel's UPM TH02 in C\n\nimport mraa\n\nTH02_ADDR = 0x40 # device address\nTH02_REG_STATUS = 0x00\nTH02_REG_DATA_H = 0x01\nTH02... | python | new_file | 1 | 3 | mit | a0844c1dd37e0d487350187874804e973c106445 | SinZ163/EdisonSandbox | TH02.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write a test for the command line tool"
},
{
"role": "assistant",
"content": "import pytest\nimport sys\nimport binascii\nimport base64\nfrom unittest import mock\nfrom io import StringIO, BytesIO, TextIOWrapper\n\nimport cbor2.t... | python | new_file | 7 | 1 | mit | ca6de0795babfd911c49a0f66ca27cd063faf1f1 | agronholm/cbor2,agronholm/cbor2,agronholm/cbor2 | tests/test_tool.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic checks for web endpoints integraiton tests"
},
{
"role": "assistant",
"content": "import requests\nimport pytest\n\n\nclass TestWebUI(object):\n def get_page(self, page):\n return requests.get('http://127.0.0.... | python | new_file | 1 | 2 | mit | f2e6fedf021e48e275a857bc7a0471a17aa10c29 | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/integration/test_webui.py | rejected_duplicate | Near-duplicate of sample 5055 | true |
[
{
"role": "user",
"content": "Write python code for the following: Work on 31 coin sums"
},
{
"role": "assistant",
"content": "def coin_change(left, coins, count):\n if left == 0:\n return count\n\n if not coins:\n return 0\n\n coin, *coins_left = coins\n return sum(coi... | python | new_file | 1 | 4 | mit | cfee86e7e9e1e29cbdbf6d888edff1f02d733808 | dawran6/project-euler | 31-coin-sums.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add \"Glyphs/Copy to Background, Decompose, Remove Overlaps, Correct Path Direction\""
},
{
"role": "assistant",
"content": "# MenuTitle: Copy to Background, Decompose, Remove Overlaps, Correct Path Direction\nfor layer in Glyphs... | python | new_file | 2 | 0 | mit | 7086dcce04799d744bb594cbf6ccbe8b7b09767d | jenskutilek/Glyphs-Scripts | Glyphs/DecRO.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for watch function"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport pytest\nfrom butter.inotify import watch\n\nfrom subprocess import Popen\nfrom tempfile import TemporaryDirectory\nfrom time impo... | python | new_file | 5 | 1 | bsd-3-clause | 660aecd99935ef3073d8ff166c5bd131b2d95b22 | wdv4758h/butter,dasSOZO/python-butter | tests/unit/test_inotify.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport psshutil\nimport random\n\nclass ServerPool(list):\n def __init__(self, options):\n self.options = options\n try:\n hosts = psshutil.read_host_files(options.host_files, default_user=options.use... | python | edit | 1 | 7 | bsd-3-clause | fe9da2481ab777012fbfd94bd9bacef9fc8151f4 | jcmcken/parallel-ssh,jorik041/parallel-ssh,gyf19/parallel-ssh | psshlib/hosts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new lots for G-Cloud 9"
},
{
"role": "assistant",
"content": "\"\"\"add entries to lots table for G-Cloud 9\n\nRevision ID: 790\nRevises: 780\nCreate Date: 2017-01-27 13:33:33.333333\n\n\"\"\"\n\n# revision identifiers, used ... | python | new_file | 1 | 1 | mit | 4e5ce8c0d0c998d8e9734bec584c93e0bc2fd065 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/790_add_g9_lots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make package installable via pip"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nsetup(\n name=\"pycomponents\",\n version='0.1',\n description=\"A simple component entity system for python\",\... | python | new_file | 1 | 0 | mit | b977cf85a16d322cecb2bde051ad3026fa8e037e | dragonfi/pycomponents,dragonfi/pycomponents | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add columns to suppliers table\n\nThe following data is moving from framework-level supplier declarations to the\nsupplier account level:\n\n* Organisation size\n* VAT number\n* Non-companies-house registration number (for non-UK companies)\... | python | new_file | 1 | 1 | mit | 8475c80b48d02fad440acd4324b2bfba2f8e1f67 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/940_more_supplier_details.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move Probes and Water_History formset views to using a common \"Farms_FormsetView\" superclass."
},
{
"role": "assistant",
"content": "from extra_views import ModelFormSetView\nfrom django.forms import Textarea, TextInput\nfrom d... | python | new_file | 2 | 2 | mit | 594039c17f9db7b2cb058eaca58299281a61ef29 | warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro | irrigator_pro/farms/formset_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add kerberos authentication requester using requests_kerberos"
},
{
"role": "assistant",
"content": "from jenkinsapi.utils.requester import Requester\nfrom requests_kerberos import HTTPKerberosAuth, OPTIONAL\n\n\nclass KrbRequest... | python | new_file | 1 | 3 | mit | 05c2b5edb0ad2dd96f4146893de1bcaa2b691c64 | domenkozar/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,jduan/jenkinsapi,JohnLZeller/jenkinsapi,JohnLZeller/jenkinsapi,mistermocha/jenkinsapi,imsardine/jenkinsapi,aerickson/jenkinsapi,zaro0508/jenkinsapi,mistermocha/jenkinsapi,jduan/jenkinsapi,domenkozar/jenkinsapi,salimfadhley/jenkinsapi,salimfadhley/jenkinsapi... | jenkinsapi/utils/krb_requester.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Script for Testing Line Segment Features"
},
{
"role": "assistant",
"content": "from image_process.hough_transform import get_hough_lines\nfrom lines.line import Point, LineSegment\nimport matplotlib.pyplot as plt\nimport os\... | python | new_file | 6 | 0 | mit | 1337bed0e13f8e0f3d1294464e817b782b765b47 | Molecular-Image-Recognition/Molecular-Image-Recognition | scripts/read_in_lines.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Delete obsolete Whois model from the datastore."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport time\nimport getpass\nimport datetime\n\nfrom common.appenginepatch.aecmd import setup_... | python | new_file | 4 | 6 | mit | 3e25a1b44743bbf7d0bf1205cebe5bfb6a693fef | jcrocholl/nxdom,jcrocholl/nxdom | delete_whois.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add settings for django tests."
},
{
"role": "assistant",
"content": "from .base_settings import *\n\nCACHES = {\n 'default': {\n 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',\n 'LOCATION': '1... | python | new_file | 2 | 0 | mit | 8c37c1ae7f42d22a186de4751a56209ebdd77ec4 | SRJ9/django-driver27,SRJ9/django-driver27,SRJ9/django-driver27 | dr27demo/dr27app/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to rename all references to cpp-sort in the library.\n\nThis tool mostly exists to simplify including and comparing different\nversions of the same algorithms in benchmarks.\n\n[ci skip]"
},
{
"role": "assistant",
"con... | python | new_file | 3 | 10 | mit | 4840b5b6326229a215ccd3ae4d230adc2f5cf374 | Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort | tools/rename-library.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to delete duplicate cancelled repeat records"
},
{
"role": "assistant",
"content": "import csv\nimport datetime\nfrom collections import defaultdict\n\nfrom django.core.management.base import BaseCommand\n\... | python | new_file | 4 | 4 | bsd-3-clause | f5b33f7e80176efeb0eb0d0ea6fc8a8c7463a429 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/motech/repeaters/management/commands/delete_duplicate_cancelled_records.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add site engine for Derideal"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Copyright (C) 2019-2020 Tobias Gruetzmacher\n\nfrom __future__ import absolute_import, division, print_function\n\nfrom ..scraper impo... | python | new_file | 2 | 3 | mit | b168e05cfdf9df1c8d4fa2fa851b75b6a6633708 | peterjanes/dosage,webcomics/dosage,peterjanes/dosage,webcomics/dosage | dosagelib/plugins/derideal.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new SMS rates for 1 May 2022 onwards\n\nThis change can be merged before the new rates go live, because they\nwon't be used until the start date."
},
{
"role": "assistant",
"content": "\"\"\"\n\nRevision ID: 0369_update_sms_r... | python | new_file | 1 | 1 | mit | 7721cd26ca18b655e4866fff17d4522cccc02a7a | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0369_update_sms_rates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for the UserAdmin"
},
{
"role": "assistant",
"content": "import pytest\nfrom django.urls import reverse\n\nfrom {{ cookiecutter.project_slug }}.users.models import User\n\npytestmark = pytest.mark.django_db\n\n\nclass Te... | python | new_file | null | null | bsd-3-clause | 37e0d6ae04da6b127e214afba1d8d1adabfa707e | pydanny/cookiecutter-django,ryankanno/cookiecutter-django,ryankanno/cookiecutter-django,trungdong/cookiecutter-django,ryankanno/cookiecutter-django,pydanny/cookiecutter-django,trungdong/cookiecutter-django,ryankanno/cookiecutter-django,pydanny/cookiecutter-django,trungdong/cookiecutter-django,trungdong/cookiecutter-dja... | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add admin list organisations test"
},
{
"role": "assistant",
"content": "from tests import PMGLiveServerTestCase\nfrom mock import patch\nimport unittest\nfrom pmg.models import db, User\nfrom tests.fixtures import dbfixture, Use... | python | new_file | 6 | 1 | apache-2.0 | fd4bf48267e5110c92f4a7c51833c556a99ffc87 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | tests/views/test_admin_organisations_page.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for console"
},
{
"role": "assistant",
"content": "import io\n\nimport spur\nfrom nose.tools import istest, assert_equal\n\nfrom toodlepip.consoles import Console\n\n\n@istest\ndef console_writes_output_to_console(... | python | new_file | 3 | 1 | bsd-2-clause | e3349e71047381a487bf7abe8c5563c4811a3668 | mwilliamson/toodlepip | tests/consoles_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Print list of usage records from S3 CSV"
},
{
"role": "assistant",
"content": "import csv\n\n\nif __name__ == \"__main__\":\n usage = []\n\n with open(\"tests/fixtures/2021/03/S3.csv\") as f:\n reader = csv.DictReade... | python | new_file | 1 | 0 | apache-2.0 | a73f320e61f7ff937f4be3c69939edf77be60e0e | ifosch/accloudtant | accloudtant/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example 4, demonstrating how to run meta workflow of multiple workflows"
},
{
"role": "assistant",
"content": "'''\nAn example showing how you can run multiple workflow tasks, from a \"Meta workflow\" (MetaWF below)\n'''\n\ni... | python | new_file | 1 | 2 | mit | a28e82121a5dcc68183c338b06264981227f8681 | pharmbio/sciluigi,pharmbio/sciluigi,samuell/sciluigi | examples/example4_multiwf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a completely hack-ish tool to sort includes according to the coding\nstandards.\n\nI am a terrible Python programmer. Patches more the welcome. Please tell\nme how this should look if it should look differently. It's just a tiny\nlittle ... | python | new_file | 6 | 15 | bsd-3-clause | 42fdc9f9242df112046763560011336869d3efa1 | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | sort_includes.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove duplicated index on table 'records' of pDNS backend\n\nRemove duplicated index `rec_name_index` on table 'records' of pDNS backend.\n\nChange-Id: I9e8723b464522a588f0e0ef6ff261b71609b0726\nCloses-Bug: 1446980"
},
{
"role": "as... | python | new_file | 1 | 1 | apache-2.0 | f6ee98e4ed4529b0d699f3cf2d107a1ed8faa6f0 | kiall/designate-py3,cneill/designate,kiall/designate-py3,ionrock/designate,tonyli71/designate,muraliselva10/designate,cneill/designate,grahamhayes/designate,kiall/designate-py3,ramsateesh/designate,cneill/designate,cneill/designate-testing,tonyli71/designate,kiall/designate-py3,openstack/designate,openstack/designate,m... | designate/backend/impl_powerdns/migrate_repo/versions/012_records_drop_duped_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add org mode export script"
},
{
"role": "assistant",
"content": "import sys\nimport re\n\n\ndef import_file(lines):\n tags_label = \"TAGS: \"\n separator = 60*\"-\"\n\n idx = 0\n while idx < len(lines):\n asse... | python | new_file | 1 | 8 | mit | 12a5ed54c39dcabbf72c0a80b1e2ac6f3e9a576c | inducer/synoptic,inducer/synoptic,inducer/synoptic | synoptic-to-org.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"URL for setting SPAM value to the `djangospam.cookie` cookie.\nYou must also add `(r\"^somewhere/\", include(\"djangospam.cookie.urls\")`\nto your url patterns (usually in your root urls.conf; `somewhere`\nmay... | python | edit | 1 | 0 | bsd-2-clause | 6f75300037254f51f1512a271bf7850a4bc0a8f8 | leandroarndt/djangospam,leandroarndt/djangospam | djangospam/cookie/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport multiprocessing # stop tests breaking tox\nfrom setuptools import setup\n\nimport tvrenamr\n\n\nrequires = ('pyyaml', 'requests')\npackages = ('tvrenamr',)\n\nsetup_requires = ('minimock', 'mock', 'nose', 'pyyaml')\n\nsetup(\n na... | python | edit | 3 | 0 | mit | 2a0ed84f9ce2077d352c0827c2dd5fac514cb91d | wintersandroid/tvrenamr,ghickman/tvrenamr | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for `license show` function"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Tests for the `license show` function\n\"\"\"\n\nfrom click.testing import CliRunner\n\nfro... | python | new_file | 1 | 1 | mit | d6ef33d682008bbdbb00117266670607c4f66056 | lord63/choosealicense-cli | choosealicense/test/test_show.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a pip installable project"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nsetup(\n name='python-evrythng',\n version='0.1',\n packages=['evrythng', 'evrythng.entities'],\n package_dir... | python | new_file | 1 | 0 | mit | 38abc2d155492e1dadb507a63a484f2147118163 | GooeeIOT/python-evrythng | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file to experiment with plotting of world"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib import animation\nfrom numpy.random import randn\nfrom matplotlib impo... | python | new_file | 4 | 1 | mit | 6a6f7a6c6abe78094eb69b447b1b60960bf855ed | LapoFrati/GeneticAlgorithms | animation.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add TData class implementing GObject.GObject, meant for runtime data storage"
},
{
"role": "assistant",
"content": "from gi.repository import GObject\n\nclass TData(GObject.GObject):\n\n imagedir = GObject.property(t... | python | new_file | 1 | 2 | apache-2.0 | f38c8fe1736e870a29f8c44a20c903f65579976b | tinuzz/taggert | taggert/tdata.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a scenario to initiliaze nested dind"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Copyright 2018 The Kubernetes Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may ... | python | new_file | 3 | 3 | apache-2.0 | 29c6d5b78e06e8487d9eccb47070b0fb36cbb821 | jlowdermilk/test-infra,dims/test-infra,michelle192837/test-infra,monopole/test-infra,jlowdermilk/test-infra,monopole/test-infra,kargakis/test-infra,abgworrall/test-infra,michelle192837/test-infra,fejta/test-infra,kargakis/test-infra,ixdy/kubernetes-test-infra,jessfraz/test-infra,BenTheElder/test-infra,michelle192837/te... | scenarios/dindind_execute.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add message format conversion utility script"
},
{
"role": "assistant",
"content": "import json\nimport argparse\nimport heapq\nimport os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\"))\nfrom src.mod... | python | new_file | 1 | 0 | apache-2.0 | 8db2f138c83a998d0fa23b1e13f27d0823eba42e | 5agado/conversation-analyzer | utils/convert.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.