conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add valid directory test cases\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Command Line Interface test cases.\"\"\"\n\nimport argparse\nimport os\nimport tempfile\nimport unittest\n\nfrom pic2map.cli import valid_directory\n\n\nclass ValidDirector... | python | chosen |
[
{
"from": "human",
"value": "Test that .wkt and wkt.dumps produce same results\n"
},
{
"from": "gpt",
"value": "from math import pi\n\nimport pytest\n\nfrom shapely.geometry import LineString, Point\nfrom shapely.wkt import dumps\n\n\n@pytest.fixture(scope=\"module\")\ndef pipi():\n return Po... | python | chosen |
[
{
"from": "human",
"value": "Add a manage command to sync reservations from external hook .. hard coded first product only atm\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nfrom django.core.management.base import CommandError\nfrom mezzanine.conf import se... | python | chosen |
[
{
"from": "human",
"value": "Add entrypoint script to support subcommands\n"
},
{
"from": "gpt",
"value": "import argparse\nimport subprocess\nimport sys\n\nimport cloudbrain.publishers.sensor_publisher\n\ndef publish(args):\n sys.argv = args or ['-h']\n cloudbrain.publishers.sensor_publis... | python | chosen |
[
{
"from": "human",
"value": "Add a tool to convert from otter formats to what we use on the website.\n"
},
{
"from": "gpt",
"value": "import os\nimport sys\n\n\ndef main():\n if len(sys.argv) != 2:\n print(\"Usage: Pass the file name for the source transcript txt file.\")\n sys.... | python | chosen |
[
{
"from": "human",
"value": "Add a test for the max-norm constraint\n"
},
{
"from": "gpt",
"value": "import unittest\nimport numpy as np\nfrom theano import tensor as T\n\nclass TestConstraints(unittest.TestCase):\n def setUp(self):\n self.some_values = [0.1,0.5,3,8,1e-7]\n self... | python | chosen |
[
{
"from": "human",
"value": "Add tests for Nearest Neighbor Algorithm.\n\nTODO: a lot more tests are needed.\n\ngit-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@369 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8\n"
},
{
"from": "gpt",
"value": "import numpy as np\nfrom ..neighbors import Neighbors\n\n... | python | chosen |
[
{
"from": "human",
"value": "[ADD] Test for electronic invoice. [FIX] Change l10n_ar_wsfe to l10n_ar_wsafip_fe"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2012 OpenERP - Team de Localiz... | python | chosen |
[
{
"from": "system",
"value": "ADD base location to logos as it is necesary for security rules\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': 'Logos Set Up Data',\n 'version': '1.0',\n 'category': 'Accounting',\n 'sequence': 14,\n 'summary': '',\n 'descr... | python | chosen |
[
{
"from": "human",
"value": "Add new notification type for assessors reminder\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2016 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: urban@recip... | python | chosen |
[
{
"from": "human",
"value": "Call of Duty: World at War plugin\n"
},
{
"from": "gpt",
"value": "import os\nfrom lib.base_plugin import BasePlugin\n\n\nclass CoDWaWPlugin(BasePlugin):\n Name = \"Call of Duty: World at War\"\n support_os = [\"Windows\"]\n\n def backup(self, _):\n _... | python | chosen |
[
{
"from": "human",
"value": "Add script for computing jacobian, as a dataframe.\n"
},
{
"from": "gpt",
"value": "import climate\n\nimport database\n\n\ndef main(root, pattern='*'):\n for trial in database.Experiment(root).trials_matching(pattern, load=False):\n trial.load()\n\n ... | python | chosen |
[
{
"from": "human",
"value": "Add the usage of `oslo.log`.\n"
},
{
"from": "gpt",
"value": "# coding: utf-8\n\"\"\"\nUse the library 'oslo.log' to configure the logging.\n\nApplications should use oslo.log’s configuration functions to register\nlogging-related configuration options and configure ... | python | chosen |
[
{
"from": "system",
"value": "Make OpenMapQuest tests conditional on environment variable"
},
{
"from": "human",
"value": "\nfrom geopy.compat import u\nfrom geopy.geocoders import OpenMapQuest\nfrom test.geocoders.util import GeocoderTestBase\n\n\nclass OpenMapQuestTestCase(GeocoderTestBase): #... | python | chosen |
[
{
"from": "human",
"value": "Add solution to challenge 5.\n"
},
{
"from": "gpt",
"value": "from __future__ import division\nimport math\nimport base64\n\ndef repeating_xor_encrypt(text, key):\n padded_key = key * int(math.ceil(len(text) / len(key)))\n\n encrypted = [chr(ord(a) ^ ord(b)) fo... | python | chosen |
[
{
"from": "human",
"value": "tests/thread: Add test for concurrent interning of strings.\n\nQstr code accesses global state and needs to be made thread safe.\n"
},
{
"from": "gpt",
"value": "# test concurrent interning of strings\n#\n# MIT license; Copyright (c) 2016 Damien P. George on behalf o... | python | chosen |
[
{
"from": "system",
"value": "Sort by name, fix vacancy (values in api are occupancy)\n"
},
{
"from": "human",
"value": "from irc3.plugins.command import command\n\nfrom bytebot_config import BYTEBOT_PLUGIN_CONFIG\nfrom irc3 import asyncio\nimport aiohttp\nimport xml.etree.ElementTree as ET\n\n... | python | chosen |
[
{
"from": "human",
"value": "Create util file for gen and verifying auth tokens\n"
},
{
"from": "gpt",
"value": "from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, SignatureExpired, BadTimeSignature\n\nimport os\n\ndef gen_auth_token(id,expiration=10000):\n \"\"\"Generate... | python | chosen |
[
{
"from": "human",
"value": "Add firmware password status artifact\n"
},
{
"from": "gpt",
"value": "import subprocess\n\nfactoid = 'firmware_password_status'\n\ndef fact():\n '''Returns whether or not a firmware password is set'''\n\n result = 'None'\n\n try:\n proc = subprocess.... | python | chosen |
[
{
"from": "human",
"value": "Load data from modified CSV file.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport csv\nimport re\nimport sqlite3\nfrom collections import namedtuple\nimport sys\n\nRecord = namedtuple('Record', ['name', 'day_of_birth',\n ... | python | chosen |
[
{
"from": "human",
"value": "Add missing library for daemonization\n"
},
{
"from": "gpt",
"value": "#\n# Copyright (c) SAS Institute Inc.\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# You may obtain ... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for the Species model\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\n\nfrom apps.data.factories import EntryFactory\nfrom .. import models\n\n\nclass SpeciesTestCase(TestCase):\n\n def test_can_create_species(self):\n\n na... | python | chosen |
[
{
"from": "human",
"value": "tests: Add tests for defaults in core schema config\n\nTests check if default core schema has cache_dir, config_dir, data_dir and max_tracklist_length and if they have proper type\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, unicode_litera... | python | chosen |
[
{
"from": "system",
"value": "Add a test that verifies the cache has a clear method.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport django\nfrom django.core import cache\nfrom django.utils.unittest import skipIf\n\nfrom ..... | python | chosen |
[
{
"from": "human",
"value": "Add first test case for clean\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom clean import CleanSecret\n\n\nclass TestCleanSecret(unittest.TestCase):\n\n def setUp(self):\n self.secrets = []\n self.secrets.append(CleanSecret('passwd',\n ... | python | chosen |
[
{
"from": "human",
"value": "Add pindah lesson plan tarikh\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n#Created : Mon 08 Sep 2008 01:40:45 PM GMT\n#Last Modified : Tue 28 Jul 2015 10:34:53 AM UTC\n\n#qpy:2\n#qpy:console\n\nimport site\nimport os\nimport sys\nfrom time import strftime\nim... | python | chosen |
[
{
"from": "human",
"value": "Add tests for `add_trait` and `remove_trait`.\n"
},
{
"from": "gpt",
"value": "from traits.testing.unittest_tools import unittest\n\nfrom traits.api import Float, HasTraits, Int, List\n\n\nclass Foo(HasTraits):\n x = Float\n\n x_changes = List\n y_changes = ... | python | chosen |
[
{
"from": "human",
"value": "Add test schema deletion bug\n"
},
{
"from": "gpt",
"value": "from dtest import Tester\nfrom assertions import *\nfrom tools import *\nimport time\n\nclass TestSchema(Tester):\n\n def remove_columndef_test(self):\n \"\"\" Remove a column definition while a ... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests for utils\n\nSigned-off-by: Jeff Forcier <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@bitprophet.org>\n"
},
{
"from": "gpt",
"value": "from fudge.patcher import with_patched_object\nfrom functools import wraps\nfrom nose.tools import eq_\n\nfrom nose.too... | python | chosen |
[
{
"from": "system",
"value": "Fix description about global ENCODING.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2012 Alexander Shorin\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as... | python | chosen |
[
{
"from": "human",
"value": "Add utility SymPy subclasses for drudge scripts\n\nThese two subclasses are going to be used for SymPy objects in drudge\nscripts, especially used as the objects for unresolved names.\n"
},
{
"from": "gpt",
"value": "\"\"\"Support for drudge scripts.\"\"\"\n\nimport ... | python | chosen |
[
{
"from": "human",
"value": "Add missing script for extra users\n"
},
{
"from": "gpt",
"value": "import requests\nfrom requests.auth import HTTPBasicAuth\n\nusers = [\n {\n \"firstName\": \"Alicja\",\n \"lastName\": \"Smith\",\n \"login\": \"ala123\",\n \"email\": ... | python | chosen |
[
{
"from": "human",
"value": "Add a migration to add template service_letter_contact_id columns\n"
},
{
"from": "gpt",
"value": "\"\"\"\n\nRevision ID: 0144_template_service_letter\nRevises: 0143_remove_reply_to\nCreate Date: 2017-11-17 15:42:16.401229\n\n\"\"\"\nfrom alembic import op\nimport sq... | python | chosen |
[
{
"from": "human",
"value": "Add test on memory leak\n\n"
},
{
"from": "gpt",
"value": "import weakref\n\nfrom tests import BaseTestCase\n\n\nclass TestCase(BaseTestCase):\n\n async def test_on_successful_cleanup_message(self):\n rabbitmq_connection = await self.create_connection()\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add setup.py for cuda dependency\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(\n name='chainer-cuda-deps',\n version='1.0.0',\n description='A flexible framework of neural networks',\n author='Seiya Tokui',... | python | chosen |
[
{
"from": "human",
"value": "Test for accuracy indicators implemented\n"
},
{
"from": "gpt",
"value": "import os\nimport time\n\nimport pandas as pd\nimport numpy as np\n\nimport tsam.timeseriesaggregation as tsam\n\n\n\ndef test_accuracyIndicators():\n\n hoursPerPeriod = 24\n\n noTypicalP... | python | chosen |
[
{
"from": "human",
"value": "Add example for retrieving json data\n"
},
{
"from": "gpt",
"value": "import aiohttp\nimport asyncio\n\n\n@asyncio.coroutine\ndef go(session):\n print('Query http://httpbin.org/get')\n resp = yield from session.get(\n 'http://httpbin.org/get')\n print... | python | chosen |
[
{
"from": "human",
"value": "Add Triangle and Shape data structures\n\nAdded classes, Triangle and Shape, to represent triangles and shapes\nrespectively.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nclass Triangle:\n \"\"\"A class structure for storing and minipulating a triang... | python | chosen |
[
{
"from": "system",
"value": "Support multi-db for user creation signal\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\n\nfrom django.db.models.signals import post_syncdb\n\nfrom sentry.models import User\n\n\ndef create_first_user(app, created_models, ... | python | chosen |
[
{
"from": "human",
"value": "Add google url shortener example"
},
{
"from": "gpt",
"value": "import json\nimport requests\nimport argparse\nimport sys\n\n\nclass GUrlShorten():\n def __init__(self, key):\n self.API_KEY = key\n\n def google_url_shorten(self, url):\n req_url = ... | python | chosen |
[
{
"from": "human",
"value": "Add a command line tool.\n"
},
{
"from": "gpt",
"value": "import argparse\n\nfrom .api import YouTube\nfrom .utils import print_status\n\n\ndef _main():\n parser = argparse.ArgumentParser(description='YouTube video downloader')\n parser.add_argument(\"url\", he... | python | chosen |
[
{
"from": "human",
"value": "Add a script to make a test starcheck database from recent data\n\nEven on just a few weeks, this seems to take too long to be a\nstandard test, so I'm just putting the logic here for safekeeping.\nIt could also be a \"long\" test for ska_testr, but that wouldn't\nconveniently l... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for projector shortcut\n"
},
{
"from": "gpt",
"value": "from openfisca_core.simulations.simulation_builder import SimulationBuilder\nfrom openfisca_core.taxbenefitsystems import TaxBenefitSystem\nfrom openfisca_core.entities import build_entity\n\ndef ... | python | chosen |
[
{
"from": "human",
"value": "Add members interests delete existing command\n"
},
{
"from": "gpt",
"value": "import sys\nfrom optparse import make_option\nfrom django.core.management.base import NoArgsCommand\nfrom ...models import Release, Category, Entry, EntryLineItem\n\nclass Command(NoArgsCo... | python | chosen |
[
{
"from": "human",
"value": "Add script for sending rf signals.\n"
},
{
"from": "gpt",
"value": "import os\nimport subprocess\n\n# Enter codes for each outlet\ncodes = {'1': {'on': '21811', 'off': '21820'},\n '2': {'on': '21955', 'off': '21964'},\n '3': {'on': '22275', 'off': '22... | python | chosen |
[
{
"from": "human",
"value": "feat: Add scripts to process json files\n\nReads a json files, process it, and apply some functions to get\ndata\n"
},
{
"from": "gpt",
"value": "# To experiment with this code freely you will have to run this code locally.\n# Take a look at the main() function for a... | python | chosen |
[
{
"from": "human",
"value": "Add yummly.recipe and yummly.search functions.\n"
},
{
"from": "gpt",
"value": "\nimport requests\n\n# Yummly API: https://developer.yummly.com\n\n# API URLs\nURL_BASE = 'http://api.yummly.com/v1'\nURL_GET = URL_BASE + '/api/recipe/'\nURL_SEARCH = URL_BASE + ... | python | chosen |
[
{
"from": "human",
"value": "Add Constant vs Expression testing\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, print_function, division\n\nfrom firedrake import *\n\nmesh = UnitSquareMesh(2, 2)\n\nV = FunctionSpace(mesh, \"RT\", 1)\nf1 = Function(V)\nf2 = Function(V)\n\... | python | chosen |
[
{
"from": "human",
"value": "Return details about RabbitMQ server\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport requests\nimport sys\n\nOVERVIEW_URL = \"http://localhost:55672/api/overview\"\nNODES_URL = \"http://localhost:55672/api/nodes\"\nUSERNAME = 'guest'\nPASSWORD = 'gue... | python | chosen |
[
{
"from": "human",
"value": "Add workflow id column to executions_v2 table\n\nPartially implements: blueprint use-workflow-id-in-rest-api\n\nChange-Id: Iad7f1024576b31307016c0f1b4057c794bf4e30b\n"
},
{
"from": "gpt",
"value": "# Copyright 2016 OpenStack Foundation.\n#\n# Licensed under the Apach... | python | chosen |
[
{
"from": "human",
"value": "Add script to run a series of experiments\n\nThe script does Gibbs sampling for different values of nTopics.\n"
},
{
"from": "gpt",
"value": "import logging\nimport glob\nfrom multiprocessing import Process\n\nfrom CPTCorpus import CPTCorpus\nfrom CPT_Gibbs import Gi... | python | chosen |
[
{
"from": "human",
"value": "Add a way to handle sorts & pagination\n"
},
{
"from": "gpt",
"value": "import graphene\nfrom graphene.utils.str_converters import to_camel_case\nfrom django.utils import six\nfrom django.utils.functional import cached_property\n\n__all__ = ['Pager']\n\n\nclass BaseP... | python | chosen |
[
{
"from": "human",
"value": "Test tree for >50% accuracy\n"
},
{
"from": "gpt",
"value": "import milk.supervised.tree\nimport numpy as np\nimport tests.data.german.german\n\ndef test_tree():\n data = tests.data.german.german.load()\n features = data['data']\n labels = data['label']\n ... | python | chosen |
[
{
"from": "human",
"value": "Add globa_alpha_test.py for DRM per plane \"alpha\" property testing\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python3\n\nimport pykms\nimport time\n\ncard = pykms.Card()\nres = pykms.ResourceManager(card)\nconn = res.reserve_connector(\"\")\ncrtc = res.reserve_crt... | python | chosen |
[
{
"from": "human",
"value": "Add test coverage for Operation\n"
},
{
"from": "gpt",
"value": "from pylxd import operation\nfrom pylxd.tests import testing\n\n\nclass TestOperation(testing.PyLXDTestCase):\n \"\"\"Tests for pylxd.operation.Operation.\"\"\"\n\n def test_get(self):\n \"... | python | chosen |
[
{
"from": "human",
"value": "Fix missing unit test file\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nfrom nose.tools import assert_equal, assert_true, assert_false, raises, assert_is_none\nfrom ODBPy.Attributes import *\n\nclass TestAttributes(object):\n d... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests for moto.core.utils.camelcase_to_underscores()\n"
},
{
"from": "gpt",
"value": "from __future__ import unicode_literals\nimport sure\n\nfrom moto.core.utils import camelcase_to_underscores\n\n\ndef test_camelcase_to_underscores():\n cases = {\n ... | python | chosen |
[
{
"from": "human",
"value": "Add set input on selected loaders example\n"
},
{
"from": "gpt",
"value": "\"\"\"Enable the 'Loop' input for all selected loaders\"\"\"\n\nimport fusionless as fu\nimport fusionless.context as fuCtx\n\nc = fu.Comp()\nwith fuCtx.lock_and_undo_chunk(c, \"Set loaders to... | python | chosen |
[
{
"from": "human",
"value": "Add a script to show tracking results.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport os\nimport sys\nsys.path.insert(1, 'external')\nfrom vdetlib.vdet.dataset import imagenet_vdet_classes\nfrom vdetlib.utils.visual import unique_co... | python | chosen |
[
{
"from": "human",
"value": "Add minimal tests for aca_l0\n"
},
{
"from": "gpt",
"value": "from __future__ import division\n\nfrom astropy.table import Table\nimport numpy as np\nfrom mica.archive import aca_l0, asp_l1\nfrom Ska.Numpy import interpolate\n\n\ndef test_get_l0_images():\n \"\"\"... | python | chosen |
[
{
"from": "human",
"value": "Add utility to translate input data format.\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/python\n\nimport sys, os\n\nif len(sys.argv) < 3:\n print('Translate input data in AAAI\\'15 format to separate config, men, women files.')\n print('Usage: {} <input file> ... | python | chosen |
[
{
"from": "human",
"value": "trivial: Add a parallel fuzzing script\n\nThis approximately doubles performace of fuzzing for every two cores you have.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python3\n# SPDX-License-Identifier: LGPL-2.1+\n\nimport argparse\nimport sys\nimport subprocess\nimpor... | python | chosen |
[
{
"from": "human",
"value": " Build index ready for autocomplete.\n\n * indexer.py (rebuild_index, del_index, build_index,\n add_item, del_item, prefixs_for_term, search_query,\n load_items): New.\n"
},
{
"from": "gpt",
"value": "#-*- coding:utf-8 -*-\n\nimport redis\nimport simplejs... | python | chosen |
[
{
"from": "human",
"value": "Add one off mgmt cmd to resubmit some forms to ES\n\nhttp://manage.dimagi.com/default.asp?187526\n"
},
{
"from": "gpt",
"value": "\"\"\"\nATTENTION!\nIf you see this file after the year 2015, please delete it immediately.\n\"\"\"\nimport sys\nfrom django.core.managem... | python | chosen |
[
{
"from": "human",
"value": "Add prototype for k.p class.\n"
},
{
"from": "gpt",
"value": "import numpy as np\nimport scipy.linalg as la\n\nfrom fsc.export import export\nfrom fsc.hdf5_io import subscribe_hdf5, SimpleHDF5Mapping\n\n\n@export\n@subscribe_hdf5('tbmodels.model', check_on_load=False... | python | chosen |
[
{
"from": "human",
"value": "Test module : some test sinario added\n"
},
{
"from": "gpt",
"value": "import requests\nimport json\n\nCLOUD_END_POINT = \"http://211.249.49.198:5000\"\n\ndef test_IsHomePageWorking():\n homePageRequest = requests.get(CLOUD_END_POINT)\n assert homePageRequest.t... | python | chosen |
[
{
"from": "human",
"value": "Add utility function to split .gh file into thms\n\nThis commit starts some new text utilities which will be useful for\nextracting an individual thm from a .gh, for editing.\n"
},
{
"from": "gpt",
"value": "# Copyright 2012 Google Inc.\n#\n# Licensed under the Apach... | python | chosen |
[
{
"from": "human",
"value": "ahm: Create a file with nothing but a TODO in it\n"
},
{
"from": "gpt",
"value": "\"\"\"\nTODO Mon?: Autohost manager for AliCatFiberarts (and others).\n* Have a list of high priority streams, in order (or with priorities)\n* Listen for, or poll for, streams going li... | python | chosen |
[
{
"from": "human",
"value": "Add code for setting sequence length for RNN\n\nIn some cases, sequence length may differ (sentences, sound)\nThis small example shows how to manually deal seq\nof different lengths.\n"
},
{
"from": "gpt",
"value": "import tensorflow as tf\nimport numpy as np\n\ntf.s... | python | chosen |
[
{
"from": "human",
"value": "Add the animals testing harness.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015-2016 MIT Probabilistic Computing Project\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in co... | python | chosen |
[
{
"from": "human",
"value": "Add tests for aggregates with inheritance\n"
},
{
"from": "gpt",
"value": "from decimal import Decimal\nimport sqlalchemy as sa\nfrom sqlalchemy_utils.aggregates import aggregated\nfrom tests import TestCase\n\n\nclass TestLazyEvaluatedSelectExpressionsForAggregates(... | python | chosen |
[
{
"from": "human",
"value": "Add default module for tests to support automatically running all unit tests, with associated scaffold for when other tests are converted.\n"
},
{
"from": "gpt",
"value": "#TODO: REMOVE COMMENTS ONCE BELOW TESTS ARE CONVERTED TO THE UNITTEST FRAMEWORK\n\n#from .test_... | python | chosen |
[
{
"from": "human",
"value": "Add a test for get_current_commit\n"
},
{
"from": "gpt",
"value": "from subprocess import check_call\n\nfrom valohai_cli.git import get_current_commit\n\n\ndef test_get_current_commit(tmpdir):\n dir = str(tmpdir)\n check_call('git init', cwd=dir, shell=True)\n ... | python | chosen |
[
{
"from": "human",
"value": "Add ArcGIS data source util\n"
},
{
"from": "gpt",
"value": "# Copyright 2020 Google LLC\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# You may obtain a copy of the Licens... | python | chosen |
[
{
"from": "human",
"value": "Add kafka writer for benchmarks\n"
},
{
"from": "gpt",
"value": "from kafka import KafkaClient, create_message\nfrom kafka.protocol import KafkaProtocol\nfrom kafka.common import ProduceRequest\nimport random\nimport logging\n\nclass KafkaSampleWriter(object):\n \... | python | chosen |
[
{
"from": "human",
"value": "Add simple test for palplot\n"
},
{
"from": "gpt",
"value": "import nose.tools as nt\nimport numpy.testing as npt\nimport matplotlib.pyplot as plt\n\nfrom .. import miscplot as misc\nfrom seaborn import color_palette\n\n\nclass TestPalPlot(object):\n \"\"\"Test th... | python | chosen |
[
{
"from": "human",
"value": "Add test showing --open-files error when FITSDiff raises AssertionError\n"
},
{
"from": "gpt",
"value": "import pytest\nfrom astropy.io import fits\nimport numpy as np\nfrom pathlib import Path\n\ndef test_fitsdiff_openfile(tmpdir):\n \"\"\"Make sure that failing ... | python | chosen |
[
{
"from": "human",
"value": "feat: Add a script which check the <k> value for each <tag> and see if there are any potential problems\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport xml.etree.cElementTree as ET\nimport pprint\nimport re\nimport os\n\"\"\"\n... | python | chosen |
[
{
"from": "human",
"value": "Add test for conn._make_url. Test if url is encoded properly\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom compmusic.dunya.conn import _make_url\n\n\nclass DunyaTest(unittest.TestCase):\n def test_unicode(self):\n params = {\"first\": \"%^grt\"}\... | python | chosen |
[
{
"from": "human",
"value": "Add geographic coordinte to pixel coordinate converter"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport math\n\ndef geoToPixel( point, zoom, tilesize=256 ):\n\tlng = point[0]\n\tif lng > 180.0: lng -= 360.0\n\tlng = lng / 360.0 + 0.5\n\n\tlat = point[1]... | python | chosen |
[
{
"from": "system",
"value": "Set for zero or one slash\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls.defaults import *\nfrom django.views.generic.simple import direct_to_template\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nf... | python | chosen |
[
{
"from": "human",
"value": "Rename module and add replace_spaces.\n"
},
{
"from": "gpt",
"value": "def unique(string):\n counter = {}\n for c in string:\n if c in counter:\n return False\n else:\n counter[c] = 1\n else:\n return True\n\ndef re... | python | chosen |
[
{
"from": "human",
"value": "Move CouchDB-based Store into separate module.\n"
},
{
"from": "gpt",
"value": "import fix42\nimport couchdb\nimport copy\n\nclass Store(object):\n\t\n\tdef __init__(self, *args):\n\t\tself.db = couchdb.Server(args[0])[args[1]]\n\t\tself._last = None\n\t\n\t@property... | python | chosen |
[
{
"from": "human",
"value": "Add Java 10 (EAP) executor support"
},
{
"from": "gpt",
"value": "from dmoj.executors.java_executor import JavacExecutor\n\n\nclass Executor(JavacExecutor):\n compiler = 'javac10'\n vm = 'java10'\n name = 'JAVA10'\n jvm_regex = r'java-10-|openjdk10'\n\n ... | python | chosen |
[
{
"from": "human",
"value": "Add spiral order of matrix problem\n"
},
{
"from": "gpt",
"value": "#!/Applications/anaconda/envs/Python3/bin\n\n\ndef main():\n # Test suite\n matrix = [\n [1, 2, 3],\n [4, 5, 6],\n [7, 8, 9]\n ]\n spiral = spiral_order(matrix)\n ... | python | chosen |
[
{
"from": "human",
"value": "Grid: Add a baseline test for creating grids from data\n"
},
{
"from": "gpt",
"value": "from parcels import Grid\nimport numpy as np\nimport pytest\n\n\n@pytest.mark.parametrize('xdim', [100, 200])\n@pytest.mark.parametrize('ydim', [100, 200])\ndef test_grid_from_dat... | python | chosen |
[
{
"from": "human",
"value": "Add MQTT receiver python script\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 10 20:30:02 2015\n\n@author: piotr at nicecircuits.com\n\"\"\"\n\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function # compatibility with ... | python | chosen |
[
{
"from": "human",
"value": "Add reward filters to use average rewards\n"
},
{
"from": "gpt",
"value": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom future import standard_library\nst... | python | chosen |
[
{
"from": "human",
"value": "Test the CLI interface of fenrir\n"
},
{
"from": "gpt",
"value": "# 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 may obtain a copy of the License at\n#\n# http://www.apach... | python | chosen |
[
{
"from": "human",
"value": "Add a wrapper to solve all puzzles in ./puzzles and print out timings (timeout after a minute)\n"
},
{
"from": "gpt",
"value": "import os\nimport subprocess\nimport sys\nimport time\n\npaths = []\nfor path, dirs, files in os.walk('puzzles'):\n for file in files:\n... | python | chosen |
[
{
"from": "human",
"value": "Add a tools to config nova paste, not finished\n"
},
{
"from": "gpt",
"value": "# Still some problems...\n\nimport time\nimport shutil\nfrom configobj import ConfigObj\n\nNOVA_API_CONF = \"/etc/nova/api-paste.ini\"\nOS_API_SEC = \"composite:openstack_compute_api_v2\"... | python | chosen |
[
{
"from": "human",
"value": "feat: Create file to get information from a particular URL to get data about airplanes and carriers.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nScript to get information from:\nhttp://www.transtats.bts.gov/Data_Elements... | python | chosen |
[
{
"from": "human",
"value": "Add a script to write frame changes to the executable.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport json\nimport r2pipe\nfrom getopt import getopt, GetoptError\n\nr2 = None\n\ndef write_frame(frame_no, lvl_prefix):\n lvl_... | python | chosen |
[
{
"from": "system",
"value": "Fix error raised when twitter lib is installed, but mezzanine.twitter is removed from INSTALLED_APPS.\n"
},
{
"from": "human",
"value": "\"\"\"\nProvides models and utilities for displaying different types of Twitter feeds.\n\"\"\"\nfrom __future__ import unicode_li... | python | chosen |
[
{
"from": "system",
"value": "Update intersphinx mapping to Django 1.8\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# This file is execfile()d with the current directory set to its containing\n# directory.\n\nimport sys, os\nsys.path.append(os.path.join(os.path.abspath('.'), '_... | python | chosen |
[
{
"from": "human",
"value": "Add tests for compression and decompression functions\n"
},
{
"from": "gpt",
"value": "from tempfile import NamedTemporaryFile\n\nfrom typhon.files import compress, decompress\n\n\nclass TestCompression:\n data = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910\"\n\n de... | python | chosen |
[
{
"from": "human",
"value": "Add constant for ESX datacenter path (HTTP access)\n\nThis patch adds a constant.py file to store the constants needed in\nthe VMware ecosystem. A new constant is added for the ESX datacenter\npath when using http access to datastores.\n\nChange-Id: Ie5b84b3cc3913ab57f7ab4873495... | python | chosen |
[
{
"from": "human",
"value": "Add a test case for masking secret values in API log messages.\n"
},
{
"from": "gpt",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional inf... | python | chosen |
[
{
"from": "human",
"value": "Add a template tag filter to properly format the time of events\n"
},
{
"from": "gpt",
"value": "# -*- encoding:utf-8 -*-\n# Template tag\nfrom django.template.defaultfilters import stringfilter\nfrom datetime import datetime, timedelta\nfrom django import template\n... | python | chosen |
[
{
"from": "human",
"value": "[AC-7272] Add migration for altered field\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.18 on 2019-11-25 17:04\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db import migrations, model... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.