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: Attach LTOP as the attribute and remove index"
},
{
"role": "assistant",
"content": "\ndef handle_ltop_links(dmrs_xml):\n '''\n Remove LTOP links from DMRS and add LTOP attribute to the DMRS entity\n :param dmrs_xml: Inp... | python | new_file | 1 | 5 | mit | 04c692ca4b6045a49b76dab46847bc058adbdacd | matichorvat/pydmrs | dmrs_preprocess/handle_ltop.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 594. Longest Harmonious Subsequence\n\n594. Longest Harmonious Subsequence: https://leetcode.com/problems/longest-harmonious-subsequence/"
},
{
"role": "assistant",
"content": "from collections import Counter\... | python | new_file | 1 | 3 | apache-2.0 | 23f8cee3b11c839216f9ef7621fbcc039a4e57be | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/longest-harmonious-subsequence.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 521. Longest Uncommon Subsequence I\n\n521. Longest Uncommon Subsequence I: https://leetcode.com/problems/longest-uncommon-subsequence-i/"
},
{
"role": "assistant",
"content": "class Solution(object):\n def... | python | new_file | 1 | 2 | apache-2.0 | 555c5ce53f454d538701c56628749b3e9f363034 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/longest-uncommon-subsequence-i.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a management command to send a statsd message\n\n(imported from commit 25ead4a0dee185a139eb5401e109c9cbe937c7bf)"
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand\nfrom django.conf imp... | python | new_file | 2 | 3 | apache-2.0 | 29ad205b01a45b87d939c8bebb3c2d92ef98f6cb | hayderimran7/zulip,Drooids/zulip,Gabriel0402/zulip,levixie/zulip,dxq-git/zulip,PhilSk/zulip,yocome/zulip,esander91/zulip,aliceriot/zulip,eeshangarg/zulip,codeKonami/zulip,tommyip/zulip,jeffcao/zulip,mohsenSy/zulip,hafeez3000/zulip,jonesgithub/zulip,hengqujushi/zulip,JPJPJPOPOP/zulip,synicalsyntax/zulip,adnanh/zulip,tom... | zephyr/management/commands/send_stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Raspberry PI Alexa control server"
},
{
"role": "assistant",
"content": "from flask import Flask\nfrom flask_ask import Ask, statement, convert_errors\nimport logging\nfrom rfsend import rf_send\n\nGPIO.setmode(GPIO.BCM)\n\na... | python | new_file | 5 | 4 | bsd-3-clause | c29ec289d8fe252aa8fd8d913abb3f1bd263eab1 | kbsezginel/raspberry-pi,kbsezginel/raspberry-pi,kbsezginel/raspberry-pi,kbsezginel/raspberry-pi | scripts/web-server/alexa-pi.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: attachment: Add migration to fix duplicate attachment objects.\n\nThe comment in the migration explains this change in detail."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-0... | python | new_file | 4 | 5 | apache-2.0 | 0f855b84ccd7e0c1b068b56540f36ac02dca4b66 | eeshangarg/zulip,ryanbackman/zulip,synicalsyntax/zulip,SmartPeople/zulip,dhcrzf/zulip,shubhamdhama/zulip,zulip/zulip,rishig/zulip,shubhamdhama/zulip,rht/zulip,punchagan/zulip,jrowan/zulip,timabbott/zulip,brainwane/zulip,jackrzhang/zulip,vaidap/zulip,rishig/zulip,rishig/zulip,rht/zulip,jackrzhang/zulip,rishig/zulip,punc... | zerver/migrations/0074_fix_duplicate_attachments.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for subresource documentation"
},
{
"role": "assistant",
"content": "# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n... | python | new_file | 1 | 1 | apache-2.0 | b8bb7aef7371f52f53f5871b9e27375c39aced97 | boto/boto3 | tests/unit/docs/test_subresource.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add rudimentary smoke test for hearing admin"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nimport pytest\nfrom django.contrib import admin\nfrom django.core.urlresolvers import reverse\n\n\n@pytest.mark.django_d... | python | new_file | 4 | 1 | mit | 244068d0689973ff462b455ac8db849b0839e694 | vikoivun/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi | democracy/tests/test_hearing_admin.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: <EMAIL>\n# Maintained By: <EMAIL>\n\nscope = \"Audit\"\ndescriptio... | python | edit | 1 | 0 | apache-2.0 | 086351fb56e2c777bcd6b332c1550acb46fc6fa6 | edofic/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,AleksNeStu/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,edofic/... | src/ggrc_basic_permissions/roles/Auditor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a script to calibrate PID"
},
{
"role": "assistant",
"content": "from LLD import *\nimport csv\n\nSAMPLING_PERIOD = 15\nMAX_DUTY = 1800/3200\nlld = LLD()\n\n\nclass Fake_Tank(object):\n\n def __init__(self, name):\n ... | python | new_file | 6 | 1 | mit | 7847b0dab326110ffa834fc35e98f8b9e3fef3e3 | flagos/pico-brewUI,flagos/pico-brewUI,flagos/pico-brewUI,flagos/pico-brewUI,flagos/pico-brewUI | PID_determine_coef.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add task for running fsx on an rbd image."
},
{
"role": "assistant",
"content": "import contextlib\nimport logging\n\nfrom ..orchestra import run\nfrom teuthology.parallel import parallel\n\nlog = logging.getLogger(__name__)\n\n@... | python | new_file | 3 | 2 | mit | e875b89f9370da901d72d4bb7b0cc581cde541de | robbat2/teuthology,zhouyuan/teuthology,dreamhost/teuthology,SUSE/teuthology,SUSE/teuthology,ivotron/teuthology,tchaikov/teuthology,tchaikov/teuthology,t-miyamae/teuthology,ceph/teuthology,ceph/teuthology,zhouyuan/teuthology,ktdreyer/teuthology,yghannam/teuthology,ktdreyer/teuthology,robbat2/teuthology,dmick/teuthology,... | teuthology/task/rbd_fsx.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add solution to lintcode question 182"
},
{
"role": "assistant",
"content": "class Solution:\n \"\"\"\n @param A: A positive integer which has N digits, A is a string.\n @param k: Remove k digits.\n @return: A string\... | python | new_file | 3 | 9 | mit | f6572a125d8129cdf22ea8a1f5e60416d10b3f5b | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | lintcode/Medium/182_Delete_Digits.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for qisrc reset\n\nChange-Id: I6d009b46aefc53c7eca18d77225796614d200d10"
},
{
"role": "assistant",
"content": "# this is only used on buildfarm, so only test this\nimport pytest\n\nimport qisrc.snapshot\n\ndef test_res... | python | new_file | 3 | 1 | bsd-3-clause | 6d42f4c26550486af6caa1ee74475d051af18940 | dmerejkowsky/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild | python/qisrc/test/test_qisrc_reset.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a binary to convert model to tflite supported foramt.\n\nPiperOrigin-RevId: 302497553"
},
{
"role": "assistant",
"content": "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache Licens... | python | new_file | 1 | 1 | apache-2.0 | 6a767b028647220199bd90c1b26226802a089a6f | tensorflow/tpu,tensorflow/tpu,tensorflow/tpu,tensorflow/tpu | models/official/detection/export_tflite_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add template loader for clients"
},
{
"role": "assistant",
"content": "from django.template.loader import BaseLoader\nfrom django.db import connection\nfrom django.conf import settings\nfrom django.core.exceptions import Improper... | python | new_file | 1 | 8 | bsd-3-clause | a1531197784cce0222720581a3bc47cd7b83e0ca | jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/utils/template_loaders.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to export hashtags counts, user tweet counts, etc."
},
{
"role": "assistant",
"content": "\"\"\"\nSome really simple export scripts.\n\n\"\"\"\nfrom __future__ import unicode_literals\n\nimport io\nimport iterutils\nim... | python | new_file | 1 | 4 | unlicense | 429cf2018a5480e7a2ab083b95bfe74d3cc8bfcb | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | scripts/exports.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unittests for bridgedb.util module."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# This file is part of BridgeDB, a Tor bridge distribution system.\n#\n# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <<EMA... | python | new_file | 1 | 1 | bsd-3-clause | 739cca47c700a3a5965465c958297eee2de8f8b6 | mmaker/bridgedb,pagea/bridgedb,mmaker/bridgedb,pagea/bridgedb | lib/bridgedb/test/test_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add line position to TSV file."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\n\nimport csv\nfrom itertools import tee\n\nimport nltk\n\n\nMATCH_FILE = 'data/6705bigrams-PopewDryden.txt'\nOUTPUT_FILE = 'data/6705b... | python | new_file | 1 | 4 | apache-2.0 | b732ea4bd64a05c7d75ddbce0925d5402142c67d | erochest/c18sgml | scripts/add_pos.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest2\n\nfrom ..plugins import prof\nfrom ._common import Stub, FakeStartTestRunEvent\n\n\nclass TestProfPlugin(unittest2.TestCase):\n tags = ['unit']\n\n def setUp(self):\n self.plugin = prof.Profiler()\n sel... | python | edit | 1 | 1 | bsd-2-clause | 5babccca12e1cbef655957b038594eadb1fe63bc | ojengwa/nose2,ezigman/nose2,leth/nose2,ptthiem/nose2,leth/nose2,little-dude/nose2,ptthiem/nose2,ezigman/nose2,little-dude/nose2,ojengwa/nose2 | nose2/tests/unit/test_prof_plugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Disable tv through raspberry pi's cec interface."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport cec # from python-cec\nimport os.path\nimport time\n\ncec.init()\n\nfor adress, device in cec.list_devic... | python | new_file | 4 | 0 | mit | 7b4b07dddccfe11dd42aa3613c68acc2939bef41 | vlimit/screenquota,vlimit/screenquota | src/screenquota.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2012-2013, Mark Peek <<EMAIL>>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty, Tags\nfrom .compat import policytypes\nfrom .validators import boolean\n\n\nclass Subsc... | python | edit | 10 | 0 | bsd-2-clause | 3b684eeadb0c8b39593b14c15233a314bbab0895 | cloudtools/troposphere,ikben/troposphere,ikben/troposphere,cloudtools/troposphere | troposphere/sns.py | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add better solution for simple cipher"
},
{
"role": "assistant",
"content": "import re\nimport time\nimport random\nrandom.seed(int(time.time()))\nlength = 100\nkeyinit = \"\".join([chr(random.randint(97,122)) for i in range(0,10... | python | new_file | 1 | 4 | mit | 7914c46189634e1c4abf713fc2c70fa81a72101d | always-waiting/exercism-python | simple-cipher/simple_cipher_better.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Set up shell argparser for sge module"
},
{
"role": "assistant",
"content": "import argparse\nimport textwrap\nfrom qstat import Qstat\n\n__author__ = 'Datasnakes'\n\nparser = argparse.ArgumentParser(\n formatter_class=arg... | python | new_file | 1 | 0 | mit | 14d223068e2d8963dfe1f4e71854e9ea9c194bc5 | datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts | Datasnakes/Tools/sge/qsubber.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add py solution for 501. Find Mode in Binary Search Tree\n\n501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/"
},
{
"role": "assistant",
"content": "# Definition for a binary tre... | python | new_file | 1 | 6 | apache-2.0 | c267818a28018a6f386c6f4d11eefc9987efe7bd | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/find-mode-in-binary-search-tree.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests around our new handling of exceptions"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You... | python | new_file | 1 | 1 | apache-2.0 | 903b448a5a6e8eb882fbfa7cb48fa9e17d7c21af | pypa/twine | tests/test_main.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Move LockFixture into a fixtures module\n\nIn Nova and other projects, fixtures are in test-requirements.txt and\nNOT in requirements.txt so updating nova to use latest lockutils.py\nis not possible. So let us move LockFixture out into it a ... | python | new_file | 1 | 1 | apache-2.0 | 210a9809eef6743107b459b91980158ea87e75dc | openstack/oslotest,openstack/oslotest | openstack/common/fixture/lockutils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) Ivan Kravets <<EMAIL>>\n# See LICENSE for details.\n\nimport atexit\nfrom os import remove\nfrom tempfile import mkstemp\n\nMAX_SOURCES_LENGTH = 8000 # Windows CLI has limit with command length to 8192\n\n\ndef _remove_tmpf... | python | edit | 1 | 2 | apache-2.0 | 21c60fdd99e37436228cfe8e59f1b8788ea2b58b | dkuku/platformio,mseroczynski/platformio,jrobeson/platformio,bkudria/platformio,awong1900/platformio,TimJay/platformio,TimJay/platformio,jrobeson/platformio,awong1900/platformio,awong1900/platformio,mcanthony/platformio,TimJay/platformio,ZachMassia/platformio,platformio/platformio-core,TimJay/platformio,platformio/plat... | platformio/builder/tools/pioar.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Read in python dependency graph and clean up"
},
{
"role": "assistant",
"content": "# IPython log file\n\n\nimport itertools as it\nwith open('pypi-deps.txt', 'r') as fin:\n lines = fin.readlines()\n edges = [line.rstrip().... | python | new_file | 1 | 0 | bsd-3-clause | 623cdce39e1a14a2cbd80f116ab7e709c469e891 | jni/useful-histories | read-python-dependency-graph.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Indonesia weights as migration"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nfrom django_countries import countries\n\ndef populat... | python | new_file | 3 | 3 | apache-2.0 | a88d9181497ac18a3905e33664e1642e68b192f8 | Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp | reports/migrations/0003_indonesia-weights.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add SQS visibility timeout message example"
},
{
"role": "assistant",
"content": "# Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\... | python | new_file | 1 | 0 | apache-2.0 | 8e59e994370749db03ffda32bc449049c49a3f22 | awsdocs/aws-doc-sdk-examples,imshashank/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,imshashank/aws-doc-sdk-exam... | python/example_code/sqs/change_visibility.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for dummy violation"
},
{
"role": "assistant",
"content": "from django.test import TestCase\nfrom tasks.const import STATUS_SUCCESS\nfrom ..dummy import dummy_violation\n\n\nclass DummyViolationCase(TestCase):\n \"\"\... | python | new_file | 1 | 1 | mit | d3ab1bb80945f8ebf6c16620e5629f497bdc5a17 | nvbn/coviolations_web,nvbn/coviolations_web | violations/tests/test_dummy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple test for the history page"
},
{
"role": "assistant",
"content": "from tests.conftest import SERVICE_ONE_ID\n\n\ndef test_history(\n client_request,\n mock_get_service_history,\n):\n client_request.get('main.... | python | new_file | 1 | 1 | mit | 8c7f9a8286d3d1b5172af2fdfb74d1f73756790b | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | tests/app/main/views/test_history.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing migration for DeviceRule"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.7 on 2017-04-20 15:47\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, m... | python | new_file | 1 | 0 | mit | bcd4ebd31f915825eb135420d56231e380589c5b | LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation | src/personalisation/migrations/0008_devicerule.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments."
},
{
"role": "assistant",
"content": "import torch\nimport torch.nn as nn\nimport torch.nn.func... | python | new_file | 3 | 1 | apache-2.0 | ba9c1108a15bac713e7bda987865f8c4c1db92c7 | rwightman/pytorch-image-models,rwightman/pytorch-image-models | timm/loss/binary_cross_entropy.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Bluetooth support. Still buggy but works. Mostly. If you are lucky."
},
{
"role": "assistant",
"content": "from time import sleep\nfrom bluetooth import *\n\nclass BluetoothDataSource:\n\tdef __init__(self, params):\n\t\tself... | python | new_file | 5 | 2 | mit | 88e4d0beaca3adc561fc624e4d878c90c2750a8f | Max-Might/Elmo-Scan | DataSources/BluetoothDataSource.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to ensure virtual webcam is running.\n\nThis script will check that a webcam is running and start it if it's\nnot currently running.\nIt's tailored to the way our buildbots are currently configured.\n\nTEST=local execution on Wind... | python | new_file | 4 | 6 | bsd-3-clause | 4be3afba45b39a77595d3db11db364f7f0f3c5c5 | Alkalyne/webrtctrunk,bpsinc-native/src_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,krieger-od/nwjs_chromium_webrtc,xin3liang/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_... | test/buildbot/ensure_webcam_is_running.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Implement the custom prefixes module"
},
{
"role": "assistant",
"content": "from twisted.plugin import IPlugin\nfrom twisted.python import log\nfrom txircd.module_interface import IMode, IModuleData, Mode, ModuleData\nfrom txircd... | python | new_file | 1 | 4 | bsd-3-clause | d88a793badccb506b6afd62cf8fdce846ef7fe94 | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/extra/customprefix.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add management command to export TCamp lobby day participants."
},
{
"role": "assistant",
"content": "from django.core.management.base import BaseCommand, CommandError\nfrom reg.models import *\n\nfrom optparse import make_option... | python | new_file | 2 | 14 | bsd-3-clause | 04c201a9db9eb2523febb81f5fc5601b2d86624e | sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp | tcamp/reg/management/commands/lobby_day_report.py | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add local settings template for local server instances.\n\n(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)"
},
{
"role": "assistant",
"content": "# Template for Django settings for the Zulip local servers\nimport ... | python | new_file | 1 | 0 | apache-2.0 | 391de2d5920b4ebb12d488715cec4ef6839208d3 | dawran6/zulip,amyliu345/zulip,arpitpanwar/zulip,brainwane/zulip,jphilipsen05/zulip,synicalsyntax/zulip,Drooids/zulip,PaulPetring/zulip,ericzhou2008/zulip,codeKonami/zulip,paxapy/zulip,wdaher/zulip,swinghu/zulip,so0k/zulip,aps-sids/zulip,Diptanshu8/zulip,moria/zulip,ikasumiwt/zulip,seapasulli/zulip,mansilladev/zulip,hac... | zproject/local_settings_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Python LinePlot Charts Test\n\nLargely a clone of the Cxx version save that the data arrays must\nbe manipulated directly since the vtkVariant based methods on vtkTable\naren't available to Python."
},
{
"role": "assistant",
... | python | new_file | 3 | 2 | bsd-3-clause | 711aab80991f236232d3d1247f694d16e8ac0c4d | ashray/VTK-EVM,berendkleinhaneveld/VTK,demarle/VTK,cjh1/VTK,collects/VTK,keithroe/vtkoptix,mspark93/VTK,gram526/VTK,SimVascular/VTK,spthaolt/VTK,msmolens/VTK,spthaolt/VTK,johnkit/vtk-dev,jeffbaumes/jeffbaumes-vtk,arnaudgelas/VTK,sumedhasingla/VTK,mspark93/VTK,ashray/VTK-EVM,biddisco/VTK,naucoin/VTKSlicerWidgets,jmerkow... | Charts/Testing/Python/TestLinePlot.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for connection change"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom sure import scenario\n\nfrom pyeqs import QuerySet\nfrom tests.helpers imp... | python | new_file | 1 | 1 | mit | b0243ac96d31693611cec20e60812739be92e3aa | Yipit/pyeqs | tests/functional/test_connection.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import Counter\n\n\n# TODO(tkaemming): This should probably just be part of `build_digest`.t\ndef get_digest_metadata(digest):\n start = None\n end = None\n\n counts = Counter()\n for rule, groups in digest.iter... | python | edit | 1 | 8 | bsd-3-clause | 36d23fb7a3353a621e177a044a6c64335e1a79fb | ifduyue/sentry,JamesMura/sentry,JackDanger/sentry,mvaled/sentry,BuildingLink/sentry,nicholasserra/sentry,BuildingLink/sentry,alexm92/sentry,gencer/sentry,beeftornado/sentry,JamesMura/sentry,alexm92/sentry,jean/sentry,nicholasserra/sentry,mvaled/sentry,JackDanger/sentry,ifduyue/sentry,BuildingLink/sentry,fotinakis/sentr... | src/sentry/digests/utilities.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example for the load and addid command"
},
{
"role": "assistant",
"content": "import asyncio\nimport sys\nimport ampdclient\n\n\n# This script demonstrates the lsinfo, addid and load command.\n# It can be called on with the h... | python | new_file | 1 | 5 | apache-2.0 | ded04b93d041a6b6274d7870ff2abea1fecea088 | PierreRust/ampdclient | examples/queue_mgt.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to convert (some of) hdf5 tracking data to csv"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nfrom os.path import join, splitext\nimport glob\n\nimport pandas a... | python | new_file | 3 | 2 | mit | 2a3c24b32e426e1cad65cdb72affeb81398f7b98 | tom-f-oconnell/multi_tracker,tom-f-oconnell/multi_tracker | scripts/hdf5_to_csv.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom openstack_site_pp_base import OpenStackSitePPBaseTestCase\nimport unittest\n\nclass OpenStackCase(OpenStackSitePPBaseTestCase):\n\n def test_deploy_open_stack(self):\n self.validate(\n [self.controller1,self.contro... | python | edit | 1 | 2 | apache-2.0 | e7ec8deb9fda8be9f85f1f26452646b6ddfe5367 | slystopad/fuel-lib,Metaswitch/fuel-library,zhaochao/fuel-library,eayunstack/fuel-library,huntxu/fuel-library,SmartInfrastructures/fuel-library-dev,SmartInfrastructures/fuel-library-dev,ddepaoli3/fuel-library-dev,zhaochao/fuel-library,eayunstack/fuel-library,Metaswitch/fuel-library,zhaochao/fuel-library,zhaochao/fuel-li... | fuel_test/test_openstack.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic unittest for espeak"
},
{
"role": "assistant",
"content": "import unittest\nfrom unittest import mock\n\nfrom mycroft.tts.espeak_tts import ESpeak\n\n\n@mock.patch('mycroft.tts.tts.PlaybackThread')\nclass TestMimic(unit... | python | new_file | 1 | 1 | apache-2.0 | 4d065ff7fe1aab53dee472bfa4138f19ddc6774c | forslund/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core | test/unittests/tts/test_espeak_tts.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to compare npm versions"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# This script compares the npm packages version in the Luxembourg\n# project with the ones in ngeo.\n# M... | python | new_file | 1 | 0 | mit | a216b64c9d4c156d4ef4342efa3b8203c89b13a5 | Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3 | compare_packages.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi"
},
{
"role": "assistant",
"content": "###############################################################################\n# SimpleWrapperPotential... | python | new_file | 1 | 12 | bsd-3-clause | a82f3a601d1f890913d933a528ddfe773e260c01 | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | galpy/potential_src/SimpleWrapperPotential.py | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add no-op migration to test deploys"
},
{
"role": "assistant",
"content": "\"\"\"No-op migration for testing deploys\n\nRevision ID: 3be4004781bc\nRevises: a0ee5e10f44b\nCreate Date: 2019-11-04 18:56:29.459718\n\"\"\"\n\nimport l... | python | new_file | 1 | 1 | apache-2.0 | 108e23f67e01edc98a98ea646d42137a1b49f255 | mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea | ichnaea/alembic/versions/3be4004781bc_noop.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple tests for models.Vault"
},
{
"role": "assistant",
"content": "import pytest\n\nfrom keybar.tests.factories.vault import VaultFactory\n\n\n@pytest.mark.django_db\nclass TestVault:\n\n def test_simple(self):\n ... | python | new_file | 1 | 1 | bsd-3-clause | 3cff7a8eb7dd1babeeb16da06239ad63d4f8c154 | keybar/keybar | src/keybar/tests/models/test_vault.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add problems for lesson 2"
},
{
"role": "assistant",
"content": "from core import test_helper\n\n# Question 1\n# ----------\n# Given a list of strings, return the count of the number of strings where the string length\n# is 2 or ... | python | new_file | 4 | 1 | mit | c56d00efdfe56c5854745ca282cc1a4df0b4cd6d | infoscout/python-bootcamp-pv | bootcamp/lesson2.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for the wrapper"
},
{
"role": "assistant",
"content": "# Licensed under an MIT open source license - see LICENSE\n\nfrom ..statistics import stats_wrapper\nfrom ._testing_data import \\\n dataset1, dataset2\n\n\ndef... | python | new_file | 3 | 1 | mit | 3d9c3c63758bf52b22be8c56a50a1cba2a441d12 | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/tests/test_wrapper.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ENH: Create file for the black box node"
},
{
"role": "assistant",
"content": "######################################################################\n# Copyright (C) 2015 Jaakko Luttinen\n#\n# This file is licensed under Version... | python | new_file | 4 | 2 | mit | 344a3b7277be9476d9d9e8cdbfc838bb3671b82f | SalemAmeen/bayespy,bayespy/bayespy,jluttine/bayespy,fivejjs/bayespy | bayespy/inference/vmp/nodes/pdf.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add simple scripts to plot frequencies."
},
{
"role": "assistant",
"content": "\"\"\"\nPlot user tweet activity.\n\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport twitterproj\n\ndef p... | python | new_file | 3 | 3 | unlicense | f0c2494aeec0040fab6276ba0ddbb0812d27e09a | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | scripts/plots.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper methods for commonly added commandline options for experiments\n\nSigned-off-by: Diana Guttman <<EMAIL>>"
},
{
"role": "assistant",
"content": "#\n# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation\... | python | new_file | 1 | 1 | bsd-3-clause | 4ebf68bc3ae22f39be6f7c0a260323648537e65c | geopm/geopm,cmcantalupo/geopm,cmcantalupo/geopm,cmcantalupo/geopm,geopm/geopm,geopm/geopm,cmcantalupo/geopm,geopm/geopm,geopm/geopm,cmcantalupo/geopm | integration/experiment/common_args.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n__version__ = '$Id$'\n\nfrom pywikibot import family\n\n# The wikidata family\n\n\nclass Family(family.WikimediaFamily):\n def __init__(self):\n super(Family, self).__init__()\n self.name = 'wiki... | python | edit | 1 | 4 | mit | a93ad6ce9a264a82717a37230e48ff00d9c642fc | magul/pywikibot-core,wikimedia/pywikibot-core,happy5214/pywikibot-core,jayvdb/pywikibot-core,Darkdadaah/pywikibot-core,trishnaguha/pywikibot-core,VcamX/pywikibot-core,hasteur/g13bot_tools_new,h4ck3rm1k3/pywikibot-core,hasteur/g13bot_tools_new,wikimedia/pywikibot-core,hasteur/g13bot_tools_new,PersianWikipedia/pywikibot-... | pywikibot/families/wikidata_family.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add trainer for fcn8s on apc2016"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport argparse\nimport os\nimport os.path as osp\n\nimport chainer\nfrom chainer import cuda\n\nimport fcn\n\nimport datasets\n\n\n... | python | new_file | 1 | 4 | mit | ff80cf04452c85ff0b93666feb867afa6e4d94f0 | wkentaro/fcn | examples/apc2016/train_fcn8s.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add audit foreign key to assessments and issues"
},
{
"role": "assistant",
"content": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"\nAdd audit FK to as... | python | new_file | 1 | 1 | apache-2.0 | d0dcdf7ed663f9909f2a8e889bb972c5731aef0f | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | src/ggrc/migrations/versions/20170302155757_2127ea770285_add_audit_fk_to_assessments_and_issues.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to find bad / outdated registrations"
},
{
"role": "assistant",
"content": "\"\"\"\n\n\"\"\"\n\nfrom website.app import init_app\nfrom website import models\nfrom framework import Q\n\napp = init_app()\n\nknown_schemas... | python | new_file | 3 | 5 | apache-2.0 | 9b4053dde1cd1baef2a71adbeb7ba1338a2b5093 | lamdnhan/osf.io,KAsante95/osf.io,jolene-esposito/osf.io,brianjgeiger/osf.io,SSJohns/osf.io,cwisecarver/osf.io,revanthkolli/osf.io,fabianvf/osf.io,GaryKriebel/osf.io,danielneis/osf.io,RomanZWang/osf.io,CenterForOpenScience/osf.io,petermalcolm/osf.io,HalcyonChimera/osf.io,kch8qx/osf.io,GageGaskins/osf.io,hmoco/osf.io,tic... | scripts/consistency/find_bad_registrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add --check-version to see if you are on latest release."
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals, division, absolute_import\nimport re\nfrom argparse import _VersionAction\n\nimport flexget\... | python | new_file | 1 | 3 | mit | ae580fb0dde2b6cce956733beb51dc4187183bab | dsemi/Flexget,tarzasai/Flexget,crawln45/Flexget,camon/Flexget,jawilson/Flexget,offbyone/Flexget,LynxyssCZ/Flexget,qvazzler/Flexget,ianstalk/Flexget,Danfocus/Flexget,grrr2/Flexget,cvium/Flexget,Flexget/Flexget,antivirtel/Flexget,ZefQ/Flexget,gazpachoking/Flexget,vfrc2/Flexget,qk4l/Flexget,tarzasai/Flexget,offbyone/Flexg... | flexget/plugins/cli/check_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add iteration over menu items"
},
{
"role": "assistant",
"content": "import json\nimport re\nfrom collections import defaultdict\n\ndef extract_ingredients_from_string(description):\n if description:\n cleaned_description = r... | python | new_file | 2 | 3 | mit | a6cbb7e0914afdebcb4a03078575e55ce86b3224 | keir/tastypair,keir/tastypair | extract_pairings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add android implementation of storage path"
},
{
"role": "assistant",
"content": "'''\nAndroid Storage Path\n--------------------\n'''\n\nfrom plyer.facades import StoragePath\nfrom jnius import autoclass\nfrom android import mAc... | python | new_file | 1 | 1 | mit | 2a8fe5b8293dc68628479f1223e2e564d7757b87 | kivy/plyer,kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,KeyWeeUsr/plyer | plyer/platforms/android/storagepath.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add first simple transformation tests"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n#\n# Tests Transform functions in Pints\n#\n# This file is part of PINTS (https://github.com/pints-team/pints/) which is\n# rele... | python | new_file | 3 | 3 | bsd-3-clause | 1094ba0a4ee9443e6317e7fba8db8e69f09cfaa3 | martinjrobins/hobo,martinjrobins/hobo,martinjrobins/hobo,martinjrobins/hobo | pints/tests/test_transformation.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add example that prints info on the CRAB service."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n'''\nThis script prints all available information on the CRAB webservice.\n'''\n\nfrom crabpy.client import crab_fa... | python | new_file | 2 | 0 | mit | a8c5aa8dba3a9c45ae5933ee53f895f0fa1b2c47 | OnroerendErfgoed/crabpy | examples/crab_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add profile script for comparisons"
},
{
"role": "assistant",
"content": "from firedrake import *\nimport sys\n\nparameters[\"pyop2_options\"][\"lazy_evaluation\"] = False\n\n\ndef is_intstring(s):\n try:\n int(s)\n ... | python | new_file | 36 | 2 | mit | 59e6ad7ce222ad04ba2da64aa6fa20ba0133fac9 | thomasgibson/tabula-rasa | cg-static-condensation/profile_cgsc.py | rejected_lint | Too many lint violations: 36 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test sending email with Pybossa Flask-Mail config."
},
{
"role": "assistant",
"content": "import argparse, sys\nfrom pybossa.core import create_app\nfrom flask_mail import Mail\nfrom flask_mail import Message\n\n\ni... | python | new_file | 2 | 0 | apache-2.0 | ba09c70dd02747cead96232a5b51c7b56a640df2 | Goodly/pybossa-build,Goodly/pybossa-build | docker/scripts/test-flask-mail-smtp.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add python test of importing Parquet files from S3"
},
{
"role": "assistant",
"content": "import h2o\nimport os\n\nfrom h2o.persist import set_s3_credentials\n\nfrom tests import pyunit_utils\nfrom pandas.testing import assert_fr... | python | new_file | 1 | 1 | apache-2.0 | e06642b2a3e679d9292bec6bd468d2cada2baf70 | h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3 | h2o-py/tests/testdir_persist/pyunit_import_s3_parquet.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add tests for cse for all supporting backends"
},
{
"role": "assistant",
"content": "from .. import Backend\nimport pytest\n\n\nbackends = []\nfor bk in Backend.backends.keys():\n try:\n _be = Backend(bk)\n except Im... | python | new_file | 1 | 2 | bsd-2-clause | 6db2328cee6d26d0db7a6abf4a58adb40b583799 | bjodah/sym,bjodah/sym | sym/tests/test_cse.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add single machine parallelism helper script"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python3\n\nimport argparse\nimport datetime\nimport multiprocessing\nimport os\nimport subprocess\nimport sys\nimport time\n\ndef ... | python | new_file | 3 | 8 | mit | 3481f5d11a0ff51c510e599bb3ff72ddff9be622 | AgalmicVentures/Environment,AgalmicVentures/Environment,AgalmicVentures/Environment | scripts/Parallelize.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add functional tests for volume qos\n\nChange-Id: I80010b56b399bc027ac864304be60a3ee53bda00"
},
{
"role": "assistant",
"content": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this ... | python | new_file | 1 | 1 | apache-2.0 | d82b1f9d7334c1cd976624788da785a87cd5db8a | openstack/python-openstackclient,redhat-openstack/python-openstackclient,BjoernT/python-openstackclient,BjoernT/python-openstackclient,openstack/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-openstackclient,dtroyer/python-openstackclient | functional/tests/volume/v1/test_qos.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to test webhooks\n\nSearching for the right curl commands through my shell history gets\ntedious. Let's add a bit of automation."
},
{
"role": "assistant",
"content": "#!/bin/env python3\n\n# Copyright 2016 Ruud van As... | python | new_file | 1 | 3 | apache-2.0 | 66f2a65ae393ffe1398c5d34f036940aebd170d3 | ruuda/hoff,ruuda/hoff | tools/send-webhook.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Make a special settings file for collectstatic\n\nThis is useful to minimize the services needed by a collectstatic container"
},
{
"role": "assistant",
"content": "# Settings used by containers running collectstatic. Scope our ... | python | new_file | 3 | 0 | mit | ddcc269f0f3a7d0e2e2505b0700197e4a4500984 | DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation | contentcuration/contentcuration/collectstatic_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some tests for flask integration"
},
{
"role": "assistant",
"content": "import os\nimport socket\nfrom webtest import TestApp\nfrom nose.tools import eq_, assert_raises\nfrom mock import MagicMock, patch\n\nfrom flask import ... | python | new_file | 11 | 1 | mit | 0edf160f3f12697d896721eb86ff09052fdb1126 | overplumbum/bugsnag-python,bugsnag/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python | tests/test_flask.py | rejected_lint | Too many lint violations: 11 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic web api server\n\nSo far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \\o/"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n# -*- coding: utf-8... | python | new_file | 1 | 9 | bsd-3-clause | 62d1e162cdc34cf6b361b5334625323d9d13c7ed | possel/possel,possel/possel,possel/possel,possel/possel | possel/resources.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add common base weigher/weigher handler for filter scheduler\n\nFilter scheduler is being used for more than one core projects (Nova\nand Cinder as of writing), the implementation shared a lot of common\ncode. This patch is to move base weig... | python | new_file | 1 | 1 | apache-2.0 | a75cecd0291067cf8ce7624e4c929b64e2388052 | openstack/oslo.i18n,varunarya10/oslo.i18n | tests/unit/fakes.py | rejected_duplicate | Near-duplicate of sample 2008 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add an extremely simple \"sanity test\" to the test suite."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nimport unittest\n\nclass TestSanity(unittest.TestCase):\n def setUp(self):\n self.right_answer ... | python | new_file | 1 | 1 | bsd-3-clause | d98ea2f891940a0251a470a8373dfc1b7df3b036 | blindsighttf2/Astron,pizcogirl/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron | test/test_sanity.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Test command fallback and queue."
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n\nfrom tornado.httpclient import AsyncHTTPClient\nfrom tornado.testing import gen_test, AsyncTestCase\nfrom blackgate import Command... | python | new_file | 3 | 1 | mit | e3958525303be01b2800c48a494b586f62f74393 | soasme/blackgate | tests/test_command.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: [util] Add python ROM_EXT manifest generator\n\nThis script takes .hjson input file that contains ROM_EXT manifest\nmetadata. This metadata is parsed and fed into the mako that uses it\ntogether with the template file to produce C header.\n\... | python | new_file | 1 | 3 | apache-2.0 | 4a6073e6c84391d9e67e08603b3ce429a4f58db4 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | util/rom-ext-manifest-generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add temporary corpus document generator - toolset need to be reworked."
},
{
"role": "assistant",
"content": "import joblib\n\npath_dict = joblib.load('data/filepath_dict.txt')\n\ndef tmp_gen():\n for i in range(len(path_dict)... | python | new_file | 1 | 2 | mit | 4226b7d1df34d61e948d435272964d4665c63836 | theovasi/browsewiki,theovasi/browsewiki,theovasi/browsewiki | tmp_gen.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add test for Keen script for Preprint providers."
},
{
"role": "assistant",
"content": "import datetime\n\nfrom tests.base import OsfTestCase\nfrom osf_tests.factories import PreprintFactory, PreprintProviderFactory\nfrom osf.mod... | python | new_file | 7 | 1 | apache-2.0 | ebd34d996dc49679c232b40db44114f10fdb6c58 | HalcyonChimera/osf.io,TomBaxter/osf.io,adlius/osf.io,mfraezz/osf.io,caneruguz/osf.io,mattclark/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,chennan47/osf.io,leb2dg/osf.io,felliott/osf.io,adlius/osf.io,chrisseto/osf.io,sloria/osf.io,caseyrollins/osf.io,icereval/osf.io,erinspace/osf.io,felliott/osf.io,caseyrollins/osf.... | scripts/tests/test_preprint_summary.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Write python code for the following: Create initial unit tests for run_component module"
},
{
"role": "assistant",
"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport shutil\nfrom nose.tools import raises, with_setup\nfrom dakotathon.run_component imp... | python | new_file | 4 | 4 | mit | 856cbe9049375ce277c4b3de2efa70fc4d68af4b | csdms/dakota,csdms/dakota | dakotathon/tests/test_run_component.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a test for missing migrations.\n\nThis commit detects missing migrations by running makemigrations\nwith the --dry-run flag and checking for the 'No changes detected'\nmessage on stdout. Otherwise, the error includes information on\nthe... | python | new_file | 1 | 1 | mit | b864b771f57dbef9a26fbb7acd864f113bdeab96 | jrief/djangocms-cascade,jrief/djangocms-cascade,haricot/djangocms-bs4forcascade,haricot/djangocms-bs4forcascade,jrief/djangocms-cascade | tests/test_missingmigrations.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: ENH: Add tool to extract SSI from TOPKAPI simulation results"
},
{
"role": "assistant",
"content": "__all__ = ['extract_ssi']\n\nfrom datetime import datetime, timedelta\n\nimport h5py\nimport numpy as np\nimport numpy.ma as ma\n... | python | new_file | 2 | 2 | bsd-3-clause | cc23bfe9980525c90ae32460cd8231458f8880a5 | sahg/PyTOPKAPI,scottza/PyTOPKAPI | lib/results_analysis/sim_result_tools.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Grove Thumb Joystick example"
},
{
"role": "assistant",
"content": "# GrovePi + Grove Thumb Joystick\r\n# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick\r\n\r\nimport time\r\nimport grovepi\r\n\r\n# Connect the Thumb ... | python | new_file | 4 | 0 | mit | fabcc39144e727c5c840554e229eb8f7ddd1e944 | NeuroRoboticTech/Jetduino,stwolny/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,NeuroRoboticTech/Jetduino,stwolny/GrovePi,stwolny/GrovePi,penoud/GrovePi,NeuroRoboticTech/Jetduino,rpedersen/GrovePi,karan259/GrovePi,penoud/GrovePi,rpedersen/GrovePi,stwolny/GrovePi,rpedersen/GrovePi,karan259/GrovePi,stwolny/G... | Software/Python/grove_thumb_joystick.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add missing test for ErrorHandlingURLopener\n\nI forgot to add this with commit\ndf9cfda52e952bb4d69cc0ee724e713cd6f468d5"
},
{
"role": "assistant",
"content": "from unittest import TestCase\n\nfrom openelex.base.fetch import Err... | python | new_file | 1 | 1 | mit | a08604f85b82300a4a3b4f2e70f91c3ee129859b | cathydeng/openelections-core,datamade/openelections-core,openelections/openelections-core,datamade/openelections-core,openelections/openelections-core,cathydeng/openelections-core | openelex/tests/test_fetch.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add migrations for reminder field."
},
{
"role": "assistant",
"content": "from django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('fetsy', '0004_tags'),\n ]\n\n ... | python | new_file | 1 | 0 | mit | 336f3ab701dc5b50e5ba65b7789029e6cf403d4e | normanjaeckel/FeTSy,normanjaeckel/FeTSy,normanjaeckel/FeTSy | fetsy/migrations/0005_ticket_reminder.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add scaffold for the unit test"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n#\n# Author: Bo Maryniuk <<EMAIL>>\n#\n# Copyright 2017 SUSE LLC\n# Licensed under the Apache License, Version 2.0 (the \"License\");\... | python | new_file | 6 | 1 | apache-2.0 | c7a1b733ab274381fa01c96ffc5bf16967a721e5 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/modules/test_ansiblegate.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add unit tests for BaseModel"
},
{
"role": "assistant",
"content": "import uuid\nfrom bloop import Column, UUID, Boolean, DateTime, String\nmissing = object()\n\n\ndef test_default_model_init(User):\n ''' Missing attributes ar... | python | new_file | 1 | 2 | mit | 3d6519dd5f03e5ac87c4b6c45941199b8a12e3e7 | numberoverzero/bloop,numberoverzero/bloop | tests/test_model.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add backoff retry async example"
},
{
"role": "assistant",
"content": "import asyncio\nimport logging\n\nimport aiohttp\nimport backoff\n\n\n@backoff.on_exception(backoff.expo,\n aiohttp.errors.ClientError,\n... | python | new_file | 1 | 3 | mit | 287855c67b8008a589e5009ba689cd0d9b35124a | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | backoff_retry_async.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add util script to check for broken links."
},
{
"role": "assistant",
"content": "#!/usr/bin/env python2\n\nfrom subprocess import Popen, PIPE\n\nimport os\nimport urllib2\nimport sys\n\nutilDir = os.path.dirname(os.path.realpath... | python | new_file | 1 | 3 | apache-2.0 | d9be46134972e88a01e74cefe61ff8ccd51b3fe2 | nhzandi/openface,nmabhi/Webface,xinfang/face-recognize,nmabhi/Webface,nhzandi/openface,xinfang/face-recognize,Alexx-G/openface,francisleunggie/openface,cmusatyalab/openface,Alexx-G/openface,francisleunggie/openface,nmabhi/Webface,xinfang/face-recognize,nmabhi/Webface,cmusatyalab/openface,cmusatyalab/openface,Alexx-G/op... | util/check-links.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add another module useful for GitHub actions: get a repo's latest release URL"
},
{
"role": "assistant",
"content": "import argparse\nimport subprocess\nimport os\nfrom github import Github\nimport re\n\ng = Github(os.environ[\"G... | python | new_file | 2 | 0 | apache-2.0 | 9ff6932eb887e4c1e05dd94107aa0c3438ae26a9 | googlefonts/gftools,googlefonts/gftools | Lib/gftools/actions/getlatestversion.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add sleep duration histogram plotter"
},
{
"role": "assistant",
"content": "import plotly as py, plotly.graph_objs as go\nfrom csvparser import parse\nfrom os.path import basename, splitext\nfrom sys import argv\n\ndata_file = ar... | python | new_file | 1 | 0 | mit | 2598b189bf2b7f968ded928100132f301a07f1e5 | f-jiang/sleep-pattern-grapher | hours_slept_histogram.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add subclassing example for RawCol"
},
{
"role": "assistant",
"content": "from flask_table import Table, Col\n\n\nclass RawCol(Col):\n \"\"\"Class that will just output whatever it is given and will not\n escape it.\n \"... | python | new_file | 1 | 1 | bsd-3-clause | ddacad6879d955f46f58bbfefd3363246c256193 | plumdog/flask_table,plumdog/flask_table,plumdog/flask_table | examples/subclassing2.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create migration for blog status"
},
{
"role": "assistant",
"content": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.6 on 2016-06-02 16:10\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models... | python | new_file | 1 | 0 | bsd-3-clause | 2636bf8f010de273c9713269a3402b16c83c912e | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/migrations/0021_blog_status.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nDoppler\n=======\n\nDoppler shift module.\n\"\"\"\nfrom __future__ import division\n\n\ndef velocity_from_doppler_shift(c, f1, f2):\n \"\"\"\n Calculate velocity based on measured frequency shifts due to Doppler shift.\n Th... | python | edit | 1 | 1 | bsd-3-clause | d79607f320579b2b9d98f219c35d7c878173f10e | felipeacsi/python-acoustics,FRidh/python-acoustics,antiface/python-acoustics,python-acoustics/python-acoustics,giumas/python-acoustics | acoustics/doppler.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script to get number of apps blocked without duplicates"
},
{
"role": "assistant",
"content": "#!/bin/env python\n# Get the number of apps blocked by each Motorola patent\n# and plot agains the number of citations to that pat... | python | new_file | 1 | 0 | bsd-2-clause | 1e361a431fc95304553852531427016215002cb0 | PatentBlocker/Motorola_Patent_Citations,PatentBlocker/Motorola_Patent_Citations | src/Harry_get_Citations_BlockingApps.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add fetch recipe for the Skia repository.\n\nTested with the following command lines:\n\n$ cd somewhere\n$ mkdir some-test-dir\n$ cd some-test-dir\n$ fetch skia\n$ cd skia\n # confirm it is what we expected.\n\nBUG=None\nTEST=see above\nR=<E... | python | new_file | 1 | 1 | bsd-3-clause | 562d23ecebaafcac3edf0662b4957f671a874a06 | svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools | recipes/skia.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a simple boilerplate to process jobs."
},
{
"role": "assistant",
"content": "import os\nos.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'\nimport zmq\nimport time\nimport json\n\naddr = 'tcp://127.0.0.1:5555'... | python | new_file | 1 | 1 | apache-2.0 | ad3f121f43f07a2fa27525e25ef2afdca94475f9 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/job_server/job_processor.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add a couple of tests for lsxfel"
},
{
"role": "assistant",
"content": "from karabo_data import lsxfel\nfrom karabo_data import H5File\n\ndef test_lsxfel_file(mock_lpd_data, capsys):\n with H5File(mock_lpd_data) as f:\n ... | python | new_file | 1 | 1 | bsd-3-clause | 8fb8b19c75e4a331733b79f9d1d9384a0b3080be | European-XFEL/h5tools-py | karabo_data/tests/test_lsxfel.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Create CUDA cast tests based on CPU cast tests"
},
{
"role": "assistant",
"content": "from numba import unittest_support as unittest\nimport numpy as np\nfrom numba import cuda, types\nimport struct\n\n\ndef float_to_int(x):\n ... | python | new_file | 1 | 1 | bsd-2-clause | fab3d35e7e2bd633f48d16a08914832a36eabb5e | gdementen/numba,stuartarchibald/numba,stuartarchibald/numba,ssarangi/numba,stuartarchibald/numba,IntelLabs/numba,seibert/numba,pombredanne/numba,gmarkall/numba,ssarangi/numba,numba/numba,pombredanne/numba,pombredanne/numba,jriehl/numba,stefanseefeld/numba,numba/numba,numba/numba,gmarkall/numba,stefanseefeld/numba,stefa... | numba/cuda/tests/cudapy/test_casting.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.