conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add Atlas and Mkl checkers.\n"
},
{
"from": "gpt",
"value": "from numscons.checkers.new.common import \\\n save_and_set, restore, get_initialized_perflib_config\n\n# Performance library checks\ndef _check_perflib(context, autoadd, info):\n context.Message(\"Che... | python | chosen |
[
{
"from": "human",
"value": "Add data migration causing all event map PDFs to be regenerated\n\nNote we did this before this is copied from `src\\nyc_trees\\apps\\event\\migrations\\0012_auto_20150424_1705.py`\n\nConnects #1787\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __fut... | python | chosen |
[
{
"from": "human",
"value": "Add management comand to export party dewcriptions\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals\n\nfrom compat import BufferDictWriter\n\nfrom django.core.management.base import BaseCommand\n\nfrom ... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 678. Valid Parenthesis String\n\n678. Valid Parenthesis String: https://leetcode.com/problems/valid-parenthesis-string/\n\nApproach1:\n DFS with cutting\n"
},
{
"from": "gpt",
"value": "from collections import Counter\nclass Solution(object):\n... | python | chosen |
[
{
"from": "human",
"value": "Add migration file for ash impact file path.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('r... | python | chosen |
[
{
"from": "human",
"value": "Add test for invalid parametrized usage cases\n"
},
{
"from": "gpt",
"value": "import pytest\n\nfrom tests.compiler import compile_snippet\nfrom thinglang.compiler.errors import UnfilledGenericParameters\n\n\ndef test_both_parameters_unfilled():\n with pytest.rais... | python | chosen |
[
{
"from": "human",
"value": "Add test case for get_or_create util\n"
},
{
"from": "gpt",
"value": "import unittest\nimport os, sys\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\\\\\"))\n\nfrom app import create_app, db\nfrom app.utils import get_or_create\nfrom app.models impor... | python | chosen |
[
{
"from": "human",
"value": "Add merge sort practice of python int list.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\n\ndef merge_sorted_list(alist, blist):\n \"\"\" Use merge sort to sort sorted alist and blist, and return merged sorted list of alist. \"\"\"\n\n if not isins... | python | chosen |
[
{
"from": "human",
"value": "Add program to convert from PML to XML\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env/python\n\nimport sys\nimport os.path\nimport subprocess\n\n\n# Read in a pml file and save to an xml file\ndef translate_pml_file(xml_file, pml_file):\n\n pml_path = os.path.abs... | python | chosen |
[
{
"from": "human",
"value": "Test 'annotate_object' for a WAF rule\n"
},
{
"from": "gpt",
"value": "# Copyright 2015 Isotoma Limited\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 cop... | python | chosen |
[
{
"from": "human",
"value": "Add management command for init data import\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand #, CommandError\nfrom volunteers.models import Edition\n\n\nclass Command(BaseCommand):\n\n def handle(self, *args, **options):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add a test for ABC-specific getblocktemplate behavior\n\nSummary:\nFirst step in T1014\n\nAs we modify behavior in getblocktemplate, we really need better test coverage.\nD7201 (f8360b5e981) is one such change. This patch tests that behavior specifically\nbut this test can be ex... | python | chosen |
[
{
"from": "human",
"value": "Save and load persistent state.\n"
},
{
"from": "gpt",
"value": "import os\nimport errno\nimport uuid\n\nimport msgpack # we're using it anyway...\n\ndef read_state():\n sfile = '/tmp/raft-state'\n try:\n with open(sfile) as r:\n return msgpa... | python | chosen |
[
{
"from": "human",
"value": "Add 5010 generic ISA facade tests.\n"
},
{
"from": "gpt",
"value": "import datetime\nimport os\nimport unittest\n\nfrom tigershark.facade.common import IdentifyingHeaders\nfrom tigershark.parsers import IdentifyingParser\n\n\nclass TestIdentifyingHeaders(unittest.Tes... | python | chosen |
[
{
"from": "human",
"value": "Add hacky script for anonymising dumps of the Scrobbles table whilst still maintaining internal consistency\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport random\n\ns = open(\"scrobbledump.sql\", \"r\")\no = open(\"scrobbles.anonymous.sql\", \"w\")\n\... | python | chosen |
[
{
"from": "human",
"value": "Add script to list scheduled checkins\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# This script retrieves a detailed list of the currently running checkins\n\nimport argparse\nimport concurrent.futures\nimport datetime\nimport json\nimport sys\n\nimport... | python | chosen |
[
{
"from": "human",
"value": "Add a script to renumber antennas to below 256 in uvfits files\n\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\"\nA command-line script for renumbering antenna numbers > 255 if possible in uvfits files.\n\"\"\"\nimport numpy as np\nimport os\nimport ar... | python | chosen |
[
{
"from": "human",
"value": "Add test for failing commands because of n_args\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"Fail commands because of arguments test for vimiv's test suite.\"\"\"\n\nfrom unittest import main\nfrom vimiv_testcase import VimivTestCa... | python | chosen |
[
{
"from": "human",
"value": "Add Linear Algebra python Example\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n# Linear Algebra with Python\nimport numpy as np\n\ndef numpy_show():\n # create a column vector\n col_vec = np.array([[1], [2]])\n print \"column vector\"\n print col_v... | python | chosen |
[
{
"from": "human",
"value": "Add new stats management command\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nimport arrow\n\nfrom django.contrib.auth import get_user_model\nfrom django.core.management.base import BaseCommand\nfrom django.db.models import Count\n\nfrom termcolor impo... | python | chosen |
[
{
"from": "human",
"value": "Add a management command to print the initial password for an account\n\n(imported from commit 0a2b7d8215961801dbd24d9af89785e857b9ba14)\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nfrom zephyr.lib.initial_password import init... | python | chosen |
[
{
"from": "human",
"value": "Add snippet.campaign field migration for help_text change.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = ... | python | chosen |
[
{
"from": "system",
"value": "Remove default datetime in door\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils import timezone\nfrom datetime import datetime\n\n# Create your models here.\n\n\nclass DoorStatus(models.Model):\n datetime = models.DateTimeField(... | python | chosen |
[
{
"from": "human",
"value": "Add migration with fixed copyright field descriptions\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.4 on 2017-09-18 14:44\nfrom __future__ import unicode_literals\n\nimport adhocracy4.images.fields\nfrom django.db import migrati... | python | chosen |
[
{
"from": "human",
"value": "Add test cases for TableTextLoaderFactory\n"
},
{
"from": "gpt",
"value": "\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nimport pytest\n\nimport pytablereader as ptr\n\n\nclass Test_TableTextLoaderFactory:\n @pytest.mark.parame... | python | chosen |
[
{
"from": "human",
"value": "Add script to build API docs.\n"
},
{
"from": "gpt",
"value": "# Copyright 2021 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 t... | python | chosen |
[
{
"from": "human",
"value": "Add tests for unyt.testing module\n"
},
{
"from": "gpt",
"value": "\"\"\"\nTest unyt.testing module that contains utilities for writing tests.\n\n\"\"\"\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013, yt Develo... | python | chosen |
[
{
"from": "human",
"value": "Add tests for message property page\n"
},
{
"from": "gpt",
"value": "from gaphor import UML\nfrom gaphor.diagram.tests.fixtures import find\nfrom gaphor.UML.interactions.interactionspropertypages import MessagePropertyPage\n\n\ndef test_message_property_page(diagram,... | python | chosen |
[
{
"from": "human",
"value": "Add tests for pickling doc\n"
},
{
"from": "gpt",
"value": "from __future__ import unicode_literals\n\nimport pickle\n\nfrom ...language import Language\n\n\ndef test_pickle_single_doc():\n nlp = Language()\n doc = nlp(u'pickle roundtrip')\n data = pickle.du... | python | chosen |
[
{
"from": "human",
"value": "Add convert to shellcode tool\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\nimport sys, subprocess, os, re\n\nif len(sys.argv) < 3:\n print('Incorrect usage')\n exit(1)\n\nif not os.path.isfile(sys.argv[1]):\n print('File does not exist')\n exit(1)\... | python | chosen |
[
{
"from": "human",
"value": "Add automated tests for literature reference module.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"\nCreated by: Lee Bergstrand (2017)\n\nDescription: A simple unittest for testing the literature reference module.\n\"\"\"\n\nimport unittest\nfrom mo... | python | chosen |
[
{
"from": "human",
"value": "Add result buffering/batch processing example.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nProcess 20 lines of output at a time.\n\nExample runs:\npython buffer_results.py\n\"\"\"\nimport sys\nimport time\nimport drainers\n\n# fake this\ndef setup_cruncher():\n time.... | python | chosen |
[
{
"from": "human",
"value": "Add a new, simpler example\n"
},
{
"from": "gpt",
"value": "from strip_recipes import RecipeFile\n\nrecipe = RecipeFile()\nrecipe.record_start('example01')\nrecipe.sbs_on()\n\nfor cur_gate in (10.0, 20.0, 50.0):\n\trecipe.bias_set('HA1_Vg', cur_gate)\n\t\n\trecipe.wa... | python | chosen |
[
{
"from": "human",
"value": "Create initial RDFa tests as their own top-level test module.\n"
},
{
"from": "gpt",
"value": "\"\"\"Unit tests utilizing RDFa parsing. Primarily cc.license.formatter.\"\"\"\n\nimport cc.license\nimport rdfadict\nimport rdflib\n\nclass TestHtmlFormatter:\n\n def _... | python | chosen |
[
{
"from": "system",
"value": "Install wkhtmltox from the pkgs on sourceforge\n\nThey're compiled with patched QT. This version doesn't need X/Xvfb to run.\n"
},
{
"from": "human",
"value": "\"\"\"\nwkhtmltopdf Blueprint\n\nblueprints:\n - blues.wkhtmltopdf\n\n\"\"\"\nfrom fabric.decorators impo... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests running against a live Gerrit server\n\nChange-Id: I313a9132d2de7a87b3257af7846febb64b3873ee\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# The MIT License\n#\n# Copyright 2018 David Pursehouse. All rights reserve... | python | chosen |
[
{
"from": "human",
"value": "Add migration for Receipt created field\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport datetime\nfrom django.utils.timezone import utc\n\n\nclass Migration(migratio... | python | chosen |
[
{
"from": "human",
"value": "Add tests for queue implementation\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom queue import Queue\n\n\nclass TestStringMethods(unittest.TestCase):\n\n def test_enqueue_to_empty_queue(self):\n queue = Queue()\n self.assertEqual(queue.size, ... | python | chosen |
[
{
"from": "human",
"value": "Add script to run test suite on a wheel in a virtualenv\n\n[skip ci]\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\"\nTests a .whl file by installing it and pytest into a virtual environment and\nrunning the test suite.\n\nRequires pip to be installed,... | python | chosen |
[
{
"from": "human",
"value": "Add computing frequencies with mismatches\n"
},
{
"from": "gpt",
"value": "from neighbors import neighbors\nfrom pattern_to_number import pattern_to_number\n\ndef computing_frequencies_with_mismatches(text, k, d):\n frequency_array = [0] * 4**k\n for i in range(0, ... | python | chosen |
[
{
"from": "human",
"value": "Make all models visible in Admin\n"
},
{
"from": "gpt",
"value": "from django.contrib import admin\n\nfrom .models import Voter, Flag, Vote \n\nadmin.site.register(Voter)\nadmin.site.register(Flag)\nadmin.site.register(Vote)\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add integrated tests for interaction PDBs\n"
},
{
"from": "gpt",
"value": "from unittest import TestCase\nimport pygtop\n\nclass InteractionPropertyTests(TestCase):\n\n def test_can_get_gtop_pdbs(self):\n target = pygtop.get_target_by_id(2)\n interac... | python | chosen |
[
{
"from": "human",
"value": "Check to see if input is executed\n"
},
{
"from": "gpt",
"value": "foo = input(\"Try to type eval(2+2), if the result is '4' this is unsafe: \")\nprint(\"You typed the following: \\\"\",foo,\"\\\".\")\ninput(\"Press [Enter] to exit\")\n# Result: seems to be safe with... | python | chosen |
[
{
"from": "human",
"value": "Add basic duplicate resolution cmd with log info\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom collections import defaultdict\nimport csv\nimport datetime\nfrom django.core.management.base import ... | python | chosen |
[
{
"from": "system",
"value": "Add a test that checks that different instances can have different\nbehaviour.\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the classification\"\"\"\n\nimport unittest\nimport axelrod\n\n\nclass TestClassification(unittest.TestCase):\n\n def test_known_clas... | python | chosen |
[
{
"from": "human",
"value": "Add a missing migration for the secret validator"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport utils\n\n\nclass Migration(migrations.Migration):\n\n dependencies ... | python | chosen |
[
{
"from": "human",
"value": "Add functional tests for servers\n\nChange-Id: Iff4101b3d45e04d7f6e25b5f599a7647c8cd2a80\n"
},
{
"from": "gpt",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may o... | python | chosen |
[
{
"from": "human",
"value": "Add tests for UniProt client\n"
},
{
"from": "gpt",
"value": "from indra.databases import uniprot_client\n\ndef test_query_protein_exists():\n g = uniprot_client.query_protein('P00533')\n assert(g is not None)\n\ndef test_query_protein_nonexist():\n g = unip... | python | chosen |
[
{
"from": "human",
"value": "Add migration to save every file so that it can be indexed\n"
},
{
"from": "gpt",
"value": "\"\"\"\nSaves every file to have new save() logic index those files.\n\"\"\"\nimport sys\nimport logging\n\nfrom website.app import init_app\nfrom website.files.models.osfstor... | python | chosen |
[
{
"from": "human",
"value": "MP-795: Add wsgi file for web410\n"
},
{
"from": "gpt",
"value": "\"\"\"WSGI File for Web410\n\"\"\"\n\nimport os\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"marco.settings\")\nactivate_this = '/home/point97/env/marco_portal2/bin/activate_this.py'\nexecfil... | python | chosen |
[
{
"from": "human",
"value": "Add migration to populate FlowNodeCount\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-03-30 12:50\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef do_populate(FlowStep, FlowNodeCoun... | python | chosen |
[
{
"from": "human",
"value": "Add missing migrations corresponding to 5468b2e57366bc0\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.7 on 2016-07-05 11:42\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.mo... | python | chosen |
[
{
"from": "human",
"value": "Add migration for assignable mixin\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: anze@reciprocitylabs.com\... | python | chosen |
[
{
"from": "human",
"value": "Add tests for type hierarchy\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom fluentcheck.check import Check, CheckError\n\nclass ParentA:\n def __init__(self):\n pass\n\nclass Child(ParentA):\n def __init__(self):\n pass\n\nclass GrandChild... | python | chosen |
[
{
"from": "human",
"value": "Add tests for bulk importer\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n# This work was created by participants in the DataONE project, and is\n# jointly copyrighted by participating institutions in DataONE. For\n# more information on DataONE, see our... | python | chosen |
[
{
"from": "human",
"value": "Add migration for ensure schemas\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11 on 2017-05-24 19:33\nfrom __future__ import unicode_literals\n\nimport logging\n\nfrom django.db import migrations\n\nfrom osf.models import MetaSche... | python | chosen |
[
{
"from": "human",
"value": "Add auto django migration for ProductTranslation alter name operation\n"
},
{
"from": "gpt",
"value": "# Generated by Django 3.0.5 on 2020-04-23 12:37\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | chosen |
[
{
"from": "human",
"value": "Allow plugins to have models.py files in their own plugin folders\n"
},
{
"from": "gpt",
"value": "# __init__.py\n\n## This module is so that all plugins can have custom models.py files in\n## their own folders and have them picked up with \n## $ python manage.py syn... | python | chosen |
[
{
"from": "human",
"value": "Add new test case for unrolled list comprehension comprehension\n"
},
{
"from": "gpt",
"value": "#pythran export list_comp(int list list)\n#runas list_comp([[], [], [1]])\n\ndef foo(cc, x, y):\n for a in cc:\n if a:\n return True\n return ... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 671. Second Minimum Node In a Binary Tree\n\n671. Second Minimum Node In a Binary Tree: https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/\n"
},
{
"from": "gpt",
"value": "# Definition for a binary tree node.\n# class TreeNode(obj... | python | chosen |
[
{
"from": "human",
"value": "Add some basic tests for backward compatibility.\n\n\ngit-svn-id: 353d90d4d8d13dcb4e0402680a9155a727f61a5a@1082028 13f79535-47bb-0310-9956-ffa450edef68\n"
},
{
"from": "gpt",
"value": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributo... | python | chosen |
[
{
"from": "human",
"value": "Remove database default on rate_limit column\n\nThe default for the rate_limit column in the services and\nservices_history model is now set in the model, so we can remove the\ndefault from the database.\n\nPivotal story: https://www.pivotaltracker.com/story/show/153992529\n"
... | python | chosen |
[
{
"from": "human",
"value": "Add basic sanity test for export_tables_to_backup_crawler()\n"
},
{
"from": "gpt",
"value": "from io import StringIO\n\nfrom mediawords.db import connect_to_db\nfrom mediawords.db.export.export_tables import *\n\n\ndef test_export_tables_to_backup_crawler():\n # B... | python | chosen |
[
{
"from": "human",
"value": "Improve category filter for activities\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.6 on 2017-11-11 03:35\nfrom __future__ import unicode_literals\n\nimport django.core.validators\nfrom django.db import migrations, models\nimpo... | python | chosen |
[
{
"from": "human",
"value": "Add incomplete test file for CSR\n"
},
{
"from": "gpt",
"value": "import os, sys\nimport numpy as np\nfrom numpy.testing import assert_equal, assert_almost_equal\nfrom skan import csr\n\nrundir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(rundir)\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add a snippet (Python physics).\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this ... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 374. Guess Number Higher or Lower\n\n374. Guess Number Higher or Lower: https://leetcode.com/problems/guess-number-higher-or-lower/\n"
},
{
"from": "gpt",
"value": "# The guess API is already defined for you.\n# @param num, your guess\n# @return -... | python | chosen |
[
{
"from": "human",
"value": "Add HTML tag stripper/remover (also remove <script> and <style> contents)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport urllib2\nfrom HTMLParser import HTMLParser\n\n# HTML Tag Stripper class\nclass HTMLTagStripper(HTMLPars... | python | chosen |
[
{
"from": "human",
"value": "Add collection class for stealing data from the ECU\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# coding=utf-8\n\nimport serial\n\n\nclass EcuCollector():\n SENTINEL = b'X'\n RESPONSE_LENGTH = 91\n\n\n def __init__(self, port, baudrate=9600):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add a management command to create trailing singletons.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nCreate singletons that may have been dropped\n\"\"\"\nimport collections\nimport json\nfrom optparse import make_option\n\nfrom django.contrib.contenttypes.models import ... | python | chosen |
[
{
"from": "human",
"value": "Test that the output format adapter works with Django\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\nfrom chatterbot.ext.django_chatterbot.models import Statement\n\n\nclass OutputIntegrationTestCase(TestCase):\n \"\"\"\n Tests to make sure ... | python | chosen |
[
{
"from": "system",
"value": "[recipes] Remove unnecessary depot_tools dependency in flavor module\n\nChange-Id: Ic1f3896a450bd81bb8c4859d3998c9873af821f6\nReviewed-on: https://skia-review.googlesource.com/c/skia/+/263016\nReviewed-by: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@google.com>\nCommi... | python | chosen |
[
{
"from": "human",
"value": "Add trace log stats extractor\n"
},
{
"from": "gpt",
"value": "\nimport re\nimport sys\n\nfrom collections import Counter\n\ndef oneof(strs):\n return \"(?:%s)\" % \"|\".join(strs)\n\nBRIDGE_REGEX = r\"# bridge out of Guard (0x[0-9a-fA-f]*) with \\d* ops\"\nbridge... | python | chosen |
[
{
"from": "human",
"value": "Add a driver for Ciena SAOS devices\n\nCiena carrier ethernet devices - previous Worldwide Packets"
},
{
"from": "gpt",
"value": "\"\"\"\nA driver for Ciena SAOS carrier ethernet devices\n\"\"\"\nimport re\nfrom Exscript.protocols.drivers.driver import Driver\n\n_use... | python | chosen |
[
{
"from": "human",
"value": "Write test for core module of cupy\n"
},
{
"from": "gpt",
"value": "import unittest\n\nimport cupy\nfrom cupy.core import core\n\n\nclass TestGetSize(unittest.TestCase):\n\n def test_none(self):\n self.assertEqual(core.get_size(None), ())\n\n def test_li... | python | chosen |
[
{
"from": "system",
"value": "Fix stub unit test for main.py rename\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_nova_api_docs_tracker\n----------------------------------\n\nTests for `nova_api_docs_tracker` module.\n\"\"\"\n\nimport unittest\... | python | chosen |
[
{
"from": "human",
"value": "Remove context from Request to_dict, add Request from_dict\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom pkg_resources import require\n\nfrom malcolm.core.wscomms.wsservercomms import WSServerComms\n\nrequire(\"mock\")\nfrom mock import MagicMock\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Make joke parsing more robust\n"
},
{
"from": "human",
"value": "import re\nfrom os import path\n\nfrom pal.services.service import Service\nfrom pal.services.service import wrap_response\n\n\ndef get_jokes():\n file_path = path.realpath(path.join(path.dirname(__... | python | chosen |
[
{
"from": "human",
"value": "Add working test for minimal income adjustment functionality\n"
},
{
"from": "gpt",
"value": "from django.test import SimpleTestCase\nfrom ...profile_data.indicators import (\n IncomeAdjustments,\n)\nfrom collections import defaultdict\n\nclass MockAPIData:\n r... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for options module\n"
},
{
"from": "gpt",
"value": "from nose2 import options\nfrom nose2.compat import unittest\n\n\nclass TestMultipassOptionParser(unittest.TestCase):\n\n def setUp(self):\n self.p = options.MultipassOptionParser()\n\n d... | python | chosen |
[
{
"from": "human",
"value": "Implement script to make TRIPS ontology\n"
},
{
"from": "gpt",
"value": "import os\nimport sys\nimport xml.etree.ElementTree as ET\nfrom rdflib import Graph, Namespace, Literal\n\n\ntrips_ns = Namespace('http://trips.ihmc.us/concepts/')\nisa_rel = Namespace('http://t... | python | chosen |
[
{
"from": "human",
"value": "Add script to move files (move this out of MetaControl)\n"
},
{
"from": "gpt",
"value": "import os\nimport subprocess\n\nclass MoveFiles:\n\n def __init__(self, rule, copy):\n \"\"\"\n Move audiofiles to the appropriate destination directories,\n ... | python | chosen |
[
{
"from": "human",
"value": "Add unit test for object state\n"
},
{
"from": "gpt",
"value": "\"\"\"Test Object State Module\"\"\"\n\nimport unittest\nimport ggrc.app # noqa pylint: disable=unused-import\nfrom ggrc.models import all_models\n\n\nclass TestStates(unittest.TestCase):\n \"\"\"Test ... | python | chosen |
[
{
"from": "human",
"value": "Add integration tests for SSL security provider\n"
},
{
"from": "gpt",
"value": "from . import base\n\n\nclass SSLTestCase(base.IntegrationTestCase):\n '''RabbitMQ integration test case.'''\n CTXT = {\n 'plugin.activemq.pool.1.port': 61614,\n 'plu... | python | chosen |
[
{
"from": "human",
"value": "Add simple tests for pipelines.\n"
},
{
"from": "gpt",
"value": "from twisted.internet import defer\nfrom twisted.internet.defer import Deferred\nfrom twisted.trial import unittest\n\nfrom scrapy import Spider, signals, Request\nfrom scrapy.utils.test import get_craw... | python | chosen |
[
{
"from": "human",
"value": "Add node to convert BNI trajectories (e.g. from SpiralCoords) to BART trajectories.\n"
},
{
"from": "gpt",
"value": "# Author: Ashley Anderson III <aganders3@gmail.com>\n# Date: 2016-01-25 13:58\n\nimport numpy as np\nimport gpi\n\nclass ExternalNode(gpi.NodeAPI):\n ... | python | chosen |
[
{
"from": "system",
"value": "Use xml.sax.saxutils.escape in place of xmlrpclib.escape\n\nThe latter is not available in python 3"
},
{
"from": "human",
"value": "# vim:fileencoding=utf-8:noet\n\nfrom powerline.renderer import Renderer\nfrom powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, A... | python | chosen |
[
{
"from": "human",
"value": "Add a small utility for testing to update an event\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nfrom ci import models\nfrom optparse import make_option\nimport json, random\nfrom ci import event\nfrom django.conf import settin... | python | chosen |
[
{
"from": "human",
"value": "Add small script for calculating shock retrieval times"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport requests\nimport time\nimport sys\nfrom pymongo.mongo_client import MongoClient\n\n\nMONGO_DB = 'ws_test'\nSHOCK_HOST = 'http://localhost:7044'\n\nde... | python | chosen |
[
{
"from": "human",
"value": "Add \"RGB\" colorspace volume computation example.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nShowcases RGB colourspace volume computations.\n\"\"\"\n\nfrom __future__ import division, unicode_literals\n\nimport colour\... | python | chosen |
[
{
"from": "human",
"value": "Add command to clear redis store contents\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nfrom utils.redis_store import store\n\n\nclass Command(BaseCommand):\n help = 'Remove all keys stored in Redis Store. Use it as python m... | python | chosen |
[
{
"from": "human",
"value": "Add function to plot spanwise pressure\n"
},
{
"from": "gpt",
"value": "\"\"\"\nPlotting functions.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nfrom .processing import *\n\n\ndef plot_spanwise_pressure(ax=None):\n \"\"\"Plot spanwise pressure, normalized and inver... | python | chosen |
[
{
"from": "human",
"value": "Add test for SubIndicatorAdmin result method"
},
{
"from": "gpt",
"value": "from mock import Mock\n\nfrom ..admin import SubIndicatorAdmin\nfrom ..models import SubIndicator\n\n\ndef test_sub_indicator_admin_rsult_returns_indicator_result():\n sub_indicator = Mock... | python | chosen |
[
{
"from": "human",
"value": "XenAPI: Add script to destroy cached images.\n\nOperations will want the ability to clear out cached images when\ndisk-space becomes an issue.\n\nThis script allows ops to clear out all cached images or just cached\nimages that aren't in current use.\n\nChange-Id: If87bd10ef3f89... | python | chosen |
[
{
"from": "human",
"value": "Add test of empty geometry collection creation.\n\ngit-svn-id: 1a8067f95329a7fca9bad502d13a880b95ac544b@1599 b426a367-1105-0410-b9ff-cdf4ab011145\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom shapely.geometry.collection import GeometryCollection\n\nclass Col... | python | chosen |
[
{
"from": "human",
"value": "Add tests for time units methods.\n"
},
{
"from": "gpt",
"value": "from nose.tools import assert_equal\n\nfrom pymt.framework.bmi_bridge import _BmiCap\n\n\nclass SimpleTimeBmi():\n def get_time_units(self):\n return 0, 'h'\n\n def get_start_time(self):\... | python | chosen |
[
{
"from": "human",
"value": "Add spacewalk runner command parsing tests\n"
},
{
"from": "gpt",
"value": "\"\"\"\nUnit tests for Spacewalk runner\n\"\"\"\nimport salt.runners.spacewalk as spacewalk\nfrom tests.support.mock import Mock, call, patch\n\n\ndef test_api_command_must_have_namespace():\... | python | chosen |
[
{
"from": "human",
"value": "Add functional tests for add & remove router interface\n\nChange-Id: If0616ebd088d3840ca09fbc95494f455b85c1967\n"
},
{
"from": "gpt",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with ... | python | chosen |
[
{
"from": "human",
"value": "Add script for triggering Buildbucket builds\n\nBUG=493885\nTESTED=See https://paste.googleplex.com/5622248052359168\n\nReview URL: https://codereview.chromium.org/1164363003\n\ngit-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@295569 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n"
... | python | chosen |
[
{
"from": "human",
"value": "[IMP] hw_drivers: Move Keyboard driver to Community\n\nThe KeyboardUSBDriver will be transformed to integrate barcode\nscanners. The barcode scanners will be used in Community so we move the\ndriver in Community.\n\nTaskID: 1961025\n"
},
{
"from": "gpt",
"value": "# ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.