conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "[rtntracer] Add script to parse rtntracefull output into a call tree\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport sys, os, subprocess\n\ndef ex_ret(cmd):\n return subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0]\ndef cppfilt(name)... | python | chosen |
[
{
"from": "human",
"value": "Add Think Like a Programmer section and start chp 2 exercises\n"
},
{
"from": "gpt",
"value": "#!/usr/local/bin/python\n# Think Like a Programmer Chapter 2: Pure Puzzles exercises\n\n\ndef main():\n poundV()\n print()\n poundDiamond()\n\n\ndef poundV():\n ... | python | chosen |
[
{
"from": "human",
"value": "Add initial tests for to_text\n"
},
{
"from": "gpt",
"value": "from datetime import datetime\nfrom recurrence import Recurrence, Rule\nimport recurrence\n\n\ndef test_rule_to_text_simple():\n assert Rule(\n recurrence.WEEKLY\n ).to_text() == 'weekly'\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add file with test problems\n"
},
{
"from": "gpt",
"value": "import nets\nimport random\nimport math\n\ndef XOR():\n '''Exclusive or'''\n net = nets.FeedForwardNet(2, 3, 1)\n \n domain = ((1,1), (1,-1), (-1,1), (-1,-1))\n rng = ((0,), (1,), (1,), (0,))... | python | chosen |
[
{
"from": "human",
"value": "Add a template tag to conditionally *parse* the tag's nested content.\n"
},
{
"from": "gpt",
"value": "# Loosely based on noparse.py from https://code.djangoproject.com/ticket/14502\n\nfrom django import template\nfrom django.template.defaulttags import TemplateIfPar... | python | chosen |
[
{
"from": "human",
"value": "Add script to use Dropbox API\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!\n# Go to dropbox.com/developers/apps to create an app.\n\nimport webbrowser\nfrom dropbox import client, rest, session\nimport ... | python | chosen |
[
{
"from": "human",
"value": "Solve by exploiting ascii values\n"
},
{
"from": "gpt",
"value": "\"\"\"\r\nWhen you select a contiguous block of text in a PDF viewer, the selection is highlighted with a blue rectangle. In this PDF viewer, each word is highlighted independently. For example:\r\n\r\... | python | chosen |
[
{
"from": "human",
"value": "Add excel converter which converts tab spaced text file data to excel file\n"
},
{
"from": "gpt",
"value": "import csv\nimport xlwt\nimport os\nimport sys\nimport subprocess\n\t\ndef convert(filename):\t\n\t# Look for input file in same location as script file:\n\tin... | python | chosen |
[
{
"from": "system",
"value": "Refactor unspent utxo data gathering"
},
{
"from": "human",
"value": "\n'''Communicate with local or remote peercoin-daemon via JSON-RPC'''\n\nfrom operator import itemgetter\n\ntry:\n from peercoin_rpc import Client\nexcept:\n raise EnvironmentError(\"peercoi... | python | chosen |
[
{
"from": "human",
"value": "Add the script on Python 2.x.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# The MIT License (MIT)\n# \n# Copyright (c) 2014 Keita Kita\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated... | python | chosen |
[
{
"from": "human",
"value": "Add a state for update entire list of persons.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# encoding=utf8\n\nimport json\n\nimport requests\nfrom flexbe_core import EventState, Logger\n\n\"\"\"\nCreated on 17/05/2018\n\n@author: Lucas Maurice\n\"\"\"\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add initial tests for endpoint code.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2014 Metaswitch Networks\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lice... | python | chosen |
[
{
"from": "human",
"value": "Add a file to extract error strings\n"
},
{
"from": "gpt",
"value": "from __future__ import with_statement\nimport os, sys, tempfile, subprocess, re\n\n__all__ = [\"has_error\", \"get_error_line_number\", \"make_reg_string\", \"get_coq_output\"]\n\nDEFAULT_ERROR_REG_... | python | chosen |
[
{
"from": "human",
"value": "Add a difficult test case from parakeet\n"
},
{
"from": "gpt",
"value": "#from https://github.com/iskandr/parakeet/blob/master/benchmarks/nd_local_maxima.py\n#pythran export local_maxima(float [][][][])\n#runas import numpy as np ; shape = (8,6,4,2) ; x = np.arange(8... | python | chosen |
[
{
"from": "human",
"value": "Create basic view on opps article\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.views.generic.detail import DetailView\n\nfrom opps.article.models import Post\n\n\nclass OppsDetail(DetailView):\n\n context_object_na... | python | chosen |
[
{
"from": "human",
"value": "Add the const module: List of control constants.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this soft... | python | chosen |
[
{
"from": "human",
"value": "Add vcf clean script to take out variants from vcf that dont match fasta\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2.7\n\n\"\"\"\n The 1000 Genomes VCF files have some SNPs which are not congruant with\n the fasta sequence. This script simply deletes suc... | python | chosen |
[
{
"from": "human",
"value": "Add script that detects a shapefile UTM zone\n"
},
{
"from": "gpt",
"value": "# modified code from https://pcjericks.github.io/py-gdalogr-cookbook/\n# vector_layers.html\n\nimport os\nfrom osgeo import ogr\nfrom sys import argv\nimport math\n\nscript, daShapefile = a... | python | chosen |
[
{
"from": "human",
"value": "Add new field for email - migration file\n"
},
{
"from": "gpt",
"value": "\"\"\"empty message\n\nRevision ID: f092dbba3026\nRevises: ad8c63f1135e\nCreate Date: 2018-11-20 13:01:18.328112\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = 'f092dbba3026'... | python | chosen |
[
{
"from": "human",
"value": "Add solution to lintcode question 174\n"
},
{
"from": "gpt",
"value": "\"\"\"\nDefinition of ListNode\nclass ListNode(object):\n\n def __init__(self, val, next=None):\n self.val = val\n self.next = next\n\"\"\"\nclass Solution:\n \"\"\"\n @para... | python | chosen |
[
{
"from": "human",
"value": "Add script to create CoNLL corpus from FN fulltext\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\n\"\"\"\"Create a CoNLL corpus from FrameNet fulltext data tokens\n\nThis CoNLL corpus will then be lemmatized using WordNet, and parsed using\nTurboParser.\n... | python | chosen |
[
{
"from": "human",
"value": "Add initial automated test for OSSEC alert using ossec-logtest\n\nVerify that the log event describes in PR #871 (grsec denying RWX\nmmap) produces an OSSEC alert of level 7.\n\nNote: The rule added in PR #871 was later reverted, which is why\ncurrent SecureDrop produces OSSEC a... | python | chosen |
[
{
"from": "human",
"value": "Add a testcase for Command\n"
},
{
"from": "gpt",
"value": "from tornado.ioloop import IOLoop\nfrom tests.helper import ExternalVersionTestCase\n\n\nclass CMDTest(ExternalVersionTestCase):\n def get_new_ioloop(self):\n return IOLoop.instance()\n\n def te... | python | chosen |
[
{
"from": "human",
"value": "Introduce new manage.py command which creates users with default passwords.\n\n(imported from commit ba5ed9cb6ee91435b184845019391e5dc38fc3aa)\n"
},
{
"from": "gpt",
"value": "import sys\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom djang... | python | chosen |
[
{
"from": "human",
"value": "Add some pseudo core for the core\n"
},
{
"from": "gpt",
"value": "import time\nimport RPi.GPIO as io\n\nfrom urllib.parse import urlencode\nfrom urllib.request import Request, urlopen\n\nio.setmode(io.BCM)\n\ncontact_pin = 7\nvibration_pin = 11\nsound_pin = 13\n\npi... | python | chosen |
[
{
"from": "human",
"value": "Add some inline editor tests\n"
},
{
"from": "gpt",
"value": "import pytest\nfrom gaphas.painter import BoundingBoxPainter\nfrom gaphas.view import GtkView\n\nfrom gaphor import UML\nfrom gaphor.diagram.inlineeditors import named_item_inline_editor\nfrom gaphor.diagr... | python | chosen |
[
{
"from": "human",
"value": "Add test for connection timeout.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nimport time\nimport pytest\nimport pymssql\n\n\ndef test_connect_timeout():\n\n for to in range(2,20,2):\n t = time.time()\n try:\n pymssql.connec... | python | chosen |
[
{
"from": "human",
"value": "TMP: Add temporary scratch test for dev.\n"
},
{
"from": "gpt",
"value": "from bluesky import RunEngine\nRE = RunEngine({})\nfrom ophyd.sim import det\nfrom bluesky.plans import count\nfrom suitcase.jsonl import Serializer\nserializer = Serializer('')\nRE(count([det]... | python | chosen |
[
{
"from": "human",
"value": "Add simulator result parser tool\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env python\n\nimport os\nimport os.path\nimport sys\nimport json\n\nsuccess = 0\n\ndef _extractGenome(header):\n headers = header.split('|')\n genome = headers[4].strip()\n pos = g... | python | chosen |
[
{
"from": "human",
"value": "Add script for contig statistics for FAI\n\n\nFormer-commit-id: e7b46625514f8db9b99d474ad181629e483ecbf7"
},
{
"from": "gpt",
"value": "#! /usr/bin/env python3\n\nimport argparse\nimport statistics\n\nparser = argparse.ArgumentParser(description='Input Newick tree.')... | python | chosen |
[
{
"from": "human",
"value": "Add script to create party sequences for a shop\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"Create article and order sequences for a party's shop.\n\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\... | python | chosen |
[
{
"from": "human",
"value": "Add pygments rst support plugin (from zine)\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n The Pygments reStructuredText directive\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This fragment is a Docutils_ 0.4 directive that renders sourc... | python | chosen |
[
{
"from": "human",
"value": "Migrate datbase to add Weather model and delete weather field from Incident model\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):... | python | chosen |
[
{
"from": "human",
"value": "Test worker (replies with received content) for vas2nets transport.\n"
},
{
"from": "gpt",
"value": "# -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-\n# -*- encoding: utf-8 -*-\n\nfrom twisted.python import log\nfrom twisted.internet.defer import inlineC... | python | chosen |
[
{
"from": "human",
"value": "Add automated tests for database references.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"\nCreated by: Lee Bergstrand (2017)\n\nDescription: A simple unittest for testing the database reference module.\n\"\"\"\n\nimport unittest\nfrom modules.data... | python | chosen |
[
{
"from": "human",
"value": "Add test which checks for growing memory usage for block funcs\n"
},
{
"from": "gpt",
"value": "import lz4.block\nimport pytest\n\n\ntest_data = [\n (b'a' * 1024 * 1024),\n]\n\n\n@pytest.fixture(\n params=test_data,\n ids=[\n 'data' + str(i) for i in ... | python | chosen |
[
{
"from": "human",
"value": "Add new tools for working with current data.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nTools to work with current data. Reuses some functions from tide_tools.\n\n\"\"\"\n\nfrom tide_tools import addHarmonicResults, getObservedData, getObservedMetadata, getHarmonics, T... | python | chosen |
[
{
"from": "human",
"value": "Add Python script for running VGG_Face demo."
},
{
"from": "gpt",
"value": "# Xiang Xiang (eglxiang@gmail.com), March 2016, MIT license.\n\nimport numpy as np\nimport cv2 \nimport caffe\nimport time\n\nimg = caffe.io.load_image( \"ak.png\" )\nimg = img[:,:,::-1]*255.... | python | chosen |
[
{
"from": "human",
"value": "Add log splitter for 8mote experiment."
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2014, Niklas Hauser\n# All rights reserved.\n#\n# The file is part of my bachelor thesis and is released under the 3-clause BSD\n# li... | python | chosen |
[
{
"from": "human",
"value": "Write test for reduced framerate.\n"
},
{
"from": "gpt",
"value": "try:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfrom sensor_msgs.msg import Image\n\nfrom reduce_framerate import FramerateReducer\n\n\ndef test_callback():\n r = Frame... | python | chosen |
[
{
"from": "human",
"value": "Add script to set default svn properties on source files.\n\ngit-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@263 4683daeb-ad0f-0410-a623-93161e962ae5\n"
},
{
"from": "gpt",
"value": "#\n# Run in source directory to change all file eol-style's\n#\n\nimport os, sy... | python | chosen |
[
{
"from": "human",
"value": "Test for reading the depth map\n"
},
{
"from": "gpt",
"value": "from __future__ import division, absolute_import, print_function\nfrom past.builtins import xrange\n\nimport unittest\nimport numpy.testing as testing\nimport numpy as np\nimport healpy as hp\nimport fit... | python | chosen |
[
{
"from": "system",
"value": "Make Yutu acknowledge pm'ed help commands\n"
},
{
"from": "human",
"value": "import discord\nfrom discord.ext import commands\n\nfrom pony import orm\n\nDESCRIPTION = \"\"\"\nHi, I'm Yutu!\nI'm the bot for the Velvet fan discord.\nI'm still learning so sorry if I do... | python | chosen |
[
{
"from": "human",
"value": "Add lumi for file for dataset tool\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# Before running:\n# source /cvmfs/cms.cern.ch/crab3/crab.sh\n\nimport pprint\nfrom dbs.apis.dbsClient import DbsApi\n\nurl=\"https://cmsweb.cern.ch/dbs/prod/global/DBSReader... | python | chosen |
[
{
"from": "human",
"value": "Add private module with landlab info.\n"
},
{
"from": "gpt",
"value": "version = '1.0.2'\nname = 'landlab'\ncite_as = [\n \"\"\"@article{hobley2017creative,\n title={Creative computing with Landlab: an open-source toolkit\n for building, coupling, and ex... | python | chosen |
[
{
"from": "human",
"value": "Test suggestions for missing activity\n"
},
{
"from": "gpt",
"value": "from indra.statements import *\nfrom bioagents.mra.model_diagnoser import ModelDiagnoser\n\ndrug = Agent('PLX4720')\nraf = Agent('RAF')\nmek = Agent('MEK')\nerk = Agent('ERK')\n\ndef test_missing_... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 520. Detect Capital\n\n520. Detect Capital: https://leetcode.com/problems/detect-capital/\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def detectCapitalUse(self, word):\n \"\"\"\n :type word: str\n :rtype: boo... | python | chosen |
[
{
"from": "human",
"value": "Put gst code into Avocado test format. Needs to be edited to take a snapshot and read the qr code.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"\nThis module sets up a video stream from internal or connected webcam using Gstreamer.\nYou can then ta... | python | chosen |
[
{
"from": "human",
"value": "Add smart functions to get the correct gene annotation\n"
},
{
"from": "gpt",
"value": "from contextlib import closing\nimport subprocess\nimport logging\n\nimport do\n\nlogger = logging.getLogger(\"Main\")\n\ndef g37_map(out_fn):\n url_map = \"http://ftp.ncbi.nlm... | python | chosen |
[
{
"from": "human",
"value": "Create delete data from url test script\n"
},
{
"from": "gpt",
"value": "__author__ = 'chuqiao'\nimport script\n# DELETE ALL DATA\nscript.deleteDataInSolr()\n# ADD DATA FROM 2 SORCES\nscript.addDataToSolrFromUrl(\"http://www.elixir-europe.org:8080/events\", \"http://... | python | chosen |
[
{
"from": "human",
"value": "Change volume per process example\n\nMutes the volume of all processes, but unmutes chrome.exe process.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nMutes the volume of all processes, but unmutes chrome.exe process.\n\"\"\"\nfrom pycaw import AudioUtilities\n\n\ndef main... | python | chosen |
[
{
"from": "human",
"value": "Add test class for MeasurementGet\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# Copyright 2014-2015 Boundary, 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 Licens... | python | chosen |
[
{
"from": "human",
"value": "Add script to print results.\n"
},
{
"from": "gpt",
"value": "from __future__ import division\n\nimport argparse\nimport h5py\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument('results_hdf5_fname', type=str)\n parser.add_argument('dse... | python | chosen |
[
{
"from": "human",
"value": "Add test for `__file__` behavior in `ipython <file>`\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Tests for shellapp module.\n\nAuthors\n-------\n* Bradley Froehle\n\"\"\"\n#--------------------------------------------------------------------------... | python | chosen |
[
{
"from": "human",
"value": "Complete cartesian product for repeated\n"
},
{
"from": "gpt",
"value": "\"\"\"Cartesian product of same numbers with repeated times.\"\"\"\n\nclass CartesianProduct(object):\n def _product_two(self, nums1, nums2):\n two_products = []\n\n for i in ra... | python | chosen |
[
{
"from": "human",
"value": "Add simple test case for Stratis\n"
},
{
"from": "gpt",
"value": "import test_compat # pylint: disable=unused-import\n\nimport unittest\n\nimport blivet\n\nfrom blivet.devices import StorageDevice\nfrom blivet.devices import StratisPoolDevice\nfrom blivet.devices im... | python | chosen |
[
{
"from": "system",
"value": "Replace tab indentation with 4 spaces"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright 2016 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | python | chosen |
[
{
"from": "human",
"value": "Add Twilio text message beacon\n\nThis beacon will poll a Twilio account for text messages\nand emit an event on Salt's event bus as texts are received.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n'''\nBeacon to emit Twilio text messages\n'''\n\n# Impor... | python | chosen |
[
{
"from": "human",
"value": "Add a tool for extracting subsequences from vcf2multialign output\n"
},
{
"from": "gpt",
"value": "#\n# Copyright (c) 2017 Tuukka Norri\n# This code is licensed under MIT license (see LICENSE for details).\n# \n\nimport argparse\nimport os\nimport sys\n\n# Read from ... | python | chosen |
[
{
"from": "human",
"value": "Add two methods for rotating an array.\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def rotate(self, nums, k):\n \"\"\"\n :type nums: List[int]\n :type k: int\n :rtype: void Do not return anything, modify nums in-place ins... | python | chosen |
[
{
"from": "human",
"value": "Add tests to ensure ActivityTask attaches the context\n"
},
{
"from": "gpt",
"value": "from sure import expect\n\nfrom simpleflow import activity\nfrom simpleflow.swf.task import ActivityTask\n\n\n\n@activity.with_attributes()\ndef show_context_func():\n return sh... | python | chosen |
[
{
"from": "human",
"value": "Add args to main code, and make executable\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n#\n#\nfrom zooq import ZooQ\nfrom zooqdb_sqlite import ZooQDB_SQLite\nimport time\nfrom argparse import ArgumentParser\n\nap = ArgumentParser(description=\"Example mai... | python | chosen |
[
{
"from": "human",
"value": "Add solution for 232, implement stack using queue.?\n"
},
{
"from": "gpt",
"value": "class Stack(object):\n def __init__(self):\n \"\"\"\n initialize your data structure here.\n \"\"\"\n self.__queue = []\n\n def push(self, x):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix exception to work with py3\n"
},
{
"from": "human",
"value": "from .. import env\nfrom ..exceptions import EnvironmentFileNotFound\n\n\nclass YamlFileSpec(object):\n _environment = None\n\n def __init__(self, filename=None, **kwargs):\n self.filenam... | python | chosen |
[
{
"from": "human",
"value": "Check the return value of SCardGetStatusChange() for unknown readers\n\n\ngit-svn-id: f2d781e409b7e36a714fc884bb9b2fc5091ddd28@5882 0ce88b0d-b2fd-0310-8134-9614164e65ea\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env python\n\n# SCardGetStatusChange2.py : Unitary ... | python | chosen |
[
{
"from": "human",
"value": "Test for the whole process with separated modules.\n"
},
{
"from": "gpt",
"value": "\n\"\"\"\nTest 2\n======\n- Separation between Mscthesis and pySpatialTools\n\"\"\"\n\n## Mscthesis application\n##########################\nfrom Mscthesis.IO.clean_module import clea... | python | chosen |
[
{
"from": "human",
"value": "Add a test for cluster command using VCR\n"
},
{
"from": "gpt",
"value": "import os\nimport tempfile\n\nfrom buddy.command.cluster import cli\nimport pytest\nimport vcr\nimport yaml\nimport boto3\n\n\ndef teardown():\n ecs_client = boto3.client('ecs')\n ecs_cli... | python | chosen |
[
{
"from": "human",
"value": "Add statistics computation from traces\n"
},
{
"from": "gpt",
"value": "\"\"\"\nCompute statistics from linear traces of embryos. The most basic\nstatistic is min/max, but others will be compiled here.\n\"\"\"\n\nimport numpy as np\nfrom scipy import ndimage as nd\n\... | python | chosen |
[
{
"from": "human",
"value": "Add a CI script to copy the CLI release\n\nThis moves the script out of the core CLI.\n\nhttps://github.com/dcos/dcos-core-cli/pull/66\nhttps://jira.mesosphere.com/browse/DCOS_OSS-4278\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nimport os\nimport pathl... | python | chosen |
[
{
"from": "human",
"value": "Add aura compile testing by default to likely areas (4).\n\nBUG=chromium:107599\nTEST=None\n\nReview URL: http://codereview.chromium.org/8907044\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114847 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "human",
"value": "Read line by line from the NREL polymer text file and create list of dictionaries using the header keys."
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport json\n\n\ndef main(argv):\n path = len(argv) == 2 and os.path.dirname(arg... | python | chosen |
[
{
"from": "human",
"value": "Add a unit test for the ChildCacheGarbageColleector class.\n"
},
{
"from": "gpt",
"value": "import smugmug\nimport unittest\n\nclass MockNode(object):\n def __init__(self):\n self._reset_times = 0\n\n def reset_cache(self):\n self._reset_times += 1\n\n\nclass... | python | chosen |
[
{
"from": "human",
"value": "Add an example test checking that ast equality works\n"
},
{
"from": "gpt",
"value": "import unittest\n\nimport sure\n\nfrom compiler import parse, lex, error, ast, type\n\n\nclass TestAST(unittest.TestCase):\n def test_eq(self):\n ast.Constructor(\"foo\", ... | python | chosen |
[
{
"from": "human",
"value": "[devil] Add signal handler context manager.\n\nBUG=chromium:620723\n\nReview-Url: https://codereview.chromium.org/2069133005\n"
},
{
"from": "gpt",
"value": "# Copyright 2016 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-s... | python | chosen |
[
{
"from": "human",
"value": "Add data migrations for vote\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.3 on 2016-03-19 07:58\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef migrate_score(apps, schema_editor):\n Revie... | python | chosen |
[
{
"from": "human",
"value": "Call of Duty: Modern Warfare 3 plugin\n"
},
{
"from": "gpt",
"value": "import os\nfrom lib.base_plugin import BasePlugin\nfrom lib.paths import SteamGamesPath\n\n\nclass CoDMW3Plugin(BasePlugin):\n Name = \"Call of Duty: Modern Warfare 3\"\n support_os = [\"Win... | python | chosen |
[
{
"from": "human",
"value": "Add tests for custom evaluation code\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom evaluation import precision_recall_at_x_proportion\n\n\nclass EvaluationTest(unittest.TestCase):\n \"\"\"Most evaluation methods are from scikit-learn and are thus tested... | python | chosen |
[
{
"from": "human",
"value": "Add a little utility to help update resolved crashers.\n\nSwift SVN r28923\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\n# A small utility to take the output of a Swift validation test run\n# where some compiler crashers have been fixed, and move them into th... | python | chosen |
[
{
"from": "human",
"value": "Solve Code Fights sum of two representations 2 problem\n"
},
{
"from": "gpt",
"value": "#!/usr/local/bin/python\n# Code Fights Count of Two Representations 2 Problem\n\n\ndef countSumOfTwoRepresentations2(n, l, r):\n return sum(1 for x in range(l, r + 1) if x <= n... | python | chosen |
[
{
"from": "human",
"value": "Add classes representing column options\n\nWe will use these instances of these classes, instead of the\nDataSourceProperty named tuples to represent the available columns\nin the report.\n"
},
{
"from": "gpt",
"value": "class ColumnOption(object):\n \"\"\"\n T... | python | chosen |
[
{
"from": "human",
"value": "Add python test for copyto with mask\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n'''\nTest for copyto with mask\n'''\n\n# Python 2/3 compatibility\nfrom __future__ import print_function\n\nimport cv2 as cv\nimport numpy as np\nimport sys\n\nfrom tests_c... | python | chosen |
[
{
"from": "human",
"value": "Complete members bypass for larger than chorus\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.0.2 on 2018-02-24 21:22\n\nfrom django.db import migrations\nimport django.db.models.manager\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | chosen |
[
{
"from": "human",
"value": "Create setup channel models test\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.test import TestCase\nfrom django.contrib.sites.models import Site\n\nfrom opps.core.models.channel import Channel\n\n\nclass ChannelModelT... | python | chosen |
[
{
"from": "human",
"value": "Add docopt implementation in main file\n"
},
{
"from": "gpt",
"value": "\"\"\"space_allocator.py\n\nUsage:\n create_room <room_type> <room_name>\n Create rooms in the dojo\n add_person <person_name> <FELLOW|STAFF> [wants_accommodation]\n Adds and ... | python | chosen |
[
{
"from": "human",
"value": "Add submission script that currently only performs login.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport getpass\nimport json\nimport requests\nimport sys\nfrom argparse import ArgumentParser, FileType\nfrom urllib.parse import urljoin\n\nclass Nudibr... | python | chosen |
[
{
"from": "system",
"value": "Fix a white space error\n\nThis was introduced in e2a415797d4adb81551c5331b1adfdb4a6ecbe94.\n"
},
{
"from": "human",
"value": "from __future__ import print_function, division\n\nfrom sympy.logic.utilities import load_file\nfrom sympy.logic import satisfiable\nimport... | python | chosen |
[
{
"from": "human",
"value": "Add test for extra roots\n"
},
{
"from": "gpt",
"value": "from support import lib,ffi\nfrom qcgc_test import QCGCTest\nimport unittest\n\nclass ExtraRootTestCase(QCGCTest):\n def test_extra_root(self):\n # XXX: Violates the condition of the extra roots but ... | python | chosen |
[
{
"from": "human",
"value": "Add skeleton for sync daemon.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# Copyright 2012 Jim Lawton. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with t... | python | chosen |
[
{
"from": "human",
"value": "Add initial testing for persistence.\n"
},
{
"from": "gpt",
"value": "import os\nimport shutil\nimport tempfile\nimport time\n\n\nfrom lwr.persistence import PersistedJobStore\nfrom lwr.queue_manager import QueueManager\n\n\ndef test_persistence():\n \"\"\"\n T... | python | chosen |
[
{
"from": "human",
"value": "Transform units of cavity regions in Shin et al's 2016.\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com>\n\n\"\"\"\nTransform cavities regions of samples selected from paper\narXiv-1610.03487.\n\nReference\n---------\n[1] J. Shin, J... | python | chosen |
[
{
"from": "human",
"value": "Add example tests for canvas actions\n"
},
{
"from": "gpt",
"value": "from seleniumbase import BaseCase\r\n\r\n\r\nclass CanvasTests(BaseCase):\r\n def get_pixel_colors(self):\r\n # Return the RGB colors of the canvas element's top left pixel\r\n x =... | python | chosen |
[
{
"from": "human",
"value": "Move all formatting logic into a single module\n"
},
{
"from": "gpt",
"value": "import os\r\n\r\nfrom gooey.gui.util.quoting import quote\r\n\r\n\r\ndef checkbox(metadata, value):\r\n return metadata['commands'][0] if value else None\r\n\r\n\r\ndef radioGroup(meta... | python | chosen |
[
{
"from": "human",
"value": "Add file UUID to OCR text file name\n\nAdds a migration that causes each OCR text file to include the UUID of its\nsource file in its filename. This prevents OCR text files from overwriting one\nanother when there are two identically named source files in a transfer. Fixes\nissu... | python | chosen |
[
{
"from": "human",
"value": "Add alembic migration for role type\n\nrefs #295\n"
},
{
"from": "gpt",
"value": "\"\"\"add_role_type\n\nRevision ID: 551bc42a839\nRevises: 41af1c8d394\nCreate Date: 2016-02-02 17:19:21.998718\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '551bc42... | python | chosen |
[
{
"from": "human",
"value": "Add migrations for website app\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.0.6 on 2018-06-21 07:59\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('website', '0004_auto_20170713_23... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests for views.\n"
},
{
"from": "gpt",
"value": "from django.test.client import Client\nfrom django.core.urlresolvers import reverse\n\nfrom go.apps.tests.base import DjangoGoApplicationTestCase\n\n\nclass JsBoxTestCase(DjangoGoApplicationTestCase):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove redirect from delete modal page object\n\n(cherry picked from commit 480ecdb)\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"Modals for deleting obje... | python | chosen |
[
{
"from": "human",
"value": "Add GPIO-zero-based demo of 4Tronix Pi-Stop"
},
{
"from": "gpt",
"value": "from gpiozero import TrafficLights\nimport time\n\ndef british_lights_cycle(lights, cycle_time):\n lights.off()\n\n # Red\n lights.red.on()\n time.sleep(cycle_time)\n\n # Red an... | python | chosen |
[
{
"from": "human",
"value": "Add conf file for Canope Guyane with Moodle and Etherpad card\n"
},
{
"from": "gpt",
"value": "from .idb import * # pragma: no flakes\n\nCUSTOM_CARDS = [\n {\n # Must be one of create, discover, info, learn, manage, read\n 'category': 'create',\n ... | python | chosen |
[
{
"from": "human",
"value": "Add method to get list of patients from API.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"Script to upload pictures to the gallery.\n\nThis script scans a local picture folder to determine which patients\nhave not yet been created in the gallery. I... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.