conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add Example for Git Deamon.\n\nThis can now be used in the unittests\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\n\nimport git\nimport tempfile\nimport time\n\ntmpdir = tempfile.TemporaryDirectory(suffix='.git')\nrepo = git.Repo.init(tmpdir.name, shared... | python | chosen |
[
{
"from": "human",
"value": "Fix configuration imports. Adapter now works.\n"
},
{
"from": "gpt",
"value": "# configure django to use default settings\n# note that this can also be done using an environment variable\nfrom django.conf import settings\nfrom django.core.exceptions import Improperly... | python | chosen |
[
{
"from": "human",
"value": "Test the Map CTP interface.\n"
},
{
"from": "gpt",
"value": "import sys, os, re, shutil\nfrom nose.tools import *\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))\nfrom qipipe.interface... | python | chosen |
[
{
"from": "human",
"value": "Add test for wlan widget\n"
},
{
"from": "gpt",
"value": "# Copyright (c) 2021 elParaguayo\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the ... | python | chosen |
[
{
"from": "human",
"value": "Add example of how to do sparse-checkout\n"
},
{
"from": "gpt",
"value": "import tempfile\nimport typer\nfrom pathlib import Path\nimport subprocess\nimport shlex\nimport shutil\nfrom contextlib import contextmanager\n\n\n@contextmanager\ndef make_tempdir():\n d =... | python | chosen |
[
{
"from": "human",
"value": "Add API permission class for HasScopeOrWriteOnly\n"
},
{
"from": "gpt",
"value": "from oauth2_provider.ext.rest_framework import TokenHasScope\nfrom rest_framework.permissions import DjangoObjectPermissions\n\n\nclass TokenHasScopeOrUserHasObjectPermissionsOrWriteOnl... | python | chosen |
[
{
"from": "human",
"value": "Add conf file for TV5 Monde Burundi\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"KoomBook conf\"\"\"\nfrom .kb import * # noqa\n\nLANGUAGE_CODE = 'fr'\nIDEASCUBE_NAME = 'TV5 Monde Burundi'\nHOME_CARDS = STAFF_HOME_CARDS + [\n {\n 'id': '... | python | chosen |
[
{
"from": "human",
"value": "Test the webcam with cv2\n\n"
},
{
"from": "gpt",
"value": "import cv2, sys, os, time, logging\n\nvideo = cv2.VideoCapture(0)\n\nwhile True:\n ret, cameraFrame = video.read()\n if not ret:\n exit()\n cv2.imshow(\"Live Video\", cameraFrame)\n contin... | python | chosen |
[
{
"from": "human",
"value": "Add conf file for MOOC RDC\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"KoomBook conf\"\"\"\n\nfrom .base import * # noqa\nfrom django.utils.translation import ugettext_lazy as _\n\n# SECURITY WARNING: don't run with debug turned on in productio... | python | chosen |
[
{
"from": "human",
"value": "Release: Add script to only create the MSI package.\n\n* This is for external CI to produce MSI packages instead of my\n internal one.\n"
},
{
"from": "gpt",
"value": "# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com\n#\n# Part of \"Nuitka\", an optim... | python | chosen |
[
{
"from": "human",
"value": "Add unittest for command recent_proposals\n"
},
{
"from": "gpt",
"value": "from datetime import timedelta\nimport re\n\nimport pytest\nfrom django.utils.timezone import now\nfrom django.core.management import call_command\n\nfrom proposals.models import TalkProposal\... | python | chosen |
[
{
"from": "human",
"value": "Add class specific for IVoiSys to do DB auth.\n"
},
{
"from": "gpt",
"value": "# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.\n# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.\n#\n# This file is part of SIPPY, a free RFC3261 SIP stac... | python | chosen |
[
{
"from": "human",
"value": "Add simple KafkaProducer -> KafkaConsumer integration test\n"
},
{
"from": "gpt",
"value": "import pytest\n\nfrom kafka import KafkaConsumer, KafkaProducer\nfrom test.conftest import version\nfrom test.testutil import random_string\n\n\n@pytest.mark.skipif(not versio... | python | chosen |
[
{
"from": "human",
"value": "Add some xtheme admin tests\n"
},
{
"from": "gpt",
"value": "from shuup.apps.provides import override_provides\nfrom shuup.testing.utils import apply_request_middleware\nfrom shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTem... | python | chosen |
[
{
"from": "human",
"value": "Add some tests for catalog\n"
},
{
"from": "gpt",
"value": "\"\"\"Objects catalog unittests.\"\"\"\n\nimport unittest2 as unittest\n\nfrom objects.catalog import AbstractCatalog\n\nfrom objects.providers import Object\nfrom objects.providers import Value\n\nfrom obje... | python | chosen |
[
{
"from": "human",
"value": "Add test superclasses for authorization and permissions\n\n"
},
{
"from": "gpt",
"value": "class AuthorizedTest:\n\n async def test_not_authorized(self, do_get):\n resp = await do_get(\"/api/users\")\n\n assert resp.status == 403\n\n assert aw... | python | chosen |
[
{
"from": "human",
"value": "Add a unit test for get_train_routes func.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nimport unittest\nimport korail_split_ticket_checker\n\nimport datetime\n\nclass TestKorailSplitTickerChecker(unittest.TestCase):\n\n\tdef setUp(self):\t\t\n\t\ttomorr... | python | chosen |
[
{
"from": "human",
"value": "Add test for the start module\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom coilmq.server.socket_server import ThreadedStompServer\nfrom coilmq.start import server_from_config\n\nclass GetServerTestCase(unittest.TestCase):\n\n def test_server_from_confi... | python | chosen |
[
{
"from": "human",
"value": "Add example of various name servers from one script\n"
},
{
"from": "gpt",
"value": "\"\"\"\nThis example is relatively complex.\n\nWe will be creating a system in which agents will connect to different\nname servers. Each name server will therefore represent a 'grou... | python | chosen |
[
{
"from": "human",
"value": "Add functional tests for commands of floating ip\n\nThis patch add functinal tests for commands of floating ip\n\nChange-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029\n"
},
{
"from": "gpt",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\... | python | chosen |
[
{
"from": "human",
"value": "Add test for async Block\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nimport aiounittest\nfrom graphenecommon.utils import parse_time\nfrom .fixtures_aio import fixture_data, Block, BlockHeader\n\n\nclass Testcases(aiounittest.AsyncTestCase):\n def se... | python | chosen |
[
{
"from": "human",
"value": "PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only dataset\n"
},
{
"from": "gpt",
"value": "import sys, os\nsys.path.insert(1, os.path.join(\"..\",\"..\",\"..\"))\nimport h2o\nfrom tests import pyunit_utils\nfrom h2o.estimators.gbm import H2OGr... | python | chosen |
[
{
"from": "human",
"value": "owrocanalysis: Add basic tests for roc analysis utilities\n"
},
{
"from": "gpt",
"value": "import unittest\nimport numpy\n\nimport Orange.data\nimport Orange.evaluation\nimport Orange.classification\n\nfrom Orange.widgets.evaluate import owrocanalysis\n\n\nclass Test... | python | chosen |
[
{
"from": "human",
"value": "Add script for doing OPTIMA-overlap queries"
},
{
"from": "gpt",
"value": "# Takes a file in the format used by Valouev and extracts k-mers as new maps\nimport sys\nimport numpy as np\nk = 12 # window size ... | python | chosen |
[
{
"from": "human",
"value": "Add a migration to remove old imported buyer accounts\n\nUsers with a \"buyer\" role were imported from the Grails app and are\na mix of buyer and supplier users. We used to convert them to supplier\naccounts during registration, but now that we're planning to open buyer\nregist... | python | chosen |
[
{
"from": "human",
"value": "Add script to add extension based on mimetype\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# Note, you need to pip install python-magic to use this.\n\nimport magic\nimport os\nimport sys\n\ndef fix_with_magic(filename):\n base, ext = os.path.splitext... | python | chosen |
[
{
"from": "human",
"value": "Add utility functions to distinguish events with same type/time\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef is_matching_event(play, event):\n \"\"\"\n Checks ... | python | chosen |
[
{
"from": "human",
"value": "Add alembic revision to create FKs\n\nTo be run AFTER running the zodbimporter\n"
},
{
"from": "gpt",
"value": "\"\"\"Add abstract FKs\n\nRevision ID: 55d523872c43\nRevises: 2ce1756a2f12\nCreate Date: 2016-09-14 16:52:29.196932\n\"\"\"\n\nfrom alembic import op\n\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add migration for contest curator and tester\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.2.13 on 2021-04-26 02:57\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('judge', '0115_con... | python | chosen |
[
{
"from": "system",
"value": "[FIX] mrp_subcontracting: Allow to select any type of subcontracting product\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n##############################################################################\n#\n# This program is free software: you can ... | python | chosen |
[
{
"from": "human",
"value": "[mlir][python[[sparse] Add tests for the exhaustive test utilities.\n\nAdd tests for the common utilities that we use for writing exhaustive tests for\nthe MLIR sparse codegen.\n\nSimplify the relevant build rules by adding a new filegroup and moving a shared\nlibrary to an exis... | python | chosen |
[
{
"from": "human",
"value": "Add unit test for bucket sort implementation.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nfrom helper.read_data_file import read_int_array\nfrom sorting.bucket_sort import sort\n\n\nBASE_DIR = os.pa... | python | chosen |
[
{
"from": "human",
"value": "Add code to support OpenID\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\nimport ConfigParser\nimport pprint\n\ndef get_external_idps(director_configfile):\n \"\"\"\n\tget_external_idps(director_configfile)\n\tChecks in the conpaas section if the support_exte... | python | chosen |
[
{
"from": "human",
"value": "[tests] Add unit tests for pulseaudio module\n"
},
{
"from": "gpt",
"value": "# pylint: disable=C0103,C0111\n\nimport mock\nimport unittest\n\nimport tests.mocks as mocks\n\nfrom bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN\nfrom bumblebee.mod... | python | chosen |
[
{
"from": "human",
"value": "Add initial Hugging Face Datasets parser impl.\n"
},
{
"from": "gpt",
"value": "\"\"\" Dataset parser interface that wraps Hugging Face datasets\nHacked together by / Copyright 2022 Ross Wightman\n\"\"\"\nimport io\nimport math\nimport torch\nimport torch.distributed... | python | chosen |
[
{
"from": "human",
"value": "Add flush data stack example utility file\n"
},
{
"from": "gpt",
"value": "#==============================================================================\n# rpc_flush_datastack.py\n# Python script that flushes a dataport for a device\n#\n# IMPORTANT NOTE!!: This wil... | python | chosen |
[
{
"from": "human",
"value": "Add script that gets the services and deployNotes where a list of Pull requests will be deployed\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport requests\nimport json\nimport sys\nimport argparse\n\nparser = argparse.ArgumentParser('Queries Monorail ... | python | chosen |
[
{
"from": "human",
"value": "DEV: Add a function for matrix representation.\n\nSee issue #49.\n"
},
{
"from": "gpt",
"value": "# Copyright 2014, 2015 The ODL development group\n#\n# This file is part of ODL.\n#\n# ODL is free software: you can redistribute it and/or modify\n# it under the terms ... | python | chosen |
[
{
"from": "human",
"value": "Add script to read and load chus and chews\n"
},
{
"from": "gpt",
"value": "import os\nimport csv\nimport json\nfrom django.conf import settings\n\n\nchul_file = os.path.join(\n settings.BASE_DIR, 'data/csvs/chul.csv')\n\ntable_columns = [\n \"CommUnitId\", \"C... | python | chosen |
[
{
"from": "human",
"value": "Add data.gov.uk to the list of organisations\n\nWe need to send an email with data.gov.uk branding.\n\nThe image for the logo doesn’t exist yet, but doing this migration so\nwe’re ready when it the logo does exist.\n"
},
{
"from": "gpt",
"value": "\"\"\"empty message... | python | chosen |
[
{
"from": "human",
"value": "Add a capitalization check for world wars inspired by error in a bibliography\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"MSC: Password in plain text.\n\n---\nlayout: post\nerror_code: MSC\nsource: ???\nsource_url: ???\ntitle: Capital... | python | chosen |
[
{
"from": "human",
"value": "Add simple code generation script\n"
},
{
"from": "gpt",
"value": "\"\"\"This demonstration generates the relevant code from the Slate\nexpressions. Note that this is for code only; it's not solving any\nparticular PDE with given data.\n\nSee the main hybrid-mixed fo... | python | chosen |
[
{
"from": "human",
"value": "Add in script to track new account activity\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nfrom datetime import datetime\nfrom pymongo import MongoClient\nimport re\nfrom subprocess import call\nimport sys\n\n# minutes\nwindow = 30\n\nif len(sys.argv) != 2... | python | chosen |
[
{
"from": "system",
"value": "Add comment of vital importance\n\nThis bumps me up another shade of green! Yay!\n"
},
{
"from": "human",
"value": "from standup.settings import *\n\nDATABASE_URL = 'sqlite://'\n"
},
{
"from": "gpt",
"value": "from standup.settings import *\n\n# This loo... | python | chosen |
[
{
"from": "human",
"value": "Add script that re-translates models\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2018-06-04 09:55\nfrom __future__ import unicode_literals\n\nfrom django.db import connection\nfrom django.utils.translation import activate... | python | chosen |
[
{
"from": "human",
"value": "Add py unittest violation case\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\nfrom tasks.const import STATUS_SUCCESS, STATUS_FAILED\nfrom ..py_unittest import py_unittest_violation\nfrom .base import get_content\n\n\nclass PyUnittestViolationCase(... | python | chosen |
[
{
"from": "human",
"value": "Add tests for auth index\n"
},
{
"from": "gpt",
"value": "from changes.testutils import APITestCase\n\n\nclass AuthIndexTest(APITestCase):\n path = '/api/0/auth/'\n\n def test_anonymous(self):\n resp = self.client.get(self.path)\n assert resp.stat... | python | chosen |
[
{
"from": "human",
"value": "Add candidate status to DB field\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.0.3 on 2018-03-31 20:22\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('api', '0016_auto_20180328_0601... | python | chosen |
[
{
"from": "human",
"value": "Add test case to make sure we always proper test module names from now on\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n'''\n tests.unit.doc_test\n ~~~~~~~~~~~~~~~~~~~~\n'''\n\n# Import Python libs\nfrom __future__ import absolute_import\nimport os\... | python | chosen |
[
{
"from": "human",
"value": "Package init module now added.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nThis file is part of library PyRandLib.\nIt is provided under MIT License.\nPlease see files README.md and LICENSE.\n\nCopyright (c) 2017 Philippe Schmouker\n\"\"\"\n\nfrom .baselcg import... | python | chosen |
[
{
"from": "human",
"value": "Add utils to manage blueprints\n"
},
{
"from": "gpt",
"value": "from flask_restful import Api, output_json\n\n\ndef configure_api_from_blueprint(blueprint, route_tuples):\n api = Api(blueprint, catch_all_404s=True)\n\n api.representations = {\n 'applicat... | python | chosen |
[
{
"from": "human",
"value": "Add script for counting valorated tweets per week\n"
},
{
"from": "gpt",
"value": "# -*- coding:utf-8 -*-\n\nimport valoratweets\nimport mongoengine\nfrom tweemanager.tweetdocument import TweetDocument\nimport pprint\nimport re\nimport datetime as dt\nfrom bson impor... | python | chosen |
[
{
"from": "human",
"value": "Make migrations for Wagtail 2.3\n\nThis commit is the result of running\n\n```\ndocker-compose exec django /bin/bash -c \"./manage.py makemigrations\"\n```\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.0.13 on 2019-03-19 14:38\n\nfrom django.db import migr... | python | chosen |
[
{
"from": "human",
"value": "Add GNOME Terminal tabs script.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\"\n Run a command on multiple servers via SSH, each in a GNOME Terminal tab. \n See http://exyr.org/2011/gnome-terminal-tabs/\n\"\"\"\n\nimport subprocess\n\ncommand... | python | chosen |
[
{
"from": "system",
"value": "Add in a way to specify the utmp file path for unit testing\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\n\"\"\"\nCollects the number of users logged in and shells per user\n\n#### Dependencies\n\n * [pyutmp](http://software.clapper.org/pyutmp/)\n\n\"\"\"\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add script to turn off all lights on Sense Hat\n"
},
{
"from": "gpt",
"value": "# based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/\n\nfrom sense_hat import SenseHat\nfrom time import sleep\n\nsense = SenseHat()\nsense.clear()\n\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add tests for isCorpus() in utils.py.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n\n\"\"\"\nAutomated tests for checking various utils functions\n\"\"\... | python | chosen |
[
{
"from": "human",
"value": "Add a new interesting test to check different behaviour based on command line switches.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nfrom optparse import OptionParser\n\nimport timedRun\nimport filecmp\n\n\ndef parseOptions(arguments):\n parser = Opti... | python | chosen |
[
{
"from": "human",
"value": "Add migration script for defective \"delete wiki page\" logs\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nimport datetime\nimport logging\nimport sys\n\nfrom modularodm import Q\n\nfrom website.models import NodeLog\n\nfrom bson import ObjectId\nfrom n... | python | chosen |
[
{
"from": "human",
"value": "Add some info about Quick Sort\n"
},
{
"from": "gpt",
"value": "\"\"\"Quick Sort Algorithm.\n\nThe Quick Sort is a recursive sort of order in range from O(n log n) with\nthe best pivots, to O(n2) with the worst pivots, where n is the number\nof elements in the array.... | python | chosen |
[
{
"from": "human",
"value": "Add missing get token file\n"
},
{
"from": "gpt",
"value": "from keystoneauth1.identity import v3\nfrom keystoneauth1 import session\n\nfrom config import *\n\n\nauth = v3.Password(auth_url=AUTH_URL,\n user_domain_name='default',\n ... | python | chosen |
[
{
"from": "human",
"value": "Add Fahrenheit to Celsius table exercise\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ndef getCelsius(f):\n return (f-32) * 5/ 9\n\nfor index in range(10, 130, 10):\n fahrenheit = index\n print \"{0}ºF are {1}ºC\".format(fahren... | python | chosen |
[
{
"from": "human",
"value": "Add helpers for generating Python code"
},
{
"from": "gpt",
"value": "import sys\n\npy_reserved = set(\"id is class def\".split()) # FIXME\ndef py_name(name):\n if name in py_reserved:\n return name + \"_\"\n return name\n\nsdl_to_python = {\n \"int3... | python | chosen |
[
{
"from": "human",
"value": "Add test case for forgot password.\n"
},
{
"from": "gpt",
"value": "from . import TheInternetTestCase\nfrom helium.api import start_chrome, S, get_driver, set_driver, write, click, \\\n\tText, Link, kill_browser, wait_until\n\nclass ForgotPasswordTest(TheInternetTest... | python | chosen |
[
{
"from": "human",
"value": "Add script which divides mlsp data into train/test\n"
},
{
"from": "gpt",
"value": "import os\nimport glob\nimport csv\n\nallFiles = [\"\" + x for x in glob.glob(\"*.wav\")];\ntrainFiles = []\n\nwith open(\"file2labels.csv\", newline='') as csvfile:\n file2labels... | python | chosen |
[
{
"from": "human",
"value": "Add a MediaFileForeignKey which automatically adds thumbnail previews to the administration\n"
},
{
"from": "gpt",
"value": "from django.contrib.admin.widgets import ForeignKeyRawIdWidget\nfrom django.db import models\nfrom django.utils.html import escape\nfrom djang... | python | chosen |
[
{
"from": "human",
"value": "Add tests for agent-based functions\n"
},
{
"from": "gpt",
"value": "import socket\n\nfrom shakedown import *\n\n\ndef test_get_public_agents():\n public_agents = get_public_agents()\n\n assert isinstance(public_agents, list)\n\n try:\n assert socket.... | python | chosen |
[
{
"from": "human",
"value": "Add tests against Sponsor viewset\n"
},
{
"from": "gpt",
"value": "from django.core.urlresolvers import reverse\n\nfrom rest_framework import status\nfrom symposion.sponsorship.models import Sponsor\n\nfrom .base import TestBase\n\n\nclass TestSponsor(TestBase):\n\n ... | python | chosen |
[
{
"from": "human",
"value": "Add script for transforming letsencrypt certificate\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\"Script to transform letsencrypt certificate files into string that can be inserted into\nenvironment variable for Tutum to pick up.\n\nPut your private k... | python | chosen |
[
{
"from": "human",
"value": "Solve Age in Days in python\n"
},
{
"from": "gpt",
"value": "import sys\n\n\nfor t in sys.stdin:\n t = int(t)\n a = 0\n m = 0\n\n if t >= 365:\n a = t // 365\n t %= 365\n\n if t >= 30:\n m = t // 30\n t %= 30\n\n print(f\... | python | chosen |
[
{
"from": "human",
"value": "Add stub module for test suite.\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2013 by Alex Brandt <alunduil@alunduil.com>\n#\n# parameters is freely distributable under the terms of an MIT-style license.\n# See COPYING or http://www.opensource.org/licenses/mit-lic... | python | chosen |
[
{
"from": "human",
"value": "Add a new script for checking data integrity\n"
},
{
"from": "gpt",
"value": "\"\"\"\nA script for checking data integrity of the Rfam-miRBase sync.\n\"\"\"\n\nfrom utils import db_utils as db\n\n\ndef verify_thresholds():\n \"\"\"\n Manually export a file with... | python | chosen |
[
{
"from": "human",
"value": "Add example of using stdin pipe and creating a very simple repl\n"
},
{
"from": "gpt",
"value": "import sys\nimport code\n\nfrom diesel import Application, Pipe, until\n\ndef readcb():\n print 'Diesel Console'\n while 1:\n sys.stdout.write('>>> ')\n ... | python | chosen |
[
{
"from": "human",
"value": "Add test file for templates with initial test for comparecard.html\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\nfrom django.template.loader import render_to_string\n\n\nclass TestTemplates(TestCase):\n\n def test_comparecard(self):\n #... | python | chosen |
[
{
"from": "human",
"value": "Add some unit tests for CtfEditor\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom enable.testing import EnableTestAssistant\nfrom enable.window import Window\n\nfrom ensemble.ctf.editor import CtfEditor\n\n\ndef get_color(starting_color=None):\n if starti... | python | chosen |
[
{
"from": "human",
"value": "Test if pickle can serialize CNV/fCNV\n\nThis is crucial to use seabird objects in multiprocessings.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Check if pickle can serialize seabird's data objects\n\n\"\"\"\n\nimport os\... | python | chosen |
[
{
"from": "human",
"value": "ADD Abstract Database Manager class\n"
},
{
"from": "gpt",
"value": "from typing import Dict\nfrom typing import Type\nfrom typing import Union\nfrom typing import List\nfrom ..database import BaseModel, db\n\n\nclass DatabaseManager:\n def register(self, **kwargs... | python | chosen |
[
{
"from": "human",
"value": "Add management command to migrate tags to new_tags field\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\n\nfrom TWLight.resources.models import Partner\n\n\nclass Command(BaseCommand):\n help = \"Migrates content from the tags... | python | chosen |
[
{
"from": "human",
"value": "Add script to patch old symbooglix results when boogie-runner classified\nhitting speculative paths as BOUND_HIT. This was a bad idea so this\nscript changes those results to UNKNOWN but note we have the\n``speculative_paths_nb`` attribute so that can be used to find the\nresult... | python | chosen |
[
{
"from": "human",
"value": "Add project file class for Maven\n"
},
{
"from": "gpt",
"value": "from backend.projectfiles import GenericProjectFile\nfrom bs4 import BeautifulSoup\n\nclass MavenProjectFile(GenericProjectFile):\n \"\"\" Maven project file implementation to extract dependencies \... | python | chosen |
[
{
"from": "human",
"value": "Add test from dummy thermometer.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nBraubuddy Dummy thermometer unit tests.\n\"\"\"\n\nimport unittest\nfrom mock import patch, call, MagicMock\nfrom braubuddy.thermometer import auto \nfrom braubuddy.thermometer import dummy \nf... | python | chosen |
[
{
"from": "human",
"value": "Configure the IPython notebook user settings\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Configuration file for ipython-notebook.\n\nc = get_config()\nc.NotebookApp.ip = '*'\nc.NotebookApp.open_browser = False\nc.NotebookApp.p... | python | chosen |
[
{
"from": "human",
"value": "Add conf file for Nicarali project\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"KoomBook conf\"\"\"\nfrom .kb import * # noqa\n\nLANGUAGE_CODE = 'es'\nIDEASCUBE_NAME = 'Nicarali'\nHOME_CARDS = STAFF_HOME_CARDS + [\n {\n 'id': 'blog',\n ... | python | chosen |
[
{
"from": "human",
"value": "Add simple tests for Hyper_Function\n"
},
{
"from": "gpt",
"value": "\"\"\" Unit tests for Hyper_Function\"\"\"\nfrom sympy.core import symbols, Dummy, Tuple\nfrom sympy.functions import hyper\n\nfrom sympy.simplify.hyperexpand import Hyper_Function\n\ndef test_attrs... | python | chosen |
[
{
"from": "human",
"value": "Test skeleton for db backup scripts.\n"
},
{
"from": "gpt",
"value": "\"\"\"Tests for vumi.scripts.db_backup.\"\"\"\n\nfrom twisted.trial.unittest import TestCase\n\nfrom vumi.tests.utils import PersistenceMixin\n\nfrom vumi.scripts.db_backup import ConfigHolder, Opt... | python | chosen |
[
{
"from": "human",
"value": "Add data migrations for new processor place\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.5 on 2017-03-09 08:20\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef update_price_calculator(apps, ... | python | chosen |
[
{
"from": "human",
"value": "DOC: Add example for World Cup rankings with window transformation\n"
},
{
"from": "gpt",
"value": "\"\"\"\nWindow Rank Line Chart\n----------------------\nThis example shows the Group F rankings in the 2018 World Cup after each matchday. \nA window transformation is... | python | chosen |
[
{
"from": "human",
"value": "Add tests for new elasticsearch processor\n"
},
{
"from": "gpt",
"value": "import utils\n\nfrom scrapi.linter.document import NormalizedDocument, RawDocument\nfrom scrapi.processing.elastic_search import es, ElasticsearchProcessor\n\ntest_db = ElasticsearchProcessor(... | python | chosen |
[
{
"from": "human",
"value": "Add simple test for scalewa storage driver\n"
},
{
"from": "gpt",
"value": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding... | python | chosen |
[
{
"from": "human",
"value": "Test that watchers send newobject requests\n"
},
{
"from": "gpt",
"value": "import os\nimport select\n\nimport groundstation.fs_watcher as fs_watcher\nfrom groundstation.peer_socket import PeerSocket\n\nfrom integration_fixture import StationIntegrationFixture, \\\n ... | python | chosen |
[
{
"from": "human",
"value": "Add a url_pattern module for soc core views.\n\nThis module contains the URL patters for site-wide views like Host\nrelated views.\n\n--HG--\nextra : rebase_source : 3b1398c5149664d63f0d84df2040791995461152\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2.5\n#... | python | chosen |
[
{
"from": "human",
"value": "Add a csv import script (specific to BUCS)\n"
},
{
"from": "gpt",
"value": "import csv\nfrom django.template.defaultfilters import slugify\n\nfrom core.models import Bowstyle, Club, Archer\nfrom entries.models import CompetitionEntry, SessionEntry, SessionRound, Comp... | python | chosen |
[
{
"from": "system",
"value": "Enhance currency filter to allow format string to be specified\n\nThis allows the positioning of the currency symbol to be controlled.\n\nFixes #311\n"
},
{
"from": "human",
"value": "import locale\n\nfrom django import template\nfrom django.conf import settings\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add database migration for QuestionnaireResponse model\n"
},
{
"from": "gpt",
"value": "\"\"\"empty message\n\nRevision ID: 2439eea5b23c\nRevises: 577ad345788e\nCreate Date: 2015-11-23 14:04:45.572638\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = ... | python | chosen |
[
{
"from": "human",
"value": "Add 0048 - HelpLink migration\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('core', '0047_add... | python | chosen |
[
{
"from": "human",
"value": "Solve gaming laptop battery life\n"
},
{
"from": "gpt",
"value": "# Problem Solving (Basic) Skill Verification Test\n\n#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n#\n# Complete the 'getBattery' function below.\n#\n# The function ... | python | chosen |
[
{
"from": "human",
"value": "Add migration script to migrate users whose is_claimed field is None\n\nh/t @icereval\n\n[skip ci]\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Script to migrate nodes with invalid categories.\"\"\"\n\nimport sys\nimport logg... | python | chosen |
[
{
"from": "human",
"value": "Add a benchmark for coroutine processing.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# A simple benchmark of the tornado.gen module.\n# Runs in two modes, testing new-style (@coroutine and Futures)\n# and old-style (@engine and Tasks) coroutines.\n\nf... | python | chosen |
[
{
"from": "human",
"value": "forwarding: Add simplest learning switch ever\n"
},
{
"from": "gpt",
"value": "# Copyright 2011 James McCauley\n#\n# This file is part of POX.\n#\n# POX is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as... | python | chosen |
[
{
"from": "human",
"value": "Upgrade to add Time based exercises tables\n"
},
{
"from": "gpt",
"value": "\"\"\"Adds TimeExercisesHistory and TimeExercisesTaxonomy Tables\n\nRevision ID: 7791f2c862d2\nRevises: 56630a78dca0\nCreate Date: 2017-07-30 20:40:17.174425\n\n\"\"\"\nfrom alembic import op... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.