conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add a test case for guessing the BuildDir associated with a subdirectory argument.\n\n\ngit-svn-id: 7892167f69f80ee5d3024affce49f20c74bcb41d@1394 fdb21ef1-2011-0410-befe-b5e4ea1792b1\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# __COPYRIGHT__\n#\n# Per... | python | chosen |
[
{
"from": "human",
"value": "Introduce module for CLI commands; implement data generating command\n"
},
{
"from": "gpt",
"value": "import os\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nfrom ngx_task import settings, utils\n\n\ndef generate_data():\n if not os.path.exis... | python | chosen |
[
{
"from": "human",
"value": "Add test to validate service names\n"
},
{
"from": "gpt",
"value": "# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance wit... | python | chosen |
[
{
"from": "human",
"value": "Add initial version Teach First Oauth2 backend.\n"
},
{
"from": "gpt",
"value": "from django.conf import settings\nfrom social_core.backends.oauth import BaseOAuth2\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\nclass TeachFirstOAuth2(BaseOAuth2):\n \"\... | python | chosen |
[
{
"from": "human",
"value": "Add description field to Config\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('timeslot', '00... | python | chosen |
[
{
"from": "human",
"value": "Move some Utils outside of the main script.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Sep 11 10:23:38 2016\r\n\r\n@author: SISQUAKE\r\n\"\"\"\r\nimport os\r\ndef listFilePath(path):\r\n File = [];\r\n Dir = [];\r\n\r\n... | python | chosen |
[
{
"from": "human",
"value": "Add YAML wrapper allowing conf strings to be used in YAML source files\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n controlbeast.utils.yaml\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.\... | python | chosen |
[
{
"from": "human",
"value": "Initialize unit tests for Coursera API module\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom mooc_aggregator_restful_api import coursera\n\n\nclass CourseraTestCase(unittest.TestCase):\n '''\n Unit Tests for module udacity\n\n '''\n\n def setUp(... | python | chosen |
[
{
"from": "human",
"value": "migrations: Add migration to fix Attachment cache.\n\nThis migration needs to be run after the previous commit is deployed\nto a given Zulip installation, to fix any stale values of\nis_realm_public and is_web_public.\n"
},
{
"from": "gpt",
"value": "# Generated by D... | python | chosen |
[
{
"from": "human",
"value": "Add initial HDF storage class\n"
},
{
"from": "gpt",
"value": "import numpy as np\nimport pandas as pd\nimport tables as tb\n\nclass HDFStore(object):\n def __init__(self, hdfname):\n self.pdh5 = pd.HDFStore(hdfname, mode='a', complevel=9,\n ... | python | chosen |
[
{
"from": "human",
"value": "Add Management Command to Dump Project and RemoteRepository Relationship in JSON format\n"
},
{
"from": "gpt",
"value": "import json\n\nfrom django.core.management.base import BaseCommand\n\nfrom readthedocs.projects.models import Project\n\n\nclass Command(BaseComma... | python | chosen |
[
{
"from": "human",
"value": "Add a helper script to apply changes in zuul\n\nIn order to aappropriately test dependencies in a CI scenario,\nspecificially in the case of OpenStack CI, we need to be able to\nparse and act upon the changes defined by Zuul since we manage\nthe installation of our dependencies.... | python | chosen |
[
{
"from": "human",
"value": "Add single dataset doc gen\n"
},
{
"from": "gpt",
"value": "# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n... | python | chosen |
[
{
"from": "human",
"value": "Add Python script to investigate s3 speeds\n\nSigned-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com>\n"
},
{
"from": "gpt",
"value": "from __future__ import print_function\nimport boto3\nimport subprocess\nimport os\nimport pandas as pd\nim... | python | chosen |
[
{
"from": "human",
"value": "Make looking for outliers easier\n"
},
{
"from": "gpt",
"value": "\nimport sys\n\n'''\nCheck for garbage points in a MS by SPW.\n'''\n\ntry:\n vis_name = sys.argv[1]\n corrstring = sys.argv[2]\n starting_spw = int(sys.argv[3])\nexcept IndexError:\n vis_na... | python | chosen |
[
{
"from": "human",
"value": "Add a custom gunicorn Sync worker implementation which works around some issues\nwhich occur when eventlet monkey patching is used with sync worker.\n"
},
{
"from": "gpt",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor lic... | python | chosen |
[
{
"from": "human",
"value": "Test for COM collections; IEnumVariant so far only.\n\n--HG--\nextra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40142\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom comtypes.client import CreateObject, GetModule #, Constants\nfrom f... | python | chosen |
[
{
"from": "human",
"value": "Solve conflict in DB schema for circle CI\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('digi... | python | chosen |
[
{
"from": "human",
"value": "Add a testcase for RubyGems\n"
},
{
"from": "gpt",
"value": "from tests.helper import ExternalVersionTestCase\n\n\nclass RubyGemsTest(ExternalVersionTestCase):\n def test_gems(self):\n self.assertEqual(self.sync_get_version(\"example\", {\"gems\": None}), \... | python | chosen |
[
{
"from": "human",
"value": "Define \"Assessment updated\" notification type\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"\nAdd Assessment updated notification type\n\nCreate Date: 2017-... | python | chosen |
[
{
"from": "human",
"value": "Add a module for known data models: CDS, ECMWF, etc.\n"
},
{
"from": "gpt",
"value": "#\n# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ... | python | chosen |
[
{
"from": "human",
"value": "Make a unittest for CArray class\n"
},
{
"from": "gpt",
"value": "import unittest\n\nimport cupy\nfrom cupy import testing\n\n\nclass TestCArray(unittest.TestCase):\n\n def test_size(self):\n x = cupy.arange(3).astype('i')\n y = cupy.ElementwiseKerne... | python | chosen |
[
{
"from": "human",
"value": "Add file for rule's symbol tests\n"
},
{
"from": "gpt",
"value": "#!/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 main, TestCase\nfrom grammpy import Rule\n\n\nclass ... | python | chosen |
[
{
"from": "human",
"value": "Add maintenance script to fix missing menu links\n"
},
{
"from": "gpt",
"value": "from __future__ import division\n\nfrom collections import Counter\n\nfrom indico.core.db import DBMgr\nfrom indico.util.console import conferenceHolderIterator, success\nfrom MaKaC.con... | python | chosen |
[
{
"from": "human",
"value": "Add migrations for session changes\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.1 on 2016-03-16 21:24\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration... | python | chosen |
[
{
"from": "human",
"value": "Add template for lab 09 class A\n"
},
{
"from": "gpt",
"value": "\nclass Bangunan:\n def __init__(self, nama, lama_sewa, harga_sewa):\n self.nama = nama\n self.lama_sewa = lama_sewa\n self.harga_sewa = harga_sewa\n\n def getHargaSewa(self):... | python | chosen |
[
{
"from": "human",
"value": "Add simple lauch script without configuration options\n"
},
{
"from": "gpt",
"value": "from twisted.application import internet, service\nfrom twisted.names import dns\nfrom twisted.names import server\nfrom openvpnzone import OpenVpnStatusAuthority, extract_status_f... | python | chosen |
[
{
"from": "human",
"value": "Add shallow tests for spin-1/2 general drudge\n\nHere, just the number of terms in the Hamiltonian is tried to be counted\nwithout actual inspection of the content.\n"
},
{
"from": "gpt",
"value": "\"\"\"Tests for the general model with explicit one-half spin.\"\"\"\... | python | chosen |
[
{
"from": "human",
"value": "Add functioning code for training sequence\n\nRNN works reasonably well\n"
},
{
"from": "gpt",
"value": "import tensorflow as tf\nimport numpy as np\n\ntf.set_random_seed(5)\n\nn_steps = 28\nn_inputs = 28\nn_neurons = 150\nn_outputs = 10\n\nlearning_rate = 0.001\n\nX... | python | chosen |
[
{
"from": "human",
"value": "Add test for Link object.\n"
},
{
"from": "gpt",
"value": "# Copyright (c) 2015, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\nimport unittest\n\nfrom mixbox.vendor.six import u\n\nfrom cybox.objects.link_object import Link\nfr... | python | chosen |
[
{
"from": "human",
"value": "Add beam information to 850um file\n\n-Add python script to add beam information into 850um FITS header.\n"
},
{
"from": "gpt",
"value": "import os\nfrom astropy.io import fits\n\nfile_scuba2_raw='B5_850um_ext_v2_regrid.fits'\nfile_scuba2_out='B5_850um_ext_v2_regrid_... | python | chosen |
[
{
"from": "human",
"value": "Add tests for very big AST trees\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom triton import *\n\nDEPTH = 10000\n\n\nclass TestDeep(unittest.TestCase):\n\n def setUp(self):\n \"\"\"Define the arch.\"\"\"\n self.triton = TritonContext()\n ... | python | chosen |
[
{
"from": "system",
"value": "Upgrade libchromiumcontent to contain printing headers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport platform\nimport sys\n\nNODE_VERSION = 'v0.11.13'\nBASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'\nLIBCHROMIUMCO... | python | chosen |
[
{
"from": "human",
"value": "Add helper module for keyword-only arguments.\n"
},
{
"from": "gpt",
"value": "'''Support functions for implementing keyword-only arguments.\n\nThis module is designed to make it easy to support keyword-only\narguments in Python 2.7 while providing the same kind of e... | python | chosen |
[
{
"from": "human",
"value": "Add function approximator to deal with off-switch\n\nI had forgotten to add this one earlier.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\n# HO … higher-order\nclass SliceHOFeatureVec(object):\n def __init_... | python | chosen |
[
{
"from": "human",
"value": "Automate Transfers: Add another pre-transfer script\n\nrefs #7369\n\nCreate metadata.json based on directory name.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2\n\nimport json\nimport os\nimport sys\n\ndef main(transfer_path):\n basename = os.path.basena... | python | chosen |
[
{
"from": "human",
"value": "Add migration for creating the Professional Certificate program type\n\nECOM-6594\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.11 on 2016-12-19 19:51\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n... | python | chosen |
[
{
"from": "human",
"value": "Add a Quartz backend for the null toolkit\n"
},
{
"from": "gpt",
"value": "#------------------------------------------------------------------------------\n# Copyright (c) 2011, Enthought, Inc.\n# All rights reserved.\n#\n# This software is provided without warranty ... | python | chosen |
[
{
"from": "human",
"value": "Add homebrew version of fluentd logger\n"
},
{
"from": "gpt",
"value": "import logging\nfrom datetime import datetime\n\nfrom fluent import sender\n\n\nclass FluentHandler(logging.Handler):\n '''\n Logging Handler for fluent.\n '''\n def __init__(self,\n ... | python | chosen |
[
{
"from": "human",
"value": "Add simple api to redis with flask\n"
},
{
"from": "gpt",
"value": "from flask import Flask\nfrom flask import json\nfrom flask import Response\nimport redis\n\napp = Flask(__name__)\nr = redis.StrictRedis(host='localhost', port=6379, db=0)\n\n@app.route(\"/\")\ndef ... | python | chosen |
[
{
"from": "human",
"value": "CREATE new Syft Message structure\n"
},
{
"from": "gpt",
"value": "# stdlib\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Optional\n\n# third party\nfrom nacl.signing import VerifyKey\n\n# relative\nfrom .....common.message import ImmediateSyft... | python | chosen |
[
{
"from": "human",
"value": "Add way to call converters/harvesters in 0.2.0\n\nConverters in 0.2.0 cannot be run directly (breaks relative imports)\nand therefore must be imported as modules. proto_main makes this\nprocess easier.\n"
},
{
"from": "gpt",
"value": "from importlib import import_mod... | python | chosen |
[
{
"from": "human",
"value": "Add command load beginner categories\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nimport json\nfrom datasets.models import Dataset, TaxonomyNode\n\n\nclass Command(BaseCommand):\n help = 'Load field easy categories from jso... | python | chosen |
[
{
"from": "human",
"value": "examples: Add an example of resolving a known service by service name\n\nTo use:\n* `avahi-publish-service -s 'My Service Name' _test._tcp 0`\n* `./examples/resolver.py` should print a `ServiceInfo`\n* Kill the `avahi-publish-service` process\n* `./examples/resolver.py` should p... | python | chosen |
[
{
"from": "human",
"value": "Test borda ranking and spearman.\n"
},
{
"from": "gpt",
"value": "import numpy \nimport unittest\nimport logging\nfrom exp.influence2.RankAggregator import RankAggregator \nimport scipy.stats.mstats \nimport numpy.testing as nptst \n\n\nclass RankAggregatorTest(unit... | python | chosen |
[
{
"from": "human",
"value": "Add presubmit check to catch use of PRODUCT_NAME in resources.\n\nWe should not be adding any new strings resources that use a PRODUCT_NAME\nplaceholder, because it is difficult to localize in some languages. Add a\npresubmit check which shows a warning whenever a line is that c... | python | chosen |
[
{
"from": "human",
"value": "Add script to extract rows from terms.\n"
},
{
"from": "gpt",
"value": "# Convert from show term to list of rows associated with each term.\n\nimport re\nterm_regex = re.compile(\"Term\\(\\\"(\\S+)\\\"\\)\")\nrowid_regex = re.compile(\"\\s+RowId\\((\\S+),\\s+(\\S+)\\... | python | chosen |
[
{
"from": "human",
"value": "Add a frist test for create_random_data\n"
},
{
"from": "gpt",
"value": "\"\"\"\nUnittests for opal.management.commands.create_random_data\n\"\"\"\nfrom mock import patch, MagicMock\n\nfrom opal.core.test import OpalTestCase\n\nfrom opal.management.commands import cr... | python | chosen |
[
{
"from": "human",
"value": "Implement code to return how many characters to delete to make 2 strings into an anagram\n\nhttps://www.hackerrank.com/challenges/ctci-making-anagrams\n"
},
{
"from": "gpt",
"value": "# https://www.hackerrank.com/challenges/ctci-making-anagrams\n# Python 3\n\ndef del... | python | chosen |
[
{
"from": "human",
"value": "Add testing functions for join and relabel\n"
},
{
"from": "gpt",
"value": "import numpy as np\nfrom numpy.testing import assert_array_equal, assert_raises\nfrom skimage.segmentation import join_segmentations, relabel_from_one\n\ndef test_join_segmentations():\n s... | python | chosen |
[
{
"from": "human",
"value": "Python: Add test showing taint for attr store\n\nIn `x.arg = TAINTED_STRING` there is a store step to the attribute `arg`\nof `x`. In our taint modeling, we allow _any_ store step with the code\nbelow. This means that we also say there is a taint-step directly from\n`TAINTED_STR... | python | chosen |
[
{
"from": "human",
"value": "Add missing specification model tests\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom django.test import TestCase\n\nfrom django.db import IntegrityError\n\nfrom .model_factories import (\n SpecificationF,\n DomainF,\n AttributeF\n)\n\n\nclass... | python | chosen |
[
{
"from": "human",
"value": "Add some basic tests around contact parsing\n"
},
{
"from": "gpt",
"value": "import aiosip\n\n\ndef test_simple_header():\n header = aiosip.Contact.from_header('<sip:pytest@127.0.0.1:7000>')\n assert not header['name']\n assert dict(header['params']) == {}\n... | python | chosen |
[
{
"from": "human",
"value": "Add test cases for removepunctuation\n"
},
{
"from": "gpt",
"value": "#\n\nimport pytest\nfrom sdsc.textutil import removepunctuation\n\n\n@pytest.mark.parametrize(\"end\", [True, False])\n@pytest.mark.parametrize(\"start\", [True, False])\n@pytest.mark.parametrize... | python | chosen |
[
{
"from": "human",
"value": "Add \"what is my purpose in life\" plugin\n"
},
{
"from": "gpt",
"value": "from espresso.main import robot\n\n@robot.respond(r\"(?i)pass the butter\")\ndef pass_the_butter(res):\n res.reply(res.msg.user, \"What is my purpose in life?\")\n\n@robot.respond(r\"(?i)yo... | python | chosen |
[
{
"from": "human",
"value": "Add unittests for title handling methods\n\nWe add some test for our new title cutting method.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: latin-1 -*-\n\n\"\"\"Unit tests.\"\"\"\n\nimport unittest\nfrom uploadlibrary.UploadBot import _cut_ti... | python | chosen |
[
{
"from": "human",
"value": "Add tests for the signals\n"
},
{
"from": "gpt",
"value": "from django.core.cache import cache\nfrom django.test import SimpleTestCase\n\nfrom ormcache.signals import cache_hit, cache_missed, cache_invalidated\nfrom ormcache.tests.testapp.models import CachedDummyMod... | python | chosen |
[
{
"from": "human",
"value": "Add a test for rename.\n\nSigned-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>\n"
},
{
"from": "gpt",
"value": "\"\"\"\nTest 'rename'.\n\"\"\"\n\nimport subprocess\nimport unittest\n\nfrom ._constants import _CLI\n\nfrom ._misc import Service\... | python | chosen |
[
{
"from": "human",
"value": "Enable Jenkins Python3 monster for i19\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, division, print_function\n\ndef test_no_new_python3_incompatible_code_is_introduced_into_this_module():\n import i19\n import pytest\n import dials.test... | python | chosen |
[
{
"from": "human",
"value": "Add a work-in-progress parser for the ClientHello message.\n"
},
{
"from": "gpt",
"value": "import construct\n\nfrom tlsenum import hello_constructs\n\n\nclass ClientHello(object):\n\n @property\n def protocol_version(self):\n return self._protocol_versi... | python | chosen |
[
{
"from": "human",
"value": "TST: Test co2 load_data for Python 3.\n"
},
{
"from": "gpt",
"value": "from statsmodels.datasets import co2\n\ndef test_co2_python3():\n # this failed in pd.to_datetime on Python 3 with pandas <= 0.12.0\n dta = co2.load_pandas()\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add migration to replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_information.email to pass validation\n"
},
{
"from": "gpt",
"value": "\"\"\"Replace '<removed>' with '<removed>@{uuid}.com'.format(uuid=str(uuid4())) in contact_info... | python | chosen |
[
{
"from": "human",
"value": "Add script to add uplaoders to a repo\n"
},
{
"from": "gpt",
"value": "#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <sorhanse@cisco.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file... | python | chosen |
[
{
"from": "human",
"value": "Add another simpler test for %f\n"
},
{
"from": "gpt",
"value": "a = 1.123456\nb = 10\nc = -30\nd = 34\ne = 123.456789\nf = 892122.129899\n\n# form 0\ns = \"b=%f\" % a\nprint s\n\n# form 1\ns = \"b,c,d=%f+%f+%f\" % (a, e, f)\nprint s\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "TST: Test save, load functionality in Statespace"
},
{
"from": "gpt",
"value": "\"\"\"\nTests of save / load / remove_data state space functionality.\n\"\"\"\n\nfrom __future__ import division, absolute_import, print_function\n\nimport numpy as np\nimport pandas as p... | python | chosen |
[
{
"from": "human",
"value": "Add a test for __main__\n"
},
{
"from": "gpt",
"value": "import pytest\n\nfrom cutadapt.__main__ import main\n\n\ndef test_help():\n with pytest.raises(SystemExit) as e:\n main([\"--help\"])\n assert e.value.args[0] == 0\n\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add `ProtectedFieldsMixin` for use with `ChangeProtected`s\n\nRefs SHOOP-1896\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# This file is part of Shoop.\n#\n# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.\n#\n# This source code is licensed und... | python | chosen |
[
{
"from": "human",
"value": "test: Test Lemniscate of Bernoulli trajectory\n\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport unittest\n\nfrom geometry_msgs.msg import Point\n\nfrom trajectory.lemniscate_trajectory import LemniscateTrajectory\n\n\nclass LemniscateTrajectoryTest(uni... | python | chosen |
[
{
"from": "system",
"value": "Simplify the view as the validation logic has already moved to\nthe model\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nfrom django.http import HttpResponseRedirect, HttpResponseGone\nfrom django.contrib.auth import login\nfrom django.conf impo... | python | chosen |
[
{
"from": "human",
"value": "scripts: Add script to perform partial upload\n\nSigned-off-by: Sayan Chowdhury <5f0367a2b3b757615b57f51d912cf16f2c0ad827@gmail.com>\n"
},
{
"from": "gpt",
"value": "#!/bin/env python\n# -*- coding: utf8 -*-\n\"\"\" Triggers a partial upload process with the specifie... | python | chosen |
[
{
"from": "human",
"value": "Add basic unit test for parseCommand\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport unittest\nfrom udpRemote import parseCommand\n\n\nclass MockDriveParam:\n velocity = 0.0\n angle = 0.0\n\n\nclass UdpRemoteTest(unittest.TestCase):\n def te... | python | chosen |
[
{
"from": "human",
"value": "Test password tokens not in response\n"
},
{
"from": "gpt",
"value": "import json\n\nfrom radar_api.tests.fixtures import get_user\n\n\ndef test_serialization(app):\n admin = get_user('admin')\n\n client = app.test_client()\n client.login(admin)\n\n respo... | python | chosen |
[
{
"from": "human",
"value": "Define the HPACK reference structure.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nhyper/http20/hpack_structures\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nContains data structures used in hyper's HPACK implementation.\n\"\"\"\nclass Reference(object):\n ... | python | chosen |
[
{
"from": "human",
"value": "Update expenses status on database\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.6 on 2016-06-02 16:07\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for testing the widget tree iterators.\n"
},
{
"from": "gpt",
"value": "import unittest\n\n\nclass FileWidgetWalk(unittest.TestCase):\n\n def test_walk_large_tree(self):\n from kivy.uix.boxlayout import BoxLayout\n from kivy.uix.label ... | python | chosen |
[
{
"from": "human",
"value": "Convert python 2 version to python 3\n"
},
{
"from": "gpt",
"value": "import os\nimport shutil\nimport fnmatch\n\ndef get_files(patterns):\n \"\"\" gets all files matching pattern from root\n pattern supports any unix shell-style wildcards (not same as RE) ... | python | chosen |
[
{
"from": "human",
"value": "test: Add tests for circle ci checks\n"
},
{
"from": "gpt",
"value": "import pytest\n\nfrom semantic_release import ci_checks\nfrom semantic_release.errors import CiVerificationError\n\n\ndef test_circle_should_pass_if_branch_is_master_and_no_pr(monkeypatch):\n mo... | python | chosen |
[
{
"from": "human",
"value": "Add the beginnings of an example client.\n"
},
{
"from": "gpt",
"value": "\nimport dbus\n\nbus = dbus.SystemBus()\n\n# This adds a signal match so that the client gets signals sent by Blivet1's\n# ObjectManager. These signals are used to notify clients of changes to ... | python | chosen |
[
{
"from": "human",
"value": "Add standalone wave trigger tool.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# Standard library imports\nimport argparse\nimport collections\nimport logging\nimport os\nimport time\n\n# Additional library imports\nimport requests\n\n\n# Named logger fo... | python | chosen |
[
{
"from": "human",
"value": "Add basic support for LimitlessLED\n"
},
{
"from": "gpt",
"value": "\"\"\"\nhomeassistant.components.light.limitlessled\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSupport for LimitlessLED bulbs, also known as...\n\nEasyBulb\nAppLight\nAppLamp\nMiLight\nLEDme\ndekolight\... | python | chosen |
[
{
"from": "human",
"value": "Add test for 'holes' argument in add_polygon\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport pygmsh as pg\nimport numpy as np\n\ndef generate():\n # Characteristic length\n lcar = 1e-1\n\n # Coordinates of lower-left and... | python | chosen |
[
{
"from": "human",
"value": "Add conditional command prefix plugin\n"
},
{
"from": "gpt",
"value": "from cloudbot import hook\n\nimport re\n\n@hook.sieve\ndef conditional_prefix(bot, event, plugin):\n if plugin.type == 'command':\n if event.chan in event.conn.config['prefix_blocked_cha... | python | chosen |
[
{
"from": "human",
"value": "Add new top level script to ease running of individual unittests.\n"
},
{
"from": "gpt",
"value": "\nimport sys\nimport unittest\n\nfrom toast.mpirunner import MPITestRunner\n\nfile = sys.argv[1]\n\nloader = unittest.TestLoader()\nrunner = MPITestRunner(verbosity=2)\... | python | chosen |
[
{
"from": "human",
"value": "Add stubby saved roll class\n"
},
{
"from": "gpt",
"value": "import sqlite3\n\n\nconnection = sqlite3.connect('data.db')\n\n\nclass SavedRoll:\n @staticmethod\n def save(user, name, args):\n pass\n\n @staticmethod\n def get(user, name):\n pa... | python | chosen |
[
{
"from": "human",
"value": "Add simple terminal-based version of rock-paper-scissors.\n"
},
{
"from": "gpt",
"value": "from random import choice\n\nclass RPSGame:\n shapes = ['rock', 'paper', 'scissors']\n draws = [('rock', 'rock'), ('paper', 'paper'), ('scissors', 'scissors')]\n first... | python | chosen |
[
{
"from": "human",
"value": "Add tests for google menu\n"
},
{
"from": "gpt",
"value": "\"\"\"\nGoogle Menu tests\n\"\"\"\n\n\nfrom base import BaseTouchscreenTest\nimport time\nfrom base import MAPS_URL, ZOOMED_IN_MAPS_URL, Pose\nfrom base import screenshot_on_error, make_screenshot\nimport re\... | python | chosen |
[
{
"from": "human",
"value": "[Util] Add a helper script for converting -print-before-all output into a file based equivelent\n\nSimple little utility which takes a opt logfile generated with \"opt -print-before-all -print-module-scope -o /dev/null <args> 2&>1\", and splits into a series of individual \"chun... | python | chosen |
[
{
"from": "human",
"value": "Disable IPv6 on wireless (Extension Attribute for Casper)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\n#Copyright 2014 Quam Sodji\n\nimport subprocess\n\ndef getinfo(hardware): #Return network info on select interface\n info = subprocess.check_output([\"n... | python | chosen |
[
{
"from": "human",
"value": "Set up contextmanager for db cals\n"
},
{
"from": "gpt",
"value": "# muddersOnRails()\n# Sara McAllister November 5, 2-17\n# Last updated: 11-5-2017\n\n# library for SQLite database calls for teamwork analysis app\n\nimport contextlib\nimport sqlite3\n\nDB = 'db/deve... | python | chosen |
[
{
"from": "human",
"value": "Add test for exact search with album query\n"
},
{
"from": "gpt",
"value": "from __future__ import unicode_literals\n\nimport unittest\n\nfrom mopidy.local import search\nfrom mopidy.models import Album, Track\n\n\nclass LocalLibrarySearchTest(unittest.TestCase):\n ... | python | chosen |
[
{
"from": "system",
"value": "Rename new test class correctly and flesh out first passing tests\n"
},
{
"from": "human",
"value": "from spec import Spec\n\n\nclass Runner_(Spec):\n class run:\n def out_stream_defaults_to_sys_stdout(self):\n \"out_stream defaults to sys.stdou... | python | chosen |
[
{
"from": "human",
"value": "Add tests for all exceptions\n"
},
{
"from": "gpt",
"value": "# coding: utf-8\n\nimport pytest\nimport responses\nimport kiteconnect.exceptions as ex\n\n\n@responses.activate\ndef test_wrong_json_response(kiteconnect):\n responses.add(\n responses.GET,\n ... | python | chosen |
[
{
"from": "human",
"value": "Add (failing) tests for the dashboard\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2.5\n#\n# Copyright 2011 the Melange authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with th... | python | chosen |
[
{
"from": "human",
"value": "Move utility functions for checking passported benefits into separate module\n"
},
{
"from": "gpt",
"value": "from cla_public.apps.checker.constants import PASSPORTED_BENEFITS, \\\n NASS_BENEFITS\n\n\ndef passported(benefits):\n return bool(set(benefits).inters... | python | chosen |
[
{
"from": "human",
"value": "Add Repository class and module\n"
},
{
"from": "gpt",
"value": "import os\n\nfrom morenines import output\nfrom morenines import util\n\nfrom morenines.index import Index\nfrom morenines.ignores import Ignores\n\n\nNAMES = {\n 'repo_dir': '.morenines',\n 'inde... | python | chosen |
[
{
"from": "human",
"value": "Migrate creation date to new casebooks\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.2.10 on 2020-04-14 11:38\n\nfrom django.db import migrations\nfrom main.models import Casebook\n\ndef copy_old_dates(app, schema):\n update_cbs = []\n for casebook i... | python | chosen |
[
{
"from": "human",
"value": "Add fortran ABI mismatch test for scipy.linalg.\n"
},
{
"from": "gpt",
"value": "from subprocess import call, PIPE, Popen\nimport sys\nimport re\n\nimport numpy as np\nfrom numpy.testing import TestCase, dec\n\nfrom scipy.linalg import flapack\n\n# XXX: this is copie... | python | chosen |
[
{
"from": "human",
"value": "Add an example of SQLalchemy model\n"
},
{
"from": "gpt",
"value": "from flask.ext.sqlalchemy import SQLAlchemy\n\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'\ndb = SQLAlchemy(app)\n\nclass User(db.Model):\n id = db.Column(db.Integer, primary_... | python | chosen |
[
{
"from": "human",
"value": "ADD Cleaning before each test\n"
},
{
"from": "gpt",
"value": "from lettuce import *\nimport requests\n\nTARGET_URL='http://localhost:8080'\n\ntenantList = [ \"511\", \"615\", \"634\", \"515\" ]\n\n@before.each_scenario\ndef cleanContext(feature):\n for tenant in te... | python | chosen |
[
{
"from": "human",
"value": "Add image processing system (dummy)\n"
},
{
"from": "gpt",
"value": "from chunsabot.botlogic import brain\n\n@brain.route(\"@image\")\ndef add_image_description(msg, extras):\n attachment = extras['attachment']\n if not attachment:\n return None\n\n r... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.