conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add test for case properties changed function\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import\n\nimport uuid\n\nfrom django.test import TestCase, override_settings\n\nfrom casexml.apps.case.mock import CaseBlock\nfrom corehq.apps.domain.shortc... | python | chosen |
[
{
"from": "human",
"value": "Add tests for io.imshow mpl plugin\n"
},
{
"from": "gpt",
"value": "from __future__ import division\n\nimport numpy as np\nfrom skimage import io\n\nio.use_plugin('matplotlib', 'imshow')\n\n\n# test images. Note that they don't have their full range for their dtype,\... | python | chosen |
[
{
"from": "human",
"value": "Add script for assembling grade files and spreadsheet summary from graded submissions.\n"
},
{
"from": "gpt",
"value": "#####################################################################\n## \n## gradefiles-assemble.py\n##\n## Script template for assembling a co... | python | chosen |
[
{
"from": "human",
"value": "Add people groups page tests\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2015 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: jernej@reciprocitylabs.com\n# M... | python | chosen |
[
{
"from": "human",
"value": "Test interfaces for std manipulation with app\n"
},
{
"from": "gpt",
"value": "import pytest\n\n\ndef test_default_app():\n from repocribro.app import app\n import flask\n assert isinstance(app, flask.Flask)\n\n\ndef test_main_manager(capsys):\n with pyte... | python | chosen |
[
{
"from": "human",
"value": "Policy: Add new slices to all deployments\n"
},
{
"from": "gpt",
"value": "from core.models import *\n\ndef handle(slice):\n\tsite_deployments = SiteDeployments.objects.all()\n\tsite_deploy_lookup = defaultdict(list)\n\tfor site_deployment in site_deployments:\n\t\ts... | python | chosen |
[
{
"from": "human",
"value": "Add migration for new manager on user\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.8 on 2017-12-21 13:25\nfrom __future__ import unicode_literals\n\nimport django.contrib.auth.models\nfrom django.db import migrations\nimport li... | python | chosen |
[
{
"from": "human",
"value": "Add CIFAR reading and image collage.\n"
},
{
"from": "gpt",
"value": "import numpy as np\nimport cPickle as pickle\nimport os\n\ndef collage(data):\n if type(data) is not list:\n if data.shape[3] != 3:\n data = data.transpose(0, 2, 3, 1)\n ... | python | chosen |
[
{
"from": "human",
"value": "Add smoke test for HTML generation\n\ngit-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143\n"
},
{
"from": "gpt",
"value": "# Copyright (c) 2014 The Chromium Authors. All rights reserved.\n# Use of this source code is governe... | python | chosen |
[
{
"from": "human",
"value": "Add tests for new codecutil module -- very basic for now\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom openid import codecutil # registers encoder\n\n\nclass EncoderTest(unittest.TestCase):\n def test_handler_registered(self):\n self.assertEqual... | python | chosen |
[
{
"from": "human",
"value": "Add function for fast modular exponentiation.\n\nThe function uses GMPY's bignum arithmetic which speeds up the calculation.\n"
},
{
"from": "gpt",
"value": "import gmpy\n\ndef powMod( x, y, mod ):\n \"\"\"\n Efficiently calculate and return `x' to the power of... | python | chosen |
[
{
"from": "human",
"value": "Add spider for Kindred Cocktails\n"
},
{
"from": "gpt",
"value": "from scrapy.contrib.spiders import CrawlSpider, Rule\nfrom scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor\nfrom scrapy.selector import HtmlXPathSelector\n\nfrom lxml.cssselect import css_t... | python | chosen |
[
{
"from": "human",
"value": "Add a script for cleaning a page\n"
},
{
"from": "gpt",
"value": "import re\nimport sys\n\ndef remove_lang_templates(string):\n # Preserves text inside template, as it is displayed in the page.\n re_str_lang = ur'{{lang\\|.*?\\|(.*?)}}'\n return re.sub(re_st... | python | chosen |
[
{
"from": "human",
"value": "Add celery beat health check\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand, CommandError\nimport time\n\nfrom django_celery_beat.models import PeriodicTask\nfrom django.utils import timezone\nfrom datetime import timedelta\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Remove user from readonly fields\n\nSo that we can add Applicants from the admin interface.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom cfp.models import CallForPaper, PaperApplication, Applicant\nfrom django.core import urlresolvers\n\... | python | chosen |
[
{
"from": "human",
"value": "Add a new unit test for BERT in Python [skip test]\n"
},
{
"from": "gpt",
"value": "# Copyright 2017-2022 John Snow Labs\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# ... | python | chosen |
[
{
"from": "human",
"value": "Add custom widget for input of Points and google map\n\nCustom widget includes input area for geometry which is automatically\nfilled upon geocoding or manual selection of a location.\n\nAlso includes a placeholder div for the google map on the page.\n"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "human",
"value": "[AC-7750-fix] Fix migrations causing test failures\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.2.10 on 2020-06-30 17:47\n\nfrom django.conf import settings\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n depen... | python | chosen |
[
{
"from": "human",
"value": "Fix build: missed a file\n\nTBR=tony\n\nReview URL: http://codereview.chromium.org/13209\n\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "human",
"value": "Add script export build temporal collection.\n"
},
{
"from": "gpt",
"value": "\"\"\"\n\nExports the data in db.grids.temporal.counties to CSV.\n\n\"\"\"\n\nimport twitterproj\n\ndb = twitterproj.connect()\n\nheader = \\\n\"\"\"# COUNTS are tweet counts in 5 minute in... | python | chosen |
[
{
"from": "human",
"value": "Create partition cleaning utility script\n\nIssues:\nFixes #464\n\nProblem:\nIn the event the agent to get out of sync with the neutron database,\nit is helpful to clear all objects from the tenant partition without\nhaving to navigate to the BIG-IP and delete manually or having... | python | chosen |
[
{
"from": "human",
"value": "Add gene locus generator taking in tabular inputs and using fav lib\n"
},
{
"from": "gpt",
"value": "\"\"\"\nTake the csv/tsv data from coding and non-coding files and insert into\nGene Locus database.\n\"\"\"\n\nimport logging\nfrom collections import OrderedDict\n\... | python | chosen |
[
{
"from": "human",
"value": "Add a few test cases for validate_file_option function.\n"
},
{
"from": "gpt",
"value": "from assess_isoform_quantification.options import validate_file_option\nfrom tempfile import NamedTemporaryFile\nfrom schema import SchemaError\n\nimport pytest\n\n\ndef test_val... | python | chosen |
[
{
"from": "human",
"value": "Add script for twitter search api\n"
},
{
"from": "gpt",
"value": "import json\nimport os\n\nimport pymongo\nimport tweepy\n\nfrom libs.carmen import get_resolver\n\ndef search(query, pages):\n _mongo = pymongo.MongoClient().minerva[query]\n\n minerva_twitter_c... | python | chosen |
[
{
"from": "human",
"value": "Add test for running ros-get without arguments\n"
},
{
"from": "gpt",
"value": "import pytest\nfrom ros_get.__main__ import parse_args\n\n\ndef test_parse_no_command(capsys):\n \"\"\"It should print an error message when no command is provided\"\"\"\n with pyte... | python | chosen |
[
{
"from": "human",
"value": "Test case for mononotic increasing graph\n\nVerify feature description for simple linear graph increasing\nmonotonically with time.\n"
},
{
"from": "gpt",
"value": "import wordgraph\n\nEPOCH_START = 1407109280\n\ndef test_monotonic_up_per_second():\n datapoints = ... | python | chosen |
[
{
"from": "human",
"value": "Add tests for latest fix\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom stencil import Template\n\n\nclass ExpressionTests(unittest.TestCase):\n\n def test_function(self):\n t = Template('Test {{f(\"abc\")}}').render({\"f\": lambda x: x.title() })... | python | chosen |
[
{
"from": "human",
"value": "Add updated migrations for vat_conditions\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-07-30 01:44\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.M... | python | chosen |
[
{
"from": "human",
"value": "Add migration for homepage featured-section integer_block\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport wagtail.wagtailcore.fields\nimport wagtail.wagtailcore.bloc... | python | chosen |
[
{
"from": "human",
"value": "Add integration test for AnnotateImage transform\n"
},
{
"from": "gpt",
"value": "#\n# 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 ... | python | chosen |
[
{
"from": "human",
"value": "Add settings for another instance: fffs\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n# Prefix of default document collection of this instance\nFST_INSTANCE_PREFIX = \"fffs\"\n\n# Organization authorized to publish these documents.\nFST_ORG_NAME = u\"Fi... | python | chosen |
[
{
"from": "human",
"value": "Create file for uWSGI launch\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015:\n# Frederic Mohier, frederic.mohier@gmail.com\n#\n# This file is part of (WebUI).\n#\n# (WebUI) is free software: you can redistrib... | python | chosen |
[
{
"from": "human",
"value": "Create Script to populate volume_path field\n"
},
{
"from": "gpt",
"value": "from backup.models import Volume\nfrom workflow.steps.util.volume_provider import VolumeProviderBase\n\n\nfor vol in Volume.objects.all():\n vol_inst = vol.host and vol.host.instances.fir... | python | chosen |
[
{
"from": "human",
"value": "Create BaseCSV class in support of CSV data extraction\n"
},
{
"from": "gpt",
"value": "import os\nimport glob\n\n\nclass BaseCSV(object):\n\n def __init__(self, settings):\n self.directory = settings.CSV_DATA_DIR\n self.data_files = settings.CSV_FIL... | python | chosen |
[
{
"from": "human",
"value": "Add example page for custom colormaps (incomplete)\n"
},
{
"from": "gpt",
"value": "\"\"\"\nCustom Colormaps\n~~~~~~~~~~~~~~~~\n\nUse a custom built colormap when plotting scalar values.\n\"\"\"\n#######################################################################... | python | chosen |
[
{
"from": "human",
"value": "Read a binary file in chunks, using 'modern' idiomatic Python\n"
},
{
"from": "gpt",
"value": "\"\"\"Read a binary file in chunks, using 'modern' idiomatic Python.\"\"\"\nimport functools\n\nCHUNKSIZE = 42\n\nwith open(__file__, 'rb') as handle:\n read_chunk = fun... | python | chosen |
[
{
"from": "human",
"value": "Add migration files for ProblemQuestion\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.0.7 on 2018-07-11 07:51\n\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Mi... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 419. Battleships in a Board\n\n419. Battleships in a Board: https://leetcode.com/problems/battleships-in-a-board/\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def countBattleships(self, board):\n \"\"\"\n :type board... | python | chosen |
[
{
"from": "human",
"value": "Add reset tunnels management command\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\nfrom app.models import Tunnel\n\n\nclass Command(BaseCommand):\n help = \"Create superuser if missing (Non Interactive).\"\n\n def add_arg... | python | chosen |
[
{
"from": "human",
"value": "Add module to save .csv files as HDF5 data structure.\n"
},
{
"from": "gpt",
"value": "import pandas as pd\nimport numpy as np\nimport os\nimport glob\n\ndef csvtohdf(source, destination):\n \"\"\"Takes a csv file as input and storest it as a hdf5 file in the\n ... | python | chosen |
[
{
"from": "human",
"value": "Solve problem 4 with python.\n"
},
{
"from": "gpt",
"value": "for i in range(10, 100):\n for j in range(i, 100):\n n = i * j\n if str(n) == str(n)[::-1]:\n print \"{} x {} = {}\".format(i, j, n)\n\nfor i in range(100, 1000):\n for j in range(i, 1000):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add migration script to drop service flags\n"
},
{
"from": "gpt",
"value": "\"\"\"empty message\n\nRevision ID: 0109_drop_old_service_flags\nRevises: 0108_change_logo_not_nullable\nCreate Date: 2017-07-12 13:35:45.636618\n\n\"\"\"\n\n# revision identifiers, used by A... | python | chosen |
[
{
"from": "human",
"value": "Add CustomFinders in data migrations\n\nI'm not 100% sure this is the best way of doing this in the long term:\n\nGood: CustomFinders are automatically added when migrations are run,\nmeaning we don't need to figure out a new system for importing them.\n\nThey are also checked i... | python | chosen |
[
{
"from": "human",
"value": "Add module to create GalSim models from GREAT3 truth catalog entries\n"
},
{
"from": "gpt",
"value": "import numpy as np\n\nimport galsim\n\ndef createSource(params):\n \"\"\"\n Returns a GalSim model of the unlensed source specified by params.\n \"\"\"\n ... | python | chosen |
[
{
"from": "human",
"value": "Add tempest tests for build-info API\n\nAdd tempest tests for build-info API\n\nChange-Id: I74bfe7f74678e1c35404afad11d111a7b47f75fe\n"
},
{
"from": "gpt",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file exce... | python | chosen |
[
{
"from": "human",
"value": "Add example of stateful LSTM sequence prediction\n"
},
{
"from": "gpt",
"value": "'''Example script to predict sequence using stateful rnns.\nAt least 10 epochs are required before the generated text\nstarts sounding coherent.\n'''\n\nimport numpy as np\nimport matpl... | python | chosen |
[
{
"from": "human",
"value": "Add cart lines data migration\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.3 on 2016-12-06 13:02\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef convert_lines_data(apps, schema_editor):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add management command to reset Lite counters\n"
},
{
"from": "gpt",
"value": "from django.core.management.base import BaseCommand\n\nfrom paypal.standard.ipn import models\nfrom subscription.models import UserSubscription\n\n\nclass Command(BaseCommand):\n def ha... | python | chosen |
[
{
"from": "human",
"value": "Add the python script that processes the information\n"
},
{
"from": "gpt",
"value": "from pocket import Pocket, PocketException\nimport simplejson\n\nj = simplejson.loads(\"config.json\")\n\np = Pocket(\n consumer_key=j['consumer_key'] #'67605-7d07d07daa10f7fb8db... | python | chosen |
[
{
"from": "human",
"value": "Add convenience script to run all experiments\n"
},
{
"from": "gpt",
"value": "from pathlib import Path\nfrom subprocess import run\n\n\nfor param_file in Path('.').glob('*.json'):\n print(f'Run {param_file.stem}')\n run(['python', 'run.py', str(param_file)])\n... | python | chosen |
[
{
"from": "human",
"value": "Add missing migration for geodata and addondevicetype changes\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport mkt.constants.applications\n\n\nclass Migration(migrati... | python | chosen |
[
{
"from": "human",
"value": "Update audit context permissions for the ProgramReader, ProgramEditor,\nand ProgramOwner roles.\n"
},
{
"from": "gpt",
"value": "\n\"\"\"Update audit permissions.\n\nRevision ID: 2785a204a673\nRevises: c460b4f8cc3\nCreate Date: 2013-12-11 00:11:13.431124\n\n\"\"\"\n\... | python | chosen |
[
{
"from": "human",
"value": "Add a step to make sure that task output matches expected output from a json file, including when the output is dynamic\n"
},
{
"from": "gpt",
"value": "import json\nimport time\nimport operator\nfrom functools import reduce\n\nfrom behave import given, then, when, s... | python | chosen |
[
{
"from": "human",
"value": "Add migration to create and update Option rows\n"
},
{
"from": "gpt",
"value": "\n\"\"\"Add options\n\nRevision ID: 18e1e2aec298\nRevises: 37c5ca51ad36\nCreate Date: 2013-11-16 23:50:30.637169\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '18e1e2a... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 674. Longest Continuous Increasing Subsequence\n\n674. Longest Continuous Increasing Subsequence: https://leetcode.com/problems/longest-continuous-increasing-subsequence/\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def findLength... | python | chosen |
[
{
"from": "human",
"value": "Add 5 test cases for maximumSubarray problem.\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom maximumSubarray import Solution\n\nclass TestMaximumSubarrayEdgeCases(unittest.TestCase):\n def setUp(self):\n self.solution = Solution()\n\n def testEmp... | python | chosen |
[
{
"from": "human",
"value": "Add script that adds all media IDs to SimilarWeb's queue\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n\nfrom mediawords.db import connect_to_db, DatabaseHandler\nfrom mediawords.job.similarweb.update_audience_data import SimilarWebUpdateAudienceDataJob\nf... | python | chosen |
[
{
"from": "human",
"value": "Solve problem 3 in Python\n"
},
{
"from": "gpt",
"value": "# Simple function for primeness test\ndef is_prime(number):\n\n import math\n\n limit = int(math.sqrt(number)) + 1\n\n if number == 2:\n return True\n if number % 2 == 0:\n return False\n for i in ... | python | chosen |
[
{
"from": "human",
"value": "Add script to list repo URLs from GH enterprise.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3.7\n# 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 ... | python | chosen |
[
{
"from": "human",
"value": "Add src/python directory and put Python script in it\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\n'''\n\tAuthor : Various Users\n\tDate : 06/11/2015\n\tDescription : This will be a a relatively simple document breaking down the city_bash project\n\n'''\n##Ne... | python | chosen |
[
{
"from": "human",
"value": "Add test cases for runner container service.\n"
},
{
"from": "gpt",
"value": "try:\n import simplejson as json\nexcept ImportError:\n import json\n\nimport os\n\nfrom oslo.config import cfg\nimport unittest2\n\nfrom st2actions.container.service import RunnerCon... | python | chosen |
[
{
"from": "human",
"value": "[tests] Test that all backends detected on GitHub Actions\n"
},
{
"from": "gpt",
"value": "from unittest import TestCase\n\nimport phi\n\n\nclass TestCIInstallation(TestCase):\n\n def test_detect_tf_torch_jax(self):\n backends = phi.detect_backends()\n ... | python | chosen |
[
{
"from": "human",
"value": "Work on refining the demo code to add some markers, etc.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport sys\nimport SimpleHTTPServer\nimport SocketServer\n\nPORT = 8000\nif len(sys.argv) > 1:\n PORT = int(sys.argv[1])\n\nHandler = SimpleHTTPServer.S... | python | chosen |
[
{
"from": "human",
"value": "Add MIT organization in a migration\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.2 on 2017-07-31 18:22\nfrom __future__ import unicode_literals\n\nfrom django.core.management.sql import emit_post_migrate_signal\nfrom django.db ... | python | chosen |
[
{
"from": "human",
"value": "Add regression test for immediate server name update\n\nThis tests a scenario where a user requests an update to the\nserver before it's scheduled and ensures it succeeds.\n\nRelated-Bug: #1620248\n\nChange-Id: I13a9989d7f515ad2356d26b36b65742dbe48d1a8\n"
},
{
"from": "g... | python | chosen |
[
{
"from": "human",
"value": "Add migration: auto-enable Turn.io for domains using it\n"
},
{
"from": "gpt",
"value": "# Generated by Django 2.2.24 on 2021-06-10 09:13\n\nfrom django.db import migrations\nfrom corehq.messaging.smsbackends.turn.models import SQLTurnWhatsAppBackend\nfrom corehq.tog... | python | chosen |
[
{
"from": "human",
"value": "Add a test case to see that we are using cryptography from the right source\n"
},
{
"from": "gpt",
"value": "\n\ndef test_cryptography_path():\n \"\"\"\n Checks that an imported version of cryptography is actually from the\n dist/cext folder. We can allow ot... | python | chosen |
[
{
"from": "human",
"value": "Repair responses that should have a numeric value stored, but don't,\nmaking sure we don't insert implausibly large values.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom south.v2 import DataMigration\nfrom education.models import Response\nimport re\... | python | chosen |
[
{
"from": "human",
"value": "Add template for testing goedbloed eigenvalue problem\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 16 10:29:40 2014\n\n@author: Jens von der Linden\n\nTests based on relations in Goedbloed (2010) Principles of MHD.\nAll equatio... | python | chosen |
[
{
"from": "human",
"value": "Add cleanup migration for indexes.\n\nThere are a lot of extra indexes in database (for primary key).\n\nbp: ceilometer-db-sync-models-with-migrations\n\nChange-Id: I44d569de81f078aef27451382baf0a3061f38be2\n"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n... | python | chosen |
[
{
"from": "human",
"value": "Add mahalanobis tests to check that the warning is raised\n"
},
{
"from": "gpt",
"value": "# Licensed under an MIT open source license - see LICENSE\nfrom __future__ import print_function, absolute_import, division\n\nimport pytest\nimport warnings\n\nfrom ..statisti... | python | chosen |
[
{
"from": "human",
"value": "Add a management command for getting site information.\n"
},
{
"from": "gpt",
"value": "# coding=utf-8\n\nfrom django.db import connection\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.contrib.sites.... | python | chosen |
[
{
"from": "human",
"value": "Add tests for searching on the Page model\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.conf import settings\nfrom django.test import TestCase\n\nfrom wagtail.wagtailcore.models import Page\nfrom wagtail.wagt... | python | chosen |
[
{
"from": "human",
"value": "TST: Add unit tests for Dirichlet node\n"
},
{
"from": "gpt",
"value": "######################################################################\n# Copyright (C) 2014 Jaakko Luttinen\n#\n# This file is licensed under Version 3.0 of the GNU General Public\n# License. Se... | python | chosen |
[
{
"from": "human",
"value": "Add script to run PBS jobs to collect all data to fragment database\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n#==============================================================================\n# author : Pavel Polishchuk\n# date : 20-... | python | chosen |
[
{
"from": "human",
"value": "Add script for parsing mutation results.\n"
},
{
"from": "gpt",
"value": "import matplotlib.pyplot as plt\nimport numpy\n\nclass Result:\n\n def __init__(self, mut_type, schemes, results):\n self.mut_type = mut_type\n self.schemes = schemes\n ... | python | chosen |
[
{
"from": "system",
"value": "Change way README is imported.\n\nThe custom read function is unnecessary since only one file is being\naccessed. Removing it reduces the amount of code.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\nimport os\n\ndef rea... | python | chosen |
[
{
"from": "human",
"value": "Add class dump automation script\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\nfrom subprocess import call\nimport glob\nimport os\nimport sys\nimport fileinput\nimport re\n\ndestination_path = 'Multiplex/FrameworkHeaders/'\n\ndef dump_all_frameworks():\n\t# 3 ... | python | chosen |
[
{
"from": "human",
"value": "Add a script for dumping data into the graphdb\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\ndef log(msg):\n print(\"[+] %s\" % msg)\n\nimport os\nimport sys\n\nimport bz2\n\nfrom groundstation.station import Station\nfrom groundstation.node import Node\... | python | chosen |
[
{
"from": "human",
"value": "Set CognateJudgementCitation reliabilities to high\n\n- This only affects CognateJudgementCitations that link to Lexemes\n that belong to Meanings from the `Jena200` list and belong to Languages from the `Current` list.\n- Relates to #229\n"
},
{
"from": "gpt",
"val... | python | chosen |
[
{
"from": "system",
"value": "Return `OrderItemTuple`s rather than order item database entities from service\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.shop.order.ordered_articles_service\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2018 Jochen Kuppers... | python | chosen |
[
{
"from": "human",
"value": "Add migration for methods, realtimeurl\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.2 on 2016-05-11 17:40\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migra... | python | chosen |
[
{
"from": "human",
"value": "Create UserProfile model for NurseConnect\n"
},
{
"from": "gpt",
"value": "from django.db import models\n\nfrom molo.profiles.models import UserProfile as MoloUserProfile\n\n\nclass UserProfile(MoloUserProfile):\n \"\"\"\n NurseConnect requires a few modificati... | python | chosen |
[
{
"from": "human",
"value": "Add td agent restarts tep\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom util import full_stack\nfrom util import exec_remote_command\nfrom dbaas_cloudstack.models import HostAttr as CS_HostAttr\nfrom workflow.steps.util.base import Ba... | python | chosen |
[
{
"from": "human",
"value": "Add script to generate BED intervals from filtered coverage data\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\"\"\"Collapse smaller consecutive intervals into larger ones. Allows a minimum\ndistance intervals are spaced for them to be consecutive.\"\"\"\n... | python | chosen |
[
{
"from": "human",
"value": "Add the bin search py version of FindtheDupNum"
},
{
"from": "gpt",
"value": "class Solution(object):\n def findDuplicate(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: int\n \"\"\"\n l, r = 1, len(nums) - 1\n whi... | python | chosen |
[
{
"from": "human",
"value": "Add tests for the lexer\n"
},
{
"from": "gpt",
"value": "from unittest import TestCase\nfrom cinch.lexer import lex\n\n\nclass TestLexer(TestCase):\n\n def test_lex(self):\n # noqa -- this is formatted like real code\n source = \"\"\"\n if... | python | chosen |
[
{
"from": "human",
"value": "Add script for visualizing model\n"
},
{
"from": "gpt",
"value": "import argparse\n\nfrom keras.utils import plot_model\n\nfrom prep import prep_data\n\nfrom model import get_model\n\nap = argparse.ArgumentParser()\nap.add_argument('--dataset', type=str, default='./d... | python | chosen |
[
{
"from": "human",
"value": "Add mock script to test messages in amqp\n\nThis patch adds support to receive and send unregistered\nmessages.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python3\n#\n# This file is part of the KNOT Project\n#\n# Copyright (c) 2019, CESAR. All rights reserved.\n#\... | python | chosen |
[
{
"from": "human",
"value": "Add unique column constraints to db\n\nUnique constraints are not being set on the database but they are\ndefined in the schema. This db upgrade adds the unique constraints.\n\nChange-Id: I0dd1c2190bf7b68e1e0c8c71fbb123d2c82cc0d3\nCloses-Bug: 1451761\n"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 583. Delete Operation for Two Strings\n\n583. Delete Operation for Two Strings: https://leetcode.com/problems/delete-operation-for-two-strings/\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def minDistance(self, word1, word2):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add script to launch ms-gf\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n#\n# Wrapper script for Java Conda packages that ensures that the java runtime\n# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59... | python | chosen |
[
{
"from": "human",
"value": "Add test for help command\n"
},
{
"from": "gpt",
"value": "import unittest\nfrom unittest.mock import MagicMock\nfrom phial.commands import help_command\n\n\nclass TestHelpCommand(unittest.TestCase):\n def test_help_command(self):\n bot = MagicMock()\n ... | python | chosen |
[
{
"from": "human",
"value": "Add pure python multi-process client\n\nAvoid using bash to spawn our worker processes,\nsince it can lose them and cleaning them up is\nquite annoying.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n\"\"\"\nUse with timeit module as follows::\n\n pytho... | python | chosen |
[
{
"from": "human",
"value": "Add pascal image segmentation example\n"
},
{
"from": "gpt",
"value": "\"\"\"\n===========================================\nSemantic Image Segmentation on Pascal VOC\n===========================================\nThis example demonstrates learning a superpixel CRF\nfo... | python | chosen |
[
{
"from": "human",
"value": "Add script for disable/enable tm backup\n"
},
{
"from": "gpt",
"value": "'''\nCreated on Mar 1, 2015\n\n@author: namezys\n\nSet time machine backup disable flag\n'''\n\nimport os\nfrom argparse import ArgumentParser\nfrom tm_police.ctrl import enable_tm\nfrom tm_poli... | python | chosen |
[
{
"from": "human",
"value": "Add script for making status consistent.\n"
},
{
"from": "gpt",
"value": "from app import geo\nfrom app.firebase import db\n\nfrom app.constants import locationsTable, venuesTable, GPS_LOCATIONS\n\n# The casing of tripadvisor is not consistent across our Firebase scr... | python | chosen |
[
{
"from": "human",
"value": "Add preliminary version of the intelligent miner robot\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom botchallenge import Robot\nfrom botchallenge import BlockType\nfrom botchallenge import Dir\nimport random\n\n\nUSERNAME =... | python | chosen |
[
{
"from": "human",
"value": "Add test for OWNDATA flag\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom cupy import core\nfrom cupy import testing\n\n\n@testing.gpu\nclass TestArrayOwndata(unittest.TestCase):\n\n _multiprocess_can_split_ = True\n\n def setUp(self):\n self.a ... | python | chosen |
[
{
"from": "human",
"value": "Test added for unit write_statistics\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n# FOGLAMP_BEGIN\n# See: http://foglamp.readthedocs.io/\n# FOGLAMP_END\n\n\nimport asyncio\nfrom unittest.mock import patch, call\nimport pytest\nfrom foglamp.common.stora... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.