conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add test data generator (to be hacked as needed)\n"
},
{
"from": "gpt",
"value": "# Generate test data in FDAX datafile format\n# Hack as needed\n\nfrom math import sin, pi\n\nprice_anchor = 9000.0\nprice_swing = 200.0\nperiod = 1000\n\nwith open('FDAX_19700101.csv',... | python | chosen |
[
{
"from": "human",
"value": "Add tests for userinfo endpoint.\n"
},
{
"from": "gpt",
"value": "from datetime import timedelta\n\nfrom django.core.urlresolvers import reverse\nfrom django.test import RequestFactory\nfrom django.test import TestCase\nfrom django.utils import timezone\n\nfrom oidc_... | python | chosen |
[
{
"from": "human",
"value": "ENH: Add smoke tests for interaction_plot\n"
},
{
"from": "gpt",
"value": "import numpy as np\nfrom pandas import Series\nimport matplotlib.pyplot as plt\nfrom statsmodels.graphics.factorplots import interaction_plot\n\nclass TestInteractionPlot(object):\n\n @clas... | python | chosen |
[
{
"from": "human",
"value": "Test script for obd library\n"
},
{
"from": "gpt",
"value": "#ODB2 datalogger\n\nimport odb\n\nconnection = obd.OBD()\n\nwhile true:\n request = connection.query(obd.commands.RPM)\n\n if not r.is_null():\n print(r.value)"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add tests for playplaylist filter\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# coding=utf-8\n\nfrom __future__ import print_function, unicode_literals\n\nimport os\nimport os.path\n\nimport nose.tools as nose\n\nfrom tests.utils import run_filter\n\n\nde... | python | chosen |
[
{
"from": "human",
"value": "Test if identify binary is in PATH\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport shutil\nimport unittest\n\n\nclass TestBinariesInPath(unittest.TestCase):\n\n \"\"\"\n TODO: Docstring\n\n \"\"\"\n\n def setUp(se... | python | chosen |
[
{
"from": "human",
"value": "Add a specification for the pb_type.xml generator\n\nSigned-off-by: David Shah <4be9b043912c80de45ffb490ebd07e45bc0fcd34@gmail.com>\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python3\nimport yosys_exec\nimport lxml.etree as ET\nimport argparse, re\nimport os, tempfi... | python | chosen |
[
{
"from": "human",
"value": "Add UltimateListCtrl sample for virtual\n"
},
{
"from": "gpt",
"value": "import wx\nfrom wx.lib.agw import ultimatelistctrl as ULC\n\n\nclass TestUltimateListCtrl(ULC.UltimateListCtrl):\n def __init__(self, parent, log):\n ULC.UltimateListCtrl.__init__(self... | python | chosen |
[
{
"from": "human",
"value": "Add UTM bathy extraction function\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport numpy\n\nimport matplotlib.pyplot as plt\nimport mpl_toolkits.basemap.pyproj as pyproj\n\nimport extract_bathy\nimport bathy\n\ndef convert_UTM2longlat(file_path, zone=... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests for address validation\n"
},
{
"from": "gpt",
"value": "import i18naddress\nimport pytest\n\nfrom . import forms\n\n\n@pytest.mark.parametrize('country', ['CN', 'PL', 'US'])\ndef test_address_form_for_country(country):\n data = {\n 'first_na... | python | chosen |
[
{
"from": "human",
"value": "Add browser test for admin menu\n\nRefs SH-435\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# This file is part of Shuup.\n#\n# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.\n#\n# This source code is licensed under the AGPLv3 license ... | python | chosen |
[
{
"from": "human",
"value": "feat(macro): Add translate example macro for NTB\n"
},
{
"from": "gpt",
"value": "\"\"\"\r\n En to NO Metadata Macro will perform the following changes to current content item:\r\n - change the byline to \"(NPK-NTB)\"\r\n - change the signoff to \"npk@npk.no... | python | chosen |
[
{
"from": "human",
"value": "Add test for new fast correlate\n"
},
{
"from": "gpt",
"value": "from contextlib import contextmanager\nfrom time import time\nimport numpy as np\nfrom skan.vendored import thresholding as th\n\n\n@contextmanager\ndef timer():\n result = [0.]\n t = time()\n ... | python | chosen |
[
{
"from": "human",
"value": "Move the signature class into it's own tool .py\n"
},
{
"from": "gpt",
"value": "\nimport datetime\nimport hmac, hashlib, base64\n\ndef _build_authheader(method, data):\n datastr = \", \".join(['{0}=\"{1}\"'.format(x, y) for x, y in data.iteritems()])\n return \"{0... | python | chosen |
[
{
"from": "human",
"value": "Add a basic Gene class to contain a sequence of dna and support mutation.\n"
},
{
"from": "gpt",
"value": "import random\nHUMAN_DNA_ELEMENTS = set([\"A\",\"C\",\"G\",\"T\"])\n\ndef clone_gene(g):\n return Gene(g.dna, g.elements, g.name)\n\nclass Gene:\n # Gene ... | python | chosen |
[
{
"from": "human",
"value": "Add script for generating mod_raw test cases\n\nThis commit only adds the boilerplate, no actual tests are added.\n\nSigned-off-by: Janos Follath <b175c17abe0474719672be1367bb75ee28bd5c71@arm.com>\n"
},
{
"from": "gpt",
"value": "\"\"\"Framework classes for generatio... | python | chosen |
[
{
"from": "human",
"value": "Add script for generating simple chunk data.\n"
},
{
"from": "gpt",
"value": "from num2words import num2words\n\n# Generate BitFunnel chunk data, with documents consisting of:\n# {'one'}, {'one', 'two'}, {'one', 'two', 'three'}, ...\n\ndef print_numbers(num):\n al... | python | chosen |
[
{
"from": "human",
"value": "Test file for parallel map\n"
},
{
"from": "gpt",
"value": "# Built-in module #\n\n# Internal modules #\nfrom plumbing.processes import prll_map\n\ndef add(xy):\n x,y = xy\n return x+y\n\ninputs = [(5,5), (2,2), (20,30)]\n\nresults = prll_map(add, inputs)\n\npr... | python | chosen |
[
{
"from": "system",
"value": "Change minimisation example mif name\n"
},
{
"from": "human",
"value": "def main():\n from sim import Sim\n from mesh import Mesh\n from energies.exchange import Exchange\n from energies.demag import Demag\n from energies.zeeman import Zeeman\n fro... | python | chosen |
[
{
"from": "human",
"value": "Add python script to manage custom metaphlan2 db\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport cPickle as pickle\nimport bz2\nimport json\nimport argparse\n\ndef transform_json_to_pkl(args):\n with open(args.json_input, ... | python | chosen |
[
{
"from": "human",
"value": "Add migration to copy global document permissions to the default collection\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef get_document_permissions(apps):\n # return a ... | python | chosen |
[
{
"from": "human",
"value": "Add WSGI file for deployment with apache\n\nNote using this means that the Apache config files (typically in /etc/apache2/sites-available)\nshould be congifured to point to this WSGI file. See Digital Ocean tutorial for reference:\nhttps://www.digitalocean.com/community/tutorial... | python | chosen |
[
{
"from": "system",
"value": "Add tests to confirm store/not api is default\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import absolute_import\n\nfrom django.conf import settings\n\nfrom sentry.models import Project, Team, User\nfrom sentry.receivers.core import create_... | python | chosen |
[
{
"from": "human",
"value": "Add tests for Render wrapper\n"
},
{
"from": "gpt",
"value": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom builtins import * # NOQA\nfrom future import s... | python | chosen |
[
{
"from": "human",
"value": "Add a file to hold default settings.\n"
},
{
"from": "gpt",
"value": "DEV_LISTEN_HOST = '127.0.0.1'\nDEV_LISTEN_PORT = 5000\n\nSERVERS = {}\nAPI_KEYS = {}\nLOGLEVEL = 'info'\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add script for downloading data sets\n"
},
{
"from": "gpt",
"value": "import argparse\nimport subprocess as sp\nimport os\n\"\"\"\nScript for downloading the data sets from Kaggle\n\nUsage:\n\n python download_data.py\n\nRun\n\n python download_data.py --help\n... | python | chosen |
[
{
"from": "human",
"value": "Complete two pointers w/ leftmax/rightmax heights sol\n"
},
{
"from": "gpt",
"value": "\"\"\"Leetcode 42. Trapping Rain Water\nHard\n\nURL: https://leetcode.com/problems/trapping-rain-water/\n\nGiven n non-negative integers representing an elevation map where the wid... | python | chosen |
[
{
"from": "human",
"value": "Support for creating tarballs of arbitrary locations on disk and download them locally.\n"
},
{
"from": "gpt",
"value": "import os\n\nfrom fabric.api import run, get\n\nfrom braid import utils\nfrom pipes import quote\n\n\ndef dump(spec, localfile):\n \"\"\"\n ... | python | chosen |
[
{
"from": "human",
"value": "Add stats dump example (used as a sanity check of the protocol against the machine)\n"
},
{
"from": "gpt",
"value": "\"\"\"\nRead some statistics from a connected machine, and dump them to the console.\n\nRequires these modules:\n* pySerial: http://pypi.python.org/py... | python | chosen |
[
{
"from": "human",
"value": "Add base HyperModel class and DefaultHyperModel.\n"
},
{
"from": "gpt",
"value": "# Copyright 2019 The Keras Tuner 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# Y... | python | chosen |
[
{
"from": "human",
"value": "Add wavelet transform node from Andrew Li\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, division, print_function\n\nimport os\n\n# gpi, future\nimport gpi\nfrom bart.gpi.borg import IFilePath, OFilePath, Command\n\n# bart\nimport bart\nbase... | python | chosen |
[
{
"from": "human",
"value": "Add script that exports departments to elastic search.\n"
},
{
"from": "gpt",
"value": "import json\nimport elasticsearch\nfrom django.core.management.base import BaseCommand\nfrom firecares.firestation.models import FireDepartment\nfrom elasticsearch import Elastics... | python | chosen |
[
{
"from": "human",
"value": "Test case for python bindings.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport mapnik\nimport sys\n\nclass MyText(mapnik.FormatingNode):\n def __init__(self):\n mapnik.FormatingNode.__init__(self)\n self.expr = mapnik.Expression(\"[nam... | python | chosen |
[
{
"from": "human",
"value": "Add a really expensive script to iterate and obliterate spammy domains from the data store\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport pprint\nimport sys\n\nimport redis\nimport yajl\n\ndef main():\n lines = [l.strip() for l in sys.stdin.xread... | python | chosen |
[
{
"from": "human",
"value": "Add some tests for variables\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom mo.runner import Variable\n\n\nclass TestVariable(unittest.TestCase):\n def test_default(self):\n v = Variable('name', {'default': 'default'})\n self.assertEqual(v.... | python | chosen |
[
{
"from": "human",
"value": "Add a s4ils example that uses more math\n"
},
{
"from": "gpt",
"value": "from s4ils import *\n\ns = Session()\n\nwith s[INIT]:\n s.engine = c.Engine() | s\n s.fm = s.engine.new_module(rv.m.Fm) | s\n s.engine.output << s.fm | s\n s.track1 = s.engine.track(... | python | chosen |
[
{
"from": "human",
"value": "Remove the need to call super.__init__ by lazily instatiating instance variables.\n"
},
{
"from": "gpt",
"value": "from nose.tools import with_setup, raises\n\nfrom gevent_tools import util\nfrom unittest import TestCase\n\nclass TestUtil(TestCase):\n def setUp(se... | python | chosen |
[
{
"from": "human",
"value": "Add script from master to ensure bookmark uniqueness in modm\n"
},
{
"from": "gpt",
"value": "import argparse\nimport logging\n\nfrom modularodm import Q\n\nfrom framework.auth.core import User\nfrom framework.transactions.context import TokuTransaction\nfrom scripts... | python | chosen |
[
{
"from": "human",
"value": "Add quick benchmark profile for EFM32 targets.\n"
},
{
"from": "gpt",
"value": "# Boards to test.\nBOARDS = [\n \"stk3200\",\n \"slstk3401a\",\n \"stk3600\",\n \"stk3700\",\n \"stk3800\",\n \"slwstk6220a\",\n]\n\n# Applications to compile (relative ... | python | chosen |
[
{
"from": "human",
"value": "Fix broken ceilometer resources migration script\n\nMigration script 828c16f70cce have a bug, the following command doesn't\ninsert anything:\n\n op.execute(resource_type.insert().from_select(\n ['name'], sa.select([resource.c.type]).distinct()))\n\nSo all migration... | python | chosen |
[
{
"from": "human",
"value": "Create the starts of an Api object\n"
},
{
"from": "gpt",
"value": "from . import requests\n\n\nclass Api(object):\n\n def __init__(self, url, session=None, *args, **kwargs):\n super(Api, self).__init__(*args, **kwargs)\n\n if session is None:\n ... | python | chosen |
[
{
"from": "human",
"value": "Add migration file for modification date\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport datetime\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [... | python | chosen |
[
{
"from": "human",
"value": "Set up to take a list of playlist ids and return all urls\n"
},
{
"from": "gpt",
"value": "import gdata.youtube\nimport gdata.youtube.service\n\nyt_service = gdata.youtube.service.YouTubeService()\nyt_service.ssl = True\n\nbaseURL = \"http://gdata.youtube.com/feeds/a... | python | chosen |
[
{
"from": "human",
"value": "Add new test for android web view.\n"
},
{
"from": "gpt",
"value": "import os\nimport glob\nimport unittest\nfrom time import sleep\nfrom selenium import webdriver\n\nclass TestAndroidWebView(unittest.TestCase):\n\n def setUp(self):\n app = os.path.abspath(... | python | chosen |
[
{
"from": "human",
"value": "Add prerequisite script for gdrive migration\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Migrates GoogleDrive files that have unescaped paths and have a counterpart StoredFileNode. This repoints\nthe Guid for the unescaped StoredFileNode to the co... | python | chosen |
[
{
"from": "human",
"value": "Add simple example player for README tutorial\n"
},
{
"from": "gpt",
"value": "from pypokerengine.players import BasePokerPlayer\n\nclass FishPlayer(BasePokerPlayer): # Do not forget to make parent class as \"BasePokerPlayer\"\n\n # we define the logic to make a... | python | chosen |
[
{
"from": "human",
"value": "Add utility to turn findBin variable on/off\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nfrom networktables import NetworkTable\nfrom optparse import OptionParser\n\nimport time\n\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\n\nif __name__ ... | python | chosen |
[
{
"from": "system",
"value": "Add Python version trove classifiers.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name = \"django-redis-cache\",\n url = \"http://github.com/sebleier/django-redis-cache/\",\n author = \"Sean Bleier\",\n author_email = \"se... | python | chosen |
[
{
"from": "human",
"value": "Add code to generate Erdos and preferential attachment graphs\n"
},
{
"from": "gpt",
"value": "import pdb\nimport time\nimport collections\nimport random\nimport itertools\nimport xmlrpclib\nimport dis\n\nserver_url = 'http://127.0.0.1:20738/RPC2'\nserver = xmlrpclib... | python | chosen |
[
{
"from": "human",
"value": "Add unit test for safe_equal_attributes\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom raiden.utils import safe_equal_attributes\n\n\nclass Slotted(object):\n __slots__ = (\n 'a',\n 'b',\n )\n\n def __eq__(self, other):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add basic unit testing functionality\n"
},
{
"from": "gpt",
"value": "\ndef run_tests(name, globals_dict):\n import sys\n RED = '\\033[91m'\n BOLD = '\\033[1m'\n END = '\\033[0m'\n print (BOLD + 'Running tests for ' + name + ' ...' + END)\n tests = ... | python | chosen |
[
{
"from": "human",
"value": "Test case for wordaxe bug"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom reportlab.platypus import SimpleDocTemplate\nfrom reportlab.platypus.paragraph import Paragraph\nfrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle\nfrom reportla... | python | chosen |
[
{
"from": "human",
"value": "Add euler project 3 problem\n"
},
{
"from": "gpt",
"value": "# projecteuler.net/problem=3\r\n\r\ndef LargestPrimeFactor():\r\n\tres = FindLargestPrimeNumber(600851475143)\r\n\tprint(res)\r\n\r\ndef FindLargestPrimeNumber(n):\r\n\ti = n\r\n\twhile i > 1:\r\n\t\ti = i ... | python | chosen |
[
{
"from": "human",
"value": "Add a unit test for utils.parsing\n\nMost of the coverage comes from the main test suite, but this covers the\ncase where the lextab/parsetab does not yet exist and has to be\ngenerated.\n"
},
{
"from": "gpt",
"value": "# Licensed under a 3-clause BSD style license -... | python | chosen |
[
{
"from": "human",
"value": "Add Briefs.is_a_copy to replace Briefs.copied_from_brief_id\n"
},
{
"from": "gpt",
"value": "\"\"\"Add Brief.is_a_copy boolean, default False, nullable False\n\nRevision ID: 890\nRevises: 880\nCreate Date: 2017-06-01 11:24:53.346954\n\n\"\"\"\n\n# revision identifier... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with missing files from the PyPI package.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n e... | python | chosen |
[
{
"from": "human",
"value": "Add task file using invoke task runner\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nimport subprocess\nfrom invoke import task\n\n\n@task\ndef test():\n # invoke.run() does not color output, unfortunately\n nosetests = subprocess.Popen(['nosetests... | python | chosen |
[
{
"from": "human",
"value": "Implement function for retrieving ISS timestamps\n"
},
{
"from": "gpt",
"value": "import requests\nfrom datetime import datetime\n\n\ndef get_next_pass(lat, lon):\n iss_url = 'http://api.open-notify.org/iss-pass.json'\n location = {'lat': lat, 'lon': lon}\n ... | python | chosen |
[
{
"from": "human",
"value": "Add script to process domain name\n"
},
{
"from": "gpt",
"value": "with open('generic.txt') as old:\n\tfor line in old:\n\t\tline.strip()\n\t\tmlength = len(line)-1\n\t\twith open('generic-'+str(mlength)+'.txt', 'a') as new:\n\t\t\tnew.write(line)"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add phased loop limitter class.\n\nThis is needed for Aggregator to work.\n"
},
{
"from": "gpt",
"value": "\"\"\" Standard shared utilities. \"\"\"\n\n\nimport time\n\n\nclass PhasedLoopLimitter:\n \"\"\" Constrains a loop to running a particular number of iteration... | python | chosen |
[
{
"from": "human",
"value": "Add test view for debugging\n"
},
{
"from": "gpt",
"value": "from flask.ext.restful import Resource, abort\nfrom finder.models import Card\nfrom finder import api\n#fields, marshal_with\n\n\n\n#gen_fields = {\n# 'key': fields.Raw,\n# 'salt': fields.Raw,\n# '... | python | chosen |
[
{
"from": "human",
"value": "Add tests for quantity helpers\n"
},
{
"from": "gpt",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nTests for the _quantity_helpers module.\n\"\"\"\n\nimport astropy.units as u\nimport numpy as np\nfrom numpy.testing import assert... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 105. Construct Binary Tree from Preorder and Inorder Traversal\n\n105. Construct Binary Tree from Preorder and Inorder Traversal: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/\n"
},
{
"from": "gpt",
"valu... | python | chosen |
[
{
"from": "human",
"value": "Add encryption and decryption using ECB\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nimport sys\nfrom Crypto.Cipher import AES\nimport base64\n\nclass ECB:\n def __init__(self, key):\n self.key = key.encode()\n self... | python | chosen |
[
{
"from": "human",
"value": "Test of xfs_info mapper with info from 'man xfs_info'\n"
},
{
"from": "gpt",
"value": "from falafel.mappers import xfs_info\nfrom falafel.tests import context_wrap\n\nclass TestXFSInfo():\n def test_example_xfs_info(self):\n xfs_info = xfs_info.XFSInfo(cont... | python | chosen |
[
{
"from": "human",
"value": "Add migrations for Daily{Channel,Country,Snippets}Metrics models\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.2.6 on 2019-12-04 18:57\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):... | python | chosen |
[
{
"from": "system",
"value": "Add gevent as an extra requirement\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\n\n# README = \"/\".join([os.path.dirname(__file__), \"README.md\"])\n\n# with open(README) as file:\n# long_description = file.read(... | python | chosen |
[
{
"from": "human",
"value": "feat: Add a data migration to copy all course index data into MySQL\n"
},
{
"from": "gpt",
"value": "from django.db import migrations, models\nfrom django.db.utils import IntegrityError\n\n\nfrom xmodule.modulestore import ModuleStoreEnum\nfrom xmodule.modulestore.dj... | python | chosen |
[
{
"from": "human",
"value": "Add simple zone generator script\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nimport lglass.generators.dns\nimport lglass.database\n\nif __name__ == \"__main__\":\n\timport argparse\n\n\targparser = argparse.ArgumentParser(description=\"Delegation-only ... | python | chosen |
[
{
"from": "human",
"value": "Add two test cases for twoSum problem.\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom twoSum import Solution\n\nclass TestTwoSum(unittest.TestCase):\n def testLeetCodeExamplePasses(self):\n solution = Solution()\n numbers = [2, 7, 11, 15]\n ... | python | chosen |
[
{
"from": "human",
"value": "Add test for mapping predictions\n"
},
{
"from": "gpt",
"value": "\"\"\" Test ``yatsm map predict ...``\n\"\"\"\nfrom click.testing import CliRunner\nimport numpy as np\n\nfrom yatsm.cli.main import cli\n\n\n# Truth for diagonals\ndiag = np.eye(5).astype(bool)\n# SWI... | python | chosen |
[
{
"from": "human",
"value": "Resolve Disk Database backup tool\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env python\n\n# Davinci Resolve 12 and above Disk Database project backup utility.\n# Igor Ridanovic, HDhead.com\n\nimport os\nimport sys\nimport getpass\nimport time\nfrom shutil import m... | python | chosen |
[
{
"from": "human",
"value": "Move ParseDump script to dumps folder.\n\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n#\n# Copyright (c) 2007-2008 The PyAMF Project.\n# See LICENSE for details.\n\n\"\"\"\nExtracts and displays information for files that contain AMF data.\n\"\"\"\n\nimport gl... | python | chosen |
[
{
"from": "human",
"value": "Add conf file for Avanti KoomBook\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"KoomBook conf\"\"\"\nfrom .kb import * # noqa\n\nLANGUAGE_CODE = 'es'\nIDEASCUBE_NAME = 'Avanti'\nHOME_CARDS = STAFF_HOME_CARDS + [\n {\n 'id': 'blog',\n }... | python | chosen |
[
{
"from": "human",
"value": "Add new indexes to optimize `task().result` expression function\n\nChange-Id: I94707368dbfe363a2b909985d3bd24dbae8e67f6\n"
},
{
"from": "gpt",
"value": "# Copyright 2018 OpenStack Foundation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ... | python | chosen |
[
{
"from": "human",
"value": "Add accidentally omitted TintDelegate source file.\n"
},
{
"from": "gpt",
"value": "# The MIT License (MIT)\n#\n# Copyright (c) 2015 WUSTL ZPLAB\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated docu... | python | chosen |
[
{
"from": "human",
"value": "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=agable@chromium.org\n\nReview URL: https... | python | chosen |
[
{
"from": "human",
"value": "Test for adding page numbers using Table class\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# ScraperWiki Limited\n# Ian Hopkinson, 2013-07-30\n# -*- coding: utf-8 -*-\n\n\"\"\"\nTests the Table class which contains metadata\n\"\"\"\nimport sys\nsys.path.a... | python | chosen |
[
{
"from": "human",
"value": "Drop dates and comments from Czech templates.\n"
},
{
"from": "gpt",
"value": "from base import *\n\nclass SnippetParser(SnippetParserBase):\n def strip_template(self, template, normalize, collapse):\n if self.is_citation_needed(template):\n # Th... | python | chosen |
[
{
"from": "human",
"value": "Add a rudimentary script server. Does nothing at the moment.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n'''ZoneScriptServer\nA server that runs scripts for all the objects in a zone.\n'''\n\nimport threading\nfrom threading import Timer\n\nimport sched, ... | python | chosen |
[
{
"from": "human",
"value": "Add alembic revision to enable abstract feature\n"
},
{
"from": "gpt",
"value": "\"\"\"Enable abstract feature for conferences\n\nRevision ID: 5596683819c9\nRevises: ccd9d0858ff\nCreate Date: 2016-08-23 11:35:26.018462\n\"\"\"\n\nimport json\n\nimport sqlalchemy as s... | python | chosen |
[
{
"from": "human",
"value": "Add dist-utils support for gentoo ebuild\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"Setup script for the kconfiglib module.\"\"\"\n\nfrom distutils.core import setup\n\nsetup (# Distribution meta-data\n name = \"kconfiglib\",\n versio... | python | chosen |
[
{
"from": "human",
"value": "Implement first version of LR classifier\n"
},
{
"from": "gpt",
"value": "import numpy as np\nimport pylab as pl\nimport feature_extractor as fe\nfrom sklearn import linear_model\n\n(features, targets) = fe.extract_train()\n(features_test, targets_test) = fe.extract_... | python | chosen |
[
{
"from": "human",
"value": "Add geography column to zones.\n"
},
{
"from": "gpt",
"value": "\"\"\"Add geom field to zones to hold regions.\n\nRevision ID: 4673b3fa0d68\nRevises: 4ef20b76cab1\nCreate Date: 2015-02-11 21:12:26.578588\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision... | python | chosen |
[
{
"from": "human",
"value": "Add file for inactive rules 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 Grammar, Nonter... | python | chosen |
[
{
"from": "human",
"value": "Add ANDS RIF-CS conversion script\n"
},
{
"from": "gpt",
"value": "\"\"\"\nCreate an ANDS RIF-CS XML file.\n\nLinks\n-----\n\n- http://ands.org.au/guides/cpguide/cpgrifcs.html\n\n- http://services.ands.org.au/documentation/rifcs/guidelines/rif-cs.html\n\n- http://www... | python | chosen |
[
{
"from": "human",
"value": "Add a script for updating comments(in methods). The script is used to sync the channnel.py comments with the AMQP spec.\n"
},
{
"from": "gpt",
"value": "import sys, os\nimport re\n\ndefault_source_file = os.path.join(os.path.dirname(__file__), '../amqp/channel.py') ... | python | chosen |
[
{
"from": "human",
"value": "Integrate calparser app with neverlate\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\n\nfrom celery import shared_task\n\nfrom calparser.tasks import parse_ical_from_url\nfrom calparser.models import CalendarEntry\nfrom django.contrib.auth.m... | python | chosen |
[
{
"from": "human",
"value": "Test case for incorrect rendering of bullet noticed in a wydget test case.\n\n\ngit-svn-id: d4fdfcd4de20a449196f78acc655f735742cd30d@1197 14d46d22-621c-0410-bb3d-6f67920f7d95\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n'''Test that font.Text horizontal ... | python | chosen |
[
{
"from": "human",
"value": "Break out constantns to a diff file\n"
},
{
"from": "gpt",
"value": "\n\npayload_types = {\n 'ipmi': 0x0,\n 'sol' : 0x1,\n 'rmcpplusopenreq': 0x10,\n 'rmcpplusopenresponse': 0x11,\n 'rakp1': 0x12,\n 'rakp2': 0x13,\n 'rakp3': 0x14,\n 'rakp4': 0... | python | chosen |
[
{
"from": "human",
"value": "Add a string format test.\n"
},
{
"from": "gpt",
"value": "#!/usr/local/bin/python\nwidth=input('Please input width: ')\nprice_width=10\nitem_width=width-price_width\n\nheader='%-*s%*s'\nformat='%-*s%*.2f'\n\nprint width*'='\nprint header %(item_width,'Item',price_wi... | python | chosen |
[
{
"from": "human",
"value": "Add mostly empty unit tests\n"
},
{
"from": "gpt",
"value": "#!/bin/python2.7\n\nimport mock\nimport unittest\n\nimport api_calls\n\n\nclass FakeFirebase(object):\n\n def get(self, path, item):\n return None\n\n def put(self, path, item, data):\n return None\... | python | chosen |
[
{
"from": "human",
"value": "Add presubmit format requirement for webrtc/api/android\n\nBUG=webrtc:6419\nNOTRY=True\nTBR=kjellander@webrtc.org\n\nReview-Url: https://codereview.webrtc.org/2377113003\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#14435}\n"
},
{
"from": "gpt",
"va... | python | chosen |
[
{
"from": "human",
"value": "Add script to plot ECDH timing.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# Script for plotting ECTester ECDH results.\n#\n# Example usage:\n#\n# > java -jar ECTesterReader.jar -dh 10000 -b 192 -fp -o dh.csv\n# ...\n# > ./plot_dh.py dh.cs... | python | chosen |
[
{
"from": "human",
"value": "Check that empty functions can be compiled\n"
},
{
"from": "gpt",
"value": "from i8c.tests import TestCase\n\nSOURCE = \"define test::pretty_minimal\"\n\nclass TestEmptyFunction(TestCase):\n def test_empty_function(self):\n \"\"\"Check that empty functions ... | python | chosen |
[
{
"from": "human",
"value": "Add test case for WordPress_With_LB.template\n\nChange-Id: I324da126b5a775a00b97d868cbd347dd65cb16aa\nSigned-off-by: Steven Dake <8638f3fce5db0278cfbc239bd581dfc00c29ec9d@redhat.com>\n"
},
{
"from": "gpt",
"value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# ... | python | chosen |
[
{
"from": "human",
"value": "Add test for atomicity of renames of non-empty directories\n"
},
{
"from": "gpt",
"value": "import errno\nimport multiprocessing\nimport os\nimport tempfile\nfrom functools import partial\n\nfrom toil.test import ToilTest\n\n\nclass SystemTest(ToilTest):\n \"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Correct the translation domain for loading messages\n\nChange-Id: If7fa8fd1915378bda3fc6e361049c2d90cdec8af\n"
},
{
"from": "human",
"value": "# Copyright 2014 Mirantis Inc.\n#\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Li... | python | chosen |
[
{
"from": "human",
"value": "LILY-1099: Add management script to identify similar tag names.\n"
},
{
"from": "gpt",
"value": "from optparse import make_option\nfrom django.core.management.base import BaseCommand\n\nfrom lily.tags.models import Tag\n\nimport difflib\n\n\nclass Command(BaseCommand... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary import of form submodule\n"
},
{
"from": "human",
"value": "import forms # noqa\nimport models # noqa\n\n\n__all__ = (\n 'forms',\n 'models',\n)\n\n\n__version__ = 'unknown'\ntry:\n __version__ = __import__('pkg_resources').get_distribu... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.