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: Python: Add tests for non-async constructs"
},
{
"role": "assistant",
"content": "# Add taintlib to PATH so it can be imported during runtime without any hassle\nimport sys; import os; sys.path.append(os.path.dirname(os.path.dirn... | python | new_file | 8 | 2 | mit | 05aa314ac9b5d38bb7a30e30aced9b27b2797888 | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_syntax.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add realtime chart plotting example"
},
{
"role": "assistant",
"content": "import time, random\nimport math\nfrom collections import deque\n\nstart = time.time()\n\nclass RealtimePlot:\n def __init__(self, axes, max_entries = ... | python | new_file | 3 | 2 | mit | c650d64247d63d2af7a8168795e7edae5c9ef6ef | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | realtime-plot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for changing users added by OSF for meetings with emails for fullnames to their guid"
},
{
"role": "assistant",
"content": "import sys\nimport logging\n\nimport django\nfrom django.db import transaction\ndjango.setu... | python | new_file | 1 | 3 | apache-2.0 | 75a882bf38c88d73e38d13fbb8b1499ff4ae4ea6 | felliott/osf.io,adlius/osf.io,felliott/osf.io,adlius/osf.io,saradbowman/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,mfraezz/osf.io,adlius/osf.io,felliott/osf.io,mattclark/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,pattisdr/osf.io,brianjgeiger/... | scripts/remove_after_use/set_meetings_users_fullnames_to_guids.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for avging imputations"
},
{
"role": "assistant",
"content": "\"\"\"test_averaging_imputations.py\"\"\"\nimport unittest\nimport numpy as np\nfrom impy.imputations import mean_imputation\nfrom impy.imputations impo... | python | new_file | 1 | 1 | mit | b3e9075e819402f93f7dc2e29b61e3e621ab7355 | eltonlaw/impyute | impy/imputations/tests/test_averaging_imputations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add UglifyJS as a filter."
},
{
"role": "assistant",
"content": "from django.conf import settings\nfrom django.utils.encoding import smart_str\nfrom mediagenerator.generators.bundles.base import Filter\n\nclass Uglifier(Filter):\... | python | new_file | 4 | 4 | bsd-3-clause | 495da73f305a2a0e79a28d251b5b93caea06656d | Carlangueitor/django-mediagenerator,adieu/django-mediagenerator,Carlangueitor/django-mediagenerator,adieu/django-mediagenerator | mediagenerator/filters/uglifier.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command for resyncing mobile worker location user data"
},
{
"role": "assistant",
"content": "from corehq.apps.locations.models import Location\nfrom corehq.apps.users.models import CommCareUser\nfrom dimagi.utils.... | python | new_file | 2 | 4 | bsd-3-clause | a6b35a9a94b2e4b32c2236258812b44e81184515 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/apps/users/management/commands/fix_location_user_data.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement unit test for break."
},
{
"role": "assistant",
"content": "import ast\nfrom jaspyx.ast_util import ast_store, ast_load\nfrom jaspyx.tests.visitor.v8_helper import V8Helper\n\n\nclass TestBreak(V8Helper):\n def test_... | python | new_file | 1 | 1 | mit | 415717bddb00ca650bef61a5c6054a7b47575b56 | iksteen/jaspyx,ztane/jaspyx | jaspyx/tests/visitor/test_break.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: test: Add test for config module"
},
{
"role": "assistant",
"content": "# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors\n# License: MIT. See LICENSE\nimport unittest\n\nimport frappe\nfrom frappe.config impor... | python | new_file | 1 | 4 | mit | 96ed06f1f3dab3aa9d0f8150c41a5c1b943a86b0 | StrellaGroup/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe | frappe/tests/test_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create file for Nonterminal have method"
},
{
"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\"\"\""
}
] | python | new_file | 1 | 0 | mit | 5578d11f45e9c41ab9c4311f2bed48b9c24d9bf5 | PatrikValkovic/grammpy | tests/grammar_term-nonterm_test/NonterminalHaveTest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python cloudfront update_distribution example to replace ACM Certificate\n\nAdd python cloudfront update_distribution example to replace ACM Certificate"
},
{
"role": "assistant",
"content": "# Copyright 2010-2018 Amazon.com,... | python | new_file | 2 | 2 | apache-2.0 | c1fcf54b63de95c85a9505d83062d8b320b1cbdf | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | python/example_code/cloudfront/update_distribution_certificate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for cross domain xhr view"
},
{
"role": "assistant",
"content": "\"\"\"Test for go.base.utils.\"\"\"\n\nfrom mock import patch, Mock\nfrom django.core.urlresolvers import reverse\n\nfrom go.base.tests.utils import VumiG... | python | new_file | 1 | 1 | bsd-3-clause | f1ccab2168dea1b0827f4ca929f0036e84170a76 | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/base/tests/test_views.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for Hostname object"
},
{
"role": "assistant",
"content": "# Copyright (c) 2014, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\nimport unittest\n\nfrom cybox.objects.hostname_object... | python | new_file | 1 | 0 | bsd-3-clause | 913c9a10b2eb3b3d9de108a82a3251b2c0de0e10 | CybOXProject/python-cybox | cybox/test/objects/hostname_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.\n\nR=<EMAIL>\nBUG=852142\n\nChange-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06\nReviewed-on: https://chromium-review.googlesource.com/1098463\nReviewed-by: Andr... | python | new_file | 8 | 5 | apache-2.0 | 24d742e444c84df99629d8a6aff7ca7e6c90f995 | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | scheduler/misc/detect_stuck_active_invs.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add integration test checking compatibility of Keras models with TF optimizers."
},
{
"role": "assistant",
"content": "from __future__ import print_function\n\nimport os\nimport tempfile\nimport pytest\nimport keras\nfrom keras i... | python | new_file | 1 | 1 | apache-2.0 | 514aca20c6f076a86819d7180f36c3b2e8bcc33b | keras-team/keras,keras-team/keras | tests/integration_tests/test_tensorflow_integration.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a sample config file"
},
{
"role": "assistant",
"content": "FLASK_SECRET_KEY = 'Enter a Flask Secret Key'\n\n# OAuth Credentials. You can find them on\n# https://www.yelp.com/developers/v3/manage_app\nYELP_CLIENT_ID = 'Enter ... | python | new_file | 1 | 0 | mit | 6e535a2d597f172d9342fb8a547335890c474b49 | byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood | src/config-sample.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a snippet (Python OpenCV)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n\"\"\"\nOpenCV - Display image: display an image... | python | new_file | 1 | 1 | mit | 22298d91fff788c37395cdad9245b3e7ed20cfdf | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/images/display_image_with_matplotlib.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Author: AlexBanks97\n# Purpose: LIFO Stack implementation using python array.\n# Date: October 15th 2017\n\nclass Stack(object):\n def __init__(self):\n # Initialize stack as empty array\n self.stack = []\n\n # Return ... | python | edit | 1 | 2 | cc0-1.0 | eb0772fc6c30d98b83bf1c8e7d83af21066ae45b | Deepak345/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-r... | data_structures/Stack/Python/Stack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Hide the AuditorReader role in the system role assignment modal by\nplacing it in an \"implied\" scope."
},
{
"role": "assistant",
"content": "\n\"\"\"Hide the AuditorReader role by changing its scope.\n\nRevision ID: 37b63b1220... | python | new_file | 3 | 1 | apache-2.0 | ff2fb40e961fe7b0c3f6dd6e91d8fb79a865a631 | josthkko/ggrc-core,uskudnik/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,hasanalom/ggrc-core,hasanalom/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,andrei-karalio... | src/ggrc_basic_permissions/migrations/versions/20131108224846_37b63b122038_hide_the_auditorread.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a simple method to segment a trip into sections\n\nThis is purely based on the activity detection by android.\n\nIt assumes that we have all activity updates. It uses a fairly naive algorithm\nwith a threshold of 60% confidence, ignor... | python | new_file | 5 | 6 | bsd-3-clause | 825c4d613915d43aea2e6ee0bc5d5b49ed0a4500 | shankari/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mis... | emission/analysis/classification/segmentation/section_segmentation.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple regression test to go with r143260.\nCommandInterpreter::PreprocessCommand() should not infinite loop\nwhen a target has not been specified yet.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410... | python | new_file | 6 | 1 | apache-2.0 | cf78037980a9345c12b1e2562bc4eda63cea95b3 | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb | test/functionalities/backticks/TestBackticksWithoutATarget.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading."
},
{
"role": "assistant",
"content": "# Copyright (C) Jean-Paul Calderone\n# Se... | python | new_file | 1 | 3 | apache-2.0 | 5f2cd26054adff5a1fbf9ba5d56766b972f46670 | mhils/pyopenssl,kediacorporation/pyopenssl,reaperhulk/pyopenssl,r0ro/pyopenssl,mhils/pyopenssl,daodaoliang/pyopenssl,elitest/pyopenssl,kjav/pyopenssl,kediacorporation/pyopenssl,alex/pyopenssl,lvh/pyopenssl,samv/pyopenssl,Lukasa/pyopenssl,mitghi/pyopenssl,msabramo/pyOpenSSL,reaperhulk/pyopenssl,hynek/pyopenssl,pyca/pyop... | leakcheck/thread-key-gen.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for account lockout fields on User"
},
{
"role": "assistant",
"content": "\"\"\"Add account lockout fields to User\n\nRevision ID: fb6a6554b21\nRevises: 1f9b411bf6df\nCreate Date: 2015-10-29 01:07:27.930095\n\n\"\"\... | python | new_file | 1 | 1 | mit | 4820013e207947fe7ff94777cd8dcf1ed474eab1 | richgieg/flask-now,richgieg/flask-now | migrations/versions/fb6a6554b21_add_account_lockout_fields_to_user.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for downloading Indonesia price data\n\n(http://m.pip.kementan.org/index.php)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimport urllib2\nimport shutil\nimport re\nimport sys\nimport datetime\nfrom... | python | new_file | 5 | 7 | bsd-3-clause | 6fabbe85bb74788641897daf8b162eac3d47b0aa | FAB4D/humanitas,FAB4D/humanitas,FAB4D/humanitas | data_crunching/indonesia_timeseries/download_indonesia_prices.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test to make sure imports and __all__ matches"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nimport warthog.api\n\n\ndef test_public_exports():\n exports = set([item for item in dir(warthog.api) if not i... | python | new_file | 1 | 3 | mit | bfaeeec3f5f5582822e2918491090815a606ba44 | smarter-travel-media/warthog | test/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple function-size analysis tool."
},
{
"role": "assistant",
"content": "\nimport os\nimport re\nimport sys\nimport optparse\n\nMARKER_START_FUNCS = \"// EMSCRIPTEN_START_FUNCS\"\nMARKER_END_FUNCS = \"// EMSCRIPTEN_END_FUNC... | python | new_file | 3 | 7 | mit | a795d94a9c885b97ab5bffc313524ae46626d556 | pypyjs/pypyjs,perkinslr/pypyjs,perkinslr/pypyjs,perkinslr/pypyjs,albertjan/pypyjs,pombredanne/pypyjs,albertjan/pypyjs,perkinslr/pypyjs,pombredanne/pypyjs,pypyjs/pypyjs,trinketapp/pypyjs,pypyjs/pypyjs,pypyjs/pypyjs,perkinslr/pypyjs,trinketapp/pypyjs,albertjan/pypyjs | tools/analyze_code_size.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add function decorator to improve functools.wraps"
},
{
"role": "assistant",
"content": "\"\"\"\nDocumentation-related helper classes/functions\n\"\"\"\n\n\nclass soft_wraps:\n \"\"\"\n A Python decorator which concatenates... | python | new_file | 1 | 2 | bsd-3-clause | 48857638694ceca08c64d7b9c6825e2178c53279 | goodfeli/pylearn2,JesseLivezey/pylearn2,TNick/pylearn2,fulmicoton/pylearn2,pkainz/pylearn2,Refefer/pylearn2,woozzu/pylearn2,kastnerkyle/pylearn2,CIFASIS/pylearn2,mclaughlin6464/pylearn2,hyqneuron/pylearn2-maxsom,aalmah/pylearn2,bartvm/pylearn2,JesseLivezey/pylearn2,nouiz/pylearn2,lamblin/pylearn2,CIFASIS/pylearn2,junbo... | pylearn2/utils/doc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test javascript using the \"js\""
},
{
"role": "assistant",
"content": "import os\n\nfrom py2js import JavaScript\n\ndef f(x):\n return x\n\ndef test(func, run):\n func_source = str(JavaScript(func))\n run_file = \"/tmp/... | python | new_file | 1 | 1 | mit | 8dc7a1e239dc22dd4eb69cfe1754586e3a1690dc | qsnake/py2js,mattpap/py2js,chrivers/pyjaco,buchuki/pyjaco,mattpap/py2js,chrivers/pyjaco,chrivers/pyjaco,buchuki/pyjaco,buchuki/pyjaco,qsnake/py2js | tests/test_run_js.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for Clifford drudge by quaternions"
},
{
"role": "assistant",
"content": "\"\"\"Test for the Clifford algebra drudge.\"\"\"\n\nfrom drudge import CliffordDrudge, Vec, inner_by_delta\n\n\ndef test_clifford_drudge_by_quate... | python | new_file | 1 | 2 | mit | fed2e3f9bdb3a00b077b5e7df1aed4d927b77b6c | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | tests/clifford_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for the hard-coded re() partial frac form"
},
{
"role": "assistant",
"content": "from sympy import together, expand_complex, re, im, symbols\n\nfrom ..partialfrac import t\n\ndef test_re_form():\n theta, alpha = sym... | python | new_file | 1 | 1 | bsd-3-clause | 7ff614950163b1fb6a8fe0fef5b8de9bfa3a9d85 | ergs/transmutagen,ergs/transmutagen | transmutagen/tests/test_partialfrac.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read the header of a fits file and/or look up a single key (case insensitive)."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\n# My imports\nfrom __future__ import division\nfrom astropy.io... | python | new_file | 2 | 1 | mit | 09a0689b8e521c1d5c0ea68ac448dc9ae7abcff5 | DanielAndreasen/astro_scripts | fitsHeader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an extension to allow for an addFixedIp action on instances"
},
{
"role": "assistant",
"content": "# Copyright 2011 OpenStack LLC.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License... | python | new_file | 6 | 3 | apache-2.0 | d764a483497afc5d029a82db14cc5cc88f45f4c0 | saleemjaveds/https-github.com-openstack-nova,bigswitch/nova,virtualopensystems/nova,leilihh/nova,cyx1231st/nova,rajalokan/nova,whitepages/nova,eneabio/nova,devendermishrajio/nova,virtualopensystems/nova,luogangyi/bcec-nova,tanglei528/nova,cloudbau/nova,sileht/deb-openstack-nova,tianweizhang/nova,mandeepdhami/nova,salv-... | nova/api/openstack/contrib/multinic.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to generate a csv of talk titles and video reviewers"
},
{
"role": "assistant",
"content": "import sys\nimport csv\n\nfrom django.core.management.base import BaseCommand\n\nfrom django.contrib.auth import get_user_mod... | python | new_file | 4 | 4 | isc | b674f921a8e5cffb2d3e320f564c61ca01455a9f | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/management/commands/wafer_talk_video_reviewers.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to simulate multiple games"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nfrom game import Game\n\nprint(\"Welcome to a game of ludo!\")\n\naverage_throw_counter = 0\nmin_throws_per_game = 10000000\nmax... | python | new_file | 1 | 0 | mit | fe479bf2a8ec547922c6643bbdf0ba768eb79c9d | risteon/ludo_python | ludo/simulator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create a simple static gallery script."
},
{
"role": "assistant",
"content": "from . import flag\n#from go import html\nfrom go import os\nfrom go import path/filepath\n\ndef ReadAlbumDirs(input_dir):\n f = os.Open(input_dir)\n ... | python | new_file | null | null | mit | c39c086f51963678769c1066637ca573c721e827 | strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid | static_gallery.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add a compatibility module, because of Python 2/3 compatibility issues."
},
{
"role": "assistant",
"content": "import sys\n\nis_py3 = sys.version_info[0] >= 3\n\n\ndef utf8(string):\n \"\"\"Cast to unicode DAMMIT!\n Written... | python | new_file | 3 | 3 | mit | 3db3c22d83071550d8bbd70062f957cf43c5e54a | davidhalter-archive/shopping_cart_example | cart/_compatibility.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a migration to update to final tree fields"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Mi... | python | new_file | 1 | 0 | bsd-3-clause | 1e65555a08ff3ee1a06e92d9dd054abf3cfaf711 | samluescher/django-media-tree,samluescher/django-media-tree,samluescher/django-media-tree | media_tree/migrations/0003_alter_tree_fields.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add demo for non-blocking with poll()."
},
{
"role": "assistant",
"content": "import os\nimport sys\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))\nimport logging\nimport threading\nimport xmpp2\nimport time\n... | python | new_file | 4 | 0 | mit | c89cce1a47c1e379958d7cced624ec0317cd3407 | easies/xmpp2 | examples/demo3.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command line interface to play"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport cmd\nfrom tictactoe.ai_player import AIPlayer\nfrom tictactoe.human_player import HumanPlayer\nfrom tictactoe.game_control... | python | new_file | 1 | 2 | mit | fb5f6bf999b2cd8b674bc2c89f74f1413fc8ee1e | rickerbh/tictactoe_py | command_line_tic_tac_toe.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script for listing all Elasticsearch indexes"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- encoding: utf-8\n\nimport boto3\nimport hcl\nimport requests\n\n\ndef get_terraform_vars():\n s3_client = b... | python | new_file | 1 | 1 | mit | 156b7dfc11f24a7d77d2280e8ddade3cb7a474b7 | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | misc/list_all_es_indexes.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to recover the chat_id"
},
{
"role": "assistant",
"content": "#! /usr/bin/python3\n# -*- coding:utf-8 -*-\n\n# by <EMAIL>\n\nimport sys\nimport time\nimport telepot\n\ndef handle(msg):\n content_type, chat_type, c... | python | new_file | 1 | 3 | apache-2.0 | 3dd71c02ea1fa9e39054bd82bf9e8657ec77d6b9 | a2ohm/ProgressBot | tools/get_chat_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: INDY-1405: Add minimal test case (failing)\n\nSigned-off-by: Sergey Khoroshavin <<EMAIL>>"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom plenum.common.constants import DOMAIN_LEDGER_ID\nfrom plenum.common.startable ... | python | new_file | 3 | 3 | apache-2.0 | 27622185e04bb652284597783287262e23bafa7d | evernym/zeno,evernym/plenum | plenum/test/node_request/test_apply_stashed_partially_ordered.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Print out all links on a page"
},
{
"role": "assistant",
"content": "import requests\nimport re\n\nurl = raw_input(\"Enter URL with http or https prefix : \" )\nprint url\nwebsite= requests.get(url)\n\nhtml = website.text\nprint ... | python | new_file | 5 | 0 | mit | 681cc0a4160373fe82de59946b52e0e21611af84 | NilanjanaLodh/PyScripts,NilanjanaLodh/PyScripts | linkLister.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for discovery loader"
},
{
"role": "assistant",
"content": "from nose2.tests._common import FunctionalTestCase, support_file\nfrom nose2 import events, loader, session\nfrom nose2.plugins.loader.discovery import Di... | python | new_file | 1 | 1 | bsd-2-clause | b1ef133904540b7f49e22ac52a0f844963be829e | ojengwa/nose2,ezigman/nose2,little-dude/nose2,ojengwa/nose2,leth/nose2,ptthiem/nose2,ptthiem/nose2,little-dude/nose2,leth/nose2,ezigman/nose2 | nose2/tests/functional/test_discovery_loader.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add dumb log view test cases"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nfrom flask import url_for\n\n\ndef test_view_build_log(test_client):\n test... | python | new_file | 1 | 1 | mit | 690c08b2b35df2d81dc0977d8bd593c45806e1c2 | bosondata/badwolf,bosondata/badwolf,bosondata/badwolf | tests/test_log.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix mysql encoding for users.profile.reason"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.9 on 2016-09-25 01:43\nfrom __future__ import unicode_literals\n\nfrom django.db import migrati... | python | new_file | 1 | 0 | mit | 8139dc9e04025da001323122521951f5ed2c391b | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | users/migrations/0010_users-profile-encoding.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to remove system avatar source.\n\nFixes the last commit having broken master."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrati... | python | new_file | 1 | 0 | apache-2.0 | 893679baff0367538bdf3b52b04f8bae72732be8 | sharmaeklavya2/zulip,isht3/zulip,joyhchen/zulip,susansls/zulip,zulip/zulip,punchagan/zulip,blaze225/zulip,PhilSk/zulip,samatdav/zulip,hackerkid/zulip,christi3k/zulip,brainwane/zulip,mahim97/zulip,kou/zulip,jackrzhang/zulip,amyliu345/zulip,paxapy/zulip,niftynei/zulip,samatdav/zulip,vikas-parashar/zulip,shubhamdhama/zuli... | zerver/migrations/0031_remove_system_avatar_source.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a basic Storage engine to talk to the DB"
},
{
"role": "assistant",
"content": "\"\"\"\nThis is the Storage engine. It's how everything should talk to the database\nlayer that sits on the inside of the inventory-control syste... | python | new_file | 1 | 1 | mit | b01bd1b21f1b12c9120845ec8a85355b038d6b20 | codeforsanjose/inventory-control,worldcomputerxchange/inventory-control | inventory_control/storage.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to update uploaded files."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n#import hashlib\nimport os\n\ndef main():\n for root, dirs, files in os.walk(\"/mcfs/data/materialscommons\"):\n for f... | python | new_file | 2 | 3 | mit | b51398d602a157ce55fd7e08eedd953051f716a1 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/updatedf.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a history demo in documentation."
},
{
"role": "assistant",
"content": "# coding: utf-8\nfrom deprecated.history import deprecated\nfrom deprecated.history import versionadded\nfrom deprecated.history import versionchanged\n\... | python | new_file | 1 | 1 | mit | 4d500d9abe2da28cdd9bd95019048de445aac265 | tantale/deprecated | docs/source/tutorial/v5/history_demo.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migrations for institutions"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-08-10 21:18\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | new_file | 1 | 0 | mit | 85202173cf120caad603315cd57fa66857a88b0b | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | feder/institutions/migrations/0013_auto_20170810_2118.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD 138 solutions with A195615(OEIS)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n'''\nProblem 138\nConsider the isosceles triangle with base length, b = 16, and legs, L = 17.\n\n\nBy ... | python | new_file | 1 | 5 | mit | c95234c130435ddd116784ad1829f7bdaa9182c5 | byung-u/ProjectEuler | 100_to_199/euler_138.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit test for webpage creation and description"
},
{
"role": "assistant",
"content": "\"\"\"Test the AutoCMS web reporting functionality.\"\"\"\n\nimport os\nimport shutil\nimport unittest\nimport re\n\nfrom autocms.core impo... | python | new_file | 1 | 1 | mit | 328901c74d1ee103a1ee5b2f26aa391ddeda465b | appeltel/AutoCMS,appeltel/AutoCMS,appeltel/AutoCMS | tests/test_web.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add support for cheminformatics descriptors"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n\"\"\"\nfile: cheminfo_molhandle.py\n\nCinfony driven cheminformatics fingerprint functions\n\"\"\"\n\nimport logging\n... | python | new_file | 2 | 3 | apache-2.0 | c16620dffd2cd6396eb6b7db76a9c29849a16500 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | components/lie_structures/lie_structures/cheminfo_descriptors.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test recorded and exported to the project"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom selenium.webdriver.firefox.webdriver import WebDriver\nfrom selenium.webdriver.common.action_chains import ActionChain... | python | new_file | 4 | 2 | mit | 4569c22d2d0245641e0c2696f798f273405c6bee | spcartman/python_qa | test_add_group.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add short Python script that prints as many dummy divs as needed.\n\nUsed for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items."
},
{
... | python | new_file | 1 | 2 | apache-2.0 | 399daa8ebec14bc4d7ee6c08135e525190e1eb6f | scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback | collections/show-test/print-divs.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test that modules can be imported in any order\n\nThis excercises an tricky import cycle introduced in:\n\n 7c68f3f78 more imports at top level"
},
{
"role": "assistant",
"content": "\"\"\"Test that all modules/packages in the l... | python | new_file | 1 | 2 | bsd-3-clause | fbf36a2fb52b5ed1aceaec4c1d1075448584a97d | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor | tests/test_imports.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic tests for run length encoding printable"
},
{
"role": "assistant",
"content": "from unittest import mock\nfrom django.http import QueryDict\nfrom django.test import tag\nfrom resources.generators.RunLengthEncodingResour... | python | new_file | 3 | 1 | mit | b223c8be2bcb11d529a07997c05a9c5ab2b183b2 | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/tests/resources/generators/test_run_length_encoding.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example for the music module"
},
{
"role": "assistant",
"content": "from screenfactory import create_screen\nfrom modules.music import Music\nimport config\nimport time\nimport pygame\n\nscreen = create_screen()\n\nmusic =... | python | new_file | 1 | 0 | mit | ee3e04d32e39d6ac7ef4ac7abc2363a1ac9b8917 | derblub/pixelpi,marian42/pixelpi,derblub/pixelpi,derblub/pixelpi,marian42/pixelpi | example_music.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Codewars: Convert string to camel case"
},
{
"role": "assistant",
"content": "def to_camel_case(text):\n if len(text) < 2:\n return text\n capped_camel = \"\".join([word.title() for word in text.replace('-','_').spli... | python | new_file | 1 | 4 | unlicense | 8fbc5877fa97b6b8df621ff7afe7515b501660fc | SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive | LeetCode/ConvertStringToCamelCase.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for transnational weights"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom django_countries import countries\n\ndef po... | python | new_file | 3 | 3 | apache-2.0 | e262d176ecd7d8871a9e06ebc542cf473acf0925 | Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp | reports/migrations/0004_transnational_weights.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example for opening a file."
},
{
"role": "assistant",
"content": "import numpy as np\nimport pyh5md\n\nf = pyh5md.H5MD_File('poc.h5', 'r')\n\nat = f.trajectory('atoms')\n\nat_pos = at.data('position')\n\nr = at_pos.v.valu... | python | new_file | 2 | 0 | bsd-3-clause | db41bce3d90cfada9916baa8f9267cd9e6160a94 | MrTheodor/pyh5md,khinsen/pyh5md | examples/open_file.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: INFRA-6896: Add a module to set the \"display name\" of a dedicated server\n\n- Change the \"display name\" in ovh manager, so you can use your internal\nnaming for example\n- No need to set internal names in reverse dns anymore\n- Change is... | python | new_file | 1 | 4 | mit | c0ab9b755b4906129988348b2247452b6dfc157f | synthesio/infra-ovh-ansible-module | plugins/modules/dedicated_server_display_name.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement management command for creating demo records of balance history (NC-842)"
},
{
"role": "assistant",
"content": "from datetime import timedelta\n\nfrom django.core.management.base import BaseCommand\nfrom django.utils im... | python | new_file | 1 | 3 | mit | af508daaf016b824c7518a36f9b92f571f0f65af | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/management/commands/init_balance_history.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add corpus fetch from database\n\n\nFormer-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# encoding: utf-8\n\nimport argparse\nimport sqlite3\nimport sys\n\n\"\... | python | new_file | 1 | 7 | mit | 35317e778b2fe1d238e21954df1eac0c5380b00b | greenify/zodiacy,greenify/zodiacy | generate_horoscope.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to clean up all FD phone and fax numbers."
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom firecares.firestation.models import FireDepartment\nfrom phonenumber_field.mode... | python | new_file | 3 | 6 | mit | b0577ce3b8b162ce3702430b189905f9beaae8d5 | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firestation/management/commands/cleanup_phonenumbers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing noop-migrations for PositiveIntegerField"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.1 on 2018-03-22 19:56\nfrom __future__ import unicode_literals\n\nimport django.core.... | python | new_file | 1 | 0 | mit | 4c3c9c6929ebc3f439ccf3bb7d3696f484b154bc | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | karspexet/ticket/migrations/0017_positive_integers_20180322_2056.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [Code] Add code to dump features into libsvm file format"
},
{
"role": "assistant",
"content": "import numpy as np\nfrom datetime import datetime\nfrom sklearn.datasets import dump_svmlight_file\nimport os.path as path\n\ndef mai... | python | new_file | 3 | 1 | mit | d5d3fcfb331c1486acbfb004705b94b1923a0db8 | erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge | Codes/SuperEdge/SuperEdge/dump_libsvm.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add minimal REST API script based on flask"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nfrom tempfile import NamedTemporaryFile\nimport json\nfrom threading import Lock\n\nimport numpy as np\nfrom flask import... | python | new_file | 1 | 3 | apache-2.0 | 638ee09f0f2958a955fbad42368ffc6bb2a2688a | BioroboticsLab/deeppipeline,BioroboticsLab/bb_pipeline,BioroboticsLab/deeppipeline | pipeline/scripts/bb_pipeline_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add External Temperature Probe from OpenWeather"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# Get External Temperature from OpenWeatherMap\n# External informations are :\n# - temperature\n# - humidity\n# - press... | python | new_file | 7 | 2 | mit | 1765ac3a12ea2a56b4e25e05cf1f1b531de5b2cf | mattcongy/piprobe | pyexternal.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple benchmark script"
},
{
"role": "assistant",
"content": "import timeit\n\nnormal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)\nnaive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy ... | python | new_file | 1 | 0 | unlicense | decf4b1916a421fe996a31feb131b7ed9e4e3c36 | abhimanyuma/ml-with-py | numpy-benchmark-one.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file to create all files to school census."
},
{
"role": "assistant",
"content": "import os\nimport commands\nimport time\nimport logging\nimport sys\n\nif len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):\n pri... | python | new_file | 2 | 0 | mit | 70a6553d9323b3522e492c414b67e76111519368 | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | scripts/data_download/school_census/create_all_files.py | rejected_duplicate | Near-duplicate of sample 103 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create pldm related specific constants file.\n\nChange-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0\nSigned-off-by: Sridevi Ramesh <<EMAIL>>"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nr\"\"\"\nContains PLDM-rela... | python | new_file | 1 | 0 | apache-2.0 | 70e14187ecd2567894e5e8183341a63835d6839c | openbmc/openbmc-test-automation,openbmc/openbmc-test-automation | data/pldm_variables.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up frontend for longpolling"
},
{
"role": "assistant",
"content": "from gevent.event import AsyncResult\n\n_event = AsyncResult()\n\ndef wait():\n \"\"\"\n Gets the New Block work unit to send to clients\n \"\"\"\n ... | python | new_file | 4 | 1 | mit | ccbb7e11edc63a128b7006e015539fdabd8f3a7f | c00w/bitHopper,c00w/bitHopper | bitHopper/LongPoll.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to count emotional sentences according to LIWC\n\nAdded a script that counts the number of emotional sentences in titles\nin the corpus. A sentence is considered emotional if it contains at\nleast one Posemo or Negemo term. The st... | python | new_file | 6 | 0 | apache-2.0 | 65b362985d502440b12efc8a6a49ab0603354fd2 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | liwc_emotional_sentences.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a check for keystone expired tokens buildup.\n\nMore than 1K is too many when cleaning every 5 minutes, so warn about\nit. The admin may have to go in and more aggressively clean or figure\nout why the cleaning isn't completing as expect... | python | new_file | 1 | 2 | apache-2.0 | cb454d310431700e5ac9883a32f0b36e2e50e0fe | aacole/ursula-monitoring,sivakom/ursula-monitoring,sivakom/ursula-monitoring,blueboxgroup/ursula-monitoring,blueboxgroup/ursula-monitoring,sivakom/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,sivakom/ursula-monitoring,blueboxgroup/ursula-monitoring,blueboxgroup/ursula-mon... | sensu/plugins/check-keystone-expired-tokens.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to remove unpaired fasta entries."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\"\nRemove unpaired reads from a fasta file.\n\nThis script can be used for the case that unpaired reads (e.g. as\nr... | python | new_file | 1 | 0 | isc | 8b42b0825d5cbb6becef9669b43a2c8229ea8642 | konrad/kuf_bio_scripts | remove_unpaired_fasta_entries.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: pandoc-include-clone.py: Add clone of Haskell version\n\nThis at least doesn't require linking against anything, waiting for a\nlong compilation and installation with `cabal`, complaining about the\nPandoc API version in the latest GitHub re... | python | new_file | 1 | 11 | isc | 98aee2af9aa3f7dcc75969f1ec3118c40539793e | pilona/Utils,pilona/Utils,pilona/Utils | pandoc-include-code.py | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add modified chart with better values"
},
{
"role": "assistant",
"content": "\nfrom brew.utilities import sg_from_dry_basis\n\n\n\"\"\"\nRay Daniels\nDesigning Great Beers\n\nAppendix 2: Course Grind Potential Extract (modified)\... | python | new_file | 1 | 2 | mit | 324243dfd61afd8ce244a9a02ffc800c5c73ce55 | chrisgilmerproj/brewday,chrisgilmerproj/brewday | charts/daniels_designing_great_beers/appendix_two_course_grind_potential_extract_modified.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for user creation form"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nfrom users.forms import ZionsUserCreationForm\nfrom users.models import User\n\n\nclass {{cookiecutter.project_camel_... | python | new_file | null | null | bsd-3-clause | 1f48fee7ffcef3eefa6aaedb5ca963c10bb7c58c | wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/test_forms.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: tests: Test for explicit start/end args to str methods for unicode."
},
{
"role": "assistant",
"content": "# str methods with explicit start/end pos\nprint(\"Привет\".startswith(\"П\"))\nprint(\"Привет\".startswith(\"р\", 1))\npr... | python | new_file | 1 | 0 | mit | 63143c94cef353d7bae13f7b13650801bb901c94 | hiway/micropython,martinribelotta/micropython,tdautc19841202/micropython,supergis/micropython,torwag/micropython,pfalcon/micropython,galenhz/micropython,TDAbboud/micropython,kerneltask/micropython,heisewangluo/micropython,kerneltask/micropython,pozetroninc/micropython,ericsnowcurrently/micropython,ernesto-g/micropython... | tests/unicode/unicode_pos.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic functionality and regression tests for ACA dark cal module"
},
{
"role": "assistant",
"content": "\"\"\"\nBasic functionality and regression tests for ACA dark cal module.\n\"\"\"\n\nimport numpy as np\n\nfrom ..aca_dar... | python | new_file | 1 | 1 | bsd-3-clause | cc89c5222ec7f6d6f95b5efdce3958b3ca33814e | sot/mica,sot/mica | mica/archive/tests/test_aca_dark_cal.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for input setup workflow"
},
{
"role": "assistant",
"content": "import os\nimport unittest\n\nimport cea.config\nfrom cea.utilities import create_polygon\nfrom cea.datamanagement import zone_helper, surroundings_helper, ... | python | new_file | 1 | 1 | mit | ac40e54d22717fbf1a2444a67198cdba66506df8 | architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst | cea/tests/test_inputs_setup_workflow.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Include OpenCV based Python CLAHE script"
},
{
"role": "assistant",
"content": "from PIL import Image\nimport numpy as np\nimport h5py\nimport os\nimport sys\nimport cv2\n\n# Maybe consider implemeting more involved auto-balancin... | python | new_file | 2 | 3 | mit | 5eefc407b8f51c017a3f4193c88f6dc188a88601 | seung-lab/Julimaps,seung-lab/Julimaps | src/CLAHE_dir.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add datetime to fast cache"
},
{
"role": "assistant",
"content": "\"\"\"Add datetime to fastcache\n\nRevision ID: 20860ffde766\nRevises: 471e6f7722a7\nCreate Date: 2015-04-14 07:44:36.507406\n\n\"\"\"\n\n# revision identifiers, u... | python | new_file | 1 | 1 | bsd-2-clause | 582b5c598da5b35032447f0eb7888051b84f844c | porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,morelab/appcomposer,morelab/appcomposer,go-lab/appcomposer,go-lab/appcomposer,porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,go-lab/appcomposer,go-lab/appcomposer | alembic/versions/20860ffde766_add_datetime_to_fastcache.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example for the RedisLock"
},
{
"role": "assistant",
"content": "import random\n\nfrom diesel import fork, quickstop, quickstart, sleep\nfrom diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, Loc... | python | new_file | 5 | 3 | bsd-3-clause | d0e5ea752912b10e473b2a05da9196800eb6ca86 | dieseldev/diesel | examples/redis_lock.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add blocking migration for new domain db"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom corehq.doctypemigrations.djangomigrations ... | python | new_file | 1 | 0 | bsd-3-clause | 70d912bfb1ccec03edfe92b9b2c87610346c8f42 | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/doctypemigrations/migrations/0006_domain_migration_20151118.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add command to test managers emails"
},
{
"role": "assistant",
"content": "from django.core.mail import mail_managers\nfrom django.core.management.base import BaseCommand\n\n\nclass Command(BaseCommand):\n help = \"Test if ema... | python | new_file | 1 | 1 | bsd-2-clause | 550469032843eb2af3b4a9faaed34d9754f00700 | mabhub/Geotrek,camillemonchicourt/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,Anaethelion/Geotrek,camillemonchicourt/Geotrek,johan--/Geotrek,GeotrekCE/Geot... | geotrek/common/management/commands/test_managers_emails.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for updating favicon from gh avatar"
},
{
"role": "assistant",
"content": "from PIL import Image\nimport requests\nfrom io import BytesIO\n\n# This whole script was done using Google and StackOverflow\n# How to generat... | python | new_file | 1 | 0 | mit | f6f75172b1b8a41fc5ae025416ea665258d4ff4c | Sorashi/sorashi.github.io | favicon-update.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Customize behave formatter to output json"
},
{
"role": "assistant",
"content": "from behave.formatter.json import PrettyJSONFormatter\nfrom pprint import pprint\n\nclass RecordFormatter(PrettyJSONFormatter):\n name = \"super\... | python | new_file | 3 | 10 | mit | edb9500824faffd9f1d0d1b59ca29966e3b18282 | avidas/reliability-demo | modules/formatter_record.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a modified version of simple bot"
},
{
"role": "assistant",
"content": "from tota.utils import closest, distance, sort_by_distance, possible_moves\nfrom tota import settings\n\n__author__ = \"angvp\"\n\n\ndef create():\n\n ... | python | new_file | 1 | 21 | mit | 04287120372a6fdb906ed9f27ead4c5f91d5690e | fisadev/tota | tota/heroes/lenovo.py | rejected_complexity | Cyclomatic complexity too high: 21 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for registry model hash"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom dockci.models.auth import AuthenticatedRegistry\n\n\nBASE_AUTHENTICATED_REGISTRY = dict(\n id=1,\n display_name='Display name',\n... | python | new_file | 1 | 1 | isc | 6b4733c213046c7a16bf255cfbc92408e2f01423 | RickyCook/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,RickyCook/DockCI | tests/models/test_authenticated_registry_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add super basic Hypothesis example"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Unit Tests\n\ndef test_add_zero():\n assert 0 + 1 == 1 + 0\n\ndef test_add_single_digits():\n ass... | python | new_file | 1 | 1 | mit | 427a95f0c56facc138448cde7e7b9da1bcdc8ea4 | dkua/pyconca16-talk | add_example.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add pseudo filter combining pypandoc and panflute\n\nThis is a prototype (filename is hardcoded) but should be easy to extend"
},
{
"role": "assistant",
"content": "import io\r\n\r\nimport pypandoc\r\nimport panflute\r\n\r\n\r\nd... | python | new_file | 1 | 3 | bsd-3-clause | 21a504dce25a1b22bda27cd74a443af98b24ad14 | sergiocorreia/panflute-filters | filters/extract_urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Improve code for creating temporary locustfiles that can be used in tests"
},
{
"role": "assistant",
"content": "import os\nimport random\nimport time\n\nfrom contextlib import contextmanager\n\n\nMOCK_LOUCSTFILE_CONTENT = '''\n\... | python | new_file | 1 | 1 | mit | 84153b0be78998ab8ec6914df8623c99255457b5 | mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,mbeacom/locust,locustio/locust,mbeacom/locust,locustio/locust | locust/test/mock_locustfile.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add module for running the main simulation"
},
{
"role": "assistant",
"content": "import genetic\nimport sys\n\noutput = sys.stdout\n\ndef setOutput(out):\n output = out\n genetic.setOutput(output)\n\n# Test data for a XOR ... | python | new_file | 1 | 1 | mit | d3d6a6018d55581bf081c93386f6676c8bb105ce | JoshuaBrockschmidt/ideal_ANN | simulate.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to fix all notions"
},
{
"role": "assistant",
"content": "from alignements_backend.db import DB\nfrom alignements_backend.notion import Notion\n\nfor notion in DB.scan_iter(match='notion:*'):\n n = Notion(list(DB.ss... | python | new_file | 1 | 0 | mit | d0b8c68ae3c8acbc3d5dfe13842e3c41a198b978 | l-vincent-l/alignements_backend | fix_notions_db.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add shared babel init code"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom flask import request\nfrom flask_babel import Babel\n\n__author__ = 'lundberg'\n\n\ndef init_babel(app):\n babel = Babel(app)\n ... | python | new_file | 1 | 1 | bsd-3-clause | 3ddf0f0fead6018b5c313253a0df2165452cfb6e | SUNET/eduid-common | src/eduid_common/api/translation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: tests/basics: Add test for logical constant folding."
},
{
"role": "assistant",
"content": "# tests logical constant folding in parser\n\ndef f_true():\n print('f_true')\n return True\n\ndef f_false():\n print('f_false')... | python | new_file | 5 | 1 | mit | 30bca45e1ac9fc6953728950695135b491403215 | mhoffma/micropython,blazewicz/micropython,tobbad/micropython,oopy/micropython,pozetroninc/micropython,swegener/micropython,tralamazza/micropython,tobbad/micropython,mhoffma/micropython,kerneltask/micropython,MrSurly/micropython,Peetz0r/micropython-esp32,tobbad/micropython,dmazzella/micropython,HenrikSolver/micropython,... | tests/basics/logic_constfolding.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for inline list compilation"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START\nfrom thinglang.compiler.errors import NoMatching... | python | new_file | 1 | 1 | mit | 8fa7120606e206d08acbad198e253ea428eef584 | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | tests/compiler/test_inline_list_compilation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for file agent"
},
{
"role": "assistant",
"content": "\"\"\"\nTests for a agent.\n\"\"\"\n\nimport io\nimport os\n\nimport pytest\n\nfrom onirim import action\nfrom onirim import agent\nfrom onirim import component\n\nd... | python | new_file | 1 | 1 | mit | 507e3bad4e877330eea29675dafb8210ab6bada5 | cwahbong/onirim-py | tests/test_agent.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.