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 some ugly code to make pretty and more efficient"
},
{
"role": "assistant",
"content": "def pretty_function(string_to_count):\n raise NotImplementedError()\n\n\ndef Ugly_Function(string_to_count):\n Cpy_Of_String = str(... | python | new_file | 1 | 11 | mit | 5e874fdc4d19f30123b74c00c162bab12e086735 | coolshop-com/coolshop-application-assignment | ugly_code.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add method to get list of patients from API."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"Script to upload pictures to the gallery.\n\nThis script scans a local picture folder to determine which patients\... | python | new_file | 1 | 1 | mit | e2a5ead8838d484a2216a84b174418ec18fc21f0 | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | extras/gallery_sync.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add GPIO-zero-based demo of 4Tronix Pi-Stop"
},
{
"role": "assistant",
"content": "from gpiozero import TrafficLights\nimport time\n\ndef british_lights_cycle(lights, cycle_time):\n lights.off()\n\n # Red\n lights.red.on... | python | new_file | 2 | 1 | mit | 6031700ba86611809619409c2a83d551f622e391 | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | hardware/gpio/TrafficLights_gpiozero.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add user admin script with list function"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\nimport argparse\nimport datetime\nimport json\nimport sys\nimport requests\n\ndef listusers(server):\n try:\n url = 'htt... | python | new_file | 5 | 4 | mit | 48cb07f0a464bde537be409318448095cabfe10e | fjacob21/nhlplayoffs,fjacob21/nhlplayoffs,fjacob21/nhlplayoffs | useradmin.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Test ansi escape sequence function"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Test the cprint function.\"\"\"\n\nfrom colorise.nix.color_functions import to_ansi\nimport pytest\... | python | new_file | 1 | 1 | bsd-3-clause | cebd5969fda658fd045c1228a8d28cc64fca103e | MisanthropicBit/colorise | tests/test_ansi.py | rejected_duplicate | Near-duplicate of sample 9178 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for KCIS (defined in pbc/ci/kcis_rhf.py)"
},
{
"role": "assistant",
"content": "import pyscf.pbc.cc.test.make_test_cell as make_test_cell\nfrom pyscf.pbc import gto, scf, ci\nfrom pyscf.pbc.ci import KCIS\nimport un... | python | new_file | 4 | 1 | apache-2.0 | bd94ce78b29d918db59f2702fd76e3207840d46f | sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf | pyscf/pbc/ci/test/test_ci.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: PM-86: Add simple script to upload hg pack files to a device"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom pymoku import Moku\nimport sys, logging\n\nlogging.basicConfig(format='%(asctime)s:%(name)s:%(level... | python | new_file | 2 | 0 | mit | 111813afa21ac0d7e4b537f9eb1295cbc0357413 | liquidinstruments/pymoku | examples/load_hgpackage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add merge heads needed migration"
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: c3d394d9dfd1\nRevises: ('3c81fc76164c', 'c19bff0f70ab')\nCreate Date: 2021-01-06 12:53:14.809274\n\n\"\"\"\nfrom alembic ... | python | new_file | 4 | 1 | bsd-3-clause | a71aa49833030795cfe6b187c5497cb5d67ae263 | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | portal/migrations/versions/c3d394d9dfd1_.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Make migration for Teacher model after add nationlaity field to it"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Mig... | python | new_file | 1 | 0 | mit | d91807ff8c8cd652e220a4add65d47e0afbcdb47 | EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat | back_office/migrations/0007_teacher_nationality.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create initial vector variance helpers file"
},
{
"role": "assistant",
"content": "import math\n\ndef listVariance(base, new):\n for i in new:\n if i in base:\n return 0\n return 1\n\ndef valueVariance(bas... | python | new_file | 3 | 3 | mit | f6e2bdeb8662cdb44db9de91d0cbebf6fc41a231 | SLongofono/448_Project4,SLongofono/448_Project4 | Variance.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add data extraction from dhis"
},
{
"role": "assistant",
"content": "import pandas as pd\nfrom blsqpy.postgres_hook import PostgresHook\nfrom blsqpy.dhis2 import Dhis2\n\npgHook = PostgresHook('local_pdss')\ndhis = Dhis2(pgHook)\... | python | new_file | 1 | 0 | mit | 6609836c0d36930a73074ec4f0cf136d887ee0f9 | grlurton/orbf_data_validation,grlurton/orbf_data_validation | src/data_preparation/get_dhis_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module index for libport instrumentation for GDB.\n\n\t* share/gdb/python/libport/__init__.py: New."
},
{
"role": "assistant",
"content": "# Copyright (C) 2011, Gostai S.A.S.\n#\n# This software is provided \"as is\" without ... | python | new_file | 3 | 0 | bsd-3-clause | c12bf811be03d8bf9f1d91adea5104f538210910 | aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport,aldebaran/libport | share/gdb/python/libport/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for i18n."
},
{
"role": "assistant",
"content": "# -*- coding: utf8 -*-\n###\n# Copyright (c) 2012, Valentin Lorentz\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\... | python | new_file | 3 | 1 | bsd-3-clause | 85f8bb3e46c5c79af6ba1e246ad5938642feadcc | Ban3/Limnoria,Ban3/Limnoria,ProgVal/Limnoria-test,ProgVal/Limnoria-test | test/test_i18n.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport curses\nimport dbm\nimport readline\n\nimport bz2\nassert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')\n\nimport platform\nif platform.python_implementation() != 'PyPy' and platform.py... | python | edit | 6 | 0 | apache-2.0 | 9358b83c1dc0c6e0306416705d28a48f478878db | nodejs-docker-bot/official-images,robfrank/official-images,mattrobenolt/official-images,mattrobenolt/official-images,infosiftr/stackbrew,infosiftr/stackbrew,neo-technology/docker-official-images,chorrell/official-images,nodejs-docker-bot/official-images,pesho/docker-official-images,chorrell/official-images,pesho/docker... | test/tests/python-imports/container.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a timeout wrapper play"
},
{
"role": "assistant",
"content": "import composite_behavior\nimport behavior\nimport constants\nimport robocup\nimport time\nimport main\nimport enum\nimport logging\n\nclass TimeoutBehavior(compos... | python | new_file | 6 | 2 | apache-2.0 | 75015c024520af76d454e48cc59eb76c23c35aee | JNeiger/robocup-software,JNeiger/robocup-software,JNeiger/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,JNeiger/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,JNeiger/robocup-software | soccer/gameplay/timeout_behavior.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add kernel construction based on kernels"
},
{
"role": "assistant",
"content": "\"Functions to create kernels from already existing kernels.\"\n\nimport numpy as np\n\n\ndef normalize(kernel, *args, **kwargs):\n \"\"\"Return t... | python | new_file | 1 | 1 | mit | a652707d889b84762f68ac381aa4e89801279e90 | manu3618/legendary-potato | src/legendary_potato/composition.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Copy the RSP2 FTP settings from one INI file into another"
},
{
"role": "assistant",
"content": "#C:\\Users\\smst\\AppData\\Local\\Radio Server Player 2>\r\n#for /d %f in (profiles\\*) do \\code\\rsab\\nowplaying\\copy_ftp.py set... | python | new_file | 3 | 15 | mit | 2981f89a1ffffbd3dae78543fd1e8e257e6a8a3f | radio-st-austell-bay/helpers | copy_ftp.py | rejected_complexity | Cyclomatic complexity too high: 15 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add base class for cogs using ESIpy"
},
{
"role": "assistant",
"content": "import esipy\nfrom discord.ext import commands\nimport time\n\nESI_SWAGGER_JSON = 'https://esi.evetech.net/latest/swagger.json'\nESI_APP: esipy.App = None... | python | new_file | 3 | 2 | mit | 30cb67f454165a72287ba511adba0d8606f3ae72 | randomic/antinub-gregbot | utils/esicog.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool to generate timeline data"
},
{
"role": "assistant",
"content": "#!/usr/bin/python2\n\nimport json\nimport subprocess\nimport time\nimport calendar\nimport dateutil.parser\nimport datetime\n\nruns = json.load(open(\"list... | python | new_file | 4 | 1 | mit | 59d8a8c1218a9641ae559b0cd710c05d17e26409 | mdinger/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,mdinger/awcy,mdinger/awcy,tdaede/awcy,mdinger/awcy,mdinger/awcy,tdaede/awcy | graph_over_time.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for preprocess of Universal bilingual dictionary database"
},
{
"role": "assistant",
"content": "import itertools\nimport codecs\n\nd=[]\nfor entry in a.findall(\"ar\"):\n \n foo = [x.text.split(\";\") for x in e... | python | new_file | 2 | 0 | mit | 7f74911cf02c624afbb85e63dedde68cda2f53f6 | KshitijKarthick/tvecs,KshitijKarthick/tvecs,KshitijKarthick/tvecs | modules/bilingual_generator/bilingual-preprocess.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new Python implementation about de Boor recurrence to draw BSplines curves, this commit contains the initial work on a module which contains knot partition extension utilities."
},
{
"role": "assistant",
"content": "\n\nimp... | python | new_file | 1 | 2 | mit | 1c04af7fa83c8bbe841ecb0ab449b31780b7571f | massimo-nocentini/cagd,massimo-nocentini/cagd,massimo-nocentini/cagd | de-boor/b-splines-with-de-Boor-recurrence.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test to catch bug in compare_to_groundtruth"
},
{
"role": "assistant",
"content": "# py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking.\n# https://github.com/cheind/py-motmetrics/\n#\n# MIT License\n# Cop... | python | new_file | 1 | 4 | mit | 02ba3da06a40e3841e54ee1c93d4dc345a69cca3 | cheind/py-motmetrics,cheind/py-motmetrics | motmetrics/tests/test_utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an unencrypted file based backend."
},
{
"role": "assistant",
"content": "import os\nimport codecs\n\nimport keyring.util.platform\nfrom keyring.py27compat import configparser\nfrom keyring.backends.file import BaseKeyring\nf... | python | new_file | 3 | 3 | mit | 62933a44942088e512ec3aa8024f97ed48375519 | bretth/djset,bretth/djset | djset/backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for updates to workup (smallintegerfield -> charfield to fix vitals thing)."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | new_file | 1 | 0 | mit | 74e46d577bab048a473862b070d8abfb1db00ea1 | SaturdayNeighborhoodHealthClinic/clintools,SaturdayNeighborhoodHealthClinic/clintools,SaturdayNeighborhoodHealthClinic/clintools | workup/migrations/0005_auto_20160826_0620.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for transforming trec topic files to lucene4ir topic files."
},
{
"role": "assistant",
"content": "\"\"\"\nTransform janky trec topics into lucene4ir topics.\n\"\"\"\n\nimport argparse\n\nimport sys\n\n\ndef transform(... | python | new_file | 1 | 7 | apache-2.0 | 51c589491257b870ce70bac66c358fac77b463d3 | leifos/lucene4ir,leifos/lucene4ir,lucene4ir/lucene4ir,lucene4ir/lucene4ir,leifos/lucene4ir,lucene4ir/lucene4ir | scripts/trectransform.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests/basics: Add test for super() when self is closed over."
},
{
"role": "assistant",
"content": "# test that no-arg super() works when self is closed over\n\nclass A:\n def __init__(self):\n self.val = 4\n def foo... | python | new_file | 1 | 2 | mit | 734775524e14a8ae3997933afba64a4ac6a3cd47 | toolmacher/micropython,HenrikSolver/micropython,henriknelson/micropython,oopy/micropython,HenrikSolver/micropython,adafruit/micropython,tralamazza/micropython,alex-robbins/micropython,cwyark/micropython,toolmacher/micropython,tralamazza/micropython,deshipu/micropython,torwag/micropython,swegener/micropython,lowRISC/mic... | tests/basics/class_super_closure.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to fix funding source"
},
{
"role": "assistant",
"content": "import pandas as pd\n\nfrom django.core.management.base import BaseCommand\n\nfrom lowfat.models import Fund, Expense\n\nclass Command(BaseCommand):\n hel... | python | new_file | 1 | 5 | bsd-3-clause | 37ee7ede62cee88a925b2f1ed99a94b445ce6a88 | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | lowfat/management/commands/fixfundingsource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for ``get_reader`` func"
},
{
"role": "assistant",
"content": "from catsup.reader import get_reader, markdown_reader, txt_reader\n\n\ndef test_reader_choser():\n assert get_reader(\"md\") == markdown_reader\n asse... | python | new_file | 1 | 1 | mit | ed491383b183d9001872591554d218603983ae35 | whtsky/catsup-docs-zh,whtsky/Catsup,whtsky/Catsup,whtsky/catsup-docs-zh | tests/test_reader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add support for MySQL-Connector python driver."
},
{
"role": "assistant",
"content": "try:\n import mysql.connector as mysql_connector\nexcept ImportError:\n mysql_connector = None\n\nfrom peewee import ImproperlyConfigured... | python | new_file | 1 | 2 | mit | 10caef4f58f7176ccce3ba65d9d068dc393e7905 | coleifer/peewee,coleifer/peewee,coleifer/peewee | playhouse/mysql_ext.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for config dict merging"
},
{
"role": "assistant",
"content": "import unittest\n\n\nclass TestConfigMerge(unittest.TestCase):\n\n def _call_fut(self, destcfg, srccfg):\n from tilequeue.config import merge_cfg\... | python | new_file | 1 | 1 | mit | 9d79b33abc80d10d525dccae7d2c5419888d96c0 | tilezen/tilequeue,mapzen/tilequeue | tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom tests.scoring_engine.engine.checks.check_test import CheckTest\n\n\nclass TestMYSQLCheck(CheckTest):\n check_name = 'MYSQLCheck'\n properties = {\n 'database': 'wordpressdb',\n 'command': 'show tables'\n }\n accou... | python | edit | 1 | 0 | mit | b32f3db018612285d228a9757d9a644292ec278e | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/scoring_engine/engine/checks/test_mysql.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to validate incoming tweet IDs"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport json\nimport sys\n\ncount = 0\nmismatches = 0\n\n# Validate incoming twitter object id, id_str match and are expected ... | python | new_file | 1 | 0 | mit | fe2f6e4b326ac0c441f561b8c9185cdad2c738fc | inactivist/twitter-streamer,inactivist/twitter-streamer | streamer/scripts/id_munging_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom src.lib.page.login import LoginPage\nfrom src.lib.base import BaseTest\n\n\nclass TestLoginPage(BaseTest):\n def test_login_as_admin(self):\n login_page = LoginPage(self.driver)\n login_page.login()\n\n self.dri... | python | edit | 1 | 1 | apache-2.0 | 5420d368c064953842023ccc07b531b071ec3514 | edofic/ggrc-core,kr41/ggrc-core,jmakov/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,prasan... | src/tests/test_login_page.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the most excellent web server ever conceived.\n\nUse PROFOUND_PORT and PROFOUND_NAME to control the service port\nand \"name\", respectively. It has sane defaults for each."
},
{
"role": "assistant",
"content": "#!/usr/bin/e... | python | new_file | 2 | 2 | mit | 5c308a46ae6863473db9cfe5f159e6fd70fe8691 | ethanrowe/docker-xtream-profundity,ethanrowe/docker-xtream-profundity | profundity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to calculate gain/read noise given a directory."
},
{
"role": "assistant",
"content": "from triage_fits_files import ImageFileCollection\nfrom ccd_characterization import ccd_gain, ccd_read_noise\nfrom numpy import ... | python | new_file | 3 | 2 | bsd-3-clause | 5caa1952c1e413922e313dd51903904fe8e23bef | mwcraig/msumastro | calc_gain_read.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solutions and demo scripts"
},
{
"role": "assistant",
"content": "\"\"\"\nDecorators\n\"\"\"\n\n# 1 Decorators##################################################################\n# Have a look at the warnings examples in warni... | python | new_file | 10 | 1 | mit | 6c0a2c487671693c7efa61aca37b177eb2d18031 | INM-6/Python-Module-of-the-Week,INM-6/Python-Module-of-the-Week,INM-6/Python-Module-of-the-Week,INM-6/Python-Module-of-the-Week | session1_Decorators/decorators.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for hardcoded user model in migrations\n\nNew migrations need to be manually updated to correctly deal with custom\nuser models. This test fails if this isn't done."
},
{
"role": "assistant",
"content": "# -*- coding: ut... | python | new_file | 1 | 7 | bsd-3-clause | ca847aea1de45971327b0008c17e07c3d9d5281c | jlmadurga/django-oscar,MatthewWilkes/django-oscar,faratro/django-oscar,pasqualguerrero/django-oscar,kapt/django-oscar,monikasulik/django-oscar,nfletton/django-oscar,eddiep1101/django-oscar,sasha0/django-oscar,okfish/django-oscar,jmt4/django-oscar,manevant/django-oscar,ka7eh/django-oscar,django-oscar/django-oscar,marcoa... | tests/unit/core/migrations_tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to fix gpt mounting issue with ubuntu."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n#\n# Copyright 2014 Microsoft Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ... | python | new_file | 5 | 0 | apache-2.0 | 346a6b5cc5426ce38195dd5ce4507894710ee8a7 | fieryorc/WALinuxAgent,lizzha/WALinuxAgent,jerickso/WALinuxAgent,SuperScottz/WALinuxAgent,yuezh/WALinuxAgent,thomas1206/WALinuxAgent,AbelHu/WALinuxAgent,thomas1206/WALinuxAgent,karataliu/WALinuxAgent,karataliu/WALinuxAgent,AbelHu/WALinuxAgent,ryanmiao/WALinuxAgent,ryanmiao/WALinuxAgent,SuperScottz/WALinuxAgent,yuezh/WAL... | fix-gpt-ubuntu.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Time: O(n)\n# Space: O(1)\n\n# Given a string, you need to reverse the order of characters in each word within a sentence\n# while still preserving whitespace and initial word order.\n#\n# Example 1:\n# Input: \"Let's take LeetCode conte... | python | edit | 3 | 4 | mit | 541d4080821692ed879bfee47eb0ce1a8b278dac | kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015 | Python/reverse-words-in-a-string-iii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert agenda to markdown"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3.8\n\nimport sys\nimport yaml\n\ndef print_votes(votes):\n if votes:\n for v in votes:\n print(\"\"\"* [#{... | python | new_file | 1 | 3 | mit | 807ceb2de5dd0f9d84d17252b0929c1c7136919d | mpi-forum/mpi-forum.github.io,mpi-forum/mpi-forum.github.io,mpi-forum/mpi-forum.github.io,mpi-forum/mpi-forum.github.io,mpi-forum/mpi-forum.github.io | utils/generate_plenary_agenda_md.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some unit tests for approximate fractions."
},
{
"role": "assistant",
"content": "from __future__ import division\n\nfrom nose.tools import *\n\nfrom fractions import Fraction\nfrom ..fraction import *\n\ndef test_fraction():... | python | new_file | 13 | 4 | bsd-3-clause | aec7f2bee97d79777e418b4752b5e9ce4d9f2a2c | dit/dit,Autoplectic/dit,Autoplectic/dit,chebee7i/dit,dit/dit,chebee7i/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,chebee7i/dit,Autoplectic/dit,dit/dit,dit/dit,chebee7i/dit | dit/math/tests/test_fraction.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for registration view"
},
{
"role": "assistant",
"content": "from django.test import TestCase\nfrom django.core.urlresolvers import reverse\n\nfrom ..models import PendingUser\n\n\nclass RegisterViewTestCase(TestCase):\... | python | new_file | 1 | 1 | mit | 81468159a3fec44ba3d764d1fbf6545bc604468b | Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org | accounts/tests/test_registration_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add base setup file for generating packages\n\n--HG--\nextra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40527"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nlong_description=... | python | new_file | 1 | 0 | mit | fc60ac22d7497e8350351a5c82a86588c6a224fe | gsnedders/html5lib-python,alex/html5lib-python,mindw/html5lib-python,mindw/html5lib-python,ordbogen/html5lib-python,ordbogen/html5lib-python,dstufft/html5lib-python,html5lib/html5lib-python,mgilson/html5lib-python,alex/html5lib-python,alex/html5lib-python,mgilson/html5lib-python,html5lib/html5lib-python,mgilson/html5li... | setup_base.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to generate the \"loading\" animation"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\n\"\"\" Generate a \"loading\" or \"waiting\" animated gif. \"\"\"\n\nimport math\n\nimport PIL.Image\nimport PIL.Im... | python | new_file | 1 | 2 | bsd-2-clause | cee058cf81fc0baba625942d90a5fd3f67fb9bec | Tarsnap/tarsnap-gui,Tarsnap/tarsnap-gui,Tarsnap/tarsnap-gui,Tarsnap/tarsnap-gui,Tarsnap/tarsnap-gui | util/generate_loading_gif.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\" Simple test for the view counter that verifies that it is updating properly \"\"\"\n\nfrom collections import namedtuple\n\nfrom mock import Mock\n\nfrom xblock.runtime import KvsFieldData, DictKeyValueStore\nfrom xblock.view_counter... | python | edit | 2 | 2 | apache-2.0 | 92759e9df89664ae515e51825982141750921ce3 | stvstnfrd/xblock-sdk,dcadams/xblock-sdk,edx/xblock-sdk,jamiefolsom/xblock-sdk,edx/xblock-sdk,stvstnfrd/xblock-sdk,nagyistoce/edx-xblock-sdk,lovehhf/xblock-sdk,edx-solutions/xblock-sdk,Pilou81715/hackathon_edX,Pilou81715/hackathon_edX,edx-solutions/xblock-sdk,lovehhf/xblock-sdk,lovehhf/xblock-sdk,nagyistoce/edx-xblock-s... | src/sample_xblocks/basic/test/test_view_counter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a class to feed minibatches for N-pair-mc training"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 10 00:15:50 2017\n\n@author: sakurai\n\"\"\"\n\nimport numpy as np\nfrom skle... | python | new_file | 4 | 4 | mit | 4e6705acffe2ecc42bb934863629eb597375e8dc | ronekko/deep_metric_learning | data_provider.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic ML framework- does not work though"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# rgb2_color_k_nearest.py\n# by <EMAIL>, <EMAIL>, <EMAIL>\n# This is not the complete/correct approach. This is just the f... | python | new_file | 3 | 0 | mit | fe3a40caf31aa1eaff4e1b6ce7dba3e01a27eec7 | jetbloom/rgb2colorname,jetbloom/rgb2colorname | rgb_color_k_nearest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move test to it's own file\n\nThe `from_json` method being tested has moved from the api client to the model,\nso I've moved the test to reflect the change."
},
{
"role": "assistant",
"content": "from app import create_app, ApiCl... | python | new_file | 1 | 1 | mit | ddc73ffe5f68d57afc8965078fcdc8f61aaf589d | alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtekel/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,mtek... | tests/app/test_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: hooks: Add a hook to limit the size of any individual file"
},
{
"role": "assistant",
"content": "from mercurial import context\nfrom mercurial.i18n import _\n\n'''\n[extensions]\nhgfilesize=~/m5/incoming/util/hgfilesize.py\n\n[h... | python | new_file | 2 | 4 | bsd-3-clause | 1018589a17484c5ed337b80a5887aef68df7adbb | pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,hoangt/tpzsimul.gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul... | util/hgfilesize.py | rejected_duplicate | Near-duplicate of sample 7990 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to diplay webcam video stream"
},
{
"role": "assistant",
"content": "import cv2\n\ncv2.namedWindow(\"preview\")\n\nvc = cv2.VideoCapture(0)\n\nif vc.isOpened(): # try to get the first frame\n rval, frame = vc... | python | new_file | 1 | 0 | mit | 1635bf028cf2a1a971f082370c94c446801ac444 | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | ObjectTracking/DisplayVideoStream.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights doodled password problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Alphabetic Shift Problem\n\nfrom collections import deque\n\n\ndef doodledPassword(digits):\n n = len(dig... | python | new_file | 1 | 3 | mit | 822cb468c033c81d8107d865715d024177b38fcd | HKuz/Test_Code | CodeFights/doodledPassword.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script select class images from video protocols."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\nimport os.path as osp\nimport os\nimport argparse\nthis_dir = osp.dirname(__file__)\nsys.path.insert... | python | new_file | 1 | 0 | mit | 0504943ebedccbeea2d22a88510aa523afa9365c | myfavouritekk/TPN | tools/data/select_class_images_from_video_proto.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to smooth gt tracks."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport sys\nimport os.path as osp\nthis_dir = osp.dirname(__file__)\nsys.path.insert(0, osp.join(this_dir, '../../external/'))\nfro... | python | new_file | 1 | 0 | mit | 148cb8b58387f0e604ef93c8080be3ed533be488 | myfavouritekk/TPN | tools/data/smooth_gt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for object mask."
},
{
"role": "assistant",
"content": "from unrealcv import client\nimport re\n\nclass Color(object):\n ''' A utility class to parse color value '''\n regexp = re.compile('\\(R=(.*),G=(.*),B=(.*)... | python | new_file | 3 | 3 | mit | 98b3f4429cb9959f294f2fb6d6345ce18339a098 | qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv | test/commands/test_object_mask.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Traversable on pathlib and zipfile Path objects."
},
{
"role": "assistant",
"content": "import io\nimport zipfile\nimport unittest\n\nfrom importlib_resources._compat import ZipPath, Path\nfrom importlib_resources.a... | python | new_file | 1 | 1 | apache-2.0 | f647b1bc68a76d990d452d50bb2d67981db12c4c | python/importlib_resources | importlib_resources/tests/test_abc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Symbol, List, Boolean, Nil and Atom types."
},
{
"role": "assistant",
"content": "class Symbol(str):\n pass\n\n\n# lists\nclass List(list):\n def __add__(self, rhs):\n return List(list.__add__(self, rhs))\n\n ... | python | new_file | 1 | 3 | mit | 98f4a1c0fc1562d49d86b4b8f6763f2ce259280d | skk/eche | eche/eche_types.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add alembic migration script for dark theme"
},
{
"role": "assistant",
"content": "\"\"\"Add dark_theme entry\n\nRevision ID: 3b85eb7c4d7\nRevises: 3d4136d1ae1\nCreate Date: 2015-08-06 03:34:32.888608\n\n\"\"\"\n\n# revision iden... | python | new_file | 3 | 1 | mit | af966370d7c13e17f7b0ad77cec8e0c53d6738f1 | EIREXE/SpaceDock,EIREXE/SpaceDock,KerbalStuff/KerbalStuff,Kerbas-ad-astra/KerbalStuff,KerbalStuff/KerbalStuff,EIREXE/SpaceDock,KerbalStuff/KerbalStuff,Kerbas-ad-astra/KerbalStuff,EIREXE/SpaceDock,Kerbas-ad-astra/KerbalStuff | alembic/versions/3b85eb7c4d7_add_dark_theme_entry.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move code from old repo."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"Simple library for posting to Rocket.Chat via webhooks a.k.a. integrations.\"\"\"\n\nimport json\nimport httplib\nimport urllib\n\n\ncla... | python | new_file | 1 | 6 | mit | b1079d59593a9b0e6a5c3f4ffa286ab472c174bf | gevial/rockethook | rockethook.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial tests of subclassing components"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# TEST_UNICODE_LITERALS\n\nfrom ... import table\n\n\n... | python | new_file | 1 | 1 | bsd-3-clause | ca8efa51b4a8269089671ec24ccbf5d5ed56dd71 | kelle/astropy,MSeifert04/astropy,pllim/astropy,aleksandr-bakanov/astropy,larrybradley/astropy,tbabej/astropy,bsipocz/astropy,joergdietrich/astropy,joergdietrich/astropy,mhvk/astropy,stargaser/astropy,kelle/astropy,dhomeier/astropy,pllim/astropy,astropy/astropy,DougBurke/astropy,saimn/astropy,MSeifert04/astropy,larrybra... | astropy/table/tests/test_subclass.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add routing table class based on pandas.DataFrame."
},
{
"role": "assistant",
"content": "import pandas\n\nclass DynamicTable(object):\n \"\"\"\n Dynamically sized table.\n \"\"\"\n\n def __init__(self, *args, **kwarg... | python | new_file | null | null | bsd-3-clause | 37848cc0a6cffe9c12dda905715fd1e347603560 | cerrno/neurokernel | routing_table.py | rejected_code_smell | Internal duplication: ~27% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for the Task model"
},
{
"role": "assistant",
"content": "from mongoengine import ValidationError\nfrom nose.tools import raises\n\nfrom app.task import Priority, Task\n\ndef test_Set_Title_String():\n task = Ta... | python | new_file | 1 | 1 | mit | fc616c89e0b647c5ada9f15bfdc508fd77e1b391 | Zillolo/lazy-todo | tests/task.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights codefighter attribute problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Codefighter Attribute Problem\n\n\nclass CodeFighter(object):\n def __init__(self, username, _id, xp... | python | new_file | 1 | 3 | mit | ab1bcd10d7abf226b4f85970eec6e27512a431f2 | HKuz/Test_Code | CodeFights/codefighterAttribute.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dummy module of Task class"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\n\nfrom enum import Enum\n\n\nclass State(Enum):\n inactive = 1\n active = 2\n running = 3\n paused = 4\n aborted = 5\n ... | python | new_file | 1 | 1 | apache-2.0 | 205ce3a2d480e0d05bbdfd9cd2c2f3bafc08a061 | vurmux/gorynych | gorynych/task.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for VPC module update"
},
{
"role": "assistant",
"content": "from pentagon import migration\nfrom pentagon.migration import *\nfrom pentagon.component import core, inventory\nfrom pentagon.helpers import merge_dict\... | python | new_file | 13 | 5 | apache-2.0 | f0146cfdf639df8905f7240ca8ef939fbd328ece | reactiveops/pentagon,reactiveops/pentagon,reactiveops/pentagon | pentagon/migration/migrations/migration_2_5_0.py | rejected_lint | Too many lint violations: 13 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to retrieve CIViC Drug / Disease information"
},
{
"role": "assistant",
"content": "import requests\nimport progressbar\nimport pandas as pd\n\nbar = progressbar.ProgressBar()\n\n\ndef create_civic_drug_disease_dataf... | python | new_file | 1 | 5 | mit | 314c40bbfa33f5ae71b35b50de5305dc20b8fd9d | jvivian/rnaseq-lib,jvivian/rnaseq-lib | src/rnaseq_lib/civic/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add batch script for kanji animations"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimport os\nimport progressbar\n\nsvgs = filter(lambda f: f.endswith(\".svg\"), os.listdir(\".\"))\n\nbar = progressbar.Progres... | python | new_file | 1 | 0 | apache-2.0 | fa475825a9d31aab6f5f4cb8851531ec5207315c | Tenchi2xh/rem-v2,Tenchi2xh/rem-v2,Tenchi2xh/rem-v2 | scripts/kanimaji_batch.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nclass SentryHandler(logging.Handler):\n def emit(self, record):\n from sentry.client.models import get_client\n\n get_client().create_from_record(record)\n```\n\nApply this change: Add a safety net for rec... | python | edit | 2 | 2 | bsd-3-clause | 700fa0144c5276d8e31c01a243340f6cbac07e8f | ewdurbin/sentry,hongliang5623/sentry,Photonomie/raven-python,ewdurbin/raven-python,daevaorn/sentry,NickPresta/sentry,dcramer/sentry-old,looker/sentry,NickPresta/sentry,chayapan/django-sentry,Kryz/sentry,BuildingLink/sentry,gencer/sentry,boneyao/sentry,danriti/raven-python,imankulov/sentry,nikolas/raven-python,mvaled/se... | sentry/client/handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function to read 3d direct access Fortran binary files into NumPy arrays."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n#Author: Scott T. Salesky\n#Created: 12.6.2014\n#Purpose: Collection of functions, routines t... | python | new_file | 1 | 0 | mit | b4fa0194d995fd2ae20a11d8f27a6273e1f01aa9 | ssalesky/Science-Library | sci_lib.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a bunch of simple tests"
},
{
"role": "assistant",
"content": "# test_wendy.py: some basic tests\nimport numpy\nimport wendy\ndef test_energy_conservation():\n # Test that energy is conserved for a simple problem\n x= n... | python | new_file | 1 | 2 | mit | 02ef9c6e77ce4ba1521eaf590b2bcba278ab2814 | jobovy/wendy,jobovy/wendy | tests/test_wendy.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\n\nclass OSUtil():\n def __init__(self):\n pass\n\n def platform(self):\n platform = sys.platform # Map from python platform name to ue4 platform name\n names = {\n 'cygwin': 'Win', # could b... | python | edit | 1 | 2 | mit | 529d72ff62f3d4b8ab18a26beadd20322a118a28 | qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv | client/scripts/osutil.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add server for embedding transformation"
},
{
"role": "assistant",
"content": "from flask import Flask\nfrom flask import request, abort, jsonify\nimport numpy as np\nimport gensim\nimport re\nimport string\n\napp = Flask(__name_... | python | new_file | 1 | 6 | mit | e4d7375b2706dd46cf08831e5f005ce3a3c17553 | DolphinBlockchainIntelligence/bitcointalk-sentiment | embedding_server/embedding_server.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests: Add test for hash of user defined class."
},
{
"role": "assistant",
"content": "# test builtin hash function\n\nclass A:\n def __hash__(self):\n return 123\n def __repr__(self):\n return \"a instance\"\... | python | new_file | 1 | 1 | mit | 4df85e49d48a76246d97383ac6a5d63e1ce2be60 | Peetz0r/micropython-esp32,henriknelson/micropython,drrk/micropython,dxxb/micropython,kerneltask/micropython,SHA2017-badge/micropython-esp32,turbinenreiter/micropython,martinribelotta/micropython,tobbad/micropython,misterdanb/micropython,Peetz0r/micropython-esp32,ganshun666/micropython,galenhz/micropython,mgyenik/microp... | tests/basics/builtin_hash.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests of fields in serializers"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\ntest_in_serializers\n-------------------\n\nTests of the fields cooperation in the serializer i... | python | new_file | 4 | 1 | bsd-3-clause | e149bddfe280e37adf2b67500c0696a86c9341dc | estebistec/drf-compound-fields,pombredanne/drf-compound-fields | tests/test_in_serializers.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to load data from scraper manifest."
},
{
"role": "assistant",
"content": "import argparse\nimport json\nimport os\n\nimport mcbench.client\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(\n descrip... | python | new_file | 1 | 2 | mit | 51b8e860e7edf77c7333c19d7de7654f22cd1b09 | isbadawi/mcbench,isbadawi/mcbench | load_manifest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create test case for MTI Plugins"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom django.conf import settings\n\nfrom cms.models import Page\nfrom cms.models.pluginmodel import CMSPlugin\nfrom cms.test_utils... | python | new_file | 11 | 0 | bsd-3-clause | 40da5ab867f49f5db64d0c58e19723149d2f8243 | rryan/django-cms,datakortet/django-cms,owers19856/django-cms,qnub/django-cms,mkoistinen/django-cms,rryan/django-cms,stefanfoulis/django-cms,petecummings/django-cms,wyg3958/django-cms,jeffreylu9/django-cms,nimbis/django-cms,netzkolchose/django-cms,jeffreylu9/django-cms,petecummings/django-cms,vxsx/django-cms,jsma/django... | cms/tests/plugins_mti.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to normalize spelling\n\nAdded a script that takes as input a training and test set containing\nsentences with words separated by spaces, normalizes the spelling using\nthe hist2modern dictionary and writes files containing the sp... | python | new_file | 4 | 0 | apache-2.0 | 1458b5a02df4e983dfa54b474d1796d530d536a7 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | normalize_spelling.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for new shortcuts."
},
{
"role": "assistant",
"content": "from nose.tools import *\n\nfrom lctools.shortcuts import get_node_or_fail\n\nclass TestShortCuts(object):\n\n def setup(self):\n class MyNode(object):... | python | new_file | 9 | 1 | apache-2.0 | 830227bad5e32683180d7d8df12f20e5935d81ed | novel/lc-tools,novel/lc-tools | test/test_shortcuts.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for checking if tesseract binary is available"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport shutil\nimport unittest\n\n\nclass TestScanimage(unittest.TestCase):\n\n \"... | python | new_file | 1 | 1 | bsd-2-clause | d339980773fb9e6b61c1f5dfab935aeb2daf8d5d | sjktje/sjkscan,sjktje/sjkscan | tests/tests_scanimage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create separate bbn ontology retriever."
},
{
"role": "assistant",
"content": "import yaml\nimport requests\nfrom os.path import join, dirname, abspath\nfrom rdflib import Graph, Namespace, Literal\n\nbb_ont_url = ('https://raw.g... | python | new_file | 3 | 14 | bsd-2-clause | a60ee78c65cc1920dc57bf26781cde5836271147 | johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,bgyori/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,bgyori/indra,pvtodorov/indra | indra/sources/bbn/make_bbn_ontology.py | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add demo script to send SMS message from command_line"
},
{
"role": "assistant",
"content": "\"\"\"\nBasic demo of summit-python that sends a simple SMS message from the\ncommand-line.\n\"\"\"\n\nimport argparse\n\nfrom summit.re... | python | new_file | 3 | 1 | mit | ad68c13a4080c80c88b039e3033f6b94421f4a27 | josephl/summit-python | sms_send_demo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for nonterms iteration tests"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\nfrom unittest import TestC... | python | new_file | 1 | 3 | mit | bddd57dd75b81887cda3f82f44eaf548b6bba405 | PatrikValkovic/grammpy | tests/grammar_term-nonterm_test/NonterminalIterationTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add l10n test for Hollywood neighbourhood"
},
{
"role": "assistant",
"content": "# Hollywood (wof neighbourhood)\n# https://whosonfirst.mapzen.com/data/858/260/37/85826037.geojson\nassert_has_feature(\n 16, 11227, 26157, 'plac... | python | new_file | 2 | 0 | mit | 8d1b806e6b28bcb80bed64d1449716a218008529 | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | test/418-wof-l10n_name.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Add test for multi-step append"
},
{
"role": "assistant",
"content": "r\"\"\"\nTests for forecasting-related features not tested elsewhere\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nimport pytest\nfrom numpy.testi... | python | new_file | 4 | 5 | bsd-3-clause | 58b9d66a10c88fb141570f7aca9ea6f471e2f82d | jseabold/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,josef-pkt/statsmodels,bashtage/statsmodels,bashtage/statsmodels,jseabold/statsmodels,josef-pkt/statsmodels,jseabold/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,bashtage/statsmodels,statsmodels/... | statsmodels/tsa/statespace/tests/test_forecasting.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for the optimizer."
},
{
"role": "assistant",
"content": "\"\"\"\nLearning tests.\n\"\"\"\n\n# pylint: disable=no-member\n# pylint: disable=missing-docstring\n\n# future imports\nfrom __future__ import division\nfrom __f... | python | new_file | 1 | 1 | bsd-2-clause | 05d7332d6305ed7d1bc75a843f91603c5997b14e | mwhoffman/pygp | tests/test_learning.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple class to work with canvas tools."
},
{
"role": "assistant",
"content": "from reportlab.lib.enums import TA_JUSTIFY\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragr... | python | new_file | 1 | 3 | bsd-2-clause | af3577a1ab0f7005d95c64be640550263efcb416 | johnbachman/indra,bgyori/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy | indra/tools/reading/util/reporter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: migrations: Adjust stats size for tsvector to 10k, from 100.\n\nPostgreSQL's `default_statistics_target` is used to track how many\n\"most common values\" (\"MCVs\") for a column when performing an\n`ANALYZE`. For `tsvector` columns, the nu... | python | new_file | 1 | 0 | apache-2.0 | 102481bc47e22424cd4d623fd84f1eb317b1d55f | zulip/zulip,rht/zulip,rht/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,andersk/zulip,rht/zulip,andersk/zulip,andersk/zulip,rht/zulip,rht/zulip,zulip/zulip,rht/zulip,andersk/zulip,zulip/zulip,rht/zulip,zulip/zulip,zulip/zulip,zulip/zulip | zerver/migrations/0398_tsvector_statistics.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple test for build details"
},
{
"role": "assistant",
"content": "from datetime import datetime\n\nfrom changes.constants import Status\nfrom changes.testutils import APITestCase\n\n\nclass BuildDetailsTest(APITestCase):\n... | python | new_file | 1 | 1 | apache-2.0 | a37521ef7b6ce40b6a182c6ff42c62f30fb12537 | bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes | tests/changes/api/test_build_details.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert between optical and radio velocities."
},
{
"role": "assistant",
"content": "\nfrom astropy import units as u\nimport numpy as np\n\n\ndef optical_to_radio(vel, freq, rest):\n\n return freq * vel / rest\n\n\ndef radio_... | python | new_file | 1 | 1 | mit | 7b6e503924525046932ad671d1a39990492c37ff | e-koch/ewky_scripts,e-koch/ewky_scripts | convert_velocity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add top script to generate binaries from scratch.\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@5553 94b884b6-d6fd-0310-90d3-974f1d3f35e1"
},
{
"role": "assistant",
"content": "import subprocess\r\nimport os\r\n\r\nPYVE... | python | new_file | 3 | 0 | bsd-3-clause | 1cb22dfdf9882de7aa6e977c79d80eac7158873e | efiring/numpy-work,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,efiring/numpy-work,efiring/numpy-work,illume/numpy3k,chadnetzer/numpy-gaurdro,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,efiring/numpy-work,jasonmccampbell/numpy-refact... | tools/win32build/doall.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a animated figure from a series of data"
},
{
"role": "assistant",
"content": "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as anim\nfrom mpl_toolkits.mplot3d import Axes3D\nimport sys\n... | python | new_file | 3 | 0 | mit | 34ec07ef4601a7702f8d606efa0d861b11cca393 | TAdeJong/plasma-analysis,TAdeJong/plasma-analysis | code/animatefuse.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a unit test for CDN-downloads"
},
{
"role": "assistant",
"content": "import unittest\nimport os\nfrom io import BytesIO\nfrom random import randint\nfrom hashlib import sha256\nfrom telethon import TelegramClient\n\n# Fill in... | python | new_file | 1 | 2 | mit | 8cfc4d0fda1bbc3301953cd7bb03073042f7c38b | LonamiWebs/Telethon,andr-04/Telethon,LonamiWebs/Telethon,expectocode/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon | telethon_tests/higher_level_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014-2015 Ivan Kravets <<EMAIL>>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# htt... | python | edit | 1 | 2 | apache-2.0 | 4e90a2fd424eeb078957b779a211d9643c516566 | platformio/platformio-core,eiginn/platformio,platformio/platformio-core,ZachMassia/platformio,platformio/platformio,valeros/platformio | tests/commands/test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for config milestones"
},
{
"role": "assistant",
"content": "from tg.configuration.milestones import _ConfigMilestoneTracker\n\n\nclass Action:\n called = 0\n def __call__(self):\n self.called += 1\n\n\ncla... | python | new_file | 1 | 1 | mit | f2bdbe29395f1fc875d097200821f0bfd099ee68 | lucius-feng/tg2,lucius-feng/tg2 | tests/test_config_milestones.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add method to find time taken"
},
{
"role": "assistant",
"content": "\"\"\"Handle datetime for pysyte's types\"\"\"\nimport datetime\nepoch = datetime.datetime.fromtimestamp(0)\n\n\ndef taken(diff, days=True):\n seconds = diff... | python | new_file | 1 | 2 | mit | c95ff949ea70e5466cf6bd0775f1033d0ad6caab | jalanb/dotsite | pysyte/types/times.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test case for ORM"
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\nfrom __future__ import print_function, unicode_literals\n\nimport sys\n\nimport pytest\nfrom simplesqlite import connect_memdb\nfrom simplesqlite... | python | new_file | 4 | 5 | mit | 0cd84e16ae6159097900e743160c6b2efa66ea0e | thombashi/SimpleSQLite,thombashi/SimpleSQLite | test/test_orm.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add diagnostic comparing aviationweather.gov to IEM"
},
{
"role": "assistant",
"content": "\"\"\"\n Compare our PIREPs data against what is at aviation wx JSON service\n\"\"\"\nimport json\nimport urllib2\nimport datetime\nimpor... | python | new_file | 4 | 0 | mit | fa4cdc8cf87d45b2f3fe38d3a99ad9ac70f70a17 | akrherz/pyWWA,akrherz/pyWWA | util/check_pireps_against_aviationwx.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple accept loop for clients"
},
{
"role": "assistant",
"content": "\"\"\"\n\nA simple chat server using TCP/IP and the publisher-subscriber pattern.\n\n@author Steven Briggs\n@version 2015.05.25\n\n\"\"\"\n\nimport sys\n... | python | new_file | 1 | 2 | mit | b3d863bd43ee53ed4fee32c4ebcd4e935852a752 | Broar/PyChat | pychat/pychat.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove tabs and trailing whitespace\n\nAlso added a simple python script for stripping the whitespace. Tabs, just grep\nand remove manually"
},
{
"role": "assistant",
"content": "import glob\nimport os\nimport sys\n\n\n\n\n\nexte... | python | new_file | 2 | 3 | apache-2.0 | b41e5552fe5abf75e6bfda9814eed4798695c01b | youngmit/mocc,youngmit/mocc,youngmit/mocc,youngmit/mocc | tools/rm_trailing_whitespace.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights check password problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Check Password Problem\n\n\ndef checkPassword(attempts, password):\n def check():\n while True:\n ... | python | new_file | 1 | 3 | mit | 1c2fc6d3e60cf36bc66aac96baa31074d52e3695 | HKuz/Test_Code | CodeFights/checkPassword.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test example viewing a dft mesh"
},
{
"role": "assistant",
"content": "\ndef test_mesh():\n from pyquante2 import grid,h2o\n from pyquante2.viewer.viewer import Shapes,Viewer\n h2o_mesh = grid(h2o)\n shapes = Shapes(h... | python | new_file | 1 | 1 | bsd-3-clause | 5f5f5df6f76e6f82960f7cd0050266e4f523d481 | Konjkov/pyquante2,Konjkov/pyquante2,Konjkov/pyquante2 | tests/gl.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.