messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Write python code for the following: Add migration mentioned in last commit..."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport django.utils.timezone\n\n\nclas... | python | new_file | 1 | 0 | bsd-3-clause | 3b852c14c76a95b386e6644b99a589c0ae4c19ed | fsr/course-management,fsr/course-management | course/migrations/0005_auto_20160622_2313.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test to cover Mako entry point."
},
{
"role": "assistant",
"content": "from unittest import TestCase\r\n\r\nfrom dogpile.cache import util\r\n\r\n\r\nclass MakoTest(TestCase):\r\n \"\"\" Test entry point for Mako\r\n ... | python | new_file | 2 | 2 | bsd-3-clause | a2f9a972c5ccb4bcecff89c07ee8a9a73ca97fd1 | thruflo/dogpile.cache,thruflo/dogpile.cache | tests/cache/test_mako.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add all test runner for command line. Now every test can be run for commandline"
},
{
"role": "assistant",
"content": "import glob\nimport unittest\nimport os, sys\n\nif __name__ == '__main__':\n PROJECT_ROOT = os.path.dirname... | python | new_file | 3 | 0 | mit | c6b9bb93f268b7c1dc100c75a7c36326d63450d5 | kyamaguchi/SublimeObjC2RubyMotion,kyamaguchi/SublimeObjC2RubyMotion | tests/all_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to decode an internal error backtrace"
},
{
"role": "assistant",
"content": "'''\nScript to decode an internal error backtrace\n'''\n\nimport sys\nfrom subprocess import Popen, PIPE\n\nif len(sys.argv) != 2 and len(sys... | python | new_file | 3 | 0 | mit | 2a5c513c1916b42a044aef15f0d407229c7adc7e | gil0mendes/Initium,gil0mendes/Initium,gil0mendes/Initium | utilities/decodetrace.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: JM: Add example read of previously written LCIO using Python"
},
{
"role": "assistant",
"content": "import lcio\n\nfac = lcio.LCFactory.getInstance()\nrdr = fac.createLCReader()\nrdr.open(\"write_test.slcio\")\nevt = rdr.readNext... | python | new_file | 3 | 0 | bsd-3-clause | 891c53eee0c6e6487ab0ba0e9d1e92d117678c9a | petricm/LCIO,petricm/LCIO,petricm/LCIO,iLCSoft/LCIO,petricm/LCIO,iLCSoft/LCIO,petricm/LCIO,petricm/LCIO,iLCSoft/LCIO,iLCSoft/LCIO,iLCSoft/LCIO,iLCSoft/LCIO | src/python/read_back.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new collector Get JSON and transform it into flat metrics"
},
{
"role": "assistant",
"content": "# coding=utf-8\n\n\"\"\"\nSimple collector which get JSON and parse it into flat metrics\n\n#### Dependencies\n\n * urllib2\n\n\... | python | new_file | 1 | 6 | mit | 23da61b3887b98df4d4f943101a2673f39920b7e | Ormod/Diamond,Netuitive/Diamond,zoidbergwill/Diamond,thardie/Diamond,sebbrandt87/Diamond,codepython/Diamond,stuartbfox/Diamond,MichaelDoyle/Diamond,thardie/Diamond,gg7/diamond,hamelg/Diamond,krbaker/Diamond,zoidbergwill/Diamond,gg7/diamond,cannium/Diamond,Netuitive/Diamond,jaingaurav/Diamond,tuenti/Diamond,disqus/Diamo... | src/collectors/jsoncommon/jsoncommon.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy from my project create-txt-file-by-name."
},
{
"role": "assistant",
"content": "# -*- coding:utf-8 -*-\n\n'''\n這個程式能夠為同目錄下的所有檔案(含子資料夾)都建立一個同名的txt檔\n'''\n\nimport os\n\ndef create_txt_file(fileSimpleName):\n fileName = (fi... | python | new_file | 1 | 5 | mit | 8af2e4a5023beeab22b87b4aab7133fd5a3c5be4 | YiFanChen99/file-walker-for-windows | ConvertFiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to demo Sense HAT buttons"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# from https://pythonhosted.org/sense-hat/api/#joystick\n\nfrom sense_hat import SenseHat, ACTION_PRESSED, ACTION_HELD, ACTION_R... | python | new_file | 4 | 2 | mit | 4816e8a6b2c1c9ef416bab5cd7d53005cd6d72c2 | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | hardware/sense_hat/demo_buttons.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 540. Single Element in a Sorted Array\n\n540. Single Element in a Sorted Array: https://leetcode.com/problems/single-element-in-a-sorted-array/"
},
{
"role": "assistant",
"content": "class Solution(object):\n ... | python | new_file | 1 | 4 | apache-2.0 | c93b8f20a65fbb2e6a2e23aad7de0c496778aa23 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/single-element-in-a-sorted-array.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy subtree plugin. Unfinished and untested."
},
{
"role": "assistant",
"content": "\"\"\"Copy values or subtrees, either locally or remotely.\n\nCurrently a quick hack using either direct database access or httplib2, synchronou... | python | new_file | null | null | mit | 45bb10691ba7021bfb834a8941ac8492ae8509af | cwi-dis/igor,cwi-dis/igor,cwi-dis/igor | igor/plugins/copy/copy.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for a film deletting."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom selenium import webdriver\nfrom selenium.common.exceptions import NoSuchElementException\nimport unittest\n\n\nclass AddFilm(un... | python | new_file | 3 | 3 | bsd-2-clause | 5d743690e1d236090064c7bb95f872d1fa279b52 | bsamorodov/selenium-py-training-samorodov | php4dvd/test_deletefilm.py | rejected_duplicate | Near-duplicate of sample 5968 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of the MT-940 parser"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom django_banking.models import MT940\n\ndef parse_mt940(input):\n\n messages = []\n message = None\n\n for lin... | python | new_file | 1 | 4 | bsd-3-clause | a2b08ba7f575bde42c57d24b4effaceea0ac4829 | headcr4sh/django-banking | django_banking/parsers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a really simple burn-in test helper"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n# Burn-in test: Keep LEDs at full brightness most of the time, but dim periodically\n# so it's clear when there's a problem.\... | python | new_file | 1 | 0 | mit | 88470edf159ef662886a4af9dc782fe173e196bf | fragmede/fadecandy,lincomatic/fadecandy,pixelmatix/fadecandy,PimentNoir/fadecandy,fragmede/fadecandy,poe/fadecandy,scanlime/fadecandy,poe/fadecandy,lincomatic/fadecandy,hakan42/fadecandy,nomis52/fadecandy,PimentNoir/fadecandy,lincomatic/fadecandy,adam-back/fadecandy,adam-back/fadecandy,adam-back/fadecandy,nomis52/fadec... | examples/python/burnin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add and Search Word - Data structure design: cheat with `re`"
},
{
"role": "assistant",
"content": "# coding: utf-8\n\n# author: Fei Gao\n#\n# Add And Search Word Data Structure Design\n\n# Design a data structure that supports t... | python | new_file | 1 | 3 | mit | 02c833fe31a31f0dd8cefe28f81a5feee0f9bedd | feigaochn/leetcode | add_and_search_word_data_structure_design.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for SMAPE"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom pmdarima.metrics import smape\nimport numpy as np\nimport pytest\n\n\n@pytest.mark.parametrize(\n 'actual,forecasted,expected', [\n... | python | new_file | 1 | 1 | mit | 4ffa049553050ab22c5c90f544bb03fcc4259bfe | tgsmith61591/pyramid,alkaline-ml/pmdarima,alkaline-ml/pmdarima,alkaline-ml/pmdarima,tgsmith61591/pyramid,tgsmith61591/pyramid | pmdarima/tests/test_metrics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python script to read mouse delta position events"
},
{
"role": "assistant",
"content": "import struct\nfile = open (\"/dev/input/mice\",\"rb\");\n\ndef getMouseEvent():\n\tbuf = file.read(3);\n\tx,y = struct.unpack(\"bb\", b... | python | new_file | 1 | 1 | mit | f9a9ce064f9a09ee0e039239aebdb742c8683a3c | cschulee/ee542-code,cschulee/ee542-code,cschulee/ee542-code | readMouse.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests to function parsing CTestTestfile.cmake"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\nmbed SDK\nCopyright (c) 2011-2015 ARM Limited\n\nLicensed under the Apache License, Version 2.0 (the \"L... | python | new_file | 1 | 3 | apache-2.0 | 75073c57d247a1424250ae98b870347af2725d1f | ARMmbed/greentea | test/mbed_gt_cmake_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Bootstrap Google Tour example"
},
{
"role": "assistant",
"content": "from seleniumbase import BaseCase\n\n\nclass MyTourClass(BaseCase):\n\n def test_google_tour(self):\n self.open('https://google.com')\n sel... | python | new_file | 1 | 1 | mit | 2697859df141b2dc6c34df5c0ac3ec87741d6b84 | mdmintz/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase,mdmintz/seleniumspot,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | examples/tour_examples/bootstrap_google_tour.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for appending entries to .gitignore.\n\nTBR=kjellander\n\nReview URL: https://webrtc-codereview.appspot.com/1629004\n\ngit-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@4193 4adac7df-926f-26a2-2b94-8c16560cd09d"
},
{
"r... | python | new_file | 1 | 4 | bsd-3-clause | 029c3f46731cd3a4746043833e912447ababf1a7 | jchavanton/webrtc,lukeweber/webrtc-src-override,AOSPU/external_chromium_org_third_party_webrtc,lukeweber/webrtc-src-override,MIPS/external-chromium_org-third_party-webrtc,bpsinc-native/src_third_party_webrtc,krieger-od/webrtc,AOSPU/external_chromium_org_third_party_webrtc,AOSPU/external_chromium_org_third_party_webrtc,... | build/extra_gitignore.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate a historic version of wna affect"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom time import sleep\nimport json\nimport codecs\nfrom emotools.lexicon import get_s... | python | new_file | 4 | 0 | apache-2.0 | c06cffd3de56e5da4cf5d19bcb7f6e1982fc7621 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | generate_historic_wnaffect.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Non linear regression with Support Vector Regression (SVR)\nusing RBF kernel\n\"\"\"\n###############################################################################\n# Generate sample data\nimport numpy as np\n\nX = np.sort(5*np.rand... | python | edit | 1 | 0 | bsd-3-clause | 69dd9057c1009d9c047f45908080a55ac3223e4c | NunoEdgarGub1/scikit-learn,f3r/scikit-learn,mehdidc/scikit-learn,icdishb/scikit-learn,xiaoxiamii/scikit-learn,MatthieuBizien/scikit-learn,Vimos/scikit-learn,walterreade/scikit-learn,lesteve/scikit-learn,hugobowne/scikit-learn,cauchycui/scikit-learn,joshloyal/scikit-learn,shangwuhencc/scikit-learn,mattilyra/scikit-learn... | examples/svm/plot_svm_regression.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add benchmark script for python 3"
},
{
"role": "assistant",
"content": "from time import clock\nfrom random import choice, randint, seed\nfrom sys import stdout\n\nimport ahocorasick\n\n\ndef write(str):\n stdout.write(str)\n... | python | new_file | 1 | 2 | bsd-3-clause | 0f39968ee0cfd4b38a599b6fc9dc6d8369392513 | WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,woakesd/pyahocorasick,woakesd/pyahocorasick | benchmarks/benchmark3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example script to print out all updates"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# A simple script to print all updates received\n\nfrom telethon import TelegramClient\nfrom getpass import getpass\nfrom ... | python | new_file | 2 | 4 | mit | d707fd1593b47d228d33bb283bb8634075df12a7 | LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon,andr-04/Telethon | telethon_examples/print_updates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for about view"
},
{
"role": "assistant",
"content": "from tests.scoring_engine.web.web_test import WebTest\n\nfrom scoring_engine.version import version\nfrom scoring_engine.engine.config import config\n\n\nclass TestAb... | python | new_file | 1 | 1 | mit | 111b296112cf3b21f9abc1da37b047c1d0bc0ab8 | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/scoring_engine/web/test_about.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test getting the logs (broken)"
},
{
"role": "assistant",
"content": "from httmock import urlmatch, HTTMock\nimport unittest\nfrom myria import MyriaConnection\n\n\n@urlmatch(netloc=r'localhost:8753')\ndef local_mock(url, request... | python | new_file | 2 | 2 | bsd-3-clause | 4f5b495a0051b39e1e6fdd54f13bad0bd2b1bd29 | uwescience/myria-python,uwescience/myria-python | myria/test/test_logs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 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\n\"\"\"Class for running uiautomator tests on a single device.\"\"\"\n... | python | edit | 1 | 2 | bsd-3-clause | 727143357853591862335eb9e556855e6056a6a8 | mogoweb/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,patrickm/chromium.src,krieger-od/nwjs_chromium.src,ondr... | build/android/pylib/uiautomator/test_runner.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that SendRefundTransfer contains a balance proof"
},
{
"role": "assistant",
"content": "from raiden.tests.utils.factories import make_address, make_channel_identifier, make_transfer\nfrom raiden.transfer.mediated_transfe... | python | new_file | 1 | 1 | mit | c75fec9298be07a9162db3b9218013661af7c5b5 | hackaugusto/raiden,hackaugusto/raiden | raiden/tests/unit/transfer/mediated_transfer/test_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Numba n-body benchmark"
},
{
"role": "assistant",
"content": "\"\"\"\nBenchmark an implementation of the N-body simulation.\n\nAs in the CUDA version, we only compute accelerations and don't care to\nupdate speeds and posit... | python | new_file | 5 | 3 | bsd-2-clause | 3a6bb4b7c282ee6c3ede1f3b662a70c9dc3ca638 | numba/numba-benchmark,gmarkall/numba-benchmark | benchmarks/bench_nbody.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add optional start of ongoing and with a deadline activities"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.17 on 2020-10-23 12:33\nfrom __future__ import unicode_literals\n\nfrom djang... | python | new_file | 1 | 0 | bsd-3-clause | 59c20c07d01ae1ebde8a6a8bb3d6fd4652507929 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/time_based/migrations/0007_auto_20201023_1433.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use as main with FormatConverter; walks directory"
},
{
"role": "assistant",
"content": "import os.path\nfrom FormatConverter import *\nimport timeSeriesFrame\n\nextmap = {'.csv':1, '.txt':2, '.xls':3, '.sql':4}\ndir = \"C:\\Docu... | python | new_file | 3 | 5 | bsd-3-clause | 5e14a02a9f670f3558a07e6c3ef592753bda3f50 | wingsit/KF,wingsit/KF | getFile.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test code for 'grouping' module"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nTest code for 'grouping' widget used by Morse Trainer.\n\"\"\"\n\nimport sys\nfrom grouping import Grou... | python | new_file | 4 | 1 | mit | 996c9428ce3f56a5f3914d2b02d670c88a198230 | rzzzwilson/morse,rzzzwilson/morse | morse_trainer/test_grouping.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new test case, extracted from a cython paper."
},
{
"role": "assistant",
"content": "# from the paper `using cython to speedup numerical python programs'\n#pythran export timeloop(float, float, float, float, float, float li... | python | new_file | 4 | 4 | bsd-3-clause | 87e4d3bc9d3efd9f84025b25a8bd975ab73626f9 | serge-sans-paille/pythran,pbrunet/pythran,serge-sans-paille/pythran,pombredanne/pythran,pombredanne/pythran,artas360/pythran,artas360/pythran,pombredanne/pythran,pbrunet/pythran,hainm/pythran,pbrunet/pythran,hainm/pythran,hainm/pythran,artas360/pythran | pythran/tests/cases/calculate_u.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a helper script, ported to Python.\n\n* tools/dev/wc-format.py: New.\n Prints the working copy format of a given directory."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sqlite3\nimpo... | python | new_file | 1 | 1 | apache-2.0 | 254403f507ea8ae075a791f24a031eaa79fc2447 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | tools/dev/wc-format.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add stats on which fields had cubes produced or had spectra used. Tidy up console output Add zoomed in l-v plot"
},
{
"role": "assistant",
"content": "\n\nfrom __future__ import print_function\n\nimport os\nimport sys\n\n# Hack t... | python | new_file | 1 | 4 | apache-2.0 | 121eefa0dd37b2dac75c56a33f1f96258b206c4c | jd-au/magmo-HI,jd-au/magmo-HI | record_cubes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for tests.app.pages (fixes build)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.1 on 2017-06-02 04:26\nfrom __future__ import unicode_literals\n\nfrom django.db i... | python | new_file | 1 | 0 | mit | 7405c342522cf3686b5946fb30a59c74c410c655 | LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation | tests/site/pages/migrations/0002_regularpage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for Strategy and Selector classes"
},
{
"role": "assistant",
"content": "import unittest\nfrom decimal import Decimal as D\nfrom oscar_vat_moss.partner.strategy import * # noqa\n\nfrom mock import Mock\n\n\nclass ... | python | new_file | 6 | 1 | bsd-3-clause | ecce482fd99263c6b2f9aa8eddc668954ab41cc6 | fghaas/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss,fghaas/django-oscar-vat_moss,hastexo/django-oscar-vat_moss,hastexo/django-oscar-vat_moss,arbrandes/django-oscar-vat_moss | tests/test_strategy.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of event parser"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport logging\nfrom collections import defaultdict\n\nlogger = logging.getLogger(__name__)\n\n\nclass E... | python | new_file | 2 | 4 | mit | 5d12703a706498f24da09c368f626a78e0269afd | leaffan/pynhldb | parsers/event_parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility module to load puzzle input"
},
{
"role": "assistant",
"content": "\"\"\"aoc_common\n\nCommon utility functions for Advent of Code solutions\n\"\"\"\n\nimport pathlib\n\n\ndef load_puzzle_input(day):\n \"\"\"Return... | python | new_file | 1 | 1 | mit | e023f8786765d8a57f45a77f0acfe70b90c2e098 | robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions | 2018/python/aoc_common.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for adding / removing fallbacks"
},
{
"role": "assistant",
"content": "from unittest import TestCase, mock\n\nfrom mycroft.skills import FallbackSkill\n\n\ndef setup_fallback(fb_class):\n fb_skill = fb_class()\n... | python | new_file | 1 | 1 | apache-2.0 | 73fd98aee14ff800ec53bd4296a5ea97c6b754b8 | MycroftAI/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,forslund/mycroft-core | test/unittests/skills/test_fallback_skill.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Allow basic downloading of repos"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport logging\nimport os\nimport subprocess\n\n\ndef git(command):\n \"\"\"Runs command\"\"\"\n command = \"git \" + command... | python | new_file | 1 | 2 | mit | 576fa1969c09554d6d5b6ceaf4c9a2b33fbc2238 | abactel/git-get | git-get.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2012 OpenStack Foundation\n# All Rights Reserved.\n#\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 t... | python | edit | 1 | 1 | apache-2.0 | ab5c5b5d7c214b17b48add9caeaa36a81e3886f5 | klmitch/python-glanceclient,alexpilotti/python-glanceclient,JioCloud/python-glanceclient,mmasaki/python-glanceclient,mmasaki/python-glanceclient,openstack/python-glanceclient,JioCloud/python-glanceclient,varunarya10/python-glanceclient,varunarya10/python-glanceclient,klmitch/python-glanceclient,openstack/python-glancec... | tests/test_exc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for leetcode exercise (771)"
},
{
"role": "assistant",
"content": "from nose.tools import raises, assert_raises\n\nimport unittest\n\nfrom ex771 import Solution\n\nclass TestClass:\n def setup(self):\n self.so... | python | new_file | 4 | 1 | mit | 43ecf3f61feef5d046770c2ff816ba98ef88aad4 | vilisimo/ads,vilisimo/ads | python/leetcode/test/test_ex771.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic testing script for groups"
},
{
"role": "assistant",
"content": "import argparse\nimport getpass\nimport logging\n\nimport pyics\n\ntry:\n import httplib\nexcept ImportError:\n import http.client as httplib\n\n# s... | python | new_file | 9 | 5 | apache-2.0 | 6ad9395de430fedbabf79ec4bb136e5f5e2da7f7 | locke105/pyics | tests/test_group_create.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate nodes.py module for AST"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nfrom viper.parser.ast.generate_nodes_module import generate_text_from_parsed_rules\nfrom viper.parser.grammar import ... | python | new_file | 1 | 1 | apache-2.0 | e39187779b0bd2a10290ef019a331a8a64a57a25 | pdarragh/Viper | generate_nodes_module.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update zipfsong with unit test refactor and python3"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2\n\n\"\"\"\"\nZipf's song problem\nv1.0 without using any class structure like creating a Song class\nJose Antonio Navar... | python | new_file | 2 | 2 | mit | 301a7ff10f4a630ca403571aee8624bf98329b16 | josenava/spotify_puzzle | zipfsong_old.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example which generates DHCP configuration"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\"\"\"A script which generates DHCP configuration for hosts matching a regex.\nUsage:\n gen_dhcpconf.py <regex> <compu... | python | new_file | 1 | 0 | apache-2.0 | 74cf0ba2d329475870d72574da32cd134c5bef97 | jkinred/psphere,graphite-server/psphere | examples/gen_dhcpconf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test cases for ‘VersionInfoWriter’."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# test_version.py\n# Part of ‘python-daemon’, an implementation of PEP 3143.\n#\n# Copyright © 2008–2014 Ben Finney <<EMAI... | python | new_file | 5 | 1 | apache-2.0 | 2d5f39bd68481c81ecf676eb99d1d0e88e9540f7 | wting/python-daemon,eaufavor/python-daemon | test_version.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittest for concurrent redirect target create\n\nChange-Id: I445901a6c1fd0105fdd4a82454c8767da751d1bc\nCloses-Bug: OPENSTACK-2865"
},
{
"role": "assistant",
"content": "# Copyright 2020 NOKIA\n#\n# Licensed under the Apac... | python | new_file | 1 | 1 | apache-2.0 | 47e1b1e2a023c0298f56b61159e76b27135b09ba | nuagenetworks/nuage-openstack-neutron,nuagenetworks/nuage-openstack-neutron | nuage_neutron/tests/unit/test_nuage_redirect_target.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests/cpydiff: Add CPy diff-test for using dict.keys() as a set.\n\nSee issue #5493."
},
{
"role": "assistant",
"content": "\"\"\"\ncategories: Types,dict\ndescription: Dictionary keys view does not behave as a set.\ncause: Not i... | python | new_file | 1 | 0 | mit | e3e5f1862651e2809e0178bc19f79d67f30a86f6 | pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython | tests/cpydiff/types_dict_keys_set.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create functions for date and recurrence parsing"
},
{
"role": "assistant",
"content": "\"\"\"Parse Astrid xml backup file into simple data structures.\"\"\"\n\nfrom datetime import datetime\nimport re\n\n# TODO: ArgumentError?\n... | python | new_file | 1 | 4 | mit | 0f50bcddeeb0f7c63e7885b2bd306509654460f1 | rwstauner/dear_astrid,rwstauner/dear_astrid | dear_astrid/parser.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test -- Encrypted File Transfer Server\n\nTest server for SSL based file transfers"
},
{
"role": "assistant",
"content": "__author__ = 'masudurrahman'\n\nimport sys\nfrom twisted.protocols import ftp\nfrom twisted.protocols.ftp i... | python | new_file | 5 | 4 | apache-2.0 | 6bd6203813bc4ca377baed842d7934a50f86f37e | mrahman1122/Team4CS3240 | Server/encryptedServer.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a TINA philosophers (Python) generator."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\n\n#####################################################\n\none_philo_places = \\\n\"\"\"\npl P%(id)dThink ... | python | new_file | 1 | 0 | bsd-2-clause | 29f8cc38a03f773726cfb1bce83eb3aaa34607fe | ahamez/caesar.sdd | samples/tina/genPhilos.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to write text to a Roku Soundbridge."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n#\n# $Id$\n\n\"\"\"\nWrite some text on a Roku soundbridge, using the telnet interface.\n\"\"\"\n\nimport telnetlib\nimport... | python | new_file | 1 | 0 | mit | 9456944a66ded9bff986bdeda1cd8367d3a1ee37 | andrewferrier/misc-scripts,andrewferrier/misc-scripts,jbreitbart/dropbox-cleanup | soundbridge-write.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create migration for user field on fellow"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.6 on 2016-06-02 16:22\nfrom __future__ import unicode_literals\n\nfrom django.conf import setting... | python | new_file | 1 | 0 | bsd-3-clause | d3d1e9eb32af7a38f99fc602e2e9e897460dfbec | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/migrations/0022_fellow_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add checking code for exercise 2"
},
{
"role": "assistant",
"content": "from learntools.core import *\nimport tensorflow as tf\n\n\nclass Q1(CodingProblem):\n _var = 'kernel'\n _solution = CS(\"\"\"\n# This is just one poss... | python | new_file | 14 | 1 | apache-2.0 | 02f7c8e6f374f2d570fb6256612393018b2d3064 | Kaggle/learntools,Kaggle/learntools | learntools/computer_vision/ex2.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for MI tokens.\nThis file tests the sequence of digits that can come before\nan MI command.\n\nPatch from <EMAIL>.\n\n\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@222873 91177308-0d34-0410-b5e6-96231b3b80d8"
},
{
... | python | new_file | 5 | 3 | apache-2.0 | 3f0ef7d273eaecad8f5b278e762a056bf17ffdb8 | llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb | test/tools/lldb-mi/TestMiSyntax.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nimport pyttsx\nimport aspects\nfrom datetime import datetime\n\nengine = pyttsx.init()\n\ndef show(*objs):\n\tbegin = '' if '\\r' in objs[0] or '\\b' in objs[0] else '\\n'\n\tsys.stdout.write(begin)\n\tfor part in objs:\n\t\tsys... | python | edit | 3 | 4 | mit | 8905993c0daa140b10cb04dca1e7bed7b813ea7a | ahMarrone/solar_radiation_model,scottlittle/solar_radiation_model,gersolar/solar_radiation_model | imagedownloader/libs/console.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read from serial, write to CSV"
},
{
"role": "assistant",
"content": "__author__ = 'miahi'\n\n## Logger for serial APC Smart UPS\n\nimport serial\nimport csv\nimport time\nimport datetime\n\nPORT = 'COM2'\nBAUDRATE = 2400\nSLEEP_... | python | new_file | 3 | 2 | mit | 35f2cea484e2080e0b64fbcb995ef1adbc2d65dd | miahi/python.apcserial | read_serial.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add integration tests for user resource"
},
{
"role": "assistant",
"content": "import demands\n\nfrom tests.test_integration.helpers import create_user\nfrom tests.test_integration.test_case import YolaServiceTestCase\n\n\nclass ... | python | new_file | 1 | 1 | mit | 359d5bb5b40cb1a15b9b3ed6fb4710ed7a6e5f89 | yola/yolapy | tests/test_integration/test_user_resource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new one concept example that uses full syntax"
},
{
"role": "assistant",
"content": "\"\"\"Concept example of `Dependency Injector`.\"\"\"\n\nimport sqlite3\n\nfrom dependency_injector import catalogs\nfrom dependency_injecto... | python | new_file | 1 | 1 | bsd-3-clause | 7b35909083325ba6a22119b0f7a1cd352503cd93 | ets-labs/python-dependency-injector,rmk135/objects,ets-labs/dependency_injector,rmk135/dependency_injector | examples/concept_full_syntax.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for AST integrity"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom tests.infrastructure.test_utils import parse_local, parse_full\nfrom thinglang.compiler.errors import NoExceptionHandlers\nfrom thinglang.par... | python | new_file | 3 | 1 | mit | a0990c986635e4079b9c7145497e44fdbde48280 | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/parser/test_ast_integrity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tools/autobuild: Add script to generate website board metadata.\n\nSigned-off-by: Jim Mussared <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport glob\nimport json\nimport os\nimport sys\n\n\ndef ma... | python | new_file | 1 | 6 | mit | ab754d5924168d027bfc2eeed7881b9b2e469535 | adafruit/circuitpython,bvernoux/micropython,adafruit/circuitpython,adafruit/circuitpython,bvernoux/micropython,adafruit/circuitpython,bvernoux/micropython,adafruit/circuitpython,bvernoux/micropython,adafruit/circuitpython,bvernoux/micropython | tools/autobuild/build-downloads.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test model for dives"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom geotrek.common.tests import TranslationResetMixin\nfrom geotrek.diving.models import Dive\nfrom geotrek.diving.factories imp... | python | new_file | 6 | 1 | bsd-2-clause | d2375ebc4908d58c1a168619ed1e1e8eb59ebf25 | GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek | geotrek/diving/tests/test_models.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Change the name of the model."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n ... | python | new_file | 3 | 0 | mit | 359ea0dd38cdc2b48322a3ad21568176916dfede | icyflame/test-taking-platform,icyflame/test-taking-platform | examsys/migrations/0003_auto_20150315_1936.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for module 1 and 2."
},
{
"role": "assistant",
"content": "from lib.tweet.parseTwitter import retrieveTweetText\nfrom lib.querygen.tweets2query import QueryGenerator\n \nhashtag = \"twitterblades\"\ntweets = retrieveTweet... | python | new_file | 1 | 0 | apache-2.0 | a0e3d1c7bc0dfe321323f26db631747188218d1e | mzweilin/HashTag-Understanding,mzweilin/HashTag-Understanding,mzweilin/HashTag-Understanding | test_12.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an LLDB data formatter script for llvm::SmallVector, maybe this is helpful to someone else.\n\nThis lets lldb give sane output for SmallVectors, e.g.\nBefore:\n(lldb) p sv\n(llvm::SmallVector<int, 10>) $0 = {\n (llvm::SmallVectorImpl<in... | python | new_file | 1 | 3 | bsd-3-clause | 7f6c9d7f577424b02ddd08ce3b189d31575a01de | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | lldbDataFormatters.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add updated migration for our work with 1.7"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migra... | python | new_file | 1 | 0 | bsd-3-clause | 2d57d39112e3abbc116f4a937c28711fa15ee89a | isotoma/django-waffle,isotoma/django-waffle,isotoma/django-waffle,isotoma/django-waffle | waffle/migrations/0002_auto_20150721_1437.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a line count script\n\nSigned-off-by: xcgspring <<EMAIL>>"
},
{
"role": "assistant",
"content": "\nimport os\ntest_dir = \"..\"\ntotal_lines = 0\nfor _root, _dirs, _files in os.walk(test_dir):\n for _file in _files:\n ... | python | new_file | 1 | 0 | apache-2.0 | 1c0a2ebeca404572bef2807dc697c90c1be1a65a | xcgspring/AXUI,xcgspring/AXUI,xcgspring/AXUI | tools/count_lines.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fixtures: Add script to update course content."
},
{
"role": "assistant",
"content": "import subprocess\n\nfrom django.conf import settings\nMY_APPS = settings.MY_APPS\n\nCOMMAND_FORMAT = \"python manage.py dumpdata {app} > core/... | python | new_file | 1 | 2 | mit | 49f588ba82151d4f2a8c8cbe0123775ef2514cf5 | pixyj/feel,pixyj/feel,pixyj/feel,pixyj/feel,pixyj/feel | django-server/feel/core/db/update_fixtures.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add task to correctly set start/end dates based on active meetings for past / current learning circles"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\n\nfrom studygroups.m... | python | new_file | 3 | 5 | mit | 5d360aaf0d619472026a1099e606043fe4910bcf | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | studygroups/management/commands/fix_start_end_dates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create validator for CEI identifiers\n\nCadastro Específico do INS (CEI) is a business identifier for entities\nthat are not required to have a CNPJ."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport re\nimpo... | python | new_file | 2 | 4 | mit | 697f5fdc260157da86abbf4579cd3f5e04eb3c63 | poliquin/brazilnum | brazilnum/cei.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool to analyse MPEG-TS packets."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nfrom ts import *\nimport sys\n\npmt_pid = None\npes_readers = {}\nfor ts_packet in read_ts(sys.argv[1]):\n print(ts_packet)\n ... | python | new_file | 7 | 0 | bsd-2-clause | cffb8551169c18f68eb8eaa506a8565b8080dc54 | brendanlong/dash-ts-tools,brendanlong/dash-ts-tools | read_ts.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add temporary, not yet working client"
},
{
"role": "assistant",
"content": "import datetime\nimport logging\nimport sys\nimport traceback\n\nimport requests\n\nfrom werkzeug.debug.tbtools import get_current_traceback\n\n\nclass ... | python | new_file | 10 | 9 | bsd-3-clause | 2c5dbf8fb147b9d9494de5f8abff52aeedf1cabf | EnTeQuAk/bilor,EnTeQuAk/bilor,EnTeQuAk/bilor,EnTeQuAk/bilor | src/bilor/core/handler.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to collect metric results in a single dataset for a main group"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 17 09:02:31 2015\n\n@author: jesus\n\"\"\"\n\... | python | new_file | 4 | 0 | bsd-2-clause | 58e22254e06b8112652b5875c02e69dcf46b8a63 | jesusbriales/rgbd_benchmark_tools | src/rgbd_benchmark_tools/h5_collectSamples.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add start of a migration to add new groups for OSF Admin"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom django.contrib.auth.models... | python | new_file | 1 | 4 | apache-2.0 | eb81bf33d26923e5d79d87aa0e4c1db32eaf7c7c | Johnetordoff/osf.io,monikagrabowska/osf.io,brianjgeiger/osf.io,hmoco/osf.io,TomBaxter/osf.io,Johnetordoff/osf.io,mattclark/osf.io,HalcyonChimera/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,caseyrollins/osf.io,erinspace/osf.io,monikagrabowska/osf.io,Nesiehr/osf.io,aaxelb/osf.io,crcresearch/osf.io,brianjgeiger/osf.io,sa... | admin/base/migrations/0002_groups.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: auth: Add HAPSession used for encryption\n\nRelates to #1255"
},
{
"role": "assistant",
"content": "\"\"\"Cryptograhpy routines used by HAP.\"\"\"\n\nfrom typing import Optional\n\nfrom pyatv.support.chacha20 import Chacha20Ciphe... | python | new_file | 1 | 3 | mit | e582644d41f3422128dfc4d45c290ac51361b4aa | postlund/pyatv,postlund/pyatv | pyatv/auth/hap_session.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to retrieve logs from kafka"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\nimport sys\nimport argparse\n\nfrom kafka import KafkaConsumer\n\nparser = argparse.ArgumentParser(description='Zoe Kafka log v... | python | new_file | 1 | 0 | apache-2.0 | 555dcd9ca022f7479415a69dd5cffee46366e055 | DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe | scripts/showlog.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tenant static files finder"
},
{
"role": "assistant",
"content": "from django.utils._os import safe_join\nimport os\nfrom django.conf import settings\nfrom django.contrib.staticfiles.finders import FileSystemFinder\nfrom blue... | python | new_file | 3 | 5 | bsd-3-clause | 02a8745ddc0e9618f79e144a92258ff8ac3f35aa | jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/utils/staticfiles_finders.py | rejected_duplicate | Near-duplicate of sample 5462 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alternate tsort solution - mergesort, with slightly modified merge procedure"
},
{
"role": "assistant",
"content": "def merge(input_array, beg, mid, end):\n \"\"\"Merge procedure for merge sort algorithm\"\"\"\n listA = inp... | python | new_file | 2 | 4 | mit | b05649bb6c99195542569c7d378991eba2187d58 | sandy-8925/codechef | tsort_3.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add conceptual implementation of BaseCachedTask"
},
{
"role": "assistant",
"content": "\"\"\"\nTasks cached on data store.\n\"\"\"\n\nfrom .base import BaseTask\n\n\nclass BaseCachedTask(BaseTask):\n\n datastore = None\n \"... | python | new_file | 1 | 4 | bsd-3-clause | 1ebed09254aa5601956af9038a3f6cb8591913c8 | tkf/buildlet | buildlet/task/cachedtask.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script that requests new capabilities"
},
{
"role": "assistant",
"content": "from bluebottle.clients.models import Client\nfrom bluebottle.clients.utils import LocalTenant\n\nfrom bluebottle.funding_stripe.utils import stripe... | python | new_file | 4 | 4 | bsd-3-clause | 09a51971d1350fcdaa0d863c3b15d142302a7516 | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | scripts/request_capabilities.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove unique constraint on users.name"
},
{
"role": "assistant",
"content": "from alembic import op\n\nrevision = '30_rm_unique_constraint'\ndown_revision = '20_initialise_data'\n\n\ndef upgrade():\n op.drop_constraint(\"user... | python | new_file | 1 | 1 | mit | 9c0a4529c15cdc5f32b1d4718995092dfb9cb263 | alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin | migrations/versions/30_rm_unique_constraint.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for tests of grammar copy"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 16.08.2017 19:16\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import main, ... | python | new_file | 2 | 0 | mit | cc003f9bf3dfe2d8f4eba8f123fb23be1d9a393c | PatrikValkovic/grammpy | tests/GrammarCopyTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for 850: Matcher fails on zero-or-more."
},
{
"role": "assistant",
"content": "'''\nTest Matcher matches with '*' operator and Boolean flag\n'''\nfrom __future__ import unicode_literals\nimport pytest\n\nfrom ...matcher ... | python | new_file | 1 | 1 | mit | 6d67213b80350fe63e46ea2a18688f4a5a3f0d81 | Gregory-Howard/spaCy,honnibal/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,recognai/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,explosion/spaCy,raphael0202/spaCy,aikramer2/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,recognai/spaCy,aikramer2/spaCy... | spacy/tests/regression/test_issue850.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the possibly gcc miscompile error of LLVM in the mandel example."
},
{
"role": "assistant",
"content": "# This tests a potential GCC 4.1.2 miscompile of LLVM.\n# The problem is observed as a error in greedy register... | python | new_file | 12 | 1 | bsd-2-clause | 33e23230315f7a922e50264948c42b2c68116cc2 | numba/numba,gmarkall/numba,pombredanne/numba,pitrou/numba,pitrou/numba,IntelLabs/numba,numba/numba,ssarangi/numba,gmarkall/numba,stuartarchibald/numba,jriehl/numba,stefanseefeld/numba,numba/numba,pitrou/numba,GaZ3ll3/numba,stonebig/numba,pitrou/numba,shiquanwang/numba,stefanseefeld/numba,stuartarchibald/numba,stonebig/... | numba/tests/issues/test_potential_gcc_error.py | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for `qilinguist list`\n\nChange-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f\nReviewed-on: http://gerrit.aldebaran.lan/62796\nTested-by: gerrit\nReviewed-by: vbarbaresi <<EMAIL>>"
},
{
"role": "assistant",
"content": ... | python | new_file | 1 | 1 | bsd-3-clause | a13f23b5f1b11b40db3325c46add3508f43cf649 | aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild | python/qilinguist/test/test_qilinguist_list.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script for driving csmith to generate large compilation inputs.\n\nBUG=None\nR=<EMAIL>\n\nReview URL: https://codereview.chromium.org/91043004\n\ngit-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@12466 fcba33aa-ac0c-11dd-b9e7-8d5594... | python | new_file | 1 | 7 | bsd-3-clause | 25f1e9d2b28c98dd8ccfeaab73179fc003deb6f5 | sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client | tools/csmith-gen-many.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# This contain a list of individual test and will be run from Jenkins.\n\nimport unittest\nimport access_dvn\n\n# This is a list of testFileName.testClass\ndef suite():\n return unittest.TestSuite((\\\n unittest.makeSuite(access_d... | python | edit | 1 | 1 | apache-2.0 | 41beca23fff6eab718550d0ce8d22769653c3109 | ekoi/DANS-DVN-4.6.1,ekoi/DANS-DVN-4.6.1,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,bmckinney/dataverse-canonical,bmckinney/dataverse-canonical,JayanthyChengan/dataverse,quarian/dataverse,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,JayanthyChengan/dataverse,JayanthyChengan/dataverse,quarian/data... | sauce_test/test_suite.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use Trie to find no of words matching pattern"
},
{
"role": "assistant",
"content": "class Trie:\n def __init__(self):\n self.root = {}\n self.end = '*'\n \n def insert(self, word):\n cur = self.root... | python | new_file | 1 | 11 | mit | f3e0664c4b062587badaa86ddfc9e75711ecf631 | sayak1711/coding_solutions,sayak1711/coding_solutions,sayak1711/coding_solutions,sayak1711/coding_solutions | coding-practice/Trie/count_using_wildcards.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for using sync protocol in pox"
},
{
"role": "assistant",
"content": "from config.experiment_config_lib import ControllerConfig\nfrom sts.control_flow.fuzzer import Fuzzer\nfrom sts.input_traces.input_logger import In... | python | new_file | 5 | 0 | apache-2.0 | 4719167b6ee1c6dd276218c84b15b9cba4fefc2e | jmiserez/sts,jmiserez/sts | config/pox_sync.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for changes to study model."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.1 on 2017-06-15 14:04\nfrom __future__ import unicode_literals\n\nfrom django.db import migratio... | python | new_file | 1 | 0 | apache-2.0 | e66c6289a7986048329e86162fa59441df7b9a0a | CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api | studies/migrations/0003_auto_20170615_1404.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Feature: Add migrations for private property of pin"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.26 on 2020-02-11 05:32\nfrom __future__ import unicode_literals\n\nfrom django.db impo... | python | new_file | 1 | 0 | bsd-2-clause | ef72df34a42eb32409a4928346382f6b5e670000 | lapo-luchini/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry | core/migrations/0007_pin_private.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test build remotely SDict wrong class"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom storage.api import getByID\nfrom hecuba.hdict import StorageDict\n\n\nclass ApiTestSDict(StorageDict):\n '''\n @TypeSpec <... | python | new_file | 1 | 1 | apache-2.0 | dca99dab5e09e6767708e92f9bf92e54a9aa9ed4 | bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba | hecuba_py/tests/storage_api_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for server-side cookies"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\"\"\"Example for aiohttp.web basic server with cookies.\n\"\"\"\n\nimport asyncio\nfrom aiohttp import web\n\n\ntmpl = '''\\\n<ht... | python | new_file | 1 | 1 | apache-2.0 | 48dbaf596ee8af826d7e9dec96fee0c626005281 | z2v/aiohttp,avanov/aiohttp,singulared/aiohttp,alunduil/aiohttp,danielnelson/aiohttp,hellysmile/aiohttp,pfreixes/aiohttp,pathcl/aiohttp,morgan-del/aiohttp,alexsdutton/aiohttp,decentfox/aiohttp,panda73111/aiohttp,alex-eri/aiohttp-1,AraHaanOrg/aiohttp,elastic-coders/aiohttp,pfreixes/aiohttp,elastic-coders/aiohttp,mind1mas... | examples/web_cookies.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for verbose name."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.1 on 2017-06-21 18:43\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models... | python | new_file | 1 | 0 | apache-2.0 | 22e4430a55c17a5b2f77c90f8862530a3ae7f0d6 | pattisdr/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api | accounts/migrations/0005_auto_20170621_1843.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add high level secret tests"
},
{
"role": "assistant",
"content": "# Import libnacl libs\nimport libnacl.secret\n# Import python libs\nimport unittest\n\nclass TestSecret(unittest.TestCase):\n '''\n '''\n def test_secret... | python | new_file | 1 | 1 | apache-2.0 | 25417369765087482f0d02b06913b3cffe9f43ad | johnttan/libnacl,cachedout/libnacl,mindw/libnacl,saltstack/libnacl,coinkite/libnacl,RaetProtocol/libnacl | tests/unit/test_secret.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2015 Mirantis, Inc.\n# All Rights Reserved.\n#\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 ... | python | edit | 3 | 4 | apache-2.0 | 6364ce646e06d1168b8b96f27c8a7df2e2f0f23b | chitr/neutron,asgard-lab/neutron,eayunstack/neutron,noironetworks/neutron,chitr/neutron,mahak/neutron,yanheven/neutron,openstack/neutron,cloudbase/neutron,sebrandon1/neutron,bigswitch/neutron,bigswitch/neutron,huntxu/neutron,MaximNevrov/neutron,asgard-lab/neutron,dims/neutron,wolverineav/neutron,wolverineav/neutron,mah... | neutron/pecan_wsgi/hooks/translation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to examine depedent tokens retrieved from Globus."
},
{
"role": "assistant",
"content": "from globus_sdk import ConfidentialAppAuthClient\nimport json\nimport sys\nimport pprint\n\nCLIENT_CRED_FILE='/home/secrets/oaut... | python | new_file | 4 | 0 | apache-2.0 | 5e229787c013cc66fe202964ffb733a2d8f5aa6a | informatics-isi-edu/webauthn,informatics-isi-edu/webauthn,informatics-isi-edu/webauthn | webauthn2/scripts/globus_test_client.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add data migrations for base app"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nfrom utils.load_data import load_data\n\n\nclas... | python | new_file | 3 | 0 | bsd-3-clause | c625c9d8918eab3e86ac14abd674b6232c2fa8e9 | unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api | django/sierra/base/migrations/0002_auto_20170602_1115.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging"
},
{
"role": "assistant",
"content": "# You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise\n# solve with O(1) ... | python | new_file | 1 | 5 | mit | 96526df63b2d45f08c7f007b45ee793e3ccc97a3 | derekmpham/interview-prep,derekmpham/interview-prep | array/rotate-image.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.