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 pagerteam tests file which had been missed despite its existence"
},
{
"role": "assistant",
"content": "from hc.api.models import Channel\nfrom hc.test import BaseTestCase\n\n\nclass AddPagerTeamTestCase(BaseTestCase):\n u... | python | new_file | 1 | 1 | bsd-3-clause | 53467bd7d4c9c12b73c66244a91f31f0dbadeeec | healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks | hc/front/tests/test_add_pagerteam.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests from Gregor's PR"
},
{
"role": "assistant",
"content": "from functools import partial\nfrom mock import Mock\nfrom unittest import TestCase\n\nfrom readthedocs.restapi.permissions import APIRestrictedPermission\n\n\ncla... | python | new_file | null | null | mit | 7707e65ed591b890d91bcb7bf22923b8c17a113a | davidfischer/readthedocs.org,wijerasa/readthedocs.org,rtfd/readthedocs.org,davidfischer/readthedocs.org,safwanrahman/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,SteveViss/readthedocs.org,stevepiercy/readthedocs.org,rtfd/readthedocs.org,stevepiercy/readthedocs.org,safwanrahman/readthedocs.org,clarkp... | readthedocs/rtd_tests/tests/test_api_permissions.py | rejected_code_smell | Internal duplication: ~55% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: Add download random leader avatar to examples"
},
{
"role": "assistant",
"content": "# Run with Python 3\nimport json\nimport requests\nfrom random import randint\nimport shutil\nimport math\n\n# 1. Get your keys at https://stepi... | python | new_file | 1 | 3 | mit | 9a22cf7452723686a5065658ce5c9d31333c8a33 | StepicOrg/Stepic-API | examples/download_random_leader_avatar.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example to illustrate different optimization procedures"
},
{
"role": "assistant",
"content": "# showing the relation between cutting plane and primal objectives\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom ... | python | new_file | 1 | 0 | bsd-2-clause | 9f9916d662d1ab130c9685c415c25b19a14733d7 | d-mittal/pystruct,massmutual/pystruct,wattlebird/pystruct,massmutual/pystruct,wattlebird/pystruct,pystruct/pystruct,amueller/pystruct,d-mittal/pystruct,pystruct/pystruct,amueller/pystruct | examples/svm_objectives.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: TST: Add tests for msgpack reader."
},
{
"role": "assistant",
"content": "import intake_bluesky.msgpack # noqa\nimport intake\nfrom suitcase.msgpack import Serializer\nimport os\nimport pytest\nimport shutil\nimport tempfile\nim... | python | new_file | 1 | 4 | bsd-3-clause | 0507a47f1c15bac5f6eddbeb9c712f5c2b2a9358 | ericdill/databroker,ericdill/databroker | intake_bluesky/tests/test_msgpack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test effect of change in Laplacian."
},
{
"role": "assistant",
"content": "import numpy \nimport scipy.sparse \nfrom apgl.graph import GraphUtils \nfrom apgl.util.Util import Util \n\nnumpy.set_printoptions(suppress=True, precisi... | python | new_file | 1 | 0 | bsd-3-clause | 3a2e9a19feab0c882a9821b7ff555bd1e2693190 | charanpald/APGL | exp/sandbox/DeltaLaplacianExp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for `check` command"
},
{
"role": "assistant",
"content": "\"\"\"\nTest check/validation command.\n\"\"\"\nimport os\nimport subprocess\n\nthis_folder = os.path.abspath(os.path.dirname(__file__))\n\n\ndef test_check_met... | python | new_file | 1 | 1 | mit | 93621f9441af4df77c8364050d7cc3dc2b1b43b2 | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | tests/functional/registration/test_check.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\nimport grp\nimport pwd\nimport inspect\nimport argparse\n\n\ndef list_all_users_in_group(groupname):\n \"\"\"Get list of all users of group.\n\n ... | python | edit | 1 | 4 | cc0-1.0 | a42a6a54f732ca7eba700b867a3025739ad6a271 | vazhnov/list_all_users_in_group | list_all_users_in_group.py | rejected_duplicate | Near-duplicate of sample 788 | true |
[
{
"role": "user",
"content": "Write python code for the following: Update way we synchronize from citybik.es\n\nNow we only download the information we actually need. We also download\nand generate network information dynamically, which should enable some\ncool stuff"
},
{
"role": "assistant",
"... | python | new_file | 1 | 4 | mit | 97d6cce2a5c0c905f0c33c41316c8e65eaed0e08 | wlach/nixi,wlach/nixi | update-bikestations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new topics migration file"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.5 on 2017-11-08 08:40\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n... | python | new_file | 1 | 0 | mit | 474c5f977ab5b035567f0107c457622c51189ac6 | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/topics/migrations/0086_auto_20171108_0840.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a solution for the MadLibs lab"
},
{
"role": "assistant",
"content": "# Create a function for adjectives so I don't repeat myself in prompts.\ndef get_adjective():\n return raw_input(\"Give me an adjective: \")\n\ndef get_... | python | new_file | 4 | 1 | apache-2.0 | ae948c95ea0087f33f13ef3463dc022eda0301a2 | google/cssi-labs,google/cssi-labs | python/labs/make-a-short-story/mystory.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix variable referenced before assginment in vmwareapi code.\n\nAdd unitests for VMwareapi vm_util.\nfix bug #1177689\n\nChange-Id: If16109ee626c197227affba122c2e4986d92d2df"
},
{
"role": "assistant",
"content": "# vim: tabstop=4... | python | new_file | 1 | 1 | apache-2.0 | b418ff779c79afd0eca85ed1479ba633f25ce73c | n0ano/ganttclient | nova/tests/test_vmwareapi_vm_util.py | rejected_duplicate | Near-duplicate of sample 6816 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee\n\n714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/"
},
{
"ro... | python | new_file | 1 | 3 | apache-2.0 | d067d9937ff34787e6f632d86075af29c27d98f8 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/best-time-to-buy-and-sell-stock-with-transaction-fee.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create Generic Sitemap abstract django"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap\nfrom django.contrib.sitemaps import Sitemap as Dja... | python | new_file | 1 | 2 | mit | 1dc439fcf7a823270156708208339a8bf420703c | opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps | opps/sitemaps/sitemaps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add wsgi compatible example gunicorn application"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nimport multiprocessing\n\nimport gunicorn.app.base\n\nfrom gunicorn.six import iteritems\n\n\ndef ... | python | new_file | 1 | 5 | mit | f3c4bac262c6d09730b3f0c4a24639fde8b4d923 | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | gunicorn-app.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple command to list speakers and tickets"
},
{
"role": "assistant",
"content": "import sys\nimport csv\nfrom optparse import make_option\n\nfrom django.core.management.base import BaseCommand\n\nfrom django.contrib.auth.mo... | python | new_file | 1 | 8 | isc | 77b34390345208a6e0bc5ad30cdce62e42ca0c56 | CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer | wafer/management/commands/pycon_speaker_tickets.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for on_delete SET_NULL"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.8 on 2017-08-25 23:13\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfr... | python | new_file | 1 | 0 | mit | 30567284410b9bb7154b8d39e5dfe7bc4bb1b269 | worthwhile/django-herald,jproffitt/django-herald,jproffitt/django-herald,worthwhile/django-herald | herald/migrations/0006_auto_20170825_1813.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for inserting project into DB"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport pymongo\nimport subprocess\nimport re\nfrom datetime import datetime\nimport argparse\nfrom json import load as load_j... | python | new_file | 3 | 1 | mit | 3bbf06964452683d986db401556183f575d15a55 | muzhack/muzhack,muzhack/muzhack,praneybehl/muzhack,muzhack/musitechhub,praneybehl/muzhack,praneybehl/muzhack,muzhack/musitechhub,praneybehl/muzhack,muzhack/muzhack,muzhack/muzhack,muzhack/musitechhub,muzhack/musitechhub | insert-project.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add demo MNH event scraper"
},
{
"role": "assistant",
"content": "from datetime import datetime, timezone, time\n\nimport requests\nfrom bs4 import BeautifulSoup\n\nfrom django.db import transaction\n\nfrom .base import BaseScrap... | python | new_file | 3 | 6 | mit | 9d7c348170fc0f9d339a2ef57a9e64b1ceaa7516 | andrewgleave/whim,andrewgleave/whim,andrewgleave/whim | web/whim/core/scrapers/mnh.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 537. Complex Number Multiplication\n\n537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/"
},
{
"role": "assistant",
"content": "import re\nclass Solution(object):\... | python | new_file | 1 | 1 | apache-2.0 | 5bc089a98bf578fd0c56e3e50cf76888ee74aba2 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/complex-number-multiplication.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test case for ioddrivesnmp class"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n# coding=utf-8\n################################################################################\n\nfrom test import CollectorTestCase\nfr... | python | new_file | 1 | 2 | mit | 8fe73523b7141f93d8523e56a7c6a5cc2ed82051 | datafiniti/Diamond,stuartbfox/Diamond,joel-airspring/Diamond,disqus/Diamond,Netuitive/Diamond,metamx/Diamond,cannium/Diamond,hvnsweeting/Diamond,MichaelDoyle/Diamond,MediaMath/Diamond,Precis/Diamond,anandbhoraskar/Diamond,socialwareinc/Diamond,joel-airspring/Diamond,h00dy/Diamond,mfriedenhagen/Diamond,socialwareinc/Dia... | src/collectors/iodrivesnmp/test/testiodrivesnmp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 350. Intersection of Two Arrays II\n\n350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/"
},
{
"role": "assistant",
"content": "from collections import Counter\ncl... | python | new_file | 1 | 1 | apache-2.0 | 06e82c471afa83bf0f08f0779b32dd8a09b8d1ba | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/intersection-of-two-arrays-ii.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the middleware for reporting errors to gcloud."
},
{
"role": "assistant",
"content": "from google.cloud import error_reporting\n\n\nclass ErrorReportingMiddleware(object):\n def __init__(self, *args, **kwargs):\n se... | python | new_file | 1 | 1 | mit | d6e9971ceefc69f0eefc7440cc5e7035e7dcc05d | fle-internal/content-curation,jonboiser/content-curation,jonboiser/content-curation,jayoshih/content-curation,aronasorman/content-curation,jayoshih/content-curation,fle-internal/content-curation,aronasorman/content-curation,jayoshih/content-curation,DXCanas/content-curation,jonboiser/content-curation,fle-internal/conte... | contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\n\ndef team_member_image_name(instance, filename):\n return 'team/{0}'.format(instance.name)\n\n\nclass TeamMember(models.Model):\n bio = models.TextField(\n verbose_name='biography')\n name = ... | python | edit | 1 | 1 | mit | 84990a4ef20c2e0f42133ed06ade5ce2d4e98ae3 | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | chmvh_website/team/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add initial draft script to analyse Maven deps"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport subprocess as sub\nimport yaml\nimport re\n\ndistrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/cle... | python | new_file | null | null | apache-2.0 | 499adce8b5c23d60073d4c92259e611609ee0c61 | uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states | states/common/maven/artifacts/check_dependencies.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to check if URNs are present in the database"
},
{
"role": "assistant",
"content": "import csv\nfrom django.core.management.base import BaseCommand\n\n\nfrom apps.plea.models import DataValidation, Case\n... | python | new_file | 5 | 7 | mit | 9c045f7667e1bdc6c9137c3877292907f4623774 | ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas | make_a_plea/management/commands/check_urns_in_db.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Infer: Add initial implementation of TempType.\n\n* This will be used to supply types to all type-bearing nodes during\n type inference."
},
{
"role": "assistant",
"content": "\"\"\"\n# ------------------------------------------... | python | new_file | 1 | 1 | mit | 40f92e6293bb13ee1462b932be15f5f11ceeee74 | Renelvon/llama,Renelvon/llama | compiler/infer.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom database.dict_converters.converter_base import ConverterBase\n\n\nclass EventDetailsConverter(ConverterBase):\n SUBVERSIONS = { # Increment every time a change to the dict is made\n 3: 0,\n }\n\n @classmethod\n def ... | python | edit | 1 | 5 | mit | 257134bdaea7c250d5956c4095adf0b917b65aa6 | verycumbersome/the-blue-alliance,the-blue-alliance/the-blue-alliance,nwalters512/the-blue-alliance,nwalters512/the-blue-alliance,the-blue-alliance/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,phil-lopreiato/the-blue-alliance,nwalters512/the-blue-alliance,tsteward/the-blue-alliance,jaredhas... | database/dict_converters/event_details_converter.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for create_image\n\nChange-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); y... | python | new_file | 1 | 2 | apache-2.0 | 930a8b1a7c980183df5469627a734033ca39a444 | openstack-infra/shade,jsmartin/shade,dtroyer/python-openstacksdk,openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,jsmartin/shade,openstack/python-openstacksdk | shade/tests/functional/test_image.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution for problem 26"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\n\"\"\"\nFor resolve this, we have to find the maximum\nFull Reptend Prime int he given limit. To do that, we need\nto check if the 10 is a pr... | python | new_file | 1 | 0 | mit | 03279bbc6193d3944dcd2542daa65701a1e0eded | cifvts/PyEuler | euler026.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for change in profile model."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2018-03-09 22:15\nfrom __future__ import unicode_literals\n\nfrom django.db import migration... | python | new_file | 1 | 0 | mit | 133da92ed69aafc6c0a8d4466cf3b0266c5edc68 | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | userprofile/migrations/0006_auto_20180309_2215.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for automating analysis for all corpora"
},
{
"role": "assistant",
"content": "import os\nimport argparse\nimport subprocess\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"corpusdir\", help = \"Path to th... | python | new_file | null | null | mit | 260e0ef2bc37750dccea47d30110221c272e757a | MontrealCorpusTools/SPADE,MontrealCorpusTools/SPADE | run_all_corpora.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write python code for the following: Add migration file for event slug changes"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-07-06 08:03\nfrom __future__ import unicode_literals\n\nimport autoslug.fields\nfrom d... | python | new_file | 1 | 0 | mit | f3db6608c2b4afeb214c3f1b94e0175609ad0b88 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | cs4teachers/events/migrations/0018_auto_20170706_0803.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [AC-9512] Merge remote-tracking branch 'origin' into AC-9512"
},
{
"role": "assistant",
"content": "from django.db import migrations\n\n\ndef remove_bucket_list_program_roles(apps, schema_editor):\n BucketState = apps.get_mode... | python | new_file | 1 | 1 | mit | 8cf5b328d7596a9b74490b7dfd4a1b8aa1577b55 | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script that recommends scrape task schedule based on recent run timings"
},
{
"role": "assistant",
"content": "import asyncio\nimport attr\nimport pprint\nimport dateutil.parser\nfrom datetime import timedelta\nfrom bobsled.c... | python | new_file | 3 | 12 | mit | 98295608a2ba4519d12212532380253bba4372ed | openstates/bobsled,openstates/bobsled,openstates/bobsled,openstates/bobsled | scripts/frequency_analysis.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration for h5p kind."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.23 on 2019-12-19 02:29\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom djan... | python | new_file | 1 | 0 | mit | 6aef9ab419b09822b2255141349144ac8978e862 | mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri | kolibri/core/content/migrations/0025_add_h5p_kind.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test case for retrieve_dns module"
},
{
"role": "assistant",
"content": "import logging\nimport os\nimport tempfile\nimport unittest\n\nimport mock\n\nimport bin.retrieve_dns\n\n\nlogging.basicConfig(level=logging.INFO)... | python | new_file | 1 | 3 | apache-2.0 | b47369d43a0a85ac2bc32bfa77c6a4d9074ce700 | apel/apel,stfc/apel,tofu-rocketry/apel,apel/apel,tofu-rocketry/apel,stfc/apel | test/test_retrieve_dns.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file lister for rclone export"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\nimport glob\n\n# For use with --files-from argument for Rclone\n# This suits Edgar's structure with is\n# SPECIESNAME/{occurrences|p... | python | new_file | 1 | 0 | bsd-3-clause | ecfadf8478b8775d8579812a7bd835f6ebb1ffd4 | jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar | util/rclone-list-files.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Update test script to do match testing."
},
{
"role": "assistant",
"content": "from util.decompose_graph import decompose_graph\n\nfrom core.himesis_utils import expand_graph, set_do_pickle, set_compression\n\nset_do_pickle(True)... | python | new_file | 10 | 0 | mit | f8a0aa92c8e19bc11f8a609733644afe0efed5c8 | levilucio/SyVOLT,levilucio/SyVOLT | decompose_test.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test file for user functions."
},
{
"role": "assistant",
"content": "from okcupyd.db import user\n\ndef test_have_messaged_before(T):\n message_thread_model = T.factory.message_thread()\n assert user.have_messaged_by_us... | python | new_file | 1 | 1 | mit | 6fd75772efac321517a1d8c01addfa5cbbf7caf0 | IvanMalison/okcupyd,okuser/okcupyd,IvanMalison/okcupyd,okuser/okcupyd | tests/db/user_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add recipe usage command for quick diagnostics.\n\nPiperOrigin-RevId: 432485870"
},
{
"role": "assistant",
"content": "###########################################################################\n#\n# Copyright 2022 Google LLC\n... | python | new_file | 4 | 4 | apache-2.0 | d17c14df00c31af49080ff2f9fea8597a8861461 | google/starthinker,google/starthinker,google/starthinker | starthinker_ui/recipe/management/commands/recipe_usage.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint"
},
{
"role": "assistant",
"content": "import requests\nimport json\n# Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdf... | python | new_file | 3 | 0 | bsd-2-clause | d60c1f9a6e56472611a96779462b42e8505e7905 | symisc/pixlab,symisc/pixlab,symisc/pixlab | python/pdf_to_img.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement a ThriftHandler for tornado\n\nThis Handler requires a processor=... kwarg (e.g., self.service) for the\nthird value in the handler description (e.g.,:\n ('/thrift', TornadoThriftHandler, dict(processor=self.service))\n)."
},
... | python | new_file | 1 | 1 | bsd-3-clause | 7e96013f21bbb5003b30da1e04833dcf58650602 | fmoo/sparts,bboozzoo/sparts,facebook/sparts,pshuff/sparts,fmoo/sparts,djipko/sparts,bboozzoo/sparts,djipko/sparts,facebook/sparts,pshuff/sparts | freenoted/tasks/tornado_thrift.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test a weighted affine solver.\n\n\nFormer-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport sys\n\nsys.path.append('../lib')\nimport transformations\n\nv0 = [[... | python | new_file | 5 | 0 | mit | 9dab373023fa6b7767cd7555a533161752205eda | UASLab/ImageAnalysis | scripts/0-weighted-affine.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 554. Brick Wall\n\n554. Brick Wall: https://leetcode.com/problems/brick-wall/\n\nApproach1:\n O(n_brick * log(n_row)) Use heap to find the least length of accumulated row\n and find how many rows can match such leng... | python | new_file | 4 | 7 | apache-2.0 | 7b179e4a420a3cd7a27f0f438a6eac462048bb93 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/brick-wall.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flare.struc import Structure\nfrom typing import List\nfrom json import dump, load\nfrom flare.util import NumpyEncoder\n\ndef md_trajectory_to_file(filename, structures: List[Structure]):\n\t\"\"\"\n\tTake a list of structures and wri... | python | edit | 1 | 2 | mit | 39b63523634801fe8ef2cca03e11b3875d84cdbd | mir-group/flare,mir-group/flare | flare/flare_io.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic class structure, map functionality, and a set of consumer functions."
},
{
"role": "assistant",
"content": "class pStream:\n###PRIVATE FUNCTIONS\n\n def _builder(self, expression):\n self.STR = expression\n ... | python | new_file | 1 | 2 | mit | e53a951ed98f460b603f43f6364d5d0a0f17a1ba | caffeine-potent/Streamer-Datastructure | src/streamer.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Timelapse script for sunrise timelapses"
},
{
"role": "assistant",
"content": "import sys\nimport time\nfrom goprocam import GoProCamera, constants\nimport threading\nimport logging\n\n\"\"\"\nI use PM2 to start my GoPro came... | python | new_file | 3 | 1 | mit | cb0d6124ea31e8fb9ff8957072a2b881b882127e | KonradIT/gopro-py-api,KonradIT/gopro-py-api | examples/hero9_timelapse_webcam.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add LeNet example with custom scoring and train_samples_per_iteration."
},
{
"role": "assistant",
"content": "from __future__ import print_function\nimport sys, os\nsys.path.insert(1, os.path.join(\"..\",\"..\",\"..\"))\nimport h... | python | new_file | 1 | 1 | apache-2.0 | 797249c42c8c1c0d6eda05dbf9e9d16d2706b373 | mathemage/h2o-3,h2oai/h2o-3,spennihana/h2o-3,spennihana/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,h2oai/h2o-3,mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-dev,michalkurka/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,spe... | h2o-py/tests/testdir_algos/deepwater/pyunit_lenet_deepwater.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Introduce a timer based update of activities"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n... | python | new_file | 5 | 23 | bsd-2-clause | 8cdbbbaf33cd09bc742761ce8cd5b79b185710cd | wodo/WebTool3,wodo/WebTool3,wodo/WebTool3,wodo/WebTool3 | webtool/server/management/commands/timer_update.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create the converter (with span-conversion functionality)"
},
{
"role": "assistant",
"content": "\"\"\"\nA Very simple tool to convert latex documents to markdown documents\n\"\"\"\nimport re\n\n\nspan_substitutions = [\n ... | python | new_file | 1 | 2 | mit | 779fb015913a17fcb8fb290515845e6b47c3ae50 | jladan/latex2markdown | latex2markdown.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Remove duplicates in all subdirectories - working raw version."
},
{
"role": "assistant",
"content": "import hashlib, csv, os\n\ndef md5(fname):\n hash_md5 = hashlib.md5()\n with open(fname, \"rb\") as f:\n for chunk... | python | new_file | 1 | 3 | apache-2.0 | 23138ab91e5ac0ecf92a0968bf8e4abfa7d0c763 | alprab/utils | removedups.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test api endpoint for package show"
},
{
"role": "assistant",
"content": "import pytest\nimport tempfile\n\nfrom ckan import model\nfrom ckan import plugins\nfrom ckan.tests import factories\nimport ckan.tests.helpers as helpers\... | python | new_file | 1 | 1 | mit | 99395e345f74bbedd29fd45eebe0738a3b5f4729 | ckan/ckanext-archiver,ckan/ckanext-archiver,ckan/ckanext-archiver | ckanext/archiver/tests/test_api.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add retrieve_all_pages util method from mtp-cashbook\n\nThis method is duplicated in functionality in multiple\nfront end apps."
},
{
"role": "assistant",
"content": "from django.conf import settings\n\n\ndef retrieve_all_pages(a... | python | new_file | 1 | 3 | mit | 6014dab06ed2275c5703ab9f9e63272656733c69 | ministryofjustice/django-utils,ministryofjustice/django-utils | moj_utils/rest.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file to test out kmc approach. Dump training k-mers to fasta file"
},
{
"role": "assistant",
"content": "# This code will test out the idea of using kmc to\n# 1. quickly enumerate the k-mers\n# 2. intersect these with the tra... | python | new_file | 1 | 0 | bsd-3-clause | d2bcba204d36a8ffd1e6a1ed79b89fcb6f1c88c5 | dkoslicki/CMash,dkoslicki/CMash | ideas/test_kmc.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple script for looking at connections."
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nfrom __future__ import print_function, division\n\nimport networkx\n\nfrom reddit_meatspace.models import MeetupConnectio... | python | new_file | 1 | 0 | bsd-3-clause | f02f8f5a68bd26d1ece32c50482729b7774b6e2a | reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace | scripts/simple-analysis.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Save error_message for resources (SAAS-982)"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migra... | python | new_file | 1 | 0 | mit | a3a48824b36ef62edaf128379f1baec5482166e7 | opennode/nodeconductor-saltstack | src/nodeconductor_saltstack/migrations/0005_resource_error_message.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple CLI script for writing out results of scripts"
},
{
"role": "assistant",
"content": "#!/usr/bin/python\n\nimport os\nimport sys\nimport json\nsys.path.append(os.path.abspath(\"..\"))\nos.environ['DJANGO_SETTINGS_MODU... | python | new_file | 4 | 1 | apache-2.0 | 4651e178ddbeac9211f8170e2e20f8a35ff0e3ab | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | ocradmin/plugins/test_nodetree.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add beginning of main script"
},
{
"role": "assistant",
"content": "#!env /usr/bin/python3\n\nimport sys\nimport urllib.parse\nimport urllib.request\n\ndef main():\n search = sys.argv[1]\n url = 'http://rarbg.to/torrents.ph... | python | new_file | 3 | 1 | mit | c675fe2a82733ef210bf287df277f8ae956a4295 | jadams/rarbg-get | rarbg-get.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add native code emitters example."
},
{
"role": "assistant",
"content": "import time\n\n@micropython.asm_thumb\ndef asm():\n movw(r0, 42)\n\n@micropython.viper\ndef viper(a, b):\n return a + b\n\n@micropython.native\ndef na... | python | new_file | 8 | 1 | mit | 6693172856655329d99f038d54b1d8819fc1a9b6 | kwagyeman/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv | scripts/examples/02-Board-Control/native_emitters.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add `issubset` and `issuperset` tests"
},
{
"role": "assistant",
"content": "# (c) 2016, Ansible, Inc\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms ... | python | new_file | 1 | 1 | mit | 02ad029840b2e770bc802fd7f8504498cb0f756d | thaim/ansible,thaim/ansible | lib/ansible/plugins/test/mathstuff.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for masking of data based on being within a range of values"
},
{
"role": "assistant",
"content": "import unittest\n\nimport numpy as np\n\nimport yatsm._cyprep\n\n\nclass TestCyPrep(unittest.TestCase):\n\n @classmet... | python | new_file | 1 | 2 | mit | bf86584829f56f91b363f251d77f3157f952db0f | ceholden/yatsm,c11/yatsm,jmorton/yatsm,valpasq/yatsm,ceholden/yatsm,valpasq/yatsm,jmorton/yatsm,c11/yatsm,jmorton/yatsm | tests/test_cyprep.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add file for Nongrammar entities tests"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom unittest import ma... | python | new_file | 4 | 0 | mit | 26ab37868e67b5b815cf8df67cc04876ff44c148 | PatrikValkovic/grammpy | tests/rules_tests/isValid_tests/NongrammarEntitiesTest.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add in a minor testcase."
},
{
"role": "assistant",
"content": "# Copyright (c) Paul R. Tagliamonte <<EMAIL>>, 2015\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associ... | python | new_file | 2 | 2 | mit | 4e3644234fab9cb14a3d511b24bce3ed8a1446e0 | paultag/python-muse | tests/scales/test_minor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an example of using fchollet multi_gpu_model on InceptionV3.\n\nAdapted from Keras example - parameterized number of GPUs, fixed imports,\ndifferent model class, fixed device placement for single GPU."
},
{
"role": "assistant",
... | python | new_file | 1 | 0 | mit | 1bb1ececfcd548d52a28b713f4ee7eb4e710da85 | rossumai/keras-multi-gpu,rossumai/keras-multi-gpu | keras_tf_multigpu/examples/fchollet_inception3_multigpu.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for filesystem observer source"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# pylint: disable=too-many-public-methods\n\n\"\"\"\nIntegration tests for spreadflow filesystem observer source.\n\"\"... | python | new_file | 1 | 1 | mit | acc5c52011db4c8edc615ae3e0cad9cea4fe58b8 | znerol/spreadflow-observer-fs,spreadflow/spreadflow-observer-fs | spreadflow_observer_fs/test/test_source.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement division using built in library function"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"Support Library for builtin Functionality\"\"\"\n\n__author__ = \"Jon Dawson\"\n__copyright__ = \"Copyright (C... | python | new_file | null | null | mit | 7bd6f3e7751deecfc3cd555fc071d722c856802c | dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0 | chips/compiler/builtins.py | rejected_code_smell | Internal duplication: ~57% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple sampler for playing wav files triggered by note on messages"
},
{
"role": "assistant",
"content": "import time\nimport wave\nimport pygame\nimport numpy\nimport Axon\nfrom Axon.SchedulingComponent import SchedulingCo... | python | new_file | 4 | 10 | apache-2.0 | fa3a02e6660ce556defc2f2c6008c6eb24eb71c1 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Sampler.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migration to add userprofiles to existing users\n\nAll existing users on staging/production will be users of the Pollination Mapper app.\n\nRefs #290"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __futu... | python | new_file | 5 | 2 | apache-2.0 | 9a6ca54f7cca0bd5f21f0bc590a034e7e3e05b6e | project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app | src/icp/apps/user/migrations/0002_add_userprofiles_to_existing_users.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for using the new Entity ID tracking in the rule matcher"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\nimport spacy\nfrom spacy.vocab import Vocab\nfrom spacy.matcher import Matcher\nfr... | python | new_file | 6 | 1 | mit | e838b6d53f131badfbb7b51b4eb268ebb5d7c450 | banglakit/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,raphael0202/spaCy,aikramer2/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,banglakit/spaCy,raphael0202/spaCy,honnibal/spaCy,banglakit/spaCy,raphael0202/spaCy,recognai/spaCy,spacy-io/spaCy,oroszgy/spaCy.hu,raphael0202/spaCy,b... | spacy/tests/matcher/test_entity_id.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: ADD PyGrid SetupService message tests"
},
{
"role": "assistant",
"content": "# syft absolute\nimport syft as sy\nfrom syft.core.io.address import Address\nfrom syft.grid.messages.setup_messages import CreateInitialSetUpMessage\nf... | python | new_file | 1 | 1 | apache-2.0 | 67596d081059a004e5f7ab15f7972773fdf2f15e | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | tests/syft/grid/messages/setup_msg_test.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python script to get group and module given a class name"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\"\"\" Given the path to the ITK Source Dir\nprint group and module of a given class\n\nfor instance, tr... | python | new_file | 5 | 0 | apache-2.0 | 6f8c64ed6f99493811cab54137a1eed44d851260 | InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples | scripts/GetGroupAndModuleFromClassName.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for bubble sort"
},
{
"role": "assistant",
"content": "import unittest\n\nfrom aids.sorting_and_searching.bubble_sort import bubble_sort\n\nclass BubbleSortTestCase(unittest.TestCase):\n '''\n Unit tests for ... | python | new_file | 1 | 1 | mit | 54ca48a2b8cbd53cd6506fdbce47d16f03a28a7d | ueg1990/aids | tests/test_sorting_and_searching/test_bubble_sort.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for custom authentication backend"
},
{
"role": "assistant",
"content": "\"\"\"logintokens app unittests for backends\n\n\"\"\"\nfrom time import sleep\n\nfrom django.test import TestCase, Client\nfrom django.contrib.au... | python | new_file | 1 | 1 | mit | 8c7fc2382db0ec9c901f6c2c2b00971f3ee7c3cc | randomic/aniauth-tdd,randomic/aniauth-tdd | logintokens/tests/test_backends.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for form mixin."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nfrom django.test import TestCase\nfrom django import forms\nfrom mock import patc... | python | new_file | 1 | 1 | apache-2.0 | 5273a97ab1da4b809573617d3fc01705c322992f | thecut/thecut-authorship | thecut/authorship/tests/test_forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for template tags"
},
{
"role": "assistant",
"content": "from datetime import datetime\n\nfrom django.test import TestCase\n\nfrom geotrek.authent.tests.factories import UserFactory, UserProfileFactory\nfrom geotrek.fee... | python | new_file | 1 | 1 | bsd-2-clause | 478072e8350d03655364ea9147bbe21bafabbcce | makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | geotrek/feedback/tests/test_template_tags.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for ansible roster virtual"
},
{
"role": "assistant",
"content": "import pytest\nimport salt.roster.ansible as ansible\nfrom tests.support.mock import patch\n\n\n@pytest.mark.xfail\n@pytest.mark.parametrize(\n \"whic... | python | new_file | 1 | 1 | apache-2.0 | 48da7ceb86387d3cb6fd53f50110232813123ecc | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/pytests/unit/roster/test_ansible.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Increase event image url limit from 200"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2017-09-05 11:08\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations... | python | new_file | 1 | 0 | mit | 8355cb358d14589a194926d37beeb5af7af2a591 | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | falmer/events/migrations/0012_auto_20170905_1208.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test case for regular extrusion"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\"\"\"Creates regular cube mesh by extrusion.\n\"\"\"\nimport pygmsh\n\nfrom helpers import compute_volume\n\n\ndef test():\n ... | python | new_file | 1 | 1 | bsd-3-clause | a16b4401f37f08d8cb5e1f9ec1b7d4a3221360ab | nschloe/python4gmsh | test/test_regular_extrusion.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a new Model-View-Projection matrix tool."
},
{
"role": "assistant",
"content": "# -*- coding:utf-8 -*- \n\n# ***************************************************************************\n# Transfor... | python | new_file | 2 | 0 | mit | fe145fd87db777d9eeb361688d502b1b3ec4b2e1 | microy/MeshToolkit,microy/PyMeshToolkit,microy/MeshToolkit,microy/PyMeshToolkit | Transformation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.\n\nBased on https://github.com/mikem23/keepalive-race\n\nChange-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b"
},
{
"role": "assistant",
"content": "#!/usr/bin/... | python | new_file | 1 | 6 | apache-2.0 | 805708048f493ca538a9e0b8d9d40ae1d4baf2c3 | JordanP/openstack-snippets,JordanP/openstack-snippets | keepalive-race/keep-alive-race.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2013 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\nfrom telemetry import test\n\nfrom perf_tools import page_cycler\n\n\nclass... | python | edit | 1 | 1 | bsd-3-clause | c3afc6c28530c3dfc3bd57d9a1841a60bf92ba4f | mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,littlstar/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/ch... | tools/perf/benchmarks/netsim_top25.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test module for napalm_acl"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Anthony Shaw <<EMAIL>>`\n'''\n\n# Import Python Libs\nfrom __future__ import absolute_import\n\n# Import... | python | new_file | 1 | 1 | apache-2.0 | 40431228c8535f325b005bb52485cae87a8be714 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/modules/test_napalm_acl.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the basic version of my file comparison script"
},
{
"role": "assistant",
"content": "#! /usr/env/python\nimport os\nimport hashlib\nimport sys\n\nbufsize = 65536\n# Path1 = '/Users/kirkchambers/Desktop'\n# Path2 = '/Users/ki... | python | new_file | 5 | 4 | mit | 59e546ae5afe22aab967e5376c8799e29ccbd86a | kirkchambe/random_scripts | directoryFileContentCmp.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for PyEcore extension (EClass/EModelElement tests)"
},
{
"role": "assistant",
"content": "import pytest\nfrom pyecore.ecore import *\nimport pyecore.ecore as ecore\nfrom ordered_set import OrderedSet\n\n\ndef test__EMod... | python | new_file | 16 | 1 | bsd-3-clause | 68dbfedf90fb9e6c922971deaeccad148a258a70 | aranega/pyecore,pyecore/pyecore | tests/test_dynamic_ecore_extension.py | rejected_lint | Too many lint violations: 16 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to update site setup which is used at places like password reset email [skip ci]"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom django.contrib.sites.model... | python | new_file | 1 | 6 | bsd-3-clause | 5114f177741b105f33819b98415702e53b52eb01 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/hqadmin/management/commands/update_site_setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add new file missed in earlier commit place holder for projects that do not load for some reason"
},
{
"role": "assistant",
"content": "'''\n ====================================================================\n Copyright (c) 20... | python | new_file | 1 | 2 | apache-2.0 | 841fb156fff3d257d39afdc9d3d4e587427fe2cf | barry-scott/git-workbench,barry-scott/scm-workbench,barry-scott/scm-workbench,barry-scott/git-workbench,barry-scott/scm-workbench | Source/Scm/wb_scm_project_place_holder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Fix loading of ply files exported by meshlab"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nfrom pathlib import Path\n\n\"\"\"Code for comparing point clouds\"\"\"\n\ncloud1Path = Path(\"./data/reconstructions/2... | python | new_file | 1 | 0 | mit | 8b4c34e84d306b5f9021de47bc3ae9050e2fc2b3 | drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark | compare_clouds.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make color emoji use character sequences instead of PUA.\n\nThe bitmap emoji tools are extended to create GSUB rules for character\nsequences. The images are renamed to code the character sequence in their\nfilenames. New images are create... | python | new_file | 1 | 7 | apache-2.0 | cc79ee252e09ade17961d03265c61a87e270bd88 | davelab6/nototools,anthrotype/nototools,pathumego/nototools,googlei18n/nototools,davelab6/nototools,pahans/nototools,moyogo/nototools,googlefonts/nototools,namemealrady/nototools,googlei18n/nototools,moyogo/nototools,dougfelt/nototools,googlefonts/nototools,pahans/nototools,googlei18n/nototools,googlefonts/nototools,da... | nototools/map_pua_emoji.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\nfrom integration.ggrc.converters import TestCase\n\nfrom ggrc import models\n\n\nclass TestImportUpdates(TestCase):\n\n \"\... | python | edit | 1 | 1 | apache-2.0 | 3adcefcad4fc3ecb85aa4a22e8b3c4bf5ca4e6f5 | edofic/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,jo... | test/integration/ggrc/converters/test_import_update.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add task that sends out notifications"
},
{
"role": "assistant",
"content": "from django.utils import timezone\n\nfrom .models import ReminderRequest, EmailReminder\n\n\ndef send_todays_notifications(self):\n today = timezone.... | python | new_file | 1 | 3 | mit | e5a39d4e17a0555cb242731b34f0ee480367b4fe | stefanw/foireminder,stefanw/foireminder | foireminder/foireminder/reminders/tasks.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 563. Binary Tree Tilt\n\n563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/"
},
{
"role": "assistant",
"content": "# Definition for a binary tree node.\n# class TreeNode(object):\n# def... | python | new_file | 1 | 2 | apache-2.0 | d1ee86414d45c571571d75434b8c2256b0120732 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/binary-tree-tilt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for contact success view."
},
{
"role": "assistant",
"content": "from django.test import RequestFactory\nfrom django.urls import reverse\n\nfrom contact.views import SuccessView\n\n\nclass TestSuccessView(object):\n \... | python | new_file | 1 | 1 | mit | 0c29b431a0f5ce9115d7acdcaaabbd27546949c6 | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | chmvh_website/contact/tests/views/test_success_view.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add directory for tests of rules removin"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 17.08.2017 22:06\n:Licence GNUv3\nPart of grammpy\n\n\"\"\""
}
] | python | new_file | 1 | 0 | mit | c58c58d5bf1394e04e30f5eeb298818558be027f | PatrikValkovic/grammpy | tests/rules_tests/clearAfterNonTermRemove/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create script for generating analysis seeds."
},
{
"role": "assistant",
"content": "import yaml\nimport sys\nimport numpy as np\nfrom astropy.table import Table\nfrom astropy.coordinates import SkyCoord\nfrom fermipy.catalog impo... | python | new_file | 4 | 2 | bsd-3-clause | d40fb122d7083b9735728df15120ed682431be79 | woodmd/haloanalysis,woodmd/haloanalysis | scripts/make_fhes_seeds.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python EC2 TerminateInstances example\n\nMerge pull request #504 from awsdocs/scalwas_ec2"
},
{
"role": "assistant",
"content": "# snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]\n# snip... | python | new_file | 1 | 3 | apache-2.0 | e48caa4bb61cce466ad5eb9bffbfba8e33312474 | 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/ec2/terminate_instances.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up test suite to ensure server admin routes are added."
},
{
"role": "assistant",
"content": "\"\"\"General functional tests for the API endpoints.\"\"\"\n\n\nfrom django.test import TestCase, Client\n# from django.urls impor... | python | new_file | 3 | 2 | apache-2.0 | 2fa7855de542bb5ecd303e26d1e9913687478589 | sheagcraig/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,salopensource/sal | server/tests/test_admin.py | rejected_duplicate | Near-duplicate of sample 7290 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic test for checking messages are received correctly"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom m2u.ue4 import connection\n\n\ndef test_send_message_size():\n \"\"\"Send a big message, larger than buff... | python | new_file | 3 | 1 | mit | 925ff38344b5058ce196877e1fdcf79a1d1f6719 | m2u/m2u | ue4/tests/test_messaging.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test capturing bad implementation of contains handler."
},
{
"role": "assistant",
"content": "from pmxbot import core\n\ndef test_contains_always_match():\n\t\"\"\"\n\tContains handler should always match if no rate is specif... | python | new_file | 1 | 1 | bsd-3-clause | 645507ed9ec43b354880673fbc75afe169ef6697 | jawilson/pmxbot,jawilson/pmxbot | tests/unit/test_handlers.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to split data with partitions."
},
{
"role": "assistant",
"content": "import csv;\nimport random;\nimport sys;\n\nin_file = str(sys.argv[1])\nout_file = str(sys.argv[2])\nnum_partitions = int(sys.argv[3])\n\nheader =... | python | new_file | 3 | 0 | mit | f7e4ca11c7bfc35bf0fd6becd2a5d5fdd2ca5ed5 | juckele/ddr-grader,juckele/ddr-grader | src/main/python/partition_data.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.