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: Test for ISO NC creator"
},
{
"role": "assistant",
"content": "from posts.nc import *\r\nimport posts.iso\r\n\r\noutput('POST_TEST.txt')\r\n\r\nprogram_begin(123, 'Test program')\r\nabsolute()\r\nmetric()\r\nset_plane(0)\r\n\r\nf... | python | new_file | 16 | 0 | bsd-3-clause | df10bd85bcf94aba9661e397960a1cd3b4dd090d | danheeks/heekscnc,danheeks/heekscnc,danheeks/heekscnc,danheeks/heekscnc | POST_TEST.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a copy of the Netgen reader example and add some statistics calculation.\n\nThese additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the n... | python | new_file | 1 | 0 | mit | 5e13e3bc045d496232e5ced6b7dc314f14183257 | jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python | doc/examples/viennagrid_wrapper/io_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for utility methods."
},
{
"role": "assistant",
"content": "from scripts.init import utils\nimport unittest\n\n\nclass TestUtils(unittest.TestCase):\n @classmethod\n def setUpClass(self):\n pass\n\n ... | python | new_file | 1 | 1 | apache-2.0 | 638e2d7a33f522007d80d39e0a8e5bface654286 | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | test/test_scripts/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [dbscan] Add python / sklearn comparison script"
},
{
"role": "assistant",
"content": "'''\nGenerate dummy data, and compare output from scikit-learn's DBSCAN.\n\nExample code based on:\n http://scikit-learn.org/stable/auto_exam... | python | new_file | 1 | 1 | mit | 83e036f3d89c4b3956bde006085becb496a1fb6e | jlas/ml.q | dbscan/test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test for semantics of for-loop that optimisation can break."
},
{
"role": "assistant",
"content": "# test assigning to iterator within the loop\nfor i in range(2):\n print(i)\n i = 2\n\n# test assigning to range ... | python | new_file | 1 | 0 | mit | 5fba93a26b6f09c20391ec18b281def2bd851650 | SungEun-Steve-Kim/test-mp,Vogtinator/micropython,turbinenreiter/micropython,HenrikSolver/micropython,drrk/micropython,alex-march/micropython,pozetroninc/micropython,blmorris/micropython,dmazzella/micropython,kerneltask/micropython,Timmenem/micropython,adamkh/micropython,adamkh/micropython,heisewangluo/micropython,infin... | tests/basics/for3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add small demo for a monochrome GST pipeline"
},
{
"role": "assistant",
"content": "import gst\nimport gobject\nimport os\n\nVIDEODEVICE = \"/dev/video1\"\nWIDTH = 1280\nHEIGHT = 960\nFRAMERATE = \"15/1\"\n\ntry:\n import psut... | python | new_file | 1 | 3 | apache-2.0 | ff9cbbac188f78ed33cb2f650a32777713911384 | TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera | examples/python/monochrome_pipeline.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some basic tests for RRTM scheme."
},
{
"role": "assistant",
"content": "from __future__ import division\nimport numpy as np\nimport climlab\nimport pytest\nfrom climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiati... | python | new_file | 7 | 1 | mit | ed985791d20199af9cb34e445d0a96dc11e9129b | brian-rose/climlab,cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab | climlab/tests/test_rrtm.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for tuning estimations"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\"\"\"\nTest suite for PgTune.\n\"\"\"\n\nfrom unittest.mock import MagicMock, patch\nimport pytest\nimport smdba.postgresqlgate\n\n\ncl... | python | new_file | 3 | 1 | mit | fe6d4383a942eb85e3062f35f5b6d073d92b1cc2 | SUSE/smdba,SUSE/smdba | tests/test_pgtune.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example script for evaluating setiment"
},
{
"role": "assistant",
"content": "# authenticates with twitter, searches for microsoft, evaluates overall\n# sentiment for microsoft\n\nimport numpy as np\nimport twitter\nfrom text... | python | new_file | 3 | 0 | mit | a84d8005193328b63eaf98f0852dc72c3e58aed9 | dankolbman/MarketCents | twitter_feed.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Django REST Framework authentication helpers for JWT"
},
{
"role": "assistant",
"content": "from django.utils.translation import ugettext as _\nfrom django.contrib.auth import get_user_model\nfrom rest_framework_jwt.authentic... | python | new_file | 3 | 7 | bsd-2-clause | 469c2932575daaf42d8cec5578c087f4e5c340af | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/jwt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test Case for adding groups"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom selenium.webdriver.firefox.webdriver import WebDriver\nfrom selenium.webdriver.common.action_chains import ActionChains\nimport time... | python | new_file | 4 | 2 | apache-2.0 | 0d7b9e23889b2908e874bda58a119af6b763f04e | labizon/Python_training | test_add_group.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add three shutters and open/close functions"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nimport epics\nimport logging\n\nfrom ophyd.controls import EpicsSignal\nfrom ophyd.controls.signal import S... | python | new_file | 4 | 2 | bsd-2-clause | 47ae456b3a4252d7c838219e3ebd15e049316891 | NSLS-II-CHX/ipython_ophyd,NSLS-II-CHX/ipython_ophyd | profile_collection/startup/25-shutter.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool for building custom packages"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport sys, os, subprocess\n\nsys.argv.pop(0)\nlanguages = sys.argv\nlanguages.sort()\n\njs_path = os.path.dirname(__file__) + '/... | python | new_file | 4 | 0 | apache-2.0 | 5c3eaede26381babac281dfa0d9bec3ebe911ba8 | HotelsDotCom/rainbow,linuxl0ver/rainbow,linuxl0ver/rainbow,metasyn/rainbow,ccampbell/rainbow,HotelsDotCom/rainbow,cybrox/rainbow,jeremykenedy/rainbow,cybrox/rainbow,segmentio/rainbow,jeremykenedy/rainbow,ptigas/rainbow,greyhwndz/rainbow,linuxl0ver/rainbow,jeremykenedy/rainbow,javipepe/rainbow,greyhwndz/rainbow,metasyn/... | util/compile.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix for django-tagging and automcomplete"
},
{
"role": "assistant",
"content": "from dal_select2_tagging.widgets import TaggingSelect2\nfrom django import VERSION\nfrom tagging.utils import parse_tag_input\n\n\nclass IxxyTaggingS... | python | new_file | 1 | 4 | mit | f35d5251500268235598e4dbd2ddf91c994e1632 | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | ixxy_admin_utils/custom_widgets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for some methods of runner"
},
{
"role": "assistant",
"content": "from twisted.trial import unittest\n\n\nfrom ooni.inputunit import InputUnit\nfrom ooni.nettest import NetTestCase\nfrom ooni.reporter import OReport... | python | new_file | 3 | 3 | bsd-2-clause | 2dc8ae91713fdd73ac1e835dcb191714c2e93593 | lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-... | tests/test_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for nbgrader update"
},
{
"role": "assistant",
"content": "from os.path import join\n\nfrom .. import run_nbgrader\nfrom .base import BaseTestApp\n\n\nclass TestNbGraderUpdate(BaseTestApp):\n\n def test_help(self):\n... | python | new_file | 1 | 1 | bsd-3-clause | 04fa680f4be4afc44dc0df3834b096d8fa7a05ac | jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader | nbgrader/tests/apps/test_nbgrader_update.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the app config for osf registrations"
},
{
"role": "assistant",
"content": "from share.provider import ProviderAppConfig\nfrom .harvester import OSFRegistrationsHarvester\n\n\nclass AppConfig(ProviderAppConfig):\n name = '... | python | new_file | 1 | 0 | apache-2.0 | 5e5e58b705d30df62423ec8bb6018c6807114580 | laurenbarker/SHARE,aaxelb/SHARE,aaxelb/SHARE,zamattiac/SHARE,zamattiac/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,aaxelb/SHARE,zamattiac/SHARE,CenterForOpenScience/SHARE,CenterForOpenScience/SHARE | providers/io/osf/registrations/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to read receiver file"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n\nimport numpy\nfrom matplotlib import pyplot as plt\nimport matplotlib.colors as colors\nimport os\nimport sys\n\nimport seab... | python | new_file | 5 | 1 | apache-2.0 | 1d021cd7b52ecc4d9684dc607a1ff9f0b8181b37 | RaphaelPoncet/2016-macs2-projet-hpc | read_receiver.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a file allowing you to try it manually"
},
{
"role": "assistant",
"content": "import json\nfrom ranch import Address, InvalidAddressException\n\n\nfilename = input('Read data from: [data/export.json] ')\nif filename == '':\n ... | python | new_file | 1 | 0 | apache-2.0 | efd3fbf51be25b46e3d5dd0cb76aaab60de7e4c8 | 3DHubs/Ranch | tryit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test utility for creating users."
},
{
"role": "assistant",
"content": "\"\"\"Utilities for testing wafer.\"\"\"\n\nfrom django.contrib.auth import get_user_model\nfrom django.contrib.auth.models import Permission\n\n\ndef cr... | python | new_file | 1 | 5 | isc | d32414164552f48226842176e05229f6895e3c1d | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/tests/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple integration test for memory profiler"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) Spyder Project Devel... | python | new_file | 4 | 2 | mit | 5ef616d0563f9e4f29ef7eaa3c163d24cf3e131f | jitseniesen/spyder-memory-profiler,jitseniesen/spyder-memory-profiler,spyder-ide/spyder.memory_profiler | spyder_memory_profiler/widgets/tests/test_memoryprofiler.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for early stopping trigger"
},
{
"role": "assistant",
"content": "import unittest\n\nimport chainer\nimport numpy\n\nfrom chainer import testing\nfrom chainer import training\nfrom chainer.training import triggers\nfrom ... | python | new_file | 1 | 2 | mit | e5ad0f3029df610a308c107a640de438f62eb00b | rezoo/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,aonotas/chainer,chainer/chainer,hvy/chainer,niboshi/chainer,ktnyt/chainer,tkerola/chainer,niboshi/chainer,chainer/chainer,niboshi/chainer,anaruse/chainer,wkentaro/chainer,okuta/chainer,ktnyt/chainer,ronekko/chainer,hvy/chainer,hvy/chainer,jnishi/chainer,okut... | tests/chainer_tests/training_tests/triggers_tests/test_early_stopping_trigger.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new version of dump source that actually marches along the nodes\n\nThe content of the nodes need to better done. However, this example does show that we can access the elements of the source AST including annotations."
},
{
"r... | python | new_file | 2 | 4 | mit | 39fc0fe91ca4bf787ceeab9ff594168f70fe0dba | michael-okeefe/soep-sandbox | src/python2/dump_source.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for exclude passing"
},
{
"role": "assistant",
"content": "import pytest\nimport salt.modules.saltutil as saltutil\nimport salt.states.saltmod as saltmod\nfrom tests.support.mock import create_autospec, patch\n\n\n@pyte... | python | new_file | 1 | 1 | apache-2.0 | f30d459b8527074e50de504695491ad17bb18f0e | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/pytests/unit/states/test_saltmod.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for TimedProc regression"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# Import python libs\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Import Salt Testing libs... | python | new_file | 1 | 1 | apache-2.0 | 6143408507468c1718999bc2bc16d7e394741e29 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/utils/test_timed_subprocess.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple test for FormDesignerPlugin"
},
{
"role": "assistant",
"content": "import pytest\nfrom cms import api\nfrom cms.page_rendering import render_page\nfrom django.contrib.auth.models import AnonymousUser\nfrom django.utils... | python | new_file | 1 | 1 | bsd-3-clause | c67dc16e73eea093befaa03790bd8d6f1b452c9a | kcsry/django-form-designer,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer-ai,andersinno/django-form-designer-ai | form_designer/tests/test_cms_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test script for the bsddb C extension module."
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n\"\"\"Test script for the bsddb C module\n Roger E. Masse\n\"\"\"\nimport bsddb\nimport tempfile\nfrom test_support im... | python | new_file | 39 | 15 | mit | 3644df1b645d4fd607f22b24c5e676644be4a9da | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_bsddb.py | rejected_lint | Too many lint violations: 39 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom telemetry.page import page as page\nfrom telemetry.page import page_... | python | edit | 1 | 1 | bsd-3-clause | 0f5716b10afff9ccbc17fb595cd7cc2f85b45f8f | Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,axinging/ch... | tools/perf/page_sets/service_worker.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add coin flip simulator (hw02)"
},
{
"role": "assistant",
"content": "'''\nFor Homework 02, Exercieses 01-02. EdX Learning From Data course.\nJonathan Miller\n'''\n\nimport random\n\n# FUNCTIONS ###########################\n\ndef... | python | new_file | 2 | 4 | apache-2.0 | b2a0247746756cc86074754bc993a757d6702b12 | JMill/edX-Learning-From-Data-Programming | hw02/exercise-02-01.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test trek_dtail_pdf language none"
},
{
"role": "assistant",
"content": "import os\n\nfrom django.test import TestCase\nfrom django.conf import settings\n\nfrom geotrek.trekking.factories import TrekFactory\nfrom geotrek.trek... | python | new_file | 1 | 1 | bsd-2-clause | f7b875bb3d4b313e9c1e22297918d33e67633104 | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | geotrek/altimetry/tests/test_models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some useful finder tests"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# Copyright (C) 2016 GoDaddy Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); y... | python | new_file | 1 | 0 | apache-2.0 | 7cb4a7290b2af1983e1e291073c0a740d9e1334e | harlowja/failure | failure/tests/test_finders.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert tests from RethinkDB core."
},
{
"role": "assistant",
"content": "import re\n\ntry:\n import yaml\nexcept:\n print('PyYAML not installed')\n\nfrom pathlib import Path\n\ndef mkdir(path):\n try:\n ... | python | new_file | 3 | 4 | apache-2.0 | a50b96ece7db9b732a6dc96c6d981588a5760311 | grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core | test_builder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add match to wd script."
},
{
"role": "assistant",
"content": "import csv\nimport pickle\nimport sys\n\n\ndef load_index():\n with open('data/wd_issn.pkl') as inf:\n data = pickle.load(inf)\n return data\n\nwd_idx = ... | python | new_file | 5 | 4 | mit | 8a0d40f9874119084f5f7a1471cb565bb85d6938 | lawlesst/c4l16-idhub | match_to_wd.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to check if modules up"
},
{
"role": "assistant",
"content": "from subprocess import call\nimport os\n\nmodules = [\n 'backend.unichat.eu',\n 'realtime.unichat.eu',\n 'presence.unichat.eu',\n 'matchmaker.un... | python | new_file | 1 | 0 | mit | 583155db6a85808c69fa25ba4959ebd370aa2fba | dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet | etc/config/check_modules.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snomask for OPER attempts"
},
{
"role": "assistant",
"content": "from twisted.plugin import IPlugin\nfrom txircd.module_interface import IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass SnoOper(Module... | python | new_file | 1 | 2 | bsd-3-clause | fc5714951bac61f17509eacf8ec2413e14a79ddc | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/core/sno_oper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration to allow Auditor role to see mappings defined in the Audit context."
},
{
"role": "assistant",
"content": "\n\"\"\"Add mappings to Auditor role\n\nRevision ID: 54b6efd65a93\nRevises: 13b49798db19\nCreate Date: 201... | python | new_file | 3 | 2 | apache-2.0 | 50db2fa37aab219c9273cf3f76269de11e2dc86b | andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,hyperNURb/ggrc-core,jmakov/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,hyperNURb/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,V... | src/ggrc_basic_permissions/migrations/versions/20131204014446_54b6efd65a93_add_mappings_to_audi.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add PyQtGraph random walk without datetime"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis example demonstrates a random walk with pyqtgraph.\n\"\"\"\n\nimport sys\nimport numpy... | python | new_file | 4 | 3 | bsd-3-clause | 186b231b7149b52dc95837aabd5f44b1c02c8e41 | scls19fr/numpy-buffer | samples/sample_pyqtgraph_no_datetime.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to rename a stream.\n\n(imported from commit b3acadc09b289b48e2ac298e50a5427545b6a473)"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nfrom django.core.management.base imp... | python | new_file | 3 | 3 | apache-2.0 | 8f3c5dc924b0a8ad35d99d66eb809a51b49fc178 | eeshangarg/zulip,dhcrzf/zulip,wavelets/zulip,hengqujushi/zulip,praveenaki/zulip,armooo/zulip,JanzTam/zulip,glovebx/zulip,amanharitsh123/zulip,dxq-git/zulip,xuxiao/zulip,stamhe/zulip,pradiptad/zulip,akuseru/zulip,bitemyapp/zulip,JPJPJPOPOP/zulip,zorojean/zulip,kokoar/zulip,zwily/zulip,LAndreas/zulip,christi3k/zulip,nata... | zerver/management/commands/rename-stream.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add base model obect to project."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\"\"\"\nBase model of project.\nContains to basic methods:\n dumps(object_data) - writes object into json.\n loads(json_data... | python | new_file | 1 | 1 | mit | c74ce3d4561a7367903863aaabe1af113d43aa0c | 0xporky/mgnemu-python | mgnemu/models/BaseModel.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a framework for data retention policies\n\nAnd add customer1.invalid to it.\n\n(imported from commit 32b0293bc48abf5d9a3bd36f14f6b16d48ea6ff2)"
},
{
"role": "assistant",
"content": "\"\"\"\nImplements the per-domain dat... | python | new_file | 3 | 4 | apache-2.0 | 5caf67f27d82689babf5dcf0a234dfe3c261ff9c | akuseru/zulip,AZtheAsian/zulip,KJin99/zulip,EasonYi/zulip,rishig/zulip,seapasulli/zulip,gigawhitlocks/zulip,dotcool/zulip,wdaher/zulip,dattatreya303/zulip,arpith/zulip,aps-sids/zulip,natanovia/zulip,wangdeshui/zulip,fw1121/zulip,JanzTam/zulip,natanovia/zulip,mansilladev/zulip,littledogboy/zulip,bowlofstew/zulip,dhcrzf/... | zephyr/retention_policy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a tool-info module for AVR"
},
{
"role": "assistant",
"content": "# This file is part of BenchExec, a framework for reliable benchmarking:\n# https://github.com/sosy-lab/benchexec\n#\n# SPDX-FileCopyrightText: 2007-2020 Di... | python | new_file | 1 | 6 | apache-2.0 | e6a3e2ac8267ae3a0f361138bd8cb25f82b12b9d | sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec | benchexec/tools/avr.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for check_inputs."
},
{
"role": "assistant",
"content": "from utilities.simulation_utilities import check_inputs\n\nimport pytest\nimport numpy as np\n\n\n@pytest.mark.parametrize(\"input,expected\", [\n (None, np.n... | python | new_file | 1 | 1 | mit | e8c8464d36e91c9a8d61db0531a2e73dcdee88b7 | jason-neal/companion_simulations,jason-neal/companion_simulations | utilities/tests/test_simulation_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 688. Knight Probability in Chessboard\n\n688. Knight Probability in Chessboard: https://leetcode.com/problems/knight-probability-in-chessboard/"
},
{
"role": "assistant",
"content": "from collections import Co... | python | new_file | 2 | 7 | apache-2.0 | b5c6e37bdcb88545d187ad1e3adbbbe1d466f874 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/knight-probability-in-chessboard.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create class to update instances with offering"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\n\nclass UpdateInstances(object):\n\n @staticmethod\n def do():\n from dbaas_cloudstack.models import DatabaseIn... | python | new_file | 1 | 5 | bsd-3-clause | f80acf05f7d492f3716be961b88c4e82d332500c | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/util/update_instances_with_offering.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test case for interval_sum\n\nSigned-off-by: Kapileshwar Singh <<EMAIL>>"
},
{
"role": "assistant",
"content": "from bart.common import Utils\nimport unittest\nimport pandas as pd\n\n\nclass TestCommonUtils(unittest.Te... | python | new_file | 1 | 1 | apache-2.0 | 17fe9d01b6771888a44d6a039b337a84c32e64e8 | JaviMerino/bart,ARM-software/bart | tests/test_common_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate partition ids."
},
{
"role": "assistant",
"content": "import sys\nimport random\n\nif len(sys.argv) != 3:\n print >> sys.stderr, \"USAGE: python generate_partitions.py nodes partitions_per_node\"\n sy... | python | new_file | 7 | 0 | apache-2.0 | b373eaab5918488292075c962f4374dc8815c395 | medallia/voldemort,HB-SI/voldemort,voldemort/voldemort,HB-SI/voldemort,cshaxu/voldemort,squarY/voldemort,medallia/voldemort,cshaxu/voldemort,stotch/voldemort,rickbw/voldemort,birendraa/voldemort,voldemort/voldemort,birendraa/voldemort,PratikDeshpande/voldemort,HB-SI/voldemort,null-exception/voldemort,mabh/voldemort,jal... | test/integration/generate_partitions.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test traverses a TS file quickly"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n'''\nModule: test\nDesc: Test to see how quickly I can parse TS es packets\nAuthor: John O'Neil\nEmail: <EMAIL>\nDATE: Thursday, Octob... | python | new_file | 3 | 7 | apache-2.0 | ecef0ea7743f25326183d09622949682ce6feb3c | johnoneil/arib,johnoneil/arib | test/ts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add reverse a list of characters in place"
},
{
"role": "assistant",
"content": "#!/Applications/anaconda/envs/Python3/bin\n\n\ndef main():\n # Test suite\n tests = [ None, [''], ['f','o','o',' ','b','a','r']]\n for t in... | python | new_file | 1 | 3 | mit | 8953b336dfcb8bd6c69b2af8e960a215a47838f8 | HKuz/Test_Code | Problems/reverseStringInPlace.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snippet (Python OpenCV)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n\"\"\"\nOpenCV - Write image: write an image giv... | python | new_file | 1 | 1 | mit | 62a860112db8c263d26eb9e4cdb67d23ce61848a | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/write_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example heat map script for data"
},
{
"role": "assistant",
"content": "import numpy as np\nimport numpy.ma as ma\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom pyiem.plot import MapPlot\nimport sys\n\nyea... | python | new_file | 3 | 0 | mit | 112e3516d7c77f23edfed704651e8c5e7f7d75e4 | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/DEV/adm/heatmap.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests creation of grammar with terminals as parameters"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\nfrom ... | python | new_file | 3 | 1 | mit | e78e56e38dfa7bfac79bc3a699ca76236d700e2a | PatrikValkovic/grammpy | tests/grammar_term-nonterm_test/TerminalAddWhenCreatingTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utilities for the clients"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\nnapalm-logs utilities\n'''\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\n# Import pythond st... | python | new_file | 14 | 3 | apache-2.0 | be8b7c27b25b60540c2e53504ce42543724577df | napalm-automation/napalm-logs,napalm-automation/napalm-logs | napalm_logs/utils/__init__.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Enable Django Admin for some of our data"
},
{
"role": "assistant",
"content": "from django.contrib import admin\nfrom models import MuseumObject,FunctionalCategory\n\nclass MOAdmin(admin.ModelAdmin):\n fields = ('registration... | python | new_file | 1 | 0 | bsd-3-clause | 91396ed246166f610e9cfc4519862f061af4e6b2 | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | cat/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a GreetingsPlugin as a sample plugin"
},
{
"role": "assistant",
"content": "from fnexchange.core.plugins import AbstractPlugin\n\n\nclass GreetingsPlugin(AbstractPlugin):\n \"\"\"\n GreetingsPlugin provides an interf... | python | new_file | 1 | 2 | apache-2.0 | 55ccaad47c2e3a1432b012218c72bca28fe06d73 | dnif/fnExchange-sample-plugin | greetings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add poolstat api example to project root."
},
{
"role": "assistant",
"content": "import requests\nimport hmac\nimport hashlib\nimport base64\n\nPUBLIC_KEY = '##'\nPRIVATE_KEY = '##'\nURL = 'https://www.poolstat.net.au/restapi/v1/... | python | new_file | 3 | 1 | mit | a4f86e11bbdcf2f478fd9cfb8df33a150f8a086e | benjiboi214/mmpl-wagtail,benjiboi214/mmpl-wagtail,benjiboi214/mmpl-wagtail | poolstatapi-example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a first draft of the evaluation module."
},
{
"role": "assistant",
"content": "from models.cuberun import CubeRun\nimport numpy as np\nimport utils\nimport loader\n\nnb_classes = 19\ninput_shape = (257, 624, 1)\n(cols, rows, ... | python | new_file | 4 | 3 | mit | 986ee0ffae416cf1dc833f581a89d718dc2ff2fe | johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification | bird/evaluate.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement links server notice type"
},
{
"role": "assistant",
"content": "from twisted.plugin import IPlugin\nfrom txircd.modbase import IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass SnoLinks(ModuleData)... | python | new_file | 1 | 2 | bsd-3-clause | edc982bdfaece6aaf23b3e7f9c967de800eacbd6 | Heufneutje/txircd | txircd/modules/extra/snotice_links.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to print the scheduling times of albums"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\n\"\"\"Radio scheduling program.\n\nUsage:\n album_times.py [--host=HOST] PORT\n\nOptions:\n --host=HOST Host... | python | new_file | 1 | 5 | mit | 1ef84c24c60cf802aeb4bf6084f9b7fc7696f79a | barrucadu/lainonlife,barrucadu/lainonlife,barrucadu/lainonlife,barrucadu/lainonlife | scripts/album_times.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add code for getting team schedule and game outcomes"
},
{
"role": "assistant",
"content": "import pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\n\n# TODO: raise error if year > current year or < first year of a te... | python | new_file | 2 | 16 | mit | bda42a4630e8b9e720443b6785ff2e3435bfdfa6 | jldbc/pybaseball | pybaseball/team_results.py | rejected_complexity | Cyclomatic complexity too high: 16 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for username length\n\nThe username length changed from 30 to 150 in commit f2a0c964 which\nupdated Django to 1.10, but there was no migration created. Add the\nmissing migration."
},
{
"role": "assistant",
... | python | new_file | 1 | 0 | mit | c65f59c6a6048807d29e5ce123447afd006ce05f | mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo | users/migrations/0007_username_length.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create new module for continuous design variables"
},
{
"role": "assistant",
"content": "\"\"\"Implementation of a Dakota continous design variable.\"\"\"\n\nfrom .base import VariableBase\n\n\nclassname = 'ContinuousDesign'\n\n\... | python | new_file | 3 | 8 | mit | 4b0221ca503be9450919e4ed4e6a75ce92cd2d63 | csdms/dakota,csdms/dakota | csdms/dakota/variables/continuous_design.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add builder to compile coffeescript to javascript files"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport fnmatch\nimport os\nfrom subprocess import call\n \nrootPath = 'ludumdare26'\npattern = '*.coffee'\n \... | python | new_file | 1 | 0 | apache-2.0 | 30d0ca9fa2c76463569362eb0f640dbbe0079068 | ZzCalvinzZ/ludumdare26,ZzCalvinzZ/ludumdare26 | buildGame.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of membership fee updater"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport datetime\nimport dateutil.parser\n\nfrom creditor.models import RecurringTransaction, TransactionTag\nfrom credi... | python | new_file | 4 | 3 | mit | df03481fd9b52e17bc637dacefd15bead4f07f23 | HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum | project/creditor/management/commands/update_membershipfees.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to upload files to carto db"
},
{
"role": "assistant",
"content": "#uploadtoCDB.py\n#Written By: Alejandro Morejon Cortina (Apr 2016)\n#usage:python uploadtoCDB.py <username> <filecontainingkey.txt> <upload.csv>\n\nimp... | python | new_file | 2 | 0 | mit | 4e8ff1f7e524d8dc843816c714e86d11e21a8562 | alejandro-mc/BDM-DDD,alejandro-mc/BDM-DDD | uploadtoCDB.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add downloader for per-polling-station data"
},
{
"role": "assistant",
"content": "import argparse\nimport glob\nimport json\n\nfrom kvd_utils import download_json, get_session\n\next_url_template = 'https://vaalit.yle.fi/content... | python | new_file | 1 | 4 | mit | 80a1cc839abc23a80b511c99e6a6c03b044eaf35 | akx/yle-kuntavaalit-2017-data | ext_download.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\nfrom django.core.management.base import BaseCommand\nfrom corehq.apps.smsforms.models import XFormsSession, sync_sql_session_from_couch_session, SQLXFormsSession\nfrom dimagi.utils.couch.database import iter_docs\n\n\nclass ... | python | edit | 3 | 6 | bsd-3-clause | 574b069363f74de35b75b6b28ca66976e6af45bb | dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/smsforms/management/commands/migrate_sms_sessions_to_sql.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add import script for Rhondda Cynon Taff"
},
{
"role": "assistant",
"content": "\"\"\"\nImport Rhondda Cynon Taf\n\nnote: this script takes quite a long time to run\n\"\"\"\nfrom time import sleep\nfrom django.contrib.gis.geos im... | python | new_file | 1 | 7 | bsd-3-clause | 23f626ddaabfa799da48ee35c29db05f95f8a732 | andylolz/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations,andylolz/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_rct.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a class to get a random photo of a folder"
},
{
"role": "assistant",
"content": "import random\n\n\nclass Cheesefolder():\n\n def __init__(self, folder):\n self.directory = folder\n pass\n\n def getrandomp... | python | new_file | 1 | 1 | mit | 2dfc4fcc61c0f9d00860168d44da5e03db8e61eb | MarkusAmshove/Photobox | photobox/cheesefolder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to calculate paried roi bbox emean and std."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport argparse\nimport scipy.io as sio\nimport sys\nimport os.path as osp\nimport numpy as np\nimport cPick... | python | new_file | 1 | 0 | mit | 0bef4682c6a81464fd6e72fddd6f0b5957f4d566 | myfavouritekk/TPN | tools/data/calculate_paired_bbox_mean_std.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an integration folder for tests that are beyond the unittest scope"
},
{
"role": "assistant",
"content": "\"\"\"\nThis is a basic test which allows you to setup a server and listen to it.\n\nFor example, running:\n\npython in... | python | new_file | 3 | 1 | bsd-3-clause | a8bded67a92632fd6d2d8791dd245dc82c773c8d | markrwilliams/tectonic | integration/basic_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to help create release zip"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport zipfile\n\ndef zipdir(path, ziph):\n # ziph is zipfile handle\n for root, dirs, files in os.walk(path):\n for... | python | new_file | 2 | 3 | mit | 6a47701ea874e657475542809ac0f9320063cb9b | james91b/ida_ipython,james91b/ida_ipython,tmr232/ida_ipython,james91b/ida_ipython | releasezip.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a generic Vispy widget"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\n\nimport sys\n\nfrom vispy import scene\nfrom glue.external.qt import QtGui, get_qapp\n\n\n... | python | new_file | 1 | 2 | bsd-2-clause | b3b7e2fcbff5cd0ec2d2b4457b7a46d1846d55a8 | PennyQ/glue-3d-viewer,PennyQ/astro-vispy,glue-viz/glue-vispy-viewers,glue-viz/glue-3d-viewer,astrofrog/glue-vispy-viewers,astrofrog/glue-3d-viewer | glue_vispy_viewers/common/vispy_viewer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for encoding subsystem"
},
{
"role": "assistant",
"content": "from diana.encoding import encode, decode\nfrom nose.tools import eq_\n\nDECODE_TESTS = [ ('', (), ()),\n ('b', (0x00,), (0,)),\n ... | python | new_file | 1 | 2 | mit | 1c7f6a6c44af9c2de372fb2c07469da29bc11764 | prophile/libdiana | tests/test_encoding.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example listing backup counts"
},
{
"role": "assistant",
"content": "import urbackup_api\r\n\r\nserver = urbackup_api.urbackup_server(\"http://127.0.0.1:55414/x\", \"admin\", \"foo\")\r\n\r\nclients = server.get_status()\r\n\... | python | new_file | 1 | 0 | apache-2.0 | 93a1ff67e62d0508744420cab8263a8cc893b119 | uroni/urbackup-server-python-web-api-wrapper | test/list_backup_counts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add custom IPython configuration ✨"
},
{
"role": "assistant",
"content": "\"\"\"\nIPython configuration with custom prompt using gruvbox colors.\n- https://github.com/reillysiemens/ipython-style-gruvbox\n\nThanks to @petobens for... | python | new_file | 2 | 3 | isc | 8994f69f23271aa93d83e81032542f17b38423fd | reillysiemens/dotfiles,reillysiemens/dotfiles | .ipython/profile_default/ipython_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to generate data sets for testing sorting algorithms."
},
{
"role": "assistant",
"content": "# Description: Script to Generate Data Sets For Sorting Algorithms\n\nimport random\nimport logging\n\n# Global Configurati... | python | new_file | 1 | 4 | mit | c6951374eba137614744928c18fa4d34de5c5d89 | vikash-india/ProgrammingProblems,vikash-india/ProgrammingProblems | src/algorithms/sorting/dataset_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Define default crispy form helper"
},
{
"role": "assistant",
"content": "#-*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nimport crispy_forms.helper\n\n\nclass DefaultFormHelper(crispy_forms.helper.FormHelper)... | python | new_file | 1 | 1 | mit | 7021806e9e510286424dae696c2f4eee0a70b630 | nigma/djutil | src/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new script to build Dogecoin"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\nimport re\nimport os\nimport string\nimport sys\nimport subprocess\nimport auto_merge\n\ndef compile_dogecoin():\n path = os.getcwd()\... | python | new_file | 4 | 1 | mit | eb9ba88177ce23ef259b1731f02c38d0ccaa8318 | rnicoll/robodoge | run_build.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add PC / DWPC test"
},
{
"role": "assistant",
"content": "import os\n\nimport pytest\n\nimport hetio.readwrite\nfrom hetio.pathtools import paths_between, DWPC\n\ndirectory = os.path.dirname(os.path.abspath(__file__))\n\n\ndef te... | python | new_file | 1 | 1 | cc0-1.0 | 45917087377adef01a4d4ce829013a7958a3afe5 | dhimmel/hetio | test/pathtools_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests/cpydiff: Add a test for storing iterable to a list slice."
},
{
"role": "assistant",
"content": "\"\"\"\ncategories: Types,list\ndescription: List slice-store with non-iterable on RHS is not implemented\ncause: RHS is restr... | python | new_file | 1 | 0 | mit | 465a604547e1438e650c8b4142816e2330363767 | alex-robbins/micropython,adafruit/circuitpython,PappaPeppar/micropython,adafruit/micropython,SHA2017-badge/micropython-esp32,swegener/micropython,Timmenem/micropython,henriknelson/micropython,adafruit/micropython,TDAbboud/micropython,SHA2017-badge/micropython-esp32,deshipu/micropython,deshipu/micropython,deshipu/microp... | tests/cpydiff/types_list_store_noniter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a debug tool to show advertising broadcasts"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport os, sys\nprint(sys.version_info)\nimport marshal\nimport select\nimport socket\nimport time\n\ndef _unpack(mes... | python | new_file | 3 | 1 | mit | d6d4f175330638f35d4eb0512ef14f82eab74f50 | tjguk/networkzero,tjguk/networkzero,tjguk/networkzero | show-adverts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.test import SimpleTestCase\nfrom jsonobject.exceptions import BadValueError\n\nfrom corehq.apps.userreports.reports.specs import ReportColumn\n\n\nclass TestReportColumn(SimpleTestCase):\n def testBadAggregation(self):\n ... | python | edit | 1 | 2 | bsd-3-clause | 4a70f9ed2f19cba08208fa9f2a3cafe38ee283b6 | qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/apps/userreports/tests/test_columns.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to plot population vs distinct hashtags."
},
{
"role": "assistant",
"content": "\"\"\"\nPlot and calculate county population size to number of distinct hashtags.\n\n\"\"\"\nimport matplotlib.pyplot as plt\nimport seabo... | python | new_file | 2 | 2 | unlicense | 3e3e5bb92b1d9e0e1981a6deba41152826c3fce0 | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | scripts/popvsdistinct.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new class to compute the colourmap and the node filters accordingly to did"
},
{
"role": "assistant",
"content": "\"\"\"@package Colours\nThis module provides the colourmaps used in globOpt to display primitives \naccording t... | python | new_file | 2 | 4 | apache-2.0 | f290dd020b2cb3e586c8de6c4e8e3c1bc80f3583 | amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt | evaluation/packages/colours.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file to read .RAW images from Aptina\n\nReading the files via numpy.memmap can destroy the files if one performs\ncalculations like Image -= numpy.mean(Image), since those changes are\nsaved to disk immediately... Thus loading the .RAW f... | python | new_file | 2 | 0 | unlicense | 833d114bd1bc396dc7c6b0434782f9e326319e88 | habi/GlobalDiagnostiX,habi/GlobalDiagnostiX,habi/GlobalDiagnostiX | readAptinaRAW.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the command handler framework"
},
{
"role": "assistant",
"content": "from twisted.plugin import IPlugin\nfrom heufybot.moduleinterface import BotModule, IBotModule\nfrom zope.interface import implements\n\n\nclass Comma... | python | new_file | 1 | 1 | mit | 56fd675e5bf0bd68a73e21c244807c39a87a3eee | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | heufybot/modules/util/commandhandler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test recipient address formatting in user message e-mails"
},
{
"role": "assistant",
"content": "\"\"\"\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom unittest.mock i... | python | new_file | 3 | 1 | bsd-3-clause | 36fb0255a4037a9fe7b6d61868f8666325fea944 | m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | tests/blueprints/user_message/test_address_formatting.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Heap sort implemented in python"
},
{
"role": "assistant",
"content": "# Python program for implementation of heap Sort\n\n# To heapify subtree rooted at index i.\n# n is size of heap\ndef heapify(arr, n, i):\n\tlargest = i #... | python | new_file | 1 | 6 | cc0-1.0 | 26cad83ebb6466d66f1e9fd87e963af4b5247ecc | 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... | sort/heap_sort/python/heap_sort_ccsc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic IAM integration test"
},
{
"role": "assistant",
"content": "# Copyright (c) 2014 Amazon.com, Inc. or its affiliates.\n# All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\... | python | new_file | 1 | 1 | mit | 5e81fca928862b1c9574f1092a131337735b63f4 | lra/boto,jotes/boto,Asana/boto,nexusz99/boto,serviceagility/boto,ekalosak/boto,shipci/boto,yangchaogit/boto,varunarya10/boto,kouk/boto,podhmo/boto,j-carl/boto,janslow/boto,disruptek/boto,nikhilraog/boto,bryx-inc/boto,khagler/boto,TiVoMaker/boto,s0enke/boto,stevenbrichards/boto,acourtney2015/boto,weka-io/boto,rayluo/bot... | tests/integration/iam/test_connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for missing building part seen in production."
},
{
"role": "assistant",
"content": "# http://www.openstreetmap.org/way/287494678\nz = 18\nx = 77193\ny = 98529\nwhile z >= 16:\n assert_has_feature(\n z, x, y, '... | python | new_file | 2 | 0 | mit | f0ac1914790e69fe786d6d3182cf15fd09302c28 | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | integration-test/912-missing-building-part.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .errors import *\nfrom .browser import AggregationBrowser\nfrom .extensions import get_namespace, initialize_namespace\n\n__all__ = (\n \"open_store\",\n \"Store\"\n )\n\n\ndef open_store(name, **options):\... | python | edit | 4 | 3 | mit | 1b83a31090cd803d2eca0b9caed0f4cc9a149fbd | noyeitan/cubes,jell0720/cubes,zejn/cubes,jell0720/cubes,she11c0de/cubes,cesarmarinhorj/cubes,jell0720/cubes,she11c0de/cubes,cesarmarinhorj/cubes,she11c0de/cubes,zejn/cubes,pombredanne/cubes,ubreddy/cubes,cesarmarinhorj/cubes,pombredanne/cubes,pombredanne/cubes,noyeitan/cubes,ubreddy/cubes,zejn/cubes,ubreddy/cubes,noyei... | cubes/stores.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for problem 6"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nlimit = 100\n\nsum_sq = ((limit + 1) * limit) / 2\nsum_sq *= sum_sq\nsq_sum = (limit * (limit + 1) * ((limit * 2) + 1)) / 6\n\nprint (int (sum... | python | new_file | 1 | 0 | mit | 4046c743323a4357864afcac482a5625ed71c184 | cifvts/PyEuler | euler006.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Complete day 4 part 2"
},
{
"role": "assistant",
"content": "import hashlib\n\n\npuzzle_input = b'iwrupvqb'\nnumber = 100000\n\nwhile True:\n key = puzzle_input + str(number).encode()\n if hashlib.md5(key).hexdigest()[:6] =... | python | new_file | 1 | 0 | mit | c3d87e837c85284baa132104e4843c3fd8f429d3 | foxscotch/advent-of-code,foxscotch/advent-of-code | day-04-2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility methods for facebook stuff."
},
{
"role": "assistant",
"content": "import facebook\n\ndef profile_for_user(user):\n profile = user.facebookprofile_set.all()\n if not profile:\n return None\n return profile[0]\n\... | python | new_file | 2 | 3 | mit | 083957302452bdd966286bfd8d37d53dce8db7d3 | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | pykeg/contrib/facebook/fbutil.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that changelog is not outdated"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nimport user_agent\nimport re\n\n\ndef test_changelog():\n \"\"\"\n Parse changelog and ensure that it cont... | python | new_file | 1 | 3 | mit | 1dd1111bd1bab62ed900d74f347a7fe10d03eb03 | lorien/user_agent | test/release.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for GameNode module"
},
{
"role": "assistant",
"content": "\"\"\" Tests for the GameNode module \"\"\"\n\nfrom contextlib import contextmanager\nfrom io import StringIO\nimport sys\nimport unittest\n\nfrom src import ga... | python | new_file | 1 | 2 | mit | 090c73c20e3a57f5b2710c270b0dfc139633d623 | blairck/jaeger | test/test_gamenode.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to migrate SMSLog to SQL"
},
{
"role": "assistant",
"content": "from corehq.apps.sms.models import SMSLog, SMS\nfrom custom.fri.models import FRISMSLog\nfrom dimagi.utils.couch.database import iter_docs\nfrom django.c... | python | new_file | 4 | 4 | bsd-3-clause | 337e60c3d63b56b1237e3d5b052a96f3824cc6c2 | dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | corehq/apps/sms/management/commands/migrate_sms_to_sql.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the skeleton and docs"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\n'''\nSafe Command\n============\n\nThe idea behind this module is to allow an arbitrary command to be executed\nsafely, with the argument... | python | new_file | 3 | 1 | apache-2.0 | 3063044995a14921fd0da2ebbbd57942bb5ca24d | basepi/hubble,basepi/hubble | hubblestack/extmods/modules/safecommand.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plot for color property combinations to examples."
},
{
"role": "assistant",
"content": "import bokeh.plotting as plt\nfrom itertools import product\n\nplt.output_file('properties_alpha.html')\n\ncats = ['RGB', 'RGBA', 'Alpha... | python | new_file | 1 | 0 | bsd-3-clause | d1588bdf0a672de8d7d4f4f9cddcc236f5b9026e | CrazyGuo/bokeh,ericdill/bokeh,saifrahmed/bokeh,stuart-knock/bokeh,schoolie/bokeh,PythonCharmers/bokeh,alan-unravel/bokeh,percyfal/bokeh,mindriot101/bokeh,satishgoda/bokeh,roxyboy/bokeh,daodaoliang/bokeh,ChristosChristofidis/bokeh,rs2/bokeh,Karel-van-de-Plassche/bokeh,aavanian/bokeh,ChristosChristofidis/bokeh,Karel-van-... | examples/plotting/file/properties_alpha.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new migrations (use \"\" as default for hash)\n\nFixes #22"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migrati... | python | new_file | 1 | 0 | mit | 53d0d5886670ba33a645fd8c82479fb4495d25d1 | sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz | website/migrations/0002_auto_20150118_2210.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.