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 a python script to generate test methods"
},
{
"role": "assistant",
"content": "from itertools import product\nimport json\nimport numpy\n\ncube = numpy.array(range(1, 9)).reshape(2, 2, 2)\n\npcube = [\n cube[0 ,0 ,0 ],... | python | new_file | 9 | 0 | mit | bcee6173027c48bfb25a65d3e97660f2e2a0852b | y-uti/php-bsxfun,y-uti/php-bsxfun | gentest.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple APL exception class"
},
{
"role": "assistant",
"content": "\"\"\"\n A simple APL exception class\n\"\"\"\n\nclass APL_Exception (BaseException):\n \"\"\"\n APL Exception Class\n \"\"\"\n def __init__... | python | new_file | 1 | 1 | apache-2.0 | c68c5bf488cb7224d675bec333c6b7a4992574ed | NewForester/apl-py,NewForester/apl-py | apl_exception.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove HInput and Isolate joystick related code because son path isues with pygame"
},
{
"role": "assistant",
"content": "#from direct.showbase import DirectObject\nimport pygame #pygame must be in the Main.py directory\n#THIS FI... | python | new_file | 2 | 5 | bsd-2-clause | f2d4ddba7c594ec93f0ede0be1fc515b0c7c2d7b | hikaruAi/HPanda | HJoystick.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement player choosing a random pawn to move"
},
{
"role": "assistant",
"content": "# Player\n\nfrom playerbase import PlayerBase, Players\nfrom random import randint\n\n\nclass PlayerMoveRandom(PlayerBase):\n\n def get_des... | python | new_file | 3 | 2 | mit | a67a4e15ce25e9e9a795534b4e629d6680fb491b | risteon/ludo_python | ludo/playermoverandom.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 396. Rotate Function\n\n396. Rotate Function: https://leetcode.com/problems/rotate-function/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def maxRotateFunction(self, A):\n \"\"\"\... | python | new_file | 3 | 4 | apache-2.0 | d159b32d51339915ef633f3c6d33ce5eeafa78d6 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/rotate-function.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tool to get new url"
},
{
"role": "assistant",
"content": "import sys\n\nimport polycules\n\n\nif len(sys.argv) != 2:\n print('Expected ID, got too little or too much')\n\nold_id = sys.argv[1]\n\ndb = polycules.connect_db(... | python | new_file | 1 | 0 | mit | ee7c257b62bff832b899f54fd7bf39ae47db05b7 | makyo/polycul.es,makyo/polycul.es,makyo/polycul.es | get_new_url.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new wrapper class for managing ansible static inventory."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nAnsibleInventory:\n\nINTRO:\n\nUSAGE:\n\n\"\"\"\n\nimport os\nimport ... | python | new_file | 2 | 4 | apache-2.0 | 9167643047c61bae50a7c73775631c7bfe434cc9 | bdastur/spam,bdastur/spam | spam/ansiInventory.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve Code Fights different symbols naive problem"
},
{
"role": "assistant",
"content": "#!/usr/local/bin/python\n# Code Fights Different Symbols Naive Problem\n\nfrom collections import Counter\n\n\ndef differentSymbolsNaive(s):... | python | new_file | 1 | 3 | mit | 052392da7980c4f4e2e86cd8eb65da5b91d3547b | HKuz/Test_Code | CodeFights/differentSymbolsNaive.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add guess phred encoding script"
},
{
"role": "assistant",
"content": "\"\"\"\n awk 'NR % 4 == 0' your.fastq | python %prog [options]\n\nguess the encoding of a stream of qual lines.\n\"\"\"\nimport sys\nimport optparse\n\nRANG... | python | new_file | 4 | 9 | apache-2.0 | c7e7430d76337ef5cfd6779d9a32c2c9d948eb86 | jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public | carbon/guess-encoding.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: DOC: Add map example with data generators"
},
{
"role": "assistant",
"content": "\"\"\"\nWorld Map\n---------\n\nThis example shows how to create a world map using data generators for\ndifferent background layers.\n\"\"\"\n# cate... | python | new_file | 1 | 0 | bsd-3-clause | a4d5e88973a25464be26488d17ecc663cce776d7 | jakevdp/altair,altair-viz/altair | altair/examples/world_map.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make gallery of examples for various bending angles up to 90 degrees"
},
{
"role": "assistant",
"content": "# Make a gallery of images showing the RGZ consensus double sources, sorted by bending angle.\n\nfrom astropy.io import a... | python | new_file | 3 | 6 | mit | 2d6ecb3b5b67539c6ad0f211d7b059ac44df2731 | willettk/rgz-analysis,willettk/rgz-analysis,afgaron/rgz-analysis,willettk/rgz-analysis,afgaron/rgz-analysis,afgaron/rgz-analysis | python/bending_examples.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test events (really event __repr__)"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom h11 import Request\n\nfrom wsproto.events import (\n ConnectionClosed,\n ConnectionEstablished,\n ConnectionRequested,\n)\n... | python | new_file | 1 | 4 | mit | 4628adc38789f52e8e2ef0cdf600b9fbed7b30ab | python-hyper/wsproto | test/test_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add init file for remediation module.\n\nPiperOrigin-RevId: 285058505"
},
{
"role": "assistant",
"content": "# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")... | python | new_file | 1 | 0 | apache-2.0 | 7b6b1426015a83b96395f0c7c112dc53d373647f | tensorflow/fairness-indicators,tensorflow/fairness-indicators,tensorflow/fairness-indicators | fairness_indicators/remediation/__init__.py | rejected_duplicate | Near-duplicate of sample 4780 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Euler angle conversion tests."
},
{
"role": "assistant",
"content": "import unittest\n\nfrom QGL import *\nfrom QGL.Euler import *\nfrom QGL.Cliffords import C1\nimport QGL.config\ntry:\n from helpers import setup_test_lib\n... | python | new_file | 17 | 2 | apache-2.0 | ae7f22b5fc606a8415e286ffabd43d3fbb71977c | BBN-Q/QGL,BBN-Q/QGL | tests/test_euler.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial unit tests for swarm module"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# Import Python libs\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Import Salt Libs\nimpor... | python | new_file | 1 | 1 | apache-2.0 | 61e0c6e325a91564250a937c0b1769992f65a7f5 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/modules/test_swarm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import Filth\n\n\nclass NamedEntityFilth(Filth):\n \"\"\"\n Named entity filth. Upon initialisation provide a label for named entity (e.g. name, org)\n \"\"\"\n type = 'named_entity'\n\n def __init__(self, *args, l... | python | edit | 1 | 1 | mit | dbdb247ad03ca6b9168f193eadaf28638d718072 | deanmalmgren/scrubadub,datascopeanalytics/scrubadub,datascopeanalytics/scrubadub,deanmalmgren/scrubadub | scrubadub/filth/named_entity.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom telemetry.page import test_expectations\n\n# Valid expectation condi... | python | edit | 1 | 1 | bsd-3-clause | d67b685340cf2db7cd31b50a4484c29625b8fea5 | jaruba/chromium.src,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,PeterW... | content/test/gpu/gpu_tests/pixel_expectations.py | rejected_duplicate | Near-duplicate of sample 3059 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the enemy file and start it up."
},
{
"role": "assistant",
"content": "import pygame\n\nclass Enemy(pygame.sprite.Sprite):\n\n def __init__(self, x, y):\n super().__init__()\n self.image = pygame.image.load(\... | python | new_file | null | null | mit | 27fca35a08278a44bb7ba693f222c6c182061872 | di1111/mlg-fite | Enemy.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add failing specs for current/future class names."
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nimport plotly.graph_objs as go\nimport plotly.graph_reference as gr\n\nOLD_CLASS_NAMES = ['AngularAxis', 'A... | python | new_file | 1 | 4 | mit | 0be0d20fc667f0734b85d98f1d359130f7ed5b98 | plotly/python-api,plotly/python-api,plotly/plotly.py,plotly/plotly.py,plotly/plotly.py,plotly/python-api | plotly/tests/test_core/test_graph_objs/test_graph_objs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a bot message to display TeamCity test results\n\n* Make modin-bot update the comment instead of creating a new one\n* Also only run the comment bot when a PR is being evaluated\n\nSigned-off-by: Devin Petersohn <<EMAIL>>"
},
{
"... | python | new_file | 1 | 0 | apache-2.0 | eb828764ddbe3988f71b98082e1560e594c3f65d | modin-project/modin,modin-project/modin | ci/teamcity/comment_on_pr.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to find forms missing in ES"
},
{
"role": "assistant",
"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nfrom __future__ import print_functi... | python | new_file | 1 | 3 | bsd-3-clause | fa375d06128e493f86524e82fa93c892f4d925b7 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/data_pipeline_audit/management/commands/find_sql_forms_not_in_es.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that daily westminster pages load"
},
{
"role": "assistant",
"content": "import datetime as dt\n\nfrom flask_application import app\n\n\ndef test_daily_westminster_pages_exist():\n start_date = dt.date(2015, 01, 01)\n\n ... | python | new_file | 4 | 2 | bsd-3-clause | 22b2446546ce59b99980e98e81b3571d81085304 | tdhopper/westminster-daily,olneyhymn/westminster-daily,olneyhymn/westminster-daily,olneyhymn/westminster-daily,olneyhymn/westminster-daily,tdhopper/westminster-daily,tdhopper/westminster-daily | tests/test_westminster_daily.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add harvesting blog data example"
},
{
"role": "assistant",
"content": "import os\nimport sys\nimport json\nimport feedparser\nfrom bs4 import BeautifulSoup\n\nFEED_URL = 'http://g1.globo.com/dynamo/rss2.xml'\n\ndef cleanHtml(htm... | python | new_file | 3 | 1 | apache-2.0 | 9b5f070705de9896c8c6f8347dc0f733ae748793 | fabriciojoc/redes-sociais-web,fabriciojoc/redes-sociais-web | harvesting_blog_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for train/test split"
},
{
"role": "assistant",
"content": "import os\nimport shutil\nimport argparse\nimport random\nrandom.seed(47297)\n\n\nparser = argparse.ArgumentParser(description='Split data into train and test... | python | new_file | 1 | 3 | mit | 9bfb182f92b8ac82ddb1b35c886b4a3f79708696 | YerevaNN/mimic3-benchmarks | scripts/split_train_and_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Solve C Mais ou Menos? in python"
},
{
"role": "assistant",
"content": "import sys\n\nMIN_VITAMIN_C = 110\nMAX_VITAMIN_C = 130\n\nvitamin_c_catalogue = {\n 'suco de laranja': 120,\n 'morango fresco': 85,\n 'mamao': 85,\n... | python | new_file | 1 | 0 | mit | f9b2bba394ad6ce31ffae5cf6ccf445dc280ba95 | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/beecrowd/2486/2486.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new example plot for `match_template`."
},
{
"role": "assistant",
"content": "\"\"\"\n=================\nTemplate Matching\n=================\n\nIn this example, we use template matching to identify the occurrence of an\nimag... | python | new_file | 1 | 0 | bsd-3-clause | f3e91020f0426fedfe229e94bf1ddc69dd64a136 | SamHames/scikit-image,warmspringwinds/scikit-image,ClinicalGraphics/scikit-image,paalge/scikit-image,emmanuelle/scikits.image,newville/scikit-image,almarklein/scikit-image,chintak/scikit-image,warmspringwinds/scikit-image,rjeli/scikit-image,chriscrosscutler/scikit-image,Britefury/scikit-image,GaZ3ll3/scikit-image,Brite... | doc/examples/plot_template_alt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add directory for CYK tests"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 31.08.2017 14:50\n:Licence GNUv3\nPart of pyparsers\n\n\"\"\""
}
] | python | new_file | 1 | 0 | mit | 42f66ea6e1921040d6e3055c41372b02511e6a5a | PatrikValkovic/grammpy | tests/CYK/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test to demonstrate issue with django 1.11\n\nIf model with state field has other fields that access their field value\nvia a property or a Virtal Field, then creation of instances will fail."
},
{
"role": "assistant",
"con... | python | new_file | 1 | 1 | mit | 982cd61d7532365d9de56b308c7a4d8308302c15 | kmmbvnr/django-fsm,kmmbvnr/django-fsm | tests/testapp/tests/test_model_create_with_generic.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add testing code for memory leak."
},
{
"role": "assistant",
"content": "from __future__ import print_function\n\nimport argparse\n\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nfrom torch.optim import A... | python | new_file | 9 | 8 | mit | d8521011d5be28812c222b58901a07e8f30e87ac | abhiskk/fast-neural-style,onai/fast-neural-style,abhiskk/fast-neural-style,darkstar112358/fast-neural-style,darkstar112358/fast-neural-style | neuralstyle/testing-train.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for monitor class"
},
{
"role": "assistant",
"content": "import unittest\nimport Monitors.monitor\n\n\nclass TestMonitor(unittest.TestCase):\n\n safe_config = {'partition': '/', 'limit': '10G'}\n\n one_KB = 1... | python | new_file | 1 | 1 | bsd-3-clause | 4ae114dd1da8118cc9d2ee87e30f5e0a1f3324f2 | jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor | tests/test_monitor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update imports for new functions"
},
{
"role": "assistant",
"content": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nImage processing utilities for Astropy.\n\"\"\"\n\n# Affiliated packages may add wha... | python | new_file | 20 | 0 | bsd-3-clause | 6e0f585a8f8433d4f6800cb1f093f97f8a1d4ff7 | mhvk/astropy,saimn/astropy,funbaker/astropy,bsipocz/astropy,tbabej/astropy,pllim/astropy,stargaser/astropy,AustereCuriosity/astropy,aleksandr-bakanov/astropy,dhomeier/astropy,funbaker/astropy,kelle/astropy,saimn/astropy,larrybradley/astropy,lpsinger/astropy,pllim/astropy,dhomeier/astropy,bsipocz/astropy,larrybradley/as... | imageutils/__init__.py | rejected_lint | Too many lint violations: 20 | true |
[
{
"role": "user",
"content": "Write python code for the following: Mask computation utilities (from nipy)."
},
{
"role": "assistant",
"content": "import numpy as np\nfrom scipy import ndimage\n\n\n###############################################################################\n# Operating on con... | python | new_file | 1 | 3 | bsd-3-clause | 54b94346d2669347cf2a9a2b24df6b657cf80c5b | abenicho/isvr | nisl/mask.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple CSV exporter to examples."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport csv\nfrom io import StringIO\nfrom collections import OrderedDict\n\nfrom tcflib.service import... | python | new_file | 1 | 14 | mit | 83e136a0e0d93d1dde4966322a3b51f453d0a1ba | SeNeReKo/TCFlib | tcflib/examples/csv_exporter.py | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for recent bugfix and move operation"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport shutil\nimport tempfile\nimport unittest\n\nfrom dotfiles import core\... | python | new_file | 2 | 1 | isc | f333b9c5741a7ffbf49caa0a6130831a834b944f | Bklyn/dotfiles,aparente/Dotfiles,nilehmann/dotfiles-1,aparente/Dotfiles,aparente/Dotfiles,aparente/Dotfiles | test_dotfiles.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for the `dirty_untar` rule"
},
{
"role": "assistant",
"content": "import os\nimport pytest\nimport tarfile\nfrom thefuck.rules.dirty_untar import match, get_new_command, side_effect\nfrom tests.utils import Command\n\n\... | python | new_file | 1 | 2 | mit | 1c5fef3a34ed421610a4e9a38feb07e6545e5d13 | PLNech/thefuck,AntonChankin/thefuck,SimenB/thefuck,gogobebe2/thefuck,BertieJim/thefuck,lawrencebenson/thefuck,barneyElDinosaurio/thefuck,vanita5/thefuck,mcarton/thefuck,redreamality/thefuck,subajat1/thefuck,mbbill/thefuck,vanita5/thefuck,qingying5810/thefuck,thinkerchan/thefuck,bigplus/thefuck,mlk/thefuck,AntonChankin/... | tests/rules/test_dirty_untar.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example usage of the JsonTestResponse."
},
{
"role": "assistant",
"content": "import unittest\nfrom flask import Flask\nfrom flask_json import json_response, FlaskJSON, JsonTestResponse\n\n\ndef our_app():\n app = Flask(__... | python | new_file | 1 | 1 | bsd-3-clause | 6279341682ae45a228302972dbd106a2e44e0b12 | craig552uk/flask-json | examples/example_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration code for updating lease status\n\nLease status was None before the status module was introduced.\nThis patch is for updating the None status.\n\nPartially Implements: blueprint state-machine\nChange-Id: I64cc07737d5c1c83a4f91d4... | python | new_file | 1 | 2 | apache-2.0 | 5d3918c885f430e79e8283533ad5eb3a84ffecc7 | openstack/blazar,stackforge/blazar,openstack/blazar,ChameleonCloud/blazar,ChameleonCloud/blazar,stackforge/blazar | blazar/db/migration/alembic_migrations/versions/75a74e4539cb_update_lease_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial version of identification algorithm"
},
{
"role": "assistant",
"content": "import os.path as path\nimport re\n\nimport Levenshtein\n\nfrom .sanitize import sanitize\nfrom .tmdb import search\n\n\ndef _gather(filename,... | python | new_file | 6 | 12 | mit | 2427dbad4fc0cfe7685dc2767069748d37262796 | divijbindlish/movienamer | movienamer/identify.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests and fixtures for the Organizations API wrapper"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\"\"\"pytest Licenses functions, fixtures and tests.\"\"\"\n\n\nimport pytest\n\nimport ciscosparkapi\n\n\... | python | new_file | 1 | 2 | mit | 2b0e13039dad8d116a5719540004bed317bb6960 | jbogarin/ciscosparkapi | tests/api/test_organizations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: lib: Add a script for generating jamo character table"
},
{
"role": "assistant",
"content": "#!/usr/bin/python3\n\n# Input: https://www.unicode.org/Public/UNIDATA/Jamo.txt\n\nimport io\nimport re\n\nclass Builder(object):\n de... | python | new_file | 5 | 4 | bsd-3-clause | b39dd2afea1f4662e17a927e7e6aa41e850f7470 | GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters | lib/gen-hangul.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dump script for all hiddens"
},
{
"role": "assistant",
"content": "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\nimport subprocess\n\nif __name__ ... | python | new_file | 1 | 0 | mit | 72e69f3535c7e2cd82cdda62636eabd7421ebddf | judithfan/pix2svg | generative/tests/compare_test/concat_first/dump_hiddens.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create python script to scroll error messages"
},
{
"role": "assistant",
"content": "from sense_hat import SenseHat\nimport sys\n\nsense = SenseHat()\nsense.show_message(sys.stdin.read(), scroll_speed=.08, text_colour=[255, 0, 0]... | python | new_file | 1 | 0 | mit | 40dd078b5e176ae5039bf20dcb50350e8f065808 | jeffstephens/pi-resto,jeffstephens/pi-resto | recognition/scrollError.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test that detects censorship in HTTP pages based on HTTP body length"
},
{
"role": "assistant",
"content": "# -*- encoding: utf-8 -*-\n#\n# :authors: Arturo Filastò\n# :licence: see LICENSE\n\nfrom twisted.internet import def... | python | new_file | 3 | 3 | bsd-2-clause | df784323d0da737755def4015840d118e3c8e595 | juga0/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,lordappsec/ooni-prob... | nettests/core/http_body_length.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pen which draws to TrueType glyphs."
},
{
"role": "assistant",
"content": "from __future__ import print_function, division, absolute_import\nfrom array import array\n\nfrom fontTools.misc.py23 import *\nfrom fontTools.pens.ba... | python | new_file | 2 | 4 | mit | b0c03b86d606c85dd1cab1ad9e9678e1057d0ae1 | googlefonts/fonttools,fonttools/fonttools | Lib/fontTools/pens/ttGlyphPen.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for volume limits client\n\nThis patch adds unit test for volume v2 limits client.\n\nPartially Implements: blueprint tempest-lib-missing-test-coverage\n\nChange-Id: I08a982758fcdd364e1790e1049d0022f04e4bcc7"
},
{
"role... | python | new_file | 1 | 1 | apache-2.0 | ace26ab5e713fabd02f4f481956c47640f50b166 | vedujoshi/tempest,openstack/tempest,cisco-openstack/tempest,cisco-openstack/tempest,Juniper/tempest,masayukig/tempest,openstack/tempest,Juniper/tempest,masayukig/tempest,vedujoshi/tempest | tempest/tests/lib/services/volume/v2/test_limits_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create class to interpolate values between indexes"
},
{
"role": "assistant",
"content": "class Interpolator:\n def __init__(self):\n self.data = []\n\n def addIndexValue(self, index, value):\n self.data.appen... | python | new_file | 1 | 7 | mit | e4b9c43d53121d2b21c4b864fcc74674b0b6dfc1 | thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x | scratchpad/Interpolator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test Basic.Publish -> Basic.Get message passing"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\nSend a message and confirm you can retrieve it with Basic.Get\nTest Steps:\n\n1) Connect to broker - start_t... | python | new_file | null | null | bsd-3-clause | 2e9f43d1c1679355e2d7d452137ddf7fb2bbdedf | Zephor5/pika,vrtsystems/pika,renshawbay/pika-python3,jstnlef/pika,hugoxia/pika,vitaly-krugl/pika,skftn/pika,fkarb/pika-python3,reddec/pika,shinji-s/pika,benjamin9999/pika,pika/pika,zixiliuyue/pika,knowsis/pika,Tarsbot/pika | tests/async-send-get-test.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add test for total property"
},
{
"role": "assistant",
"content": "from .models import Order\n\n\ndef test_total_property():\n order = Order(total_net=20, total_tax=5)\n assert order.total.gross == 25\n assert order.tota... | python | new_file | 1 | 1 | bsd-3-clause | 08447fa344e21d6d704c6f195ad2b7405fa8f916 | UITools/saleor,car3oon/saleor,itbabu/saleor,tfroehlich82/saleor,tfroehlich82/saleor,maferelo/saleor,laosunhust/saleor,jreigel/saleor,itbabu/saleor,UITools/saleor,car3oon/saleor,KenMutemi/saleor,maferelo/saleor,HyperManTT/ECommerceSaleor,itbabu/saleor,spartonia/saleor,KenMutemi/saleor,laosunhust/saleor,jreigel/saleor,ro... | saleor/order/test_order.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert GML to EWKT, via PostGIS"
},
{
"role": "assistant",
"content": "from django.db import connection\n\ndef gml_to_ewkt(gml_string, force_2D=False):\n cursor = connection.cursor()\n if force_2D:\n sql = 'SELECT S... | python | new_file | 1 | 2 | mit | 36781fb1b04a3d2fd3162ea88969244faab22a60 | Open511/open511-server,Open511/open511-server,Open511/open511-server | open511/utils/postgis.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for the methods in util"
},
{
"role": "assistant",
"content": "from lib import util\n\n\ndef test_cachedproperty():\n class Target:\n def __init__(self):\n self.call_count = 0\n\n @util.... | python | new_file | 1 | 1 | mit | fcc92760db0d1dc56aca70aff69b34a29c9e8e6c | shsmith/electrumx,thelazier/electrumx,Groestlcoin/electrumx-grs,erasmospunk/electrumx,shsmith/electrumx,bauerj/electrumx,thelazier/electrumx,erasmospunk/electrumx,Crowndev/electrumx,Groestlcoin/electrumx-grs,bauerj/electrumx,Crowndev/electrumx | tests/test_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple distutils script for modules"
},
{
"role": "assistant",
"content": "from distutils.core import setup\n\nsetup(name='dimreducer',\n version='1.0',\n description='Dimension reduction methods',\n py_modules... | python | new_file | 1 | 0 | mit | 6e805995a165f923c1c4f71c163c64a245f9a3d5 | epierson9/multiphenotype_methods | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add generic serializer tool for plugins to use"
},
{
"role": "assistant",
"content": "#\n# Copyright (c) rPath, Inc.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Gene... | python | new_file | 1 | 3 | apache-2.0 | c6c6594cda35aaa15f1efb9f336548671b0028c5 | sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake3 | rmake/lib/twisted_extras/tools.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Put split and merge in own module too"
},
{
"role": "assistant",
"content": "from app.drivers.basedrivers import PycolatorDriver\nfrom app.preparation import pycolator as preparation\nfrom app.readers import pycolator as readers\... | python | new_file | 1 | 2 | mit | 0848197b3c9ff8d09575b85b5e3a2ca1aac6f6c5 | glormph/msstitch | app/drivers/pycolator/splitmerge.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add delete old sessions command"
},
{
"role": "assistant",
"content": "from datetime import datetime\n\nfrom django.core.management.base import BaseCommand\nfrom django.contrib.sessions.models import Session\n\n\"\"\"\n>>> def cl... | python | new_file | null | null | mit | 64139e0a41c1b1da81e9b5e244b2d7095c4a7a2b | nanuxbe/djangopackages,QLGu/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,pydanny/djangopackages,QLGu/djangopackages,pydanny/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages | core/management/commands/delete_old_sessions.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add python version of the post-receive hook"
},
{
"role": "assistant",
"content": "import re\nimport os\nimport sys\nimport os\nimport json\nfrom subprocess import Popen, PIPE\nfrom httplib2 import Http\n\npostURL = \"http://loca... | python | new_file | 4 | 0 | apache-2.0 | 834516acf7b5cfbbb0f728f8b725bea120b5f5b3 | Humbedooh/gitpubsub | post_receive.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for the tokens"
},
{
"role": "assistant",
"content": "from flask import current_app\nfrom itsdangerous import TimedJSONWebSignatureSerializer\nfrom flaskbb.utils.tokens import make_token, get_token_status\n\n\ndef ... | python | new_file | 1 | 1 | bsd-3-clause | c7c3ab0a4013df99b928351040f1156b07ba6767 | realityone/flaskbb,realityone/flaskbb,realityone/flaskbb | tests/unit/utils/test_tokens.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Support rudimentary translation service from IIT Bombay\nvia web API.\n\nme: கவிதை மிக அழகாக இருக்கிறது\nit: கவிதை of the most beautiful\n\nme: good morning\nit: நல்ல காலை\n\nme: world is not flat\nit: உலக சமதளமான கிடைக்கிறது."
},
{
... | python | new_file | 3 | 1 | mit | 5f051f2ae1b105d6cc58d1cac760cb5d20908c3b | Ezhil-Language-Foundation/open-tamil,Ezhil-Language-Foundation/open-tamil,Ezhil-Language-Foundation/open-tamil,arcturusannamalai/open-tamil,arcturusannamalai/open-tamil,arcturusannamalai/open-tamil,arcturusannamalai/open-tamil,Ezhil-Language-Foundation/open-tamil,arcturusannamalai/open-tamil,arcturusannamalai/open-tami... | valai/translate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for navigator"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\nimport unittest\nimport mock\nfrom autobot.msg import detected_object\nfrom navigator import *\n\n\ndef fake_stopCar():\n return True\n... | python | new_file | 5 | 1 | mit | 0f6e065a70bcd1f9dd64dfa04c13cb0065e33c13 | atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot | src/autobot/src/navigator_test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a python version for the phonebook benchmark\n\nSwift SVN r17601"
},
{
"role": "assistant",
"content": "\nwords=[\n u\"James\", u\"John\", u\"Robert\", u\"Michael\", u\"William\", u\"David\", u\"Richard\", u\"Joseph\",\n u\"C... | python | new_file | 2 | 3 | apache-2.0 | fa0afad07f34f350233ae2a4f1654faef9bc1814 | SwiftAndroid/swift,ahoppen/swift,uasys/swift,karwa/swift,gottesmm/swift,ken0nek/swift,xwu/swift,huonw/swift,natecook1000/swift,jckarter/swift,ken0nek/swift,allevato/swift,hughbe/swift,tinysun212/swift-windows,gmilos/swift,MukeshKumarS/Swift,shahmishal/swift,sschiau/swift,austinzheng/swift,adrfer/swift,uasys/swift,shajr... | utils/benchmark/Strings/PySort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to convert hex formatted key to token using random partitioner"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Licensed to the Apache Software Foundation (ASF) under one\n# or... | python | new_file | 3 | 0 | apache-2.0 | 122eb3c6eb9f8467fc5d3325f0e5c58cc285cb50 | bharatendra/ctools | token-hexkey.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set calculation type of all indicators to Number"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2018-07-04 09:56\nfrom __future__ import unicode_literals\n\nfrom django.db import m... | python | new_file | 1 | 1 | apache-2.0 | 27ed68923579c5afff0c70b025deb8b73d448aa8 | toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity | indicators/migrations/0013_set_all_calculation_type_to_numeric.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some end-to-end functional tests\n\nSince running these tests is not part of the automated tests,\nand since the test runner picks up any file that has a name\ncontaining \"test\" I have to be clever and call it \"exam.py.\""
},
{
... | python | new_file | 1 | 9 | apache-2.0 | dbc20f37c7fb1dd00c90ac54d2021fb1ba3b5eda | rhgrant10/Groupy | exam.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some useful activation functions."
},
{
"role": "assistant",
"content": "import theano\nimport theano.tensor as T\n\n\"\"\"\nA set of activation functions for Neural Network layers.\nThey're in the form of class so we can tak... | python | new_file | 3 | 1 | mit | 81f983c833d9858ad23f589367bf601babddf858 | mmohaveri/DeepNetTookKit | elements/activation_functions.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittest for select_taxa that runs main and selects a single genome"
},
{
"role": "assistant",
"content": "import logging\nimport os\nimport tempfile\nimport unittest\n\nimport select_taxa\n\n\nclass Test(unittest.TestCase):\... | python | new_file | 1 | 2 | mit | a5012c9fb81768e85b555b52264baa11efc17ba1 | ODoSE/odose.nl | test/test_select_taxa.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new regression testing module\n\nThat module should hold all tests used when reproducing (and fixing) an\nissue."
},
{
"role": "assistant",
"content": "# Copyright: See the LICENSE file.\n\n\n\"\"\"Regression tests related ... | python | new_file | 1 | 1 | mit | 5692f64619bf009cf92bf0a8c6f77bf82f0e3d02 | FactoryBoy/factory_boy | tests/test_regression.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test if repository manager if retrieving a repository when we lookup after one"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom mock import MagicMock, patch\nfrom nose.tools import eq_\n\nfrom pyolite.... | python | new_file | 1 | 1 | bsd-2-clause | c39b95eebb402d1d0137448b3f0efd9b6d7ec169 | shawkinsl/pyolite,PressLabs/pyolite | tests/managers/test_repository.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Data: Add script to delete tables."
},
{
"role": "assistant",
"content": "from django.db.models.base import ModelBase\n\nfrom quiz.models import Quiz, ShortAnswer, Choice, QuizAttempt\nfrom codequiz.models import CodeQuiz, CodeQu... | python | new_file | 14 | 4 | mit | 38bfc1a536f43ece367a49a62501b57c89f689a1 | pixyj/feel,pixyj/feel,pixyj/feel,pixyj/feel,pixyj/feel | django-server/feel/core/db/reset.py | rejected_lint | Too many lint violations: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dead letter SQS queue example"
},
{
"role": "assistant",
"content": "# Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n... | python | new_file | 1 | 0 | apache-2.0 | 496754c54005cf7e1b49ada8e612207f5e2846ff | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,imshashank/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,imshashank/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,imshashank/aws-doc-sdk-examples,imshashank/aws-doc-sdk-examples,imshashank/aws-doc-sdk-examples,awsdocs/aws-doc... | python/example_code/sqs/dead_letter_queue.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a command for creating rsa key."
},
{
"role": "assistant",
"content": "from Crypto.PublicKey import RSA\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\n\n\nclass Command... | python | new_file | 3 | 2 | mit | 9eb5f67a954888c4e14789b5b8acc785c789a77c | juanifioren/django-oidc-provider,wojtek-fliposports/django-oidc-provider,nmohoric/django-oidc-provider,nmohoric/django-oidc-provider,ByteInternet/django-oidc-provider,juanifioren/django-oidc-provider,wojtek-fliposports/django-oidc-provider,bunnyinc/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oi... | oidc_provider/management/commands/creatersakey.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test for the PaladinSpellSchema values"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom tests.delete_test_db import delete_test_db # module that deletes the DB :)\nimport database.main\nfrom tests.create_test_db im... | python | new_file | 6 | 1 | mit | 9e388ad5b78967f87a0b3b55235bd1e19183c152 | Enether/python_wow | tests/models/spells/test_paladin_spells.py | rejected_lint | Too many lint violations: 6 | 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\n\n\ndef create_homepage(apps, schema_editor):\n # Get models\n ContentType = apps.get_model('contenttypes.ContentType')\n Page = ... | python | edit | 1 | 1 | bsd-3-clause | 1718926c99692fefb90627c55589990cd0e0225b | rsalmaso/wagtail,FlipperPA/wagtail,chrxr/wagtail,nutztherookie/wagtail,mikedingjan/wagtail,nimasmi/wagtail,rsalmaso/wagtail,Toshakins/wagtail,mikedingjan/wagtail,thenewguy/wagtail,mikedingjan/wagtail,iansprice/wagtail,nilnvoid/wagtail,nimasmi/wagtail,mikedingjan/wagtail,nutztherookie/wagtail,zerolab/wagtail,FlipperPA/w... | wagtail/project_template/home/migrations/0002_create_homepage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script for dqn continuous task demo"
},
{
"role": "assistant",
"content": "import argparse\n\nimport chainer\nfrom chainer import serializers\nimport gym\nimport numpy as np\n\nimport random_seed\nimport env_modifiers\nimpo... | python | new_file | 1 | 3 | mit | 05bf0cd188d4666c9c0aeb56a95d7867f25952c2 | toslunar/chainerrl,toslunar/chainerrl | demo_dqn_continuous.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for template tags"
},
{
"role": "assistant",
"content": "import os\nimport mock\n\nfrom django.test import TestCase\n\nfrom djlotrek.templatetags.djlotrek_tags import absolute_url\n\nfrom django.test import RequestFacto... | python | new_file | 4 | 1 | mit | 631faacaf077c2b4d0d446e42076fd4e4f27ed37 | lotrekagency/djlotrek,lotrekagency/djlotrek | djlotrek/tests/test_templatetags.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add day 3 part 2."
},
{
"role": "assistant",
"content": "\"\"\"This module checks how many valid triangles are in the input data.\"\"\"\n\n\ndef main():\n \"\"\"Run main function.\"\"\"\n with open('data/day3data.txt', 'r')... | python | new_file | 1 | 7 | mit | 61e56ad3feecef6fe422db8fb5d7b9b26dc03d6a | SayWhat1/adventofcode2016 | day3-2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create command for Data Log Report fixtures"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom django.core import serializers\n\nfrom data_log import models\nimport json\n\n\nclass Co... | python | new_file | 1 | 2 | apache-2.0 | 9386236d41298ed8888a6774f40a15d44b7e53fe | porksmash/swarfarm,porksmash/swarfarm,porksmash/swarfarm,porksmash/swarfarm | data_log/management/commands/generate_report_fixture.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add eventlet backdoor to facilitate troubleshooting.\n\nThis provides a FLAG to turn on Eventlet's builtin backdoor server which\nallows you to connect over telnet and receive a Python prompt (which is\nimmensely helpful for debugging runnin... | python | new_file | 3 | 2 | apache-2.0 | f2028ab194fe7c1c1497ee9320ddddbbece6406a | n0ano/ganttclient | nova/common/eventlet_backdoor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add lammps wrapper tests with cuds"
},
{
"role": "assistant",
"content": "\"\"\"Tests for running lammps using CUDS and Simulation classes.\"\"\"\nimport unittest\n\nfrom simphony.core.cuba import CUBA\nfrom simphony import CUDS,... | python | new_file | 5 | 1 | bsd-2-clause | a07e4d08b475e0d921265f9da104f109943901bc | simphony/simphony-lammps-md,simphony/simphony-lammps-md | simlammps/tests/cuds_test.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for document quickcaching"
},
{
"role": "assistant",
"content": "from copy import deepcopy\nfrom mock import patch, MagicMock\nfrom django.test import SimpleTestCase\nfrom dimagi.ext import couchdbkit as couch\nfro... | python | new_file | 1 | 1 | bsd-3-clause | b079edc37cd8abb68194637ee90b9fecc51b9b98 | qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/cachehq/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that an error in pre_gen_project aborts generation"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom cookiecutter import generate\nfrom cookiecutter import exceptions\n\n\n@pytest.mark.u... | python | new_file | 1 | 1 | bsd-3-clause | 803201baa32fb847f363b6807f92f2d0b6a51c51 | audreyr/cookiecutter,stevepiercy/cookiecutter,stevepiercy/cookiecutter,michaeljoseph/cookiecutter,willingc/cookiecutter,Springerle/cookiecutter,hackebrot/cookiecutter,hackebrot/cookiecutter,pjbull/cookiecutter,michaeljoseph/cookiecutter,audreyr/cookiecutter,Springerle/cookiecutter,terryjbates/cookiecutter,terryjbates/c... | tests/test_abort_generate_on_hook_error.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add ex4.4: tornado multiple requests with asyncio integration"
},
{
"role": "assistant",
"content": "from tornado.platform.asyncio import AsyncIOMainLoop, to_asyncio_future\nfrom tornado.httpclient import AsyncHTTPClient\nimport ... | python | new_file | 1 | 1 | mit | e41b79855e966977c4484efd4ad6a02475833b3e | MA3STR0/PythonAsyncWorkshop | code/ex4.4-tornado_with_asyncio.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration from 096092b."
},
{
"role": "assistant",
"content": "# Generated by Django 2.0.5 on 2018-07-15 14:16\n\nimport datetime\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n... | python | new_file | 1 | 0 | bsd-2-clause | b159433375714c67ac36e58d4323196222759f30 | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | babybuddy/migrations/0003_add_refresh_help_text.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to turn on locations flag"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom corehq.apps.domain.models import Domain\nfrom corehq.feature_previews import LOCATIONS\nfrom c... | python | new_file | 1 | 5 | bsd-3-clause | 4aced6fea8ff8ccd087362cb237a9f00d111d0d8 | dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | corehq/apps/commtrack/management/commands/toggle_locations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Migrate to latest version of db."
},
{
"role": "assistant",
"content": "\"\"\"empty message\n\nRevision ID: 1003fd6fc47\nRevises: 1a54c4cacbe\nCreate Date: 2015-03-24 13:33:50.898511\n\n\"\"\"\n\n# revision identifiers, used by A... | python | new_file | 1 | 1 | mit | a2e566cc0b925f80c30602141e890cdf9b13306b | PythonClutch/python-clutch,PythonClutch/python-clutch,PythonClutch/python-clutch | migrations/versions/1003fd6fc47_.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read the american physics society graph"
},
{
"role": "assistant",
"content": "import numpy \ntry: \n ctypes.cdll.LoadLibrary(\"/usr/local/lib/libigraph.so\")\nexcept: \n pass \nimport igraph \nfrom apgl.util.PathDefaults ... | python | new_file | 2 | 0 | bsd-3-clause | 95d87c541ebf82109b882daebcb5b387f0f1cdb8 | charanpald/APGL | exp/influence2/ReputationExp2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for db changes"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-08-05 01:07\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\ni... | python | new_file | 1 | 0 | apache-2.0 | e2020af5ccd41f8571a2d0db4f5345ca9a8b561e | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | gmn/src/d1_gmn/app/migrations/0010_auto_20170805_0107.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for Generalized Procrustes Analysis (GPA)"
},
{
"role": "assistant",
"content": "import unittest\n\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn import decomposition\nfrom sklearn.utils import estimato... | python | new_file | 4 | 1 | mit | 6beccf0c0b4e7788403415c05ae9f31e6c0a89eb | MaxHalford/Prince | tests/test_gpa.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial script to print rosbag files"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Convert a rosbag file to legacy lidar binary format.\n\"\"\"\n\n\"\"\"LIDAR datatype format is:... | python | new_file | 1 | 2 | bsd-2-clause | ac482caafe8c63de2606bb4894462f7b2e2bcb70 | oliverlee/antlia | python/printbag.py | rejected_duplicate | Near-duplicate of sample 2781 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add GMN DB migration to current"
},
{
"role": "assistant",
"content": "# Generated by Django 2.2 on 2019-04-18 20:12\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | new_file | 1 | 0 | apache-2.0 | a0cd167b9f19e2a4a9d1f2a80bc3586cce15c6ab | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | gmn/src/d1_gmn/app/migrations/0019_auto_20190418_1512.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test-case for lit xunit output\n\ngit-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@223307 91177308-0d34-0410-b5e6-96231b3b80d8"
},
{
"role": "assistant",
"content": "# Check xunit output\n# RUN: %{lit} --xunit-xml-outpu... | python | new_file | 1 | 0 | apache-2.0 | 0baca9564c9df7b06645f71abdda0fe3090f46a6 | GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift... | utils/lit/tests/xunit-output.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to delete spam users."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\" Delete users creating by spambots.\n\n\"\"\"\n\nimport logging as log\nfrom optparse import make_option\nfrom django.core.man... | python | new_file | 4 | 6 | bsd-2-clause | a102fb888b60454d7efbe26e4afb38a59c212769 | EuroPython/epcon,EuroPython/epcon,EuroPython/epcon,EuroPython/epcon | p3/management/commands/delete_spam_users.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test file which was missing from a recent branch"
},
{
"role": "assistant",
"content": "from django.db import models\nfrom djangae.test import TestCase\n\nfrom djangae.contrib import sleuth\n\n\nclass MetaQueryTestModel(mod... | python | new_file | 1 | 1 | bsd-3-clause | 8b467efd1f998d05da0272a284773501f0b330ff | grzes/djangae,grzes/djangae,potatolondon/djangae,grzes/djangae,potatolondon/djangae | djangae/tests/test_meta_queries.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add SSDP unit test case (init)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Bo Maryniuk <<EMAIL>>`\n'''\n\nfrom __future__ import absolute_import, print_function, unicode_literals\... | python | new_file | 6 | 1 | apache-2.0 | 6090dc1539bd0701381c73128a5ca0606adc09e4 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/utils/test_ssdp.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: [SDK-165] Create Virgil highlevel api implementation"
},
{
"role": "assistant",
"content": "# Copyright (C) 2016 Virgil Security Inc.\n#\n# Lead Maintainer: Virgil Security Inc. <<EMAIL>>\n#\n# All rights reserved.\n#\n# Redistri... | python | new_file | 1 | 2 | bsd-3-clause | 1c615be1d3da720d2d0a1974808e3856cbd9d498 | VirgilSecurity/virgil-sdk-python | virgil_sdk/api/virgil_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Integrate densities to check normalization"
},
{
"role": "assistant",
"content": "import argparse\nimport numpy as np\nimport h5py\n\nif __name__ == '__main__':\n\n parser = argparse.ArgumentParser(description='Integrate proba... | python | new_file | 1 | 0 | mit | fa3450a44621fab4a9a2f2ed1599d08f66860f70 | jarthurgross/bloch_distribution | integrate_density.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [typeahead_search] Add a Trie for storage of data string tokens."
},
{
"role": "assistant",
"content": "\"\"\"A Trie (prefix tree) class for use in typeahead search.\n\nEvery node in the TypeaheadSearchTrie is another TypeaheadSe... | python | new_file | 1 | 3 | mit | 72a573c24d5234003b9eeb9e0cc487d174908a2e | geekofalltrades/quora-coding-challenges | typeahead_search/trie.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Exit routine for a controlled exit from ample"
},
{
"role": "assistant",
"content": "'''\nCreated on Mar 18, 2015\n\n@author: jmht\n'''\n\nimport logging\nimport sys\nimport traceback\n\n# external imports\ntry: import pyrvapi\ne... | python | new_file | 1 | 7 | bsd-3-clause | 29e18ed63177dbe8306a22e3c0583342f4591464 | linucks/ample,rigdenlab/ample,linucks/ample,rigdenlab/ample | python/ample_exit.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Split lowpass filtering into another script."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import division\n\nimport climate\nimport lmj.cubes\nimport pandas as pd\nimport scipy.signal\n\nlogging... | python | new_file | 1 | 4 | mit | 01c74cfea946eac098a0e144380314cd4676cf2f | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | analysis/04-lowpass.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add another .py file for progress bar\n\nAdd another .py file for progress bar"
},
{
"role": "assistant",
"content": "import sys, time\r\nfrom CmdFormat import CmdFormat\r\n\r\nclass ProgressBar(CmdFormat):\r\n def __init__(se... | python | new_file | null | null | mit | 8daf4237aa84a6b032e7627afb31b29a44f47ddc | vicyangworld/AutoOfficer | ProgressBar.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add api call for Premier League standings\n\nAlso add function to print standings in tablular form using tabulate."
},
{
"role": "assistant",
"content": "import json\nimport requests\nfrom tabulate import tabulate\n\nBASE_URL = \... | python | new_file | 2 | 2 | mit | f31b42ae43e7cd2af53a504c1cc2ab398bf7810d | conormag94/pyscores | main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement cheb_dif for getting 1D chebyshev grids and differentiation matrices."
},
{
"role": "assistant",
"content": "import numpy as np\nfrom numpy.fft import fft, ifft, fftshift, fft2, ifft2\nfrom scipy.linalg import toeplitz\... | python | new_file | 8 | 5 | mit | e0597427d93f2260dfce35cfdd3e2714037fb0fb | dsteinmo/pysws,dsteinmo/pysws | src/spatial_discretizations/FourierChebyshevSpatialDiscretization.py | rejected_lint | Too many lint violations: 8 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.