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 basic script for stress testing a remote servers CPU"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport time\n\nNUM_RUNS = 10\n\ndef stress_cpu(num_passes=20000):\n sum(1/16**k *\n (4/(8*k+1) -\n... | python | new_file | 3 | 2 | mit | 9244a246b5501ae984863dd442f5b2ab10bc437b | ben-rowan/lxc-calibrate | lxc-stress.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example showing a fix-up rule for space entities"
},
{
"role": "assistant",
"content": "'''Demonstrate adding a rule-based component that forces some tokens to not\nbe entities, before the NER tagger is applied. This is used ... | python | new_file | 1 | 3 | mit | 5a4aeb96b72af43aba5a1d7f143214d4083d151f | explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy... | examples/pipeline/fix_space_entities.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Challenge 232 Palindrome Solution"
},
{
"role": "assistant",
"content": "import re\n\ndef isPalindrome(file):\n infile = open(file, 'r')\n lines = infile.readlines()\n\n num_lines = int(lines[0])\n total_string = ... | python | new_file | 1 | 3 | mit | 498bfbbde87fd94fde0775ab7d366c972b09c1d0 | JonShepChen/DailyProgrammerChallenges | challenges/232-Palindromes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Add Data Test script"
},
{
"role": "assistant",
"content": "__author__ = 'chuqiao'\nimport script\nscript.addDataToSolrFromUrl(\"http://www.elixir-europe.org:8080/events\", \"http://www.elixir-europe.org:8080/events\");\ns... | python | new_file | 1 | 0 | mit | 9e27800d4e94b9f13810b9c939bd62ef541f7f12 | elixirhub/events-portal-scraping-scripts | AddDataTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add mininet script for test topology"
},
{
"role": "assistant",
"content": "import sys\nfrom mininet.net import Mininet\nfrom mininet.topo import Topo\nfrom mininet.log import setLogLevel\nfrom mininet.cli import CLI\nfrom minine... | python | new_file | 2 | 2 | apache-2.0 | 962f7f1184803401b9d8cb3423cd574d55bcf9e4 | sangyun-han/sidekick,sangyun-han/sidekick,sangyun-han/sidekick,sangyun-han/sidekick | tools/tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a placeholder for the trigger file"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport syslog\nimport sys\n\n# first commandline argument should be the file to process\nif ( len(sys.argv) != 2 ):\n print \"I... | python | new_file | 2 | 0 | apache-2.0 | b596be1a82a9024471b4afafc8922292c300f1e9 | GabrielBrascher/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,resmo/cloudstack,wido/cloudstack,jcshen007/cloudstack,resmo/cloudstack,jcshen007/cloudstack,wido/cloudstack,DaanHoogland/cloudstack,wido/cloudstack,GabrielBrascher/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,DaanHoogland/cloudstack,resmo/cl... | systemvm/patches/debian/config/opt/cloud/bin/update_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: stmhal: Add preliminary driver for ST32F4DISC accelerometer.\n\nWritten in Python, not currently working. See issue #725."
},
{
"role": "assistant",
"content": "\"\"\"\nDriver for accelerometer on STM32F4 Discover board.\n\nAssu... | python | new_file | 5 | 3 | mit | 71bed1a9a7a0a042d3e0964f06cee900f6d7d9ae | torwag/micropython,emfcamp/micropython,jlillest/micropython,PappaPeppar/micropython,rubencabrera/micropython,tralamazza/micropython,Peetz0r/micropython-esp32,SHA2017-badge/micropython-esp32,ruffy91/micropython,SungEun-Steve-Kim/test-mp,infinnovation/micropython,supergis/micropython,xhat/micropython,emfcamp/micropython,... | stmhal/boards/STM32F4DISC/staccel.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add utility to remerge translations"
},
{
"role": "assistant",
"content": "# Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect\n# if a translation was added to the source but isn't ... | python | new_file | 1 | 0 | mit | 2a5a735d9440ca9998e80239b41410a35b0c972d | adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython | tools/fixup_translations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for method list_keypairs\n\nThis patch adds unit test for keypairs_client.\nSpecific about method list_keypairs.\n\nChange-Id: I7879280ff4f0211c7ec59c7225183f39978d3d41"
},
{
"role": "assistant",
"content": "# Copyr... | python | new_file | 1 | 2 | apache-2.0 | 9c1cb898a6a85d3bf23782ab349fb45224beee6a | sebrandon1/tempest,rakeshmi/tempest,manasi24/tempest,Tesora/tesora-tempest,openstack/tempest,flyingfish007/tempest,izadorozhna/tempest,rakeshmi/tempest,hayderimran7/tempest,tudorvio/tempest,vedujoshi/tempest,alinbalutoiu/tempest,alinbalutoiu/tempest,flyingfish007/tempest,izadorozhna/tempest,manasi24/tempest,zsoltdudas/... | tempest/tests/services/compute/test_keypairs_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for wttr widget"
},
{
"role": "assistant",
"content": "# Copyright (c) 2021 elParaguayo\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation ... | python | new_file | 1 | 1 | mit | f5c46ea946f487d6ff445020bac55bd7b137088b | qtile/qtile,qtile/qtile,ramnes/qtile,ramnes/qtile | test/widgets/test_wttr.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for digest plugin"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals, division, absolute_import\n\nfrom tests import FlexGetBase\n\n\nclass TestDigest(FlexGetBase):\n __yaml__ = \"\"\... | python | new_file | 1 | 1 | mit | 5443ceecfafea3c78a7153eaa2d38febdb54eb3e | antivirtel/Flexget,qvazzler/Flexget,tsnoam/Flexget,Danfocus/Flexget,gazpachoking/Flexget,spencerjanssen/Flexget,malkavi/Flexget,crawln45/Flexget,antivirtel/Flexget,crawln45/Flexget,ZefQ/Flexget,vfrc2/Flexget,tobinjt/Flexget,tobinjt/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,ibrahimkarahan/Flexget,tarzasai/Flexget,drwyrm... | tests/test_digest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the main interface file."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"cli2phone pushes messages from the command line to your android phone.\nRequires Android 2.2 or newer, and the chrometophone appli... | python | new_file | 6 | 7 | mit | dc818ce216bde42fdf60852e2320aaf3e6e45156 | sklnd/cli2phone | cli2phone.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a set of functions related to basis-computation."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport sympy as sy\nimport numpy as np\n\nimport itertools\n\ndef lagrange_basis(points, sym):\n \"\"\"Gene... | python | new_file | 2 | 3 | bsd-3-clause | 6503a8fc3c9f47b5e33d7ad520ac48b0d452cf70 | BrianVermeire/PyFR,tjcorona/PyFR,tjcorona/PyFR,tjcorona/PyFR,Aerojspark/PyFR,iyer-arvind/PyFR | pyfr/bases.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights math practice problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Math Practice Problem\n\nfrom functools import reduce\n\n\ndef mathPractice(numbers):\n return reduce(lambda... | python | new_file | 1 | 3 | mit | 83ae6c1f17e7f744c81b53d02cfe8f058c5500da | HKuz/Test_Code | CodeFights/mathPractice.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add snippet manipulating raw table data"
},
{
"role": "assistant",
"content": "from fontTools.ttLib import TTFont\nfrom fontTools.ttLib.tables.DefaultTable import DefaultTable\n\nfont_path = \"myfont.ttf\"\noutput_path = \"myfont... | python | new_file | 1 | 0 | mit | 0cae12bdbde6fa87f65025bc14ee5863f2526c4b | fonttools/fonttools,googlefonts/fonttools | Snippets/edit_raw_table_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new Python module for McDowell Chapter 1."
},
{
"role": "assistant",
"content": "def unique(string):\n counter = {}\n for c in string:\n if c in counter:\n counter[c] += 1\n else:\n c... | python | new_file | 1 | 5 | mit | ae4a5a3c1e85383304ea72762b7bcabbb46c2a0d | jamesewoo/tigeruppercut,jamesewoo/tigeruppercut | mcdowell/src/main/python/ch1/ch1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 416. Partition Equal Subset Sum\n\n416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def canPartitio... | python | new_file | 2 | 6 | apache-2.0 | 4c80716c799f6fd6e8d3f28f840ebf8443973931 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/partition-equal-subset-sum.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 698. Partition to K Equal Sum Subsets\n\n698. Partition to K Equal Sum Subsets: https://leetcode.com/problems/partition-to-k-equal-sum-subsets/"
},
{
"role": "assistant",
"content": "class Solution(object):\n ... | python | new_file | 2 | 7 | apache-2.0 | f342ce1ee57b0fdc6847d80a7453f575e4301299 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/partition-to-k-equal-sum-subsets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Discovery Plug-in for AWS S3 Bucket Blueprint\n\nProvide a Plug-in that Discovers and Syncs any existing S3 Buckets for all configured AWS Resource Handlers. This Plug-in creates the S3 Bucket Resources in CloudBolt with the necessary at... | python | new_file | 1 | 4 | apache-2.0 | 0a6eaaee9acdfee7154c9b10f85636e2a776c296 | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | blueprints/aws_s3_bucket/discover_s3_buckets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Send email using sendgrid API"
},
{
"role": "assistant",
"content": "import sendgrid\nimport os\nfrom sendgrid.helpers.mail import *\n\nsg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))\nfrom_email = Emai... | python | new_file | 6 | 0 | mit | 7bd32a767490c534685d1b421dcbf7e62deddc06 | efagerberg/PiCam | send_email.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add problem 37, truncatable primes"
},
{
"role": "assistant",
"content": "from problem_35 import is_prime\nfrom time import time\n\n\nTRUNCATABLE_PRIMES = []\n\n\ndef is_truncatable_prime(num):\n for i in ['0', '4', '6', '8']:... | python | new_file | 4 | 10 | mit | 51be58367217bbfc3e677afc79a73edb26ec6665 | dimkarakostas/project-euler | problem_37.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add task to sync locations from identity store"
},
{
"role": "assistant",
"content": "import urlparse\n\nfrom celery.task import Task\nfrom django.conf import settings\nfrom seed_services_client import IdentityStoreApiClient\n\nf... | python | new_file | 1 | 4 | bsd-3-clause | 05d3cb5b44bd828e354c699b5793ecdf6f4501cd | praekelt/familyconnect-registration,praekelt/familyconnect-registration | locations/tasks.py | rejected_duplicate | Near-duplicate of sample 4070 | true |
[
{
"role": "user",
"content": "Write python code for the following: Simplify the generation of a one-time pad.\n\nRenamed genoldpad.py to genotp.py. Removed the genline function; moved its\nfunctionality to the main block."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n# -*- codin... | python | new_file | 1 | 2 | mit | 0d7a51312d35b99c4eb06a349a9050cf5bb72ce1 | rsmith-nl/scripts,rsmith-nl/scripts | genotp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for hash table"
},
{
"role": "assistant",
"content": "from hash_table import HashTable\nimport io\nimport pytest\n\n\nwords = []\n\nwith io.open('/usr/share/dict/words', 'r') as word_file:\n words = word_file.readlin... | python | new_file | 1 | 2 | mit | 2f99b380ec5d725d1d27df584357324ade9e0782 | jwarren116/data-structures-deux | test_hash.py | rejected_duplicate | Near-duplicate of sample 2554 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add plot with black background\n\nin order to show the impact of commit d5a5507cd9d4b2ba4af0bf4cf42bbda043853cb5"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"\n============================================... | python | new_file | 1 | 0 | bsd-3-clause | d42cc110c3da50a62b62acb6585d4eb1d4254d66 | lesteve/sphinx-gallery,Eric89GXL/sphinx-gallery,Titan-C/sphinx-gallery,lesteve/sphinx-gallery,sphinx-gallery/sphinx-gallery,sphinx-gallery/sphinx-gallery,Titan-C/sphinx-gallery,Eric89GXL/sphinx-gallery | examples/plot_sin_black_background.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for bridgedb.email.dkim module."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# This file is part of BridgeDB, a Tor bridge distribution system.\n#\n# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35... | python | new_file | 3 | 1 | bsd-3-clause | ac36d66d7e25bbc0aa4dcef2ce364ca7aca841ea | pagea/bridgedb,pagea/bridgedb | lib/bridgedb/test/test_email_dkim.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a SeleniumBase test in Dutch"
},
{
"role": "assistant",
"content": "# Dutch Language Test\nfrom seleniumbase.translate.dutch import Testgeval\n\n\nclass MijnTestklasse(Testgeval):\n\n def test_voorbeeld_1(self):\n s... | python | new_file | 1 | 1 | mit | a99a1bad2d7281a172369c8792c05a1c429a3296 | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | examples/translations/dutch_test_1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for Utils.py"
},
{
"role": "assistant",
"content": "\"\"\"Test package for Utils.py.\"\"\"\nimport unittest\nimport Utils\n\n\nclass TestUtils(unittest.TestCase):\n \"\"\"Test cases for the Utils.\"\"\"\n\n de... | python | new_file | 1 | 1 | mit | 805c8a597a57c21ad2c3fb32b313450484d1cde7 | lnsp/tea,lnsp/tea | Runtime/test_Utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to enable colour in HTML produced from IPython notebooks"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nA script to re-enable colour in .html files produced from IPy... | python | new_file | 1 | 0 | mit | 8b2ff178c7a4fdd9af536e3c92a7e5edb05b21e0 | krischer/python-future,PythonCharmers/python-future,michaelpacer/python-future,krischer/python-future,michaelpacer/python-future,QuLogic/python-future,PythonCharmers/python-future,QuLogic/python-future | docs/other/fix_notebook_html_colour.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new script for version stamp"
},
{
"role": "assistant",
"content": "# cfgVersionStamp.py\n# Author: Christoph Stoettner\n# E-Mail: <EMAIL>\n#\n# History: \n# 20140415 Christoph Stoettner Initial Version\n\nprint \"\\nSet... | python | new_file | 2 | 0 | apache-2.0 | 0566599ded67ea6337a3ee4a99b592de571d2fa6 | stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting,stoeps13/ibmcnxscripting | WebSphere/cfgVersionStamp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new top level package matching the repository name."
},
{
"role": "assistant",
"content": "# encoding: UTF-8\n\n\"\"\"\nPhysics and High-Level Controls library\n\n.. moduleauthor:: Dylan Maxwell <<EMAIL>>\n\"\"\"\n\nfrom __fu... | python | new_file | 1 | 0 | bsd-3-clause | 937c337b35c36a91b7d153ca157b077e38641b0e | archman/phantasy,archman/phantasy | phyhlc/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to fix file extensions from messed up windows import"
},
{
"role": "assistant",
"content": "import os\nimport subprocess\n\nROOT = 'e:\\\\'\n\ndef main():\n total_renames = 0\n for dir, dirs, files in os.walk(ROOT):\... | python | new_file | 8 | 15 | mit | fde5e4378030a5332f853b0af73ed9a86c384108 | chuckhays/smugsync | connectors/fix_file_extensions.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a Python json benchmark.\n\nAlas, it's about 3x faster than us, due to being written in C."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport json, sys, time\n\ncount = int(sys.argv[1])\n\nfor n in sys.arg... | python | new_file | 3 | 0 | bsd-3-clause | cbe5617222047bc174e470051b5724f84f70609e | jkarni/aeson,beni55/aeson,nurpax/aeson,lykahb/aeson,roelvandijk/aeson,plaprade/aeson,abbradar/aeson,sol/aeson,dmjio/aeson,sol/aeson,sol/aeson,aelve/json-x,neobrain/aeson,bwo/aeson,timmytofu/aeson,23Skidoo/aeson,JPMoresmau/aeson,neobrain/aeson,roelvandijk/aeson,SeanRBurton/aeson | benchmarks/parse.py | rejected_duplicate | Near-duplicate of sample 8844 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for the HTTP test template."
},
{
"role": "assistant",
"content": "from ooni.settings import config\n\nfrom ooni.templates import httpt\n\nfrom twisted.internet.error import DNSLookupError\nfrom twisted.internet imp... | python | new_file | 1 | 1 | bsd-2-clause | e04bdd9bc27c5c19e55cce98d2876403d9c7397d | kdmurray91/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni... | ooni/tests/test_templates.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create docker Postgresql DB and proxy for testing with SQLAlchemy"
},
{
"role": "assistant",
"content": "from sqlalchemy import create_engine\nfrom sqlalchemy_utils.functions import create_database\nfrom docker import Client\nfro... | python | new_file | 3 | 2 | apache-2.0 | 67a76f74ebd535a283da8eebb06c6811e9249ace | mattmcd/PyAnalysis | mda/db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command line app example"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nimport os\nimport sys\nimport argparse\n\n\ndef main(arguments):\n\n parser = argparse.ArgumentParser(\n descrip... | python | new_file | 3 | 1 | mit | c9205c0ef75a34e608594a3ef1b733e8a38fdd1a | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | command-line-template.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an experimental backend to display figures in a standalone Qt window."
},
{
"role": "assistant",
"content": "# Copyright 2014, Sandia Corporation. Under the terms of Contract\n# DE-AC04-94AL85000 with Sandia Corporation, the ... | python | new_file | 1 | 2 | bsd-3-clause | e3079745f37ff84b1be5511986b30d3ca285c15f | cmorgan/toyplot,cmorgan/toyplot | toyplot/qt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add compilation tests for all samples"
},
{
"role": "assistant",
"content": "import os.path\nimport pytest\nimport rain.compiler as C\n\ndef ls(*path):\n path = os.path.join(*path)\n for file in os.listdir(path):\n yi... | python | new_file | 1 | 7 | mit | e2dd78c608660545529f63f82c7209b2f49eb5a7 | scizzorz/rain,philipdexter/rain,scizzorz/rain,scizzorz/rain,philipdexter/rain,philipdexter/rain,scizzorz/rain,philipdexter/rain | tests/test_compile_samples.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a demo script for the CtfEditor."
},
{
"role": "assistant",
"content": "\"\"\"\nThis demonstrates the `CtfEditor` widget.\n\nTo use: right-click in the window to bring up a context menu. Once you've added\na color or opacity,... | python | new_file | 1 | 2 | bsd-3-clause | ee44a827787cc66b64b6507601adc374e0b087de | dmsurti/ensemble | examples/ctf_demo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Use lxml instead of ET"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\nimport datetime as dt\nimport numpy as np\nimport pandas as pd\n\nfrom lxml import etree\n# test the lxml package in comparision to the standard Ele... | python | new_file | 4 | 0 | mit | d73902fb9fde6e4dac8ed856bf0bf368d3599134 | kmunve/TSanalysis,kmunve/TSanalysis,kmunve/TSanalysis | test_lxml.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add generator for tables plus SLIP room config"
},
{
"role": "assistant",
"content": "from __future__ import print_function\nimport requests\nimport json\n\nclass Table(object):\n def __init__(self, x, y, width, height, name):... | python | new_file | 1 | 2 | mit | 96616feb46dc8342f742bc63f075477dc1b325e6 | bleepr/bleepr-manage,bleepr/bleepr-manage | modules/data_generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move this test from metanl."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom ftfy import fix_bad_encoding, WINDOWS_1252_GREMLINS\nimport unicodedata\n\n# Most single-character strings which have been misencode... | python | new_file | 2 | 3 | mit | 6d46c1beb8f5f916e3fb2e08d086e5b4167383be | rspeer/python-ftfy | ftfy/test_unicode.py | rejected_duplicate | Near-duplicate of sample 8471 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add experimental JSON output module"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\n\nimport json, math\n\nfrom .schema import SolrResponse, SolrResult\n\n\nclass SunburntJSONEncoder(json.JSONEncode... | python | new_file | 1 | 3 | mit | 6eed00668f5510a6d8590ae89befba8814025f31 | rlskoeser/sunburnt,qmssof/sunburnt,anmar/sunburnt,pixbuffer/sunburnt-spatial,pixbuffer/sunburnt-spatial,tow/sunburnt,rlskoeser/sunburnt,anmar/sunburnt | sunburnt/json.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add temporary file for dataset creation code"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport os\nimport click\nimport logging\nfrom dotenv import find_dotenv, load_dotenv\n\n\n@click.command()\n@click.argum... | python | new_file | 1 | 1 | mit | 7ce77190028a55bf79f4fe7cbe9c5e7448422a8d | nelson-liu/paraphrase-id-tensorflow,nelson-liu/paraphrase-id-tensorflow | duplicate_questions/data/make_dataset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate tests for dask array conversions from dask package."
},
{
"role": "assistant",
"content": "from __future__ import absolute_import, division, print_function\n\nfrom odo.backends.dask_array import append, Array, merge\nfrom... | python | new_file | 1 | 2 | bsd-3-clause | f876c410ab39bd348f79ed2a256c09edd4225c56 | Dannnno/odo,Dannnno/odo,ywang007/odo,ContinuumIO/odo,ContinuumIO/odo,ywang007/odo,cpcloud/odo,blaze/odo,cowlicks/odo,blaze/odo,alexmojaki/odo,quantopian/odo,alexmojaki/odo,cpcloud/odo,cowlicks/odo,quantopian/odo | odo/backends/tests/test_dask_array.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nDEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage'\nFILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024\nFILE_UPLOAD_HANDLERS = (\n 'djangae.storage.BlobstoreFileUploadHandler',\n 'django.core.files.uploadhandler.MemoryFileUploadHandle... | python | edit | 1 | 0 | bsd-3-clause | 46a060666997df718b4072a6ed3ef93dbedb6107 | pablorecio/djangae,martinogden/djangae,jscissr/djangae,chargrizzle/djangae,potatolondon/djangae,martinogden/djangae,armirusco/djangae,trik/djangae,asendecka/djangae,leekchan/djangae,stucox/djangae,b-cannon/my_djae,trik/djangae,SiPiggles/djangae,potatolondon/djangae,nealedj/djangae,stucox/djangae,kirberich/djangae,jscis... | djangae/settings_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fetch recipe for the Flutter Engine repository.\n\nTested with the following\n\n$ mkdir flutter_engine\n$ cd flutter_engine\n$ fetch flutter\n$ cd src\n\n # Confirm the source tree and dependencies are as expected.\n\nBUG=None\nTEST=see ... | python | new_file | 1 | 1 | bsd-3-clause | cfac2ea76b00620545717667305e78179a8fb390 | CoherentLabs/depot_tools,CoherentLabs/depot_tools | fetch_configs/flutter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Problem Ugly Number II"
},
{
"role": "assistant",
"content": "# https://leetcode.com/problems/ugly-number-ii/\n\nclass Solution(object):\n def nthUglyNumber(self, n):\n \"\"\"\n :type n: int\n :rtype: ... | python | new_file | 2 | 5 | mit | dbfef6d04bdb8031a5f47e27e1370dfa6b797e71 | guozengxin/myleetcode,guozengxin/myleetcode | python/uglyNumberII.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move utility processors out of init file"
},
{
"role": "assistant",
"content": "\nimport re\n\n\ndef utility_processor():\n def unslug(string):\n return re.sub('_', ' ', string)\n\n def parse_field_data(value):\n ... | python | new_file | 1 | 1 | apache-2.0 | 4ff9ac54cdcc5ed4fb63dfe2b8913c656464b0c7 | rackerlabs/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork | pitchfork/context_functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module descriptions and dependencies\n\n{\r\n 'name': 'Genesis Product Multi-Image',\r\n 'description': 'This module adds multiple product images (22 currently) into a tab in product.template in a tab called Product Images',\r\n ... | python | new_file | 1 | 0 | mit | 0ca43532ea20a2d202c721a371194827c8b74520 | luistorresm/website_multi_image,luistorresm/website_multi_image,Vauxoo/website_multi_image,yelizariev/website_multi_image,OdooCommunityWidgets/website_multi_image,Vauxoo/website_multi_image,yelizariev/website_multi_image,vauxoo-dev/website_multi_image,OdooCommunityWidgets/website_multi_image,Vauxoo/website_multi_image,... | __openerp__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a @lazy decorator for simple lazy methods."
},
{
"role": "assistant",
"content": "def lazy(func):\n def lazy_func(self, *args, **kwargs):\n cached_attribute = '_cached_%s' % func.__name__\n if not hasattr(sel... | python | new_file | 1 | 2 | mit | 5c1d725103b1d97c0753d3ae2baf7f0835f995eb | bueda/django-comrade | comrade/functional.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for security groups\n\nChange-Id: I90b29c2e48303867ae2f670643171d113e485cf1"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this f... | python | new_file | 1 | 2 | apache-2.0 | 353dc990b12647ba784ad06a23dc3e374754081a | openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,briancurtin/python-openstacksdk,mtougeron/python-openstacksdk,stackforge/python-openstacksdk,mtougeron/python-openstacksdk,dtroyer/python-openstacksdk,dudymas/python-openstacksdk,briancurtin/python-ope... | openstack/tests/functional/network/v2/test_security_group.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport modelcluster.fields\nimport wagtail.wagtailcore.fields\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\... | python | edit | 1 | 0 | bsd-3-clause | 14798847730a8746c1a7bad18a2f9e0fda7e0756 | nilnvoid/wagtail,kurtrwall/wagtail,gasman/wagtail,zerolab/wagtail,kaedroho/wagtail,kurtrwall/wagtail,torchbox/wagtail,zerolab/wagtail,mikedingjan/wagtail,rsalmaso/wagtail,nilnvoid/wagtail,kaedroho/wagtail,nutztherookie/wagtail,takeflight/wagtail,gasman/wagtail,kaedroho/wagtail,wagtail/wagtail,jnns/wagtail,nimasmi/wagta... | wagtail/tests/testapp/migrations/0006_sectionedrichtextpage_sectionedrichtextpagesection.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for initialization that doesn't find library"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Copyright 2009-2016 Jason Stitt\n#\n# Permission is hereby granted, free of charge, to any person obtaining a... | python | new_file | 5 | 1 | mit | 9491469f5e34e96880e3e62bc26e742c65065a3f | countergram/pytidylib | tests/test_init.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate db to make default_registrant unique for project"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-04-07 08:15\nfrom __future__ import unicode_literals\n\nfrom django.con... | python | new_file | 1 | 0 | mit | 4e4d07254dfdbc86a2a9ed4211aacb0165cf8411 | heytrav/drs-project | domain_api/migrations/0016_auto_20170407_0815.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nApplication from a .kv\n======================\n\nThe root application is created from the corresponding .kv. Check the test.kv\nfile to see what will be the root widget.\nThis example show how you can change the directory where the .k... | python | edit | 1 | 0 | mit | 1e87a9803c76128eec0c4a8f895f163682c8591e | cbenhagen/kivy,niavlys/kivy,JohnHowland/kivy,ernstp/kivy,edubrunaldi/kivy,akshayaurora/kivy,manthansharma/kivy,andnovar/kivy,andnovar/kivy,inclement/kivy,arlowhite/kivy,CuriousLearner/kivy,Farkal/kivy,tony/kivy,yoelk/kivy,angryrancor/kivy,darkopevec/kivy,MiyamotoAkira/kivy,CuriousLearner/kivy,janssen/kivy,CuriousLearne... | examples/application/app_with_kv_in_template1.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for split_path/join_path functionality"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom binder.views import split_path, join_path\n\n\nclass PathTest(TestCase):\n\n\tdef _test_path(self, p... | python | new_file | 1 | 1 | mit | 23ebe6036ae0590ee62c8eb738a9e88a81989204 | CodeYellowBV/django-binder | tests/test_path.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add search vector agg test case"
},
{
"role": "assistant",
"content": "import sqlalchemy as sa\nfrom sqlalchemy_utils import aggregated, TSVectorType\nfrom tests import TestCase\n\n\ndef tsvector_reduce_concat(vectors):\n retu... | python | new_file | 1 | 1 | bsd-3-clause | 0e4a6550984d2a244cd0a816101697d174eb3df2 | tonyseek/sqlalchemy-utils,rmoorman/sqlalchemy-utils,spoqa/sqlalchemy-utils,cheungpat/sqlalchemy-utils,joshfriend/sqlalchemy-utils,tonyseek/sqlalchemy-utils,konstantinoskostis/sqlalchemy-utils,JackWink/sqlalchemy-utils,marrybird/sqlalchemy-utils,joshfriend/sqlalchemy-utils | tests/aggregate/test_search_vectors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for `tldr init`"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport os\nfrom os import path\nimport unittest\n\nimport click\nfrom cli... | python | new_file | 3 | 2 | mit | 834656cc94c13a5aa7f8360e2d399f0b623365f6 | lord63/tldr.py | tests/test_init.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add handy profiled wrapper function"
},
{
"role": "assistant",
"content": "from fastimgproto.sourcefind.image import SourceFindImage\nfrom memory_profiler import profile\n\n@profile\ndef memprof_sourcefindimage(data, detection_n_... | python | new_file | 1 | 1 | apache-2.0 | 30334cd42056b5c4bf229798828ff010ec2a8e07 | SKA-ScienceDataProcessor/FastImaging-Python,SKA-ScienceDataProcessor/FastImaging-Python | src/fastimgproto/fixtures/profiling.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add a test for loop.create_unix_server"
},
{
"role": "assistant",
"content": "import asyncio\nimport os\nimport socket\nimport tempfile\nimport uvloop\n\nfrom uvloop import _testbase as tb\n\n\nclass _TestUnix:\n def te... | python | new_file | 3 | 6 | apache-2.0 | c93da26c35607518f286dbdf9023034288074fab | MagicStack/uvloop,1st1/uvloop,MagicStack/uvloop | tests/test_unix.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Version import needs to come first so everyone else can pull on import\nfrom ._version import get_versions\n__version__ = get_versions()['version']\ndel get_versions\n\nfrom . import cdmr # noqa\n__all__ = ['catalog', 'cdmr']\n\n```\n\nA... | python | edit | 4 | 0 | bsd-3-clause | fc51259760c522593218b83b8c10ce4cf3f239db | MoonRaker/siphon,hyoklee/siphon,Unidata/siphon,dopplershift/siphon,dopplershift/siphon | siphon/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add main function of the rail system optimizer\n\ndef issue#17"
},
{
"role": "assistant",
"content": "\"\"\"\nTrain station Optimizer!\n\nThis program optimizes the efficiency of a train station by simulating normal\noperations a... | python | new_file | 20 | 7 | mit | 2471742baac1a452efb4ab532e0aa1bb873a2913 | ForestPride/rail-problem | rail-system-optimizer.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add host library to topology event test"
},
{
"role": "assistant",
"content": "from ryu.base import app_manager\nfrom ryu.controller import ofp_event\nfrom ryu.controller import event\nfrom ryu.controller.handler import CONFIG_DI... | python | new_file | null | null | mit | 6454bcae6c519c47fc4bd05610e8f16dfe355d66 | TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work,TakeshiTseng/SDN-Work | TopologyEventTest/host_lib.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add tests for unicode find()/rfind()/index()."
},
{
"role": "assistant",
"content": "print(\"Привет\".find(\"т\"))\nprint(\"Привет\".find(\"П\"))\nprint(\"Привет\".rfind(\"т\"))\nprint(\"Привет\".rfind(\"П\"))\nprint(\"При... | python | new_file | 1 | 0 | mit | b1949e4c0984c1f254c5877da1b977c01567bf4d | turbinenreiter/micropython,deshipu/micropython,jlillest/micropython,xuxiaoxin/micropython,dxxb/micropython,ChuckM/micropython,EcmaXp/micropython,henriknelson/micropython,alex-robbins/micropython,HenrikSolver/micropython,tdautc19841202/micropython,blmorris/micropython,emfcamp/micropython,selste/micropython,aethaniel/mic... | tests/unicode/unicode_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new modifier of F expression class (~F(\"boolean field\"))"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom django.db.models.expressions import F as BaseF\n\nclass F(BaseF):\n def __invert__(self):\n ... | python | new_file | 1 | 4 | bsd-3-clause | f8988e956577bf838663346412d223d4cd1351d5 | EnTeQuAk/django-orm,EnTeQuAk/django-orm | django_orm/postgresql/expressions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example script showing how to use this library"
},
{
"role": "assistant",
"content": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"Use IMAP CLI to gt a summary of IMAP account state.\"\"\"\n\n\nimport argpars... | python | new_file | 1 | 4 | mit | 60889b58596e81fd84d9b4fab5f8c04f0382f99c | Gentux/imap-cli,Gentux/imap-cli | examples/summary.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first version of main"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport click\nimport ebisearch\nfrom pprint import pprint\n\n\n@click.group()\ndef main():\n pass\n\n\n@click.command('get_results', sho... | python | new_file | 3 | 1 | mit | 748e39de86b35d5288cef55d3eb246dc0fd84e48 | bebatut/enasearch | enasearch/__main__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: examples/hwapi: Add soft_pwm example converted to uasyncio."
},
{
"role": "assistant",
"content": "# See original soft_pwm.py for detailed comments.\nimport uasyncio\nfrom hwconfig import LED\n\n\nasync def pwm_cycle(led, duty, c... | python | new_file | 1 | 4 | mit | 99e5badeb1e2e6aeffd3b3d56902d4257e168326 | oopy/micropython,swegener/micropython,puuu/micropython,adafruit/micropython,Timmenem/micropython,pozetroninc/micropython,henriknelson/micropython,torwag/micropython,alex-robbins/micropython,infinnovation/micropython,bvernoux/micropython,pozetroninc/micropython,micropython/micropython-esp32,tralamazza/micropython,swegen... | examples/hwapi/soft_pwm_uasyncio.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights rock paper scissors problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Rock Paper Scissors Problem\n\nfrom itertools import combinations\n\n\ndef rockPaperScissors(players):\n ... | python | new_file | 1 | 3 | mit | 76d1930367418ffc01c9629b686557d0bd979f03 | HKuz/Test_Code | CodeFights/rockPaperScissors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add session normalising malaria 3view stack"
},
{
"role": "assistant",
"content": "# IPython log file\n\n\nimport toolz as tz\nimport numpy as np\nfrom skimage import io\nimport os\nfilenames = sorted(os.listdir())\nfrom toolz im... | python | new_file | 1 | 0 | bsd-3-clause | 41047fa4f4e83d457b68b69ae04d7a5373f3aa06 | jni/useful-histories | malaria-3view-normalise.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic test for the creatersakey management command"
},
{
"role": "assistant",
"content": "from django.core.management import call_command\nfrom django.test import TestCase, override_settings\nfrom django.utils.six import St... | python | new_file | 1 | 1 | mit | 36f8bcbb5df95c10deea461ee5afddbfbf746f16 | wayward710/django-oidc-provider,wayward710/django-oidc-provider,torreco/django-oidc-provider,wojtek-fliposports/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,juanifioren/django-oidc-provider,ByteInternet/django-oidc-provider,bunnyinc/django-oidc-provider,ByteInternet/django-oidc-pr... | oidc_provider/tests/test_creatersakey_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for main-tables.rst"
},
{
"role": "assistant",
"content": "import os\nimport re\n\nfrom pokedex.db.tables import mapped_classes\n\ndef test_main_tables():\n \"\"\"Check that tables.py and main-tables.rst are in sync... | python | new_file | 1 | 2 | mit | b69a3381381aabd97873903eea863a85fc4c932d | mschex1/pokedex,DaMouse404/pokedex,RK905/pokedex-1,xfix/pokedex,veekun/pokedex,veekun/pokedex | pokedex/tests/test_docs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new difference module"
},
{
"role": "assistant",
"content": "'''Tests for distance-based objectives, layers, etc.'''\nimport pytest\nimport numpy\nimport numpy.linalg\nfrom numpy.testing import assert_allclose\nfrom... | python | new_file | 1 | 2 | mit | 238a063b821525bc24f059225cfe8fe1ecbdb586 | spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc | thinc/tests/unit/test_difference.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test script that demonstrate the failure to import OpenPNM in the test folder.\n\n\nFormer-commit-id: 38d931cb07cfb102415dc2ac2a68142e3ca3f22d\nFormer-commit-id: 83bb6579e4bd1d15fe39ef9dcb894519feaff707"
},
{
"role": "assistant",
... | python | new_file | 3 | 0 | mit | ea7aea1950e8794d9cc838b4c2311e806058e129 | amdouglas/OpenPNM,TomTranter/OpenPNM,stadelmanma/OpenPNM,PMEAL/OpenPNM,amdouglas/OpenPNM | tests/test1.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom .common import session_scope\n\n\ndef commit_db_item(db_item):\n with session_scope() as session:\n session.merge(db_item)\n session.commit()\n\n```\n\nApply this chang... | python | edit | 1 | 3 | mit | 143af64f9435b3964ee618cccb89e7ad211e030a | leaffan/pynhldb | db/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add placeholder for gwas pvalue"
},
{
"role": "assistant",
"content": "# ------------------------------------------------\n# built-ins\nimport unittest\n\n# local\nfrom utils.base import TestPostgapBase\n# -----------------------... | python | new_file | 1 | 1 | apache-2.0 | d0f144e6e7ca587e42556e19958c53ea131a68e2 | Ensembl/cttv024,Ensembl/cttv024 | tests/data_checks/test_pvalue_filtering.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create migration for the change to the more info link"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.18 on 2019-02-02 19:45\nfrom __future__ import unicode_literals\n\nfrom django.db im... | python | new_file | 1 | 0 | mit | 002bd742a2dfb01e3c69ce97987af21cb5104292 | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/projects/migrations/0038_update-doctype-helptext.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert PDF to Text As a Function"
},
{
"role": "assistant",
"content": "from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter\nfrom cStringIO import StringIO\nfrom pdfminer.converter import TextConverter\nfrom pd... | python | new_file | 2 | 2 | mit | 37e8ab6ca1ac8853df9b856c03263f4d0d7bf8ac | young-geng/ResumeAnalytics | pdf_to_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the server PUSH command"
},
{
"role": "assistant",
"content": "from twisted.plugin import IPlugin\nfrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData\nfrom zope.interface import implements\n\... | python | new_file | 1 | 3 | bsd-3-clause | 1cbd0c19501fc4605a65e89cb8fb72271751777d | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/server/push.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example with ResourceRouter and content negotiation"
},
{
"role": "assistant",
"content": "\"\"\"Example using `routing.ResourceRouter` and `negotiation` (content negotation).\n\nStart the app with\n::\n $ pip install guni... | python | new_file | 1 | 1 | mit | a86264c3d238d04cd38be2d995a7421dbaa49cd1 | sloria/aiohttp_utils | examples/resources_with_negotiation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Configure will uncomment UDP config"
},
{
"role": "assistant",
"content": "from copy import copy\n\n\ndef run():\n ## UDP /etc/rsyslog.conf\n uncomment('/etc/rsyslog.conf', ['$ModLoad imudp', '$UDPServerRun 514'])\n ## n... | python | new_file | 1 | 8 | mit | e445e62dac1e08ab36fee5d37a51c32228707ce8 | ilogue/scrolls | scrolls/configure.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add list of words and combine it with twitter."
},
{
"role": "assistant",
"content": "import urllib\nimport re\nimport math\nfrom bs4 import BeautifulSoup\n\n## This is my small project on Sentimental Analysis\n## Please NOTE: ... | python | new_file | 2 | 0 | mit | 1107b5435d7564cf3dcadfa6515d397eab203c6f | ManrajGrover/Sentimental-Analysis | bs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an utiity to measure salt performance."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# coding: utf-8\n\nimport re\nimport envoy\n\n\ndef parse_state(line):\n match = re.search('\\[(?P<state>[^\\]]+?)\\] at ... | python | new_file | 5 | 5 | bsd-2-clause | acda62ab8af2499c04ff15012039cb5fb5fa8968 | AllMyChanges/allmychanges.com,AllMyChanges/allmychanges.com,AllMyChanges/allmychanges.com,AllMyChanges/allmychanges.com | process-lines.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 628. Maximum Product of Three Numbers\n\n628. Maximum Product of Three Numbers: https://leetcode.com/problems/maximum-product-of-three-numbers/"
},
{
"role": "assistant",
"content": "from operator import mul\n... | python | new_file | 5 | 8 | apache-2.0 | b48cbb3a41372e785bb840a14880ebade4be4e67 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/maximum-product-of-three-numbers.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add rule that vpc flow logs enabled"
},
{
"role": "assistant",
"content": "#\n# This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)\n#\n\nimport boto3\nimport json\n\ndef... | python | new_file | 3 | 3 | cc0-1.0 | d1e241e0b9ce264227e151df7a302471e0df7e6d | awslabs/aws-config-rules,awslabs/aws-config-rules,awslabs/aws-config-rules,ravvav/aws-config-rules,aaronkhoo/aws-config-rules,ravvav/aws-config-rules,anthroprose/aws-config-rules,ravvav/aws-config-rules,anthroprose/aws-config-rules,aaronkhoo/aws-config-rules,aaronkhoo/aws-config-rules | python/vpc_flow_logs_enabled.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Rename files according to owncloud forbidden characters"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Parse tree and find files matching owncloud forbidden characters.\nRename in pla... | python | new_file | 1 | 6 | mit | 2654bb9ee85a9c4ba4798c1a1ce40df20417380a | pzia/keepmydatas | src/owncloud_rename.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, os.path\nimport nose.tools as nose\nimport biobox_cli.container as ctn\n\ndef project_root():\n return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\n\ndef is_ci_server():\n return \"CI\" in os.en... | python | edit | 1 | 2 | mit | a5173a0a153f40b62a7f3c086de1d97b97279bd4 | michaelbarton/command-line-interface,michaelbarton/command-line-interface,bioboxes/command-line-interface,bioboxes/command-line-interface | test/helper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for captcha generation/validation"
},
{
"role": "assistant",
"content": "# This file is part of Indico.\n# Copyright (C) 2002 - 2022 CERN\n#\n# Indico is free software; you can redistribute it and/or\n# modify it under t... | python | new_file | 1 | 1 | mit | cfc1d8c604ab4d472d7b8a73374dcead40c88073 | indico/indico,indico/indico,indico/indico,indico/indico | indico/modules/core/captcha_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test/verify alert configuration\n\nWe're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters."
},
{
"r... | python | new_file | 7 | 0 | mit | ad1121b941a694b7cb6a65e7e6bf4839147f7551 | aelialper/skyline,hcxiong/skyline,loggly/skyline,triplekill/skyline,PaytmLabs/skyline,100star/skyline,CDKGlobal/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,klynch/skyline,aelialper/skyline,triplekill/skyline,100star/skyline,sdgdsffdsfff/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,PaytmLa... | utils/verify_alerts.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test to ensure policy is always authorized\n\nThis adds new unit tests to ensure that all API methods decorated\nwith @expose.expose are also calling policy.authorize() and\ncontext.to_policy_values() within the method body.\n\nThis is d... | python | new_file | 1 | 2 | apache-2.0 | f6b28b3f256388057ef54f72bbc39d89d61ad5a0 | openstack/ironic,pshchelo/ironic,NaohiroTamura/ironic,SauloAislan/ironic,NaohiroTamura/ironic,pshchelo/ironic,openstack/ironic,SauloAislan/ironic | ironic/tests/unit/api/v1/test_expose.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.db import models\n\n\nclass FilerPluginManager(models.Manager):\n def __init__(self, select_related=None):\n self._select_related = select_related\n super(FilerPluginManager, self).__ini... | python | edit | 1 | 2 | bsd-3-clause | 63a70d847073accf679c215e3bf3296c1b107dca | divio/cmsplugin-filer,creimers/cmsplugin-filer,NB-Dev/cmsplugin-filer,brightinteractive/cmsplugin-filer,yvess/cmsplugin-filer,nephila/cmsplugin-filer,stefanfoulis/cmsplugin-filer,centralniak/cmsplugin-filer,skirsdeda/cmsplugin-filer,brightinteractive/cmsplugin-filer,jrutila/cmsplugin-filer,alsoicode/cmsplugin-filer,jru... | cmsplugin_filer_utils/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add separate script for starting app"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\nimport os\nfrom app.main import app\n\nif __name__ == '__main__':\n if len(sys.argv) > 1 and sys.argv[1] == 'debu... | python | new_file | 1 | 0 | mit | 546df2580036206eaa9a9bbc3d45c8004ad0825e | mpolden/jarvis2,mpolden/jarvis2,Foxboron/Frank,martinp/jarvis2,martinp/jarvis2,mpolden/jarvis2,Foxboron/Frank,Foxboron/Frank,martinp/jarvis2 | run.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple wolfram-style cellular automata"
},
{
"role": "assistant",
"content": "data = \"00000000000000000000100000000000000000000\"\n\nstr2idx = {\n \"111\": 0,\n \"110\": 1,\n \"101\": 2,\n \"100\"... | python | new_file | 1 | 2 | mit | adf12bd0561fb92705346f09ec6740c664fd656f | WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox | misc/automata/main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Connect to database and create if tables not exists"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport sqlite3\n\n# Connexion database\ndatabase = \"../data/storage.sq3\"\nconnexion = sqlite3.connect(database... | python | new_file | 1 | 0 | mit | 628907dc438f80f9f587c612fa756f2ffbb0eaaf | cboin/becon | src/account.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add CLI command to generate a secret token"
},
{
"role": "assistant",
"content": "import binascii\nimport logging\nimport os\n\nimport click\n\n\n@click.command()\n@click.argument('bytes', default=128)\ndef cli(bytes):\n \"\"\... | python | new_file | 1 | 1 | mit | 192bf9ea05fb5ebcf46a6f1707ca339eed96bcf0 | nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask | cli/commands/cmd_secret.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add trial runner/report class adapter for old unittests.\n\nThis adds a new unittest file, `lib/bridgedb/test/test_Tests.py`, which\nruns the old unittests in `lib/bridgedb/Tests.py` with a unittest report\nadapter that is compatible with tw... | python | new_file | 9 | 1 | bsd-3-clause | 127087eef72df5f052638bf8a770728800c15fb1 | wfn/bridgedb,mmaker/bridgedb,pagea/bridgedb,pagea/bridgedb,wfn/bridgedb,mmaker/bridgedb | lib/bridgedb/test/test_Tests.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport theanets\n\nimport util\n\n\nclass TestTrainer(util.MNIST):\n def setUp(self):\n super(TestTrainer, self).setUp()\n self.exp = theanets.Experiment(\n theanets.Autoencoder,\n layers=(self.DIGIT_S... | python | edit | 3 | 1 | mit | 976f1881ad97df2f393bb1a090419531ce11eca7 | devdoer/theanets,chrinide/theanets,lmjohns3/theanets | test/trainer_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add drop ProgramDirective table migration"
},
{
"role": "assistant",
"content": "\n\"\"\"Remove ProgramDirective table\n\nRevision ID: 3be12e136921\nRevises: 57cc398ad417\nCreate Date: 2015-04-28 15:23:10.503624\n\n\"\"\"\n\n# re... | python | new_file | 1 | 1 | apache-2.0 | 8c6e294de4c70d97bed685f433a6541dd80cfb0b | prasannav7/ggrc-core,plamut/ggrc-core,uskudnik/ggrc-core,NejcZupec/ggrc-core,hyperNURb/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,NejcZupec/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-core,hasanalom/ggrc-core,hyperNURb/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core... | src/ggrc/migrations/versions/20150428152310_3be12e136921_remove_programdirective_table.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pointless migration to ensure python functionality"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2017-04-06 21:14\nfrom __future__ import unicode_literals\n\nfrom django.db impor... | python | new_file | 1 | 0 | apache-2.0 | 59915f5fd782cef4f5805a2f7ca616b8d615b7e1 | caneruguz/osf.io,binoculars/osf.io,laurenrevere/osf.io,hmoco/osf.io,leb2dg/osf.io,mattclark/osf.io,felliott/osf.io,chrisseto/osf.io,felliott/osf.io,caseyrollins/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,chennan47/osf.io,cwisecarver/osf.io,caneruguz/osf.io,caseyrollins/osf.io,aaxelb/osf.io,cwisecarver/osf.io,caseyrolli... | osf/migrations/0009_auto_20170406_1614.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.