conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Make migration for backfilling pages' `latest_revision` and revisions' `object_str`\n"
},
{
"from": "gpt",
"value": "# Generated by Django 4.0.3 on 2022-05-26 13:58\n\nfrom django.db import migrations, models\nfrom django.db.models.functions import Cast\n\n\ndef popu... | python | chosen |
[
{
"from": "human",
"value": "Add tests for inquiry API\n"
},
{
"from": "gpt",
"value": "from rest_framework import status\nfrom rest_framework.reverse import reverse\nfrom wellsfargo.tests.base import BaseTest\nfrom wellsfargo.tests import responses\nimport mock\n\n\nclass CreditLineInquiryTest(... | python | chosen |
[
{
"from": "human",
"value": "Add alembic script for renaming 'user_mac_change' property\n\n"
},
{
"from": "gpt",
"value": "\"\"\"hosts and interfaces\n\nRevision ID: 6f1a37baa574\nRevises: cd588620e7d0\nCreate Date: 2018-09-17 15:38:56.401301\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy ... | python | chosen |
[
{
"from": "human",
"value": "Add some simple parser tests\n"
},
{
"from": "gpt",
"value": "# coding=UTF-8\n#\n# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licen... | python | chosen |
[
{
"from": "human",
"value": "Fix migration issue by creating new migration.\n\nBoth migration #3 and migration #4 in symposion.speakers have not been\napplied upstream. Because of this, migration #4 accidentally reverted\nthe changes made in migration #3.\n\nBecause there are currently deployed conference s... | python | chosen |
[
{
"from": "human",
"value": "Add plotter script to plot internal test's stats\n\nBug: webrtc:10138\nChange-Id: I2b9d55559cf6a123914e5a597a5bf6ea6e2aa4d7\nReviewed-on: https://webrtc-review.googlesource.com/c/src/+/152721\nCommit-Queue: Artem Titov <1e27363ccc366a7ff0fdde48204d68d5ebfeccc5@webrtc.org>\nRevie... | python | chosen |
[
{
"from": "human",
"value": "Transform algorithm in python 3"
},
{
"from": "gpt",
"value": "def php_crud_api_transform(tables):\n\n def get_objects(tables, table_name, where_index=None, match_value=None):\n objects = []\n for record in tables[table_name]['records']:\n ... | python | chosen |
[
{
"from": "system",
"value": "Create columns for custom fields in new table Salary Detail and Component\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import ... | python | chosen |
[
{
"from": "human",
"value": "Add router for read-only APIs\n"
},
{
"from": "gpt",
"value": "from rest_framework.routers import DefaultRouter\nfrom rest_framework.routers import Route\n\n\nclass ReadOnlyRouter(DefaultRouter):\n \"\"\"\n A router for read-only APIs, which USES trailing slash... | python | chosen |
[
{
"from": "human",
"value": "Add a script for cleaning our ECS clusters\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# -*- encoding: utf-8 -*-\n\"\"\"\nRemove unused Docker containers and images from an ECS cluster.\n\nUsage:\n ecs_clean_cluster.py --key=<PRIV_KEY> --cluster=<CLUSTE... | python | chosen |
[
{
"from": "human",
"value": "Add conversion from json to csv format"
},
{
"from": "gpt",
"value": "import json\n\ndef main():\n input_json = json.load(open(\"photo_id_to_business_id.json\"))\n \n # print the header of output csv file\n print 'photo_id,business_id,label'\n \n # ... | python | chosen |
[
{
"from": "human",
"value": "Add script to test RF performance on gala data\n"
},
{
"from": "gpt",
"value": "# IPython log file\n\n\nfrom gala import classify\ndatas = []\nlabels = []\nimport numpy as np\nlist(map(np.shape, labels))\nfor i in range(3, 4):\n data, label = classify.load_trainin... | python | chosen |
[
{
"from": "human",
"value": "Create test case from control set\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n#\n# Generate a varnishtest script to validate the preclassified\n# U-A strings in the control set.\n#\nimport sys\n\nHEADER=\"\"\"varnishtest \"automatic test of control set\"\nser... | python | chosen |
[
{
"from": "human",
"value": "Save my musings to git.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport random\nimport sys\n\n\"\"\"\nTakes a string containing {sections} to be replaced. Replaces them until no\nbraces are left in the string.\n\nOptionally takes an argument to use as ... | python | chosen |
[
{
"from": "system",
"value": "Change migration to fallback to old country\n"
},
{
"from": "human",
"value": "from django.core.management.base import LabelCommand\nfrom django_countries.countries import COUNTRIES\nfrom corehq.apps.domain.models import Domain\n\nclass Command(LabelCommand):\n h... | python | chosen |
[
{
"from": "human",
"value": "Add functional testing using Selenium Webdriver\n\nSetting up the skeleton and initial tests for unit testing of front-end of layout-web-tool\n"
},
{
"from": "gpt",
"value": "\"\"\"\n Setting up functional testing for layout web tool.\n\"\"\"\n\nimport unittest\nimp... | python | chosen |
[
{
"from": "human",
"value": "Add management command to update all player MMRs\n"
},
{
"from": "gpt",
"value": "import time\nfrom datetime import timedelta\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.db.models import Q\nfrom django.utils import timezone\n\nfr... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for max_subarray\n"
},
{
"from": "gpt",
"value": "import unittest\n\nfrom aids.sorting_and_searching.max_subarray import max_subarray\n\nclass MaxSubArrayTestCase(unittest.TestCase):\n '''\n Unit tests for max_subarray\n\n '''\n\n def setUp... | python | chosen |
[
{
"from": "human",
"value": "Add tests for config loading\n"
},
{
"from": "gpt",
"value": "import io\nimport sys\nimport tempfile\nimport textwrap\n\nfrom jacquard.config import load_config\n\nCONFIG_FILE = \"\"\"\n[storage]\nengine = dummy\nurl = dummy\n\n[directory]\nengine = dummy\n\n[test_se... | python | chosen |
[
{
"from": "human",
"value": "Add indexes to make the things faster.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2017-03-09 20:37\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add file for invalid nonterminals tests\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\r\n\"\"\"\r\n:Author Patrik Valkovic\r\n:Created 23.06.2017 16:39\r\n:Licence GNUv3\r\nPart of grammpy\r\n\r\n\"\"\"\r\nfrom unittest import TestCase, main\r\nfrom grammpy.... | python | chosen |
[
{
"from": "human",
"value": "Add variable selection to RF\n"
},
{
"from": "gpt",
"value": "from classifierBase import *\nimport h5py\n\nclass ClassifierRandomForestVariableImportance(ClassifierBase):\n #human readable information\n name = \"RandomForest classifier with variable importance\... | python | chosen |
[
{
"from": "human",
"value": "Add test for `tldr find {{command}}`\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport os\nfrom os import path\nimport unittest\n\nfrom click.testing import CliRunner\nimport mock\n\nfr... | python | chosen |
[
{
"from": "human",
"value": "Add a Python script that stops all running instances of a task\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\"\"\"\nStop all the instances of a running task.\n\nOur applications load config from an S3 bucket at startup. When the... | python | chosen |
[
{
"from": "human",
"value": "Move amount_sp to account_move\nOtherwise the value is recomputed and the following error might occur:\nImpossibile aggiungere/modificare registrazioni antecedenti o pari alla data di chiusura 24/09/2020.\n"
},
{
"from": "gpt",
"value": "# Copyright 2021 Simone Rubi... | python | chosen |
[
{
"from": "human",
"value": "Add license field to files\n"
},
{
"from": "gpt",
"value": "# Generated by Django 3.2.4 on 2021-06-11 21:19\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('museum_site', '0060_auto_20210611_04... | python | chosen |
[
{
"from": "human",
"value": "Add solution to lintcode question 109\n"
},
{
"from": "gpt",
"value": "class Solution:\n \"\"\"\n @param triangle: a list of lists of integers.\n @return: An integer, minimum path sum.\n \"\"\"\n def minimumTotal(self, triangle):\n # write your ... | python | chosen |
[
{
"from": "human",
"value": "Add basic tests for request notifications\n\nTest that imported requests get entries in the notifications table.\n"
},
{
"from": "gpt",
"value": "# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/li... | python | chosen |
[
{
"from": "human",
"value": "Print inserted block devices' paths\n"
},
{
"from": "gpt",
"value": "import re\nfrom subprocess import Popen, PIPE, STDOUT\nfrom sys import stdout\n\n\np = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE,\n stderr=STDOUT, bufsize=1)\n\nc = r... | python | chosen |
[
{
"from": "human",
"value": "Add new urls file for votes\n"
},
{
"from": "gpt",
"value": "from django.conf.urls import *\n\nurlpatterns = patterns('parliament.bills.views',\n url(r'^$', 'votes_for_session', name='votes'),\n (r'^(?:session/)?(?P<session_id>\\d+-\\d)/$', 'votes_for_session')... | python | chosen |
[
{
"from": "human",
"value": "Refactor translated main to work with new continuations and some minor changes for the translation to work\n"
},
{
"from": "gpt",
"value": "from prolog.interpreter.parsing import parse_file, TermBuilder\nfrom prolog.interpreter.term import Atom, Number, Term\nimport ... | python | chosen |
[
{
"from": "human",
"value": "Add sketch of script for getting images and verdict data from site\n"
},
{
"from": "gpt",
"value": "from __future__ import with_statement\nimport urllib2, os, cStringIO\nfrom bs4 import BeautifulSoup\nfrom collections import defaultdict\n\n\nDATA_DIR = 'data/'\nIMG_D... | python | chosen |
[
{
"from": "human",
"value": "Add tests for the registration status\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\n\nfrom registrations.models import Registration\n\n\nclass RegistrationTests(TestCase):\n def test_registration_status_external_id(self):\n \"\"\"\n ... | python | chosen |
[
{
"from": "human",
"value": "Add script for comparing Snack formant methods on Windows\n\nThis is for making the comparison Snack formant plots in\nhttps://github.com/voicesauce/opensauce-python/issues/27\n"
},
{
"from": "gpt",
"value": "# Script to compare Snack formant methods on Windows\n# Th... | python | chosen |
[
{
"from": "human",
"value": "Add alembic revision to reset current typeemote quest\n"
},
{
"from": "gpt",
"value": "\"\"\"Reset current typeemote quest\n\nRevision ID: a8ad6e7fadd6\nRevises: 5f746af0a82d\nCreate Date: 2019-06-09 11:04:34.385778\n\n\"\"\"\n\n# revision identifiers, used by Alembi... | python | chosen |
[
{
"from": "human",
"value": "Create a state for reset peoples in wonderland.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# encoding=utf8\n\nimport requests\nfrom flexbe_core import EventState\nfrom rospy import logerr, loginfo\n\n\"\"\"\nCreated on 09/06/2018\n\n@author: Lucas Mauric... | python | chosen |
[
{
"from": "human",
"value": "Create command to compare my similar with google similar per app\n"
},
{
"from": "gpt",
"value": "import logging.config\nfrom operator import or_\n\nfrom django.core.management.base import BaseCommand\n\nfrom crawler.models import *\n\nlogger = logging.getLogger('cra... | python | chosen |
[
{
"from": "human",
"value": "Add prelim. async io version\n"
},
{
"from": "gpt",
"value": "import asyncio\nfrom enum import Enum\n\nclass Connection(object):\n def __init__(self, interpreter):\n self.interpreter = interpreter \n self.loop = asyncio.get_event_loop()\n\n def __del__(self):... | python | chosen |
[
{
"from": "human",
"value": "Remove unused field from Line model\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('info_trans... | python | chosen |
[
{
"from": "human",
"value": "feat: Create data request function to get json from the API\n"
},
{
"from": "gpt",
"value": "try:\n # Python 3 import\n from urllib.request import urlopen\nexcept ImportError:\n # Python 2.* import\n from urllib2 import urlopen\n\nfrom simplejson import l... | python | chosen |
[
{
"from": "human",
"value": "Add macro for creating a list\n\nThis also allows us to pass a list in as a variable to a template, which, in\nturn, allows us to make things like a re-usable landing page search template\nfor ATF\n"
},
{
"from": "gpt",
"value": "\"\"\"Particularly when displaying bu... | python | chosen |
[
{
"from": "human",
"value": "Add script for computing a JSON-LD shape from data\n\nMeasures frequency of used properties and classes and creates a shape\nrepresenting the shape of a selection of descriptions in LDDB.\n"
},
{
"from": "gpt",
"value": "from __future__ import print_function, unicode... | python | chosen |
[
{
"from": "human",
"value": "migrations: Remove disallowed characters from topics.\n\nFollowing b3c58f454f0dce8a88c696305945bac41f9786bc, we want to clean up\nold topics that may contain the disallowed characters. The Message table\nis large, so we go in batches, making sure we limit topic fetches and\nUPDA... | python | chosen |
[
{
"from": "system",
"value": ":art: Reduce number of extra fields for prettyness\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom .models import (\n Patient, PatientRegister,\n FluVaccine,\n Sample, CollectionType,\n Symptom, ObservedSymptom\n)\n\n\nclass Flu... | python | chosen |
[
{
"from": "human",
"value": "Add a script to reproject and tile an input dataset\n\nVery simple at this stage, simply run a series of external gdal\ncommands from a python script.\n"
},
{
"from": "gpt",
"value": "\nimport subprocess\n\nsrc_files = '/g/data/rs0/scenes/ARG25_V0.0/2015-04/LS7_ETM_N... | python | chosen |
[
{
"from": "human",
"value": "Move the basic job processor into a django management command as well.\n"
},
{
"from": "gpt",
"value": "import zmq\nimport time\nimport json\n\nfrom django.core.management.base import NoArgsCommand\n\naddr = 'tcp://127.0.0.1:5555'\n\nclass Command(NoArgsCommand):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add migration for abstractnode index\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9 on 2017-03-09 01:32\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n ... | python | chosen |
[
{
"from": "human",
"value": "Add new file for idea migrations\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.4 on 2016-03-22 03:23\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):... | python | chosen |
[
{
"from": "system",
"value": "Disable web animations benchmark. It is crashing.\n\nBUG=320042\nNOTRY=True\nTBR=dtu@chromium.org\n\nReview URL: https://codereview.chromium.org/70233018\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@235452 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": ... | python | chosen |
[
{
"from": "human",
"value": "Add test for upload with '-'\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\n# Copyright (c) 2013 Robie Basak\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \... | python | chosen |
[
{
"from": "human",
"value": "Add batch processing of runs\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport glob\n\nimport clawpack.clawutil.tests as clawtests\n\nclass FaultTest(clawtests.Test):\n\n def __init__(self, deformation_file):\n\n super(... | python | chosen |
[
{
"from": "human",
"value": "Revert \"Revert \"adding varchar_pattern_ops index to devicelog table\"\"\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.10.7 on 2017-06-01 18:37\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\nfrom c... | python | chosen |
[
{
"from": "human",
"value": "Add the start of Spark SQL twitter demo in python\n"
},
{
"from": "gpt",
"value": "# A simple demo for working with SparkSQL and Tweets\nfrom pyspark import SparkContext, SparkConf\nfrom pyspark.sql import SQLContext\nimport json\nimport sys\n\nif __name__ == \"__mai... | python | chosen |
[
{
"from": "human",
"value": "Add tests for the SubmissionProcess model\n"
},
{
"from": "gpt",
"value": "from django.test import TestCase\nfrom django.urls import reverse\n\nfrom apps.core.factories import PIXELER_PASSWORD, PixelerFactory\nfrom .. import models\n\n\nclass SubmissionProcessTestCas... | python | chosen |
[
{
"from": "human",
"value": "Add a test to detect if using an out-of-date ChromeDriver\n"
},
{
"from": "gpt",
"value": "\"\"\"\nThis test is only for Chrome!\n(Verify that your chromedriver is compatible with your version of Chrome.)\n\"\"\"\nimport colorama\nfrom seleniumbase import BaseCase\n\... | python | chosen |
[
{
"from": "human",
"value": "Test to check if uuids are consistent across machines\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python2.7\n# TODO: ADD COPYRIGHT TAG\nfrom __future__ import absolute_import, division, print_function\nfrom ibeis.dev import ibsfuncs\n#from itertools import izip\n... | python | chosen |
[
{
"from": "human",
"value": "Add unit test case for fileclient\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email: `Bo Maryniuk <bo@suse.de>`\n'''\n\n# Import Python libs\nfrom __future__ import absolute_import\n\n# Import Salt Testing libs\nfrom salttesting i... | python | chosen |
[
{
"from": "human",
"value": "migrations: Add migration to migrate pronouns custom profile fields.\n\nThis commit adds a migration to migrate SHORT_TEXT type profile\nfields for pronouns to recently added PRONOUNS type.\n"
},
{
"from": "gpt",
"value": "# Generated by Django 4.1.2 on 2022-10-21 06... | python | chosen |
[
{
"from": "human",
"value": "Add script for generating libgenthrift Cassandra interface files using thrift.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport subprocess\n\nif len(sys.argv) != 3:\n print \"Usage: generate-cassandra-thrift.py /path/to/bin/t... | python | chosen |
[
{
"from": "human",
"value": "Add cross validation script for model.\n"
},
{
"from": "gpt",
"value": "# WITH CATEGORICAL VARIABLES CONVERTED TO CON_PROB VARIABLES\n# import libraries\nimport pandas as pd\nimport xgboost as xgb\nimport re\n# %matplotlib inline\n\n# import logger.py\nfrom logger im... | python | chosen |
[
{
"from": "human",
"value": "Add remove all featured_articles management command\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, unicode_literals\n\nfrom django.core.management.base import BaseCommand\nfrom molo.core.models import ArticlePage\n\n\nclass Command(BaseComma... | python | chosen |
[
{
"from": "human",
"value": "Add an unfinished version of the ZString stream translator.\n\n* zvm/zstring.py: New file.\n"
},
{
"from": "gpt",
"value": "#\n# A ZString-to-ASCII Universal Translator.\n#\n# For the license of this file, please consult the LICENSE file in the\n# root directory of t... | python | chosen |
[
{
"from": "human",
"value": "Add example on how to read and compare ObjectLists\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport logging\n\nimport d1_client.objectlistiterator\nimport d1_client.mnclient_2_0\nimport d1_client.cnclient_2_0\nimport d1_common.const\n\n\n# Check for dis... | python | chosen |
[
{
"from": "human",
"value": "Add test for target machines (native + PTX)"
},
{
"from": "gpt",
"value": "from llvm.core import *\nfrom llvm.ee import TargetMachine, EngineBuilder, print_registered_targets\nimport unittest\n\nclass TestTargetMachines(unittest.TestCase):\n '''Exercise target mac... | python | chosen |
[
{
"from": "human",
"value": "Add a test case for tests running in a virtual machine\n"
},
{
"from": "gpt",
"value": "\nimport os\nimport unittest\n\nfrom blivet import Blivet\n\n\n@unittest.skipUnless(os.environ.get(\"VM_ENVIRONMENT\"), \"vm only test\")\n@unittest.skipUnless(os.geteuid() == 0, ... | python | chosen |
[
{
"from": "human",
"value": "Add ResourceParameter class and subclasses to store parameter info\n"
},
{
"from": "gpt",
"value": "from lxml import etree\nfrom django.utils.translation import ugettext as _\n\nclass ResourceParameter(object):\n def __init__(self, name=\"\", description=\"\"):\n ... | python | chosen |
[
{
"from": "human",
"value": "Add test for get_month_shift handling December"
},
{
"from": "gpt",
"value": "from ..period_utils import get_month_shift\n\n\ndef test_get_month_shift_handles_december():\n new_month, _ = get_month_shift(12, 1)\n assert 12 == new_month\n"
}
] | python | chosen |
[
{
"from": "human",
"value": "Add manual test file as per review by @minrk.\n"
},
{
"from": "gpt",
"value": "\"\"\"Manual test for figure.show() in the inline matplotlib backend.\n\nThis script should be loaded for interactive use (via %load) into a qtconsole\nor notebook initialized with the pyl... | python | chosen |
[
{
"from": "human",
"value": "Add leak matcher for figuring out which test is leaking objects of a type\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with thi... | python | chosen |
[
{
"from": "human",
"value": "Implement Borda count and Schulze method for ranking\n"
},
{
"from": "gpt",
"value": "\"\"\" Rank aggregators. \"\"\"\n\nimport itertools\nimport functools\nimport numpy as np\n\n\ndef borda_count(voters, n_candidates):\n \"\"\" Borda count rank aggregator.\n\n ... | python | chosen |
[
{
"from": "human",
"value": "Add missed file from previous commit\n"
},
{
"from": "gpt",
"value": "'''Some utilitary classes usually used to make working with different python\nversions and different environment easier:\n\n string_types - basestring for python 2 and str fot python 3\n dict... | python | chosen |
[
{
"from": "human",
"value": "Add test for quotes check in attributes\n"
},
{
"from": "gpt",
"value": "# coding:utf-8\nfrom base import TestBase\n\nclass TestQuotesInAttributes(TestBase):\n \"\"\"Test for quotes in attributes\"\"\"\n\n # for debug\n # def tearDown(self):\n # pass\... | python | chosen |
[
{
"from": "human",
"value": "Add script to convert frog output to saf\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport click\nimport os\nimport codecs\nimport json\n\nfrom xtas.tasks._frog import parse_frog, frog_to_saf\n\n\n@click.command()\n@click.argument('input_dir', type=click... | python | chosen |
[
{
"from": "human",
"value": "Add a script to convert track_proto to zip file for RNN training.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nimport argparse\n\nimport sys\nimport os.path as osp\nthis_dir = osp.dirname(__file__)\nsys.path.insert(0, osp.join(this_dir, '../../src/'))\nsys... | python | chosen |
[
{
"from": "human",
"value": "Add unit tests for migrations_client\n\nThis patch adds unit tests for migrations_client.\n\nChange-Id: I9bb9556d9c9b821c55c97f57dd783c00e5a05e04\n"
},
{
"from": "gpt",
"value": "# Copyright 2015 NEC Corporation. All rights reserved.\n#\n# Licensed under the Apac... | python | chosen |
[
{
"from": "human",
"value": "Check for chrom gene_chrom mismatches\n"
},
{
"from": "gpt",
"value": "# ------------------------------------------------\n# built-ins\nimport unittest\n\n# local\nfrom utils.base import TestPostgapBase\n# ------------------------------------------------\n\nclass Tes... | python | chosen |
[
{
"from": "human",
"value": "Add tests for package path building\n\nUnit tests for get_package_source()\n\nSigned-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>\n"
},
{
"from": "gpt",
"value": "import tempfile\nimport os\nimport shutil\n\nimport pytest\n\nfrom ice_se... | python | chosen |
[
{
"from": "human",
"value": "Add Flask server file (Bixi statuses as a service)\n"
},
{
"from": "gpt",
"value": "from flask import Flask, request, redirect\nimport twilio.twiml\n\nfrom bixiapi import scraper, conf\n\n\napp = Flask(__name__)\n\n\ndef get_location_info(stations, location, looking_... | python | chosen |
[
{
"from": "human",
"value": "Add CKA utils for use in other projects.\n\nPiperOrigin-RevId: 461504827\n"
},
{
"from": "gpt",
"value": "# coding=utf-8\n# Copyright 2022 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fil... | python | chosen |
[
{
"from": "human",
"value": "Create the main event loop\n\nThis is the vent loop whihc will monitor twitter, and respond to new\nfollowers, post messages every so often, and hopefully be able to\nrespond to new direct messages.\n"
},
{
"from": "gpt",
"value": "\"\"\"Coordinates the twitter api w... | python | chosen |
[
{
"from": "human",
"value": "Add check package installed via python apt.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport apt\n\nclass CheckApt(object):\n\n def __init__(self):\n self.cache = apt.Cache()\n\n def list_installed(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove deprecated test runned for em machine.\n\nFrom: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>\n\ngit-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@271 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# ... | python | chosen |
[
{
"from": "human",
"value": "Add py solution for 503. Next Greater Element II\n\n503. Next Greater Element II: https://leetcode.com/problems/next-greater-element-ii/\n"
},
{
"from": "gpt",
"value": "class Solution(object):\n def nextGreaterElements(self, nums):\n \"\"\"\n :type ... | python | chosen |
[
{
"from": "human",
"value": "Add a unittest for spacegroup. Still very basic.\n\n\nFormer-commit-id: d446365ad2622bc7871817613f98cebbefb7125f [formerly dbf71a7f4973d22259e81e095402d39acb823651]\nFormer-commit-id: a5817cbc15c7c0e6f568773b47b29db34200dd87"
},
{
"from": "gpt",
"value": "#!/usr/bin/... | python | chosen |
[
{
"from": "human",
"value": "Create new tests, for auth helpers\n\n"
},
{
"from": "gpt",
"value": "import pytest\nimport pytest_django\nfrom django.contrib.auth.models import AnonymousUser, Permission\nfrom django.contrib.contenttypes.models import ContentType\n\nfrom modernrpc.auth import user_... | python | chosen |
[
{
"from": "human",
"value": "Add script to generate gif from images\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport glob\nimport os.path as osp\nimport re\nimport subprocess\nimport tempfile\n\nimport scipy.misc\n\nimport fcn\n\n\ndef main():\n parser = argpa... | python | chosen |
[
{
"from": "human",
"value": "Add script to impute name parts\n"
},
{
"from": "gpt",
"value": "\"\"\"\n\n\"\"\"\n\nfrom framework.auth.utils import parse_name\n\nfrom website.app import init_app\nfrom website import models\n\napp = init_app('website.settings', set_backends=True, routes=True)\n\nd... | python | chosen |
[
{
"from": "human",
"value": "Add command to rebuild cases and republish forms\n"
},
{
"from": "gpt",
"value": "from __future__ import absolute_import, print_function, unicode_literals\n\nimport logging\nfrom io import open\n\nfrom django.core.management.base import BaseCommand\n\nfrom casexml.ap... | python | chosen |
[
{
"from": "human",
"value": "Add migration to remove eligibility is terms are not accepted\n"
},
{
"from": "gpt",
"value": "from django.db import migrations\n\n\ndef remove_bundle_eligibility_on_users_with_unaccepted_terms(apps, schema_editor):\n Editor = apps.get_model(\"users\", \"Editor\")... | python | chosen |
[
{
"from": "human",
"value": "Add a way to bump the version number consistently\n"
},
{
"from": "gpt",
"value": "\"\"\"Bump the version of this project:\n\nLook for likely files: setup.py, doc/conf.py, etc. and update\nversion strings to whatever's passed in. At present, no check\nis made for san... | python | chosen |
[
{
"from": "human",
"value": "Add shared count incrementer puzzle\n"
},
{
"from": "gpt",
"value": "\n\nfrom threading import Thread, Semaphore\n\nimport time\n\n# shared count value\ncount = 0\n\ndef thread_finished(current_count=None):\n print \"count:\", current_count\n\n\nclass Incrementer(... | python | chosen |
[
{
"from": "human",
"value": "Add twitbot for urban dictionary\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nfrom bs4 import BeautifulSoup\nimport requests\nimport tweepy\nfrom config import *\n\nurl = 'http://www.urbandictionary.com/'\npage = requests.get(url)\nsoup = BeautifulSoup(pag... | python | chosen |
[
{
"from": "human",
"value": "Add command to count UCRs on an environment\n\nThis is something we pull ~annually. It's simple enough to write, but\nhopefully this'll give some confidence that we're pulling the same thing\nevery time.\n"
},
{
"from": "gpt",
"value": "from __future__ import absolu... | python | chosen |
[
{
"from": "human",
"value": "tests: Add test for PipelineElement hooks.\n\nSigned-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>\n"
},
{
"from": "gpt",
"value": "import unittest2\n\nfrom penchy.tests.util import MockPipelineElement\n\n\nclass PipelineElementHoo... | python | chosen |
[
{
"from": "human",
"value": "Add solution for problem 9\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/python\n\n\"\"\"\nFirst attempt to resolve this, with a brute force algorithm,\nit may not find the answer\n\"\"\"\n\nfrom math import sqrt\n\nTARGET = 1000\nLIMIT = int(sqrt(TARGET))\na, b, c = 0... | python | chosen |
[
{
"from": "human",
"value": "Add new file for price scraping for azure arm cloud\n"
},
{
"from": "gpt",
"value": "import json\nimport time\nimport os\nimport requests\n\n\nPRICES_URL = (\"https://azure.microsoft.com/api/v3/pricing/\"\n \"virtual-machines/calculator/\")\nBASE_PATH = ... | python | chosen |
[
{
"from": "system",
"value": "Return http status code 501 when a malformed message is received\n"
},
{
"from": "human",
"value": "\"\"\"namuhub --- namu.wiki contribution graph\"\"\"\nfrom flask import Flask, jsonify, render_template, request, url_for\n\napp = Flask('namuhub')\n\n@app.route('/',... | python | chosen |
[
{
"from": "human",
"value": "Add (currently failing) smartypants test\n\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n# This file is part of python-markups test suite\n# License: BSD\n# Copyright: (C) Dmitry Shachnev, 2012\n\nfrom markups.common import educate as ed\nimport unittes... | python | chosen |
[
{
"from": "human",
"value": "Add a module to handle frame matching\n\n\ngit-svn-id: a2d0af3c19596d99b5c1e07a0b4fed4eaca14ddf@18208 7fff26f0-e11d-0410-b8d0-f4b6ff9b0dc5\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"Match Frame to appropriate VerbNet str... | python | chosen |
[
{
"from": "human",
"value": "Add the migration for initial model.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ]\n\n operat... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.