conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix global test driver initialization\n" }, { "from": "human", "value": "import atexit\nimport tempfile\nimport sys\nimport mock\nfrom selenium import webdriver\nimport os\n\n\ndef build_mock_mapping(name):\n mock_driver = mock.Mock()\n browser_mapping = {name...
python
chosen
[ { "from": "system", "value": "Fix formatting, show total and sort" }, { "from": "human", "value": "from report import *\n\ndef show_track_count(S):\n print \"Track Count\\t\\tSubmission Count\"\n \n for (track, count) in S.track_count().items():\n if track:\n print \"%...
python
chosen
[ { "from": "system", "value": "Add failing test for URL without zoom\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\n\nfrom base import TestCase\n\nfrom jinja2_maps.gmaps import gmaps_url\n\nclass TestGmaps(TestCase):\n\n def test_url_dict(self):\n url = \"https://www.google...
python
chosen
[ { "from": "system", "value": "Add documentation for the control system\n" }, { "from": "human", "value": "\"\"\"\nTemplate module to define control systems.\n\"\"\"\n\n\nclass ControlSystem(object):\n \"\"\" Define a control system to be used with a device\n\n It uses channel access to com...
python
chosen
[ { "from": "system", "value": "Revert \"Revert \"Remove useless code\"\"\n\nThis reverts commit 262da59c7790cdadd60ea9612bc9e3c1616863fd.\n\nConflicts:\n\thy/models/string.py\n" }, { "from": "human", "value": "# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>\n#\n# Permission is hereby g...
python
chosen
[ { "from": "system", "value": "Use `set_defaults` of subparser to launch scripts\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# PYTHON_ARGCOMPLETE_OK\n\"\"\"Module to bundle plotting scripts\n\n`activate-global-python-argcomplete` must be run to enable auto completion \"\"\"\n\nimpor...
python
chosen
[ { "from": "system", "value": "Update numpy dtypes extension for correct type codes.\n" }, { "from": "human", "value": "\"\"\"Optional interoperability with Numpy.\"\"\"\n\nimport numpy\n\nNUMPY_DTYPES = {'ibm': numpy.dtype('f4'),\n 'l': numpy.dtype('i4'),\n 'h': ...
python
chosen
[ { "from": "system", "value": "Add location to step metadata.\n" }, { "from": "human", "value": "\n\"\"\"\nMAP Client Plugin\n\"\"\"\n\n__version__ = '0.2.0'\n__author__ = 'Richard Christie'\n__stepname__ = 'Mesh Generator'\n__location__ = ''\n\n# import class that derives itself from the step mo...
python
chosen
[ { "from": "system", "value": "Add web crawling rule and dataset url regex exp\n" }, { "from": "human", "value": "from scrapy.contrib.spiders import CrawlSpider, Rule\nfrom scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor\nfrom scrapy.selector import Selector\n\nclass DatasetSpider(Cra...
python
chosen
[ { "from": "system", "value": "Fix flake8 line length issue\n\nSigned-off-by: Chris Harris <a361e89d1eba6c570561222d75facbbf7aaeeafe@kitware.com>\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name='tomviz-pipeline',\n version='0.0.1',\n descri...
python
chosen
[ { "from": "system", "value": "Fix tests since we changed imports.\n\n--HG--\nbranch : schema-invitations\n" }, { "from": "human", "value": "from django.test import TestCase\n\nfrom .models import AwareModel, NaiveModel\nfrom ..templatetags.boardinghouse import *\n\nclass TestTemplateTags(TestCas...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.11.0\n" }, { "from": "human", "value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.10.1\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"...
python
chosen
[ { "from": "system", "value": "Remove reference to \"job\" from ThreadPool\n" }, { "from": "human", "value": "import queue\nimport threading\nfrom multiprocessing import Queue\n\n\nclass ThreadPool():\n\n def __init__(self, processes=20):\n self.processes = processes\n self.threa...
python
chosen
[ { "from": "system", "value": "Use correct parameter for HOST and PORT\n" }, { "from": "human", "value": "from .config import current_config\n\nfrom flask import Flask\nfrom flask import redirect\nfrom flask import url_for\nfrom flask.ext.babel import Babel\nfrom kqueen_ui.blueprints.registration...
python
chosen
[ { "from": "system", "value": "Allow decorator to be called with optional args\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nwagtail_mvc decorators\n\"\"\"\nfrom __future__ import unicode_literals\n\n\ndef wagtail_mvc_url(func):\n \"\"\"\n Decorates an existing method ...
python
chosen
[ { "from": "system", "value": "Fix logging for testing environment\n" }, { "from": "human", "value": "from .base_settings import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\nSECRET_KEY = '$1B&VUf$OdUEfMJXd40qdakA36@%2NE_41Dz9tFs6l=z4v_3P-'\nDATABASES = ...
python
chosen
[ { "from": "system", "value": "Change import path for pricing\n" }, { "from": "human", "value": "from .voice import (\n Voice,\n VoiceCountry,\n VoiceCountries,\n VoiceNumber,\n VoiceNumbers,\n)\n\nfrom .phone_numbers import (\n PhoneNumberCountries,\n PhoneNumberCountry,\n ...
python
chosen
[ { "from": "system", "value": "Add exporter to VisualSfM format\n" }, { "from": "human", "value": "\nimport extract_metadata\nimport detect_features\nimport match_features\nimport create_tracks\nimport reconstruct\nimport mesh\nimport undistort\nimport compute_depthmaps\nimport export_ply\nimport...
python
chosen
[ { "from": "system", "value": "Save the image of the selection (to be able to reinitialise later)\n" }, { "from": "human", "value": "\nfrom SimpleCV import ColorSegmentation, Image, Camera, VirtualCamera, Display\n\n# Open reference video\ncam=VirtualCamera('/media/bat/DATA/Baptiste/Nautilab/kite...
python
chosen
[ { "from": "system", "value": "Support more C++ extensions by default\n" }, { "from": "human", "value": "ext2lang = {\n '.cpp': 'c++',\n '.c': 'c',\n}\n" }, { "from": "gpt", "value": "ext2lang = {\n '.c' : 'c',\n '.cpp': 'c++',\n '.cc' : 'c++',\n '.cp' : 'c++',\n ...
python
chosen
[ { "from": "system", "value": "Fix formatting errors reported by flake8.\n" }, { "from": "human", "value": "import json\n\nimport requests\n\n\nclass RPCClient(object):\n def __init__(self, hostname, port):\n\n self.url = 'http://' + str(hostname) + ':' + str(port) + '/mopidy/rpc'\n ...
python
chosen
[ { "from": "system", "value": "Add a test for julian_to_gregorian.\n" }, { "from": "human", "value": "import unittest\n\nfrom calexicon.internal.julian import distant_julian_to_gregorian\n\n\nclass TestJulian(unittest.TestCase):\n def test_distant_julian_to_gregorian(self):\n self.asser...
python
chosen
[ { "from": "system", "value": "Debug in importing deleted module.\n" }, { "from": "human", "value": "\n\"\"\"\nUtil classes\n------------\nClasses which represent data types useful for the package pySpatialTools.\n\n\"\"\"\n\nfrom spdesc_mapper import Sp_DescriptorMapper\nfrom spatialelements imp...
python
chosen
[ { "from": "system", "value": "Update command to work with sublime 3\n" }, { "from": "human", "value": "import json\nimport urllib2\n\nimport sublime\nimport sublime_plugin\n\nGIST_URL = u'https://raw.githubusercontent.com/RomuloOliveira/dot-files/master/sublime/User/Preferences.sublime-settings'...
python
chosen
[ { "from": "system", "value": "Update default settings to match Slurm 17.X / CentOS installation\n" }, { "from": "human", "value": "\"\"\"\nMassOpenCloud / Hardware Isolation Layer (HIL)\n\nSlurm / HIL Control Settings\n\nMay 2017, Tim Donahue\ttpd001@gmail.com\n\"\"\"\n\nDEBUG = True\n\nSLURM_IN...
python
chosen
[ { "from": "system", "value": "Update build script to work correctly on macOS and linux.\n" }, { "from": "human", "value": "import os, sys, subprocess, shutil\n\ndef check_for_module_builder():\n if os.path.exists(\"voxel_native/scripts/\"):\n return\n\n print(\"Downloading P3DModule...
python
chosen
[ { "from": "system", "value": "Move to 1.6.6 dev for further development" }, { "from": "human", "value": "version = '1.6.5'\nrevision = ' release'\nmilestone = 'Yoitsu'\nrelease_number = '86'\nprojectURL = 'https://syncplay.pl/'\n" }, { "from": "gpt", "value": "version = '1.6.6'\nrevi...
python
chosen
[ { "from": "system", "value": "[Join] Make sure the 'channel' argument is not Unicode when we send it, because Twisted doesn't like that\n" }, { "from": "human", "value": "from CommandTemplate import CommandTemplate\nfrom IrcMessage import IrcMessage\n\n\nclass Command(CommandTemplate):\n\ttrigge...
python
chosen
[ { "from": "system", "value": "Use full pathname to perf_expectations in test.\n\nBUG=none\nTEST=none\n\nReview URL: http://codereview.chromium.org/266055\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@28770 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: f9d8e0a8dae19e482d3c435a76b4e38403e64...
python
chosen
[ { "from": "system", "value": "Fix absolute reference to logfile location\n" }, { "from": "human", "value": "import pathlib\n\n\n_basedir = pathlib.Path(__file__).parents[1]\n\nSQLALCHEMY_DATABASE_URI = (\n 'sqlite:///' + str(_basedir.joinpath(pathlib.PurePath('app.db')).resolve())\n)\nSQLALCH...
python
chosen
[ { "from": "system", "value": "Set propper mimetype for image attachment\n" }, { "from": "human", "value": "from email.mime.image import MIMEImage\n\nfrom django.contrib.staticfiles import finders\nfrom .base import EmailBase\n\n\nclass PlatformEmailMixin:\n \"\"\"\n Attaches the static fil...
python
chosen
[ { "from": "system", "value": "Standardize module names on leading capital letters\n" }, { "from": "human", "value": "from twisted.plugin import IPlugin\nfrom txircd.module_interface import IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass ErrorResponse(ModuleData):\n imp...
python
chosen
[ { "from": "system", "value": "Fix ceilometerclient mocks for 2.8.0 release\n\nThe function name changed in Iae7d60e1cf139b79e74caf81ed7bdbd0bf2bc473.\n\nChange-Id: I1bbe3f32090b9b1fd7508b1b26665bceeea21f49\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 ...
python
chosen
[ { "from": "system", "value": "Revert \"Add support for server side authentication.\"\n\nThis reverts commit 10ae930f6f14c2840d0b87cbec17054b4cc318d2.\n\nChange-Id: Ied52c31f6f28ad635a6e5dae2171df22dc91e42c\nReviewed-on: http://review.pozytywnie.pl:8080/5153\nReviewed-by: Tomasz Wysocki <f17c2dc043305c950a02...
python
chosen
[ { "from": "system", "value": "Fix due to Flask-Login version up\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nfrom flask import g, render_template, redirect, request, url_for\nfrom flask.ext.login import current_user, login_required, logout_user\n\nfrom s...
python
chosen
[ { "from": "system", "value": "Fix DatabaseCreation from django 1.7\n" }, { "from": "human", "value": "# coding=utf-8\n\nimport django\n\nfrom django.db.backends.postgresql_psycopg2.creation import DatabaseCreation as OriginalDatabaseCreation\n\n\nclass DatabaseCreationMixin16(object):\n def _c...
python
chosen
[ { "from": "system", "value": "Add success=true to satisfy Ext\n" }, { "from": "human", "value": "from base64 import b64encode\nimport os.path\nimport re\n\nfrom pyramid.httpexceptions import HTTPBadRequest\nfrom pyramid.response import Response\nfrom pyramid.view import view_config\n\n\ndef json...
python
chosen
[ { "from": "system", "value": "Fix two mistakes of method description\n\nFix two mistakes of method description in processor.py\n\nChange-Id: I3434665b6d458937295b0563ea0cd0ee6aebaca1\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 Objectif Libre\n#\n# Licensed und...
python
chosen
[ { "from": "system", "value": "Add doc str and change logger config\n" }, { "from": "human", "value": "# This script downloads weekly dengue statistics from data.gov.bn\nimport os\nimport sys\nimport logging\n\n\nDIRECTORY = '../../Data/raw/disease_BN'\nOUTFILE = \"Trend of Notifiable Diseases (2...
python
chosen
[ { "from": "system", "value": "Drop unused support to add decorators via entry points\n" }, { "from": "human", "value": "# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\nimport sys\n\nfrom pkg_resources import iter_entry_points\n\nfrom marv_node.io import Abort\nfro...
python
chosen
[ { "from": "system", "value": "Fix flake8 test for the coersion function\n" }, { "from": "human", "value": "import sys\n\n\nPY3 = sys.version_info >= (3,)\n\n\ndef iteritems(dictionary):\n if PY3:\n return dictionary.items()\n\n return dictionary.iteritems()\n\n\ndef coerce_long(stri...
python
chosen
[ { "from": "system", "value": "Add update_reservation to dummy plugin\n\nupdate_reservation is now an abstract method. It needs to be added to\nall plugins.\n\nChange-Id: I921878bd5233613b804b17813af1aac5bdfed9e7\n(cherry picked from commit 1dbc30202bddfd4f03bdc9a8005de3c363d2ac1d)\n" }, { "from": "h...
python
chosen
[ { "from": "system", "value": "Copy the settings class from an old requests version\n" }, { "from": "human", "value": "# coding: utf-8\n\n\"\"\"\nrighteous.config\n\n\nSettings object, lifted from https://github.com/kennethreitz/requests\n\"\"\"\n\nfrom requests.config import Settings\n\nclass Ri...
python
chosen
[ { "from": "system", "value": "Change license to Apache 2" }, { "from": "human", "value": "# Needed to allow import\n#\n# Copyright (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1)\n# All Rights Reserved.\n#\n# You may only modify and redistribute this under the terms of...
python
chosen
[ { "from": "system", "value": "Change print statement to logger.debug\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# ###\n# Copyright (c) 2015, Rice University\n# This software is subject to the provisions of the GNU Affero General\n# Public License version 3 (AGPLv3).\n# See LICEN...
python
chosen
[ { "from": "system", "value": "Refactor to separate the function to clean the data\n" }, { "from": "human", "value": "from flask import Flask\nfrom flask import request\nfrom flask import jsonify\n\nfrom y_text_recommender_system.recommender import recommend\n\napp = Flask(__name__)\n\n\nclass In...
python
chosen
[ { "from": "system", "value": "Fix trailing slashes in URLconfs\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include, url\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\n\n# Uncomment the next two lines to enable the admin:\n# from django.contrib...
python
chosen
[ { "from": "system", "value": "Store your username in a file\n" }, { "from": "human", "value": "import os\n\nsender = str(raw_input(\"Your Username: \"))\ntarget = str(raw_input(\"Target's Username: \"))\nmessage = str(raw_input(\"Message: \"))\n\n#Messages are encoded like so \"senderProgramVx.x...
python
chosen
[ { "from": "system", "value": "Add better __repr__s for commands errors.\n" }, { "from": "human", "value": "class CommandsError(Exception):\n pass\n\n\nclass CheckFailureError(Exception):\n def __init__(self, ctx, check):\n self.ctx = ctx\n self.check = check\n\n def __repr...
python
chosen
[ { "from": "system", "value": "Support conversion format as extension, instead of mimetype\n" }, { "from": "human", "value": "import urllib\nfrom django import template\nfrom django.conf import settings\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef convert_url(request, sourceurl...
python
chosen
[ { "from": "system", "value": "Change input from previous processing not from a file\n" }, { "from": "human", "value": "from pygraphc.preprocess.PreprocessLog import PreprocessLog\nfrom pygraphc.similarity.StringSimilarity import StringSimilarity\nfrom itertools import combinations\n\n\nclass Log...
python
chosen
[ { "from": "system", "value": "Remove last bits of file browser stuff" }, { "from": "human", "value": "from django.conf.urls.defaults import patterns, include, url\nfrom django.conf import settings\nfrom filebrowser.sites import site\n\n# Uncomment the next two lines to enable the admin:\nfrom dj...
python
chosen
[ { "from": "system", "value": "Improve the internal skipped-test helper messages.\n" }, { "from": "human", "value": "def bug(issue=None):\n message = \"A known bug.\"\n if issue is not None:\n message += \" See issue #{issue}.\".format(issue=issue)\n return message\n" }, { ...
python
chosen
[ { "from": "system", "value": "Move these to macros, the exact type of these functions changes by deifne\n" }, { "from": "human", "value": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a c...
python
chosen
[ { "from": "system", "value": "Disable Sentinel client with redis-py < 2.9\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom .default import DefaultClient\nfrom .sharded import ShardClient\nfrom .herd import HerdClient\nfrom .experimental import SimpleFailoverClient\nfrom .sentin...
python
chosen
[ { "from": "system", "value": "Put dates in the past so that we have no chance of having them spontaneously fail.\n" }, { "from": "human", "value": "# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8\nfrom unittest import TestCase\nfrom education.views import AbsenteeismForm\nfrom datetime import dateti...
python
chosen
[ { "from": "system", "value": "Add computations of great roll, pitch and small yaw angle (kite angles)\n" }, { "from": "human", "value": "# -------------------------------------------------------\nimport socket, traceback\nimport time\nimport json\n\nhost = ''\nport = 2390\n\ns = socket.socket(so...
python
chosen
[ { "from": "system", "value": "Add noqa comment so unused import does not get removed by code lint steps\n" }, { "from": "human", "value": "#!/usr/bin/python3\n\nimport sys\n\nif not sys.version_info >= (3, 5):\n sys.stderr.write(\"Pegasus requires Python 3.5 or above\\n\")\n sys.exit(1)\n\...
python
chosen
[ { "from": "system", "value": "Update download links for CelebA files\n" }, { "from": "human", "value": "from fuel.downloaders.base import default_downloader\n\n\ndef fill_subparser(subparser):\n \"\"\"Sets up a subparser to download the CelebA dataset file.\n\n Parameters\n ----------\n...
python
chosen
[ { "from": "system", "value": "Fix up nits on profileMiddleware as noticed in bugzilla-813182\n" }, { "from": "human", "value": "from django.core.urlresolvers import reverse, resolve\nfrom django.http import HttpResponseRedirect\n\nfrom gameon.users.models import get_profile_safely\n\n\nclass Pro...
python
chosen
[ { "from": "system", "value": "PUBDEV-2078: Add extra argument to get per-feature reconstruction error for\nanomaly detection from Python.\n" }, { "from": "human", "value": "\"\"\"\nAutoEncoder Models\n\"\"\"\n\nfrom model_base import *\nfrom metrics_base import *\n\n\nclass H2OAutoEncoderModel(M...
python
chosen
[ { "from": "system", "value": "Test deserialization of comm message following upload\n" }, { "from": "human", "value": "# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom unittest import TestCase\n\nfrom traitlets import TraitError\n\nfro...
python
chosen
[ { "from": "system", "value": "Make tag_suggestions test less flaky\n\nFailed on Python 2.7.6 as it was dependant on an error string returned\n" }, { "from": "human", "value": "from tagging.models import Tag, TaggedItem\nfrom django.contrib.contenttypes.models import ContentType\nfrom auxiliary.m...
python
chosen
[ { "from": "system", "value": "Add tests for multiple gibson inserts\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nfrom labcalc.run import *\nfrom labcalc import gibson\n\n# labcalc.gibson\n\ndef test_gibson_one_insert():\n d = {'insert1': [300, 50], 'vector': [5000, 50]}\n ass...
python
chosen
[ { "from": "system", "value": "Add COUNTRY_APP to settings exposed to the templates\n" }, { "from": "human", "value": "from django.conf import settings\nimport logging\n\ndef add_settings( request ):\n \"\"\"Add some selected settings values to the context\"\"\"\n return {\n 'setting...
python
chosen
[ { "from": "system", "value": "Correct zip() error in run_cyclus function\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\nfrom tools import check_cmd\n\ndef run_cyclus(cyclus, cwd, sim_files):\n \"\"\"Runs cyclus with various inputs and creates output databases\n \"\"\"\n\n ...
python
chosen
[ { "from": "system", "value": "Make _cleaned_subject migration match declared schema.\n\nTest Plan: Upgrade old database to head.\n\nReviewers: kav-ya\n\nReviewed By: kav-ya\n\nDifferential Revision: https://review.inboxapp.com/D1394\n" }, { "from": "human", "value": "\"\"\"add cleaned subject\n\...
python
chosen
[ { "from": "system", "value": "Add first code for NeuralNetwork class.\n" }, { "from": "human", "value": "import numpy as np\nimport theano\nimport theano.tensor as T" }, { "from": "gpt", "value": "import numpy as np\nimport theano\nimport theano.tensor as T\n\n\nclass NeuralNetwork(o...
python
chosen
[ { "from": "system", "value": "Add logging for api calls.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html\n\nimpo...
python
chosen
[ { "from": "system", "value": "Add detection of wrong meta data\n" }, { "from": "human", "value": "#\n# Konstrukteur - Static website generator\n# Copyright 2013 Sebastian Fastner\n#\n\n__all__ = [\"parse\"]\n\nfrom jasy.env.State import session\nfrom jasy.core import Console\nfrom bs4 import Bea...
python
chosen
[ { "from": "system", "value": "Delete useless header transform in extract_params.\n" }, { "from": "human", "value": "# coding: utf-8\n\nimport logging\nimport base64\nfrom flask import request, Response\nfrom oauthlib.common import to_unicode, bytes_type\n\nlog = logging.getLogger('flask_oauthlib...
python
chosen
[ { "from": "system", "value": "Set polymorphic.__version__ from setuptools metadata\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nSeamless Polymorphic Inheritance for Django Models\n\nCopyright:\nThis code and affiliated files are (C) by Bert Constantin and individual contri...
python
chosen
[ { "from": "system", "value": "Support for value of None in MoneyField.compress.\nLeaving a MoneyField blank in the Django admin site caused an issue when\nattempting to save an exception was raised since Money was getting an\nargument list of None.\n" }, { "from": "human", "value": "from __futur...
python
chosen
[ { "from": "system", "value": "Cut down on the loading of families in the normal GenerateReactionsTest\n\nChange generateReactions input reactant to propyl\n" }, { "from": "human", "value": "# Data sources for kinetics\ndatabase(\n thermoLibraries = ['primaryThermoLibrary'],\n reactionLibra...
python
chosen
[ { "from": "system", "value": "Add lastmod to existing profile picture metadata\n" }, { "from": "human", "value": "\"\"\"Add column for profile picture type to User\n\nRevision ID: f37d509e221c\nRevises: c997dc927fbc\nCreate Date: 2020-09-04 15:43:18.413156\n\"\"\"\n\nfrom enum import Enum\n\nimp...
python
chosen
[ { "from": "system", "value": "Update test to use new API\n" }, { "from": "human", "value": "from __future__ import absolute_import, print_function, unicode_literals\nfrom builtins import dict, str\nfrom indra.databases import biogrid_client\nfrom indra.util import unicode_strs\nfrom nose.plugins...
python
chosen
[ { "from": "system", "value": "Ch05: Add name parameter to Tag Detail URL.\n" }, { "from": "human", "value": "\"\"\"suorganizer URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples...
python
chosen
[ { "from": "system", "value": "Fix misspellings in python marconiclient\n\nFix misspellings detected by:\n* pip install misspellings\n* git ls-files | grep -v locale | misspellings -f -\n\nChange-Id: I4bbc0ba5be154950a160871ef5675039697f2314\nCloses-Bug: #1257295\n" }, { "from": "human", "value":...
python
chosen
[ { "from": "system", "value": "Add secret key env var\n" }, { "from": "human", "value": "from defprogramming.settings import *\n\nALLOWED_HOSTS = ['*']\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\n# Update database configuration with $DATABASE_URL.\nimport dj_database_url\ndb_from_env = dj_databas...
python
chosen
[ { "from": "system", "value": "Move todos into issues tracking on GitHub\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys\n\n\n# O(n^4) approach: generate all possible substrings and\n# compare each for equality.\n\ndef longest_duplicated_substring(string):\n \"\"\"Return...
python
chosen
[ { "from": "system", "value": "Add description to rst plugin\n" }, { "from": "human", "value": "import os\nimport fnmatch\nimport restructuredtext_lint\n\n\nDEFAULTS = {\n 'files': '*.rst',\n}\n\n\ndef make_message(error):\n return '%s %s:%s %s\\n' % (\n error.type, error.source, err...
python
chosen
[ { "from": "system", "value": "Remove JWT_AUTH check from settings\n\nJWT settings has been removed in OpenID change and currently there isn't use for this.\n" }, { "from": "human", "value": "from .util import get_settings, load_local_settings, load_secret_key\nfrom . import base\n\nsettings = ge...
python
chosen
[ { "from": "system", "value": "Add comments + return 1 if inconsistencies found\n" }, { "from": "human", "value": "import re\nimport json\nimport glob\n\nlocale_folder = \"../locales/\"\nlocale_files = glob.glob(locale_folder + \"*.json\")\nlocale_files = [filename.split(\"/\")[-1] for filename i...
python
chosen
[ { "from": "system", "value": "Fix style in cooper test.\n" }, { "from": "human", "value": "import pagoda.cooper\n\n\nclass Base(object):\n def setUp(self):\n self.world = pagoda.cooper.World()\n\n\nclass TestMarkers(Base):\n def setUp(self):\n super(TestMarkers, self).setUp()...
python
chosen
[ { "from": "system", "value": "Add error message for malformed request\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nimport os\n\n\ndef readStatus(student):\n student = student.lower()\n\n if not os.path.exists(\"attachments\"):\n return\n\n if not ...
python
chosen
[ { "from": "system", "value": "Fix another typo in migration\n" }, { "from": "human", "value": "def clean(record):\n if record.bibjson().get_journal_license():\n record.bibjson().remove_journal_license()\n return record\n" }, { "from": "gpt", "value": "def clean(record):\...
python
chosen
[ { "from": "system", "value": "Revert \"[SwiftSyntax] Replace ExpressibleAs protocols by ExpressibleBy protocols\"\n" }, { "from": "human", "value": "SYNTAX_BUILDABLE_EXPRESSIBLE_BY_CONFORMANCES = {\n 'ExpressibleByConditionElement': [\n 'ExpressibleByConditionElementList'\n ],\n ...
python
chosen
[ { "from": "system", "value": "Add report file deployment to init\n" }, { "from": "human", "value": "from .deploy_sql_script import DeploySqlScript, DeployOraclePackage\nfrom .deploy_report import DeployExceleratorReport\n" }, { "from": "gpt", "value": "from .deploy_sql_script import ...
python
chosen
[ { "from": "system", "value": "Tweak import statement to satisfy presubmit checks.\n\nReview URL: http://codereview.chromium.org/8292004\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@105578 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n...
python
chosen
[ { "from": "system", "value": "Add test for LocalShell.run with update_env\n" }, { "from": "human", "value": "from nose.tools import istest, assert_equal\n\nfrom spur import LocalShell\n\nshell = LocalShell()\n\n@istest\ndef output_of_run_is_stored():\n result = shell.run([\"echo\", \"hello\"]...
python
chosen
[ { "from": "system", "value": "Check the copy model for failure\n" }, { "from": "human", "value": "from test.integration.base import DBTIntegrationTest, use_profile\nimport textwrap\nimport yaml\n\n\nclass TestBigqueryCopyTableFails(DBTIntegrationTest):\n\n @property\n def schema(self):\n ...
python
chosen
[ { "from": "system", "value": "Print tracebacks that happened in tasks\n" }, { "from": "human", "value": "from .base import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nfor template_engine in TEMPLATES:\n template_engine['OPTIONS']['debug'] = True\n\n...
python
chosen
[ { "from": "system", "value": "Extend ID validator to lookdev\n" }, { "from": "human", "value": "import pyblish.api\n\n\nclass ValidateMindbenderID(pyblish.api.InstancePlugin):\n \"\"\"All models must have an ID attribute\"\"\"\n\n label = \"Mindbender ID\"\n order = pyblish.api.Validato...
python
chosen
[ { "from": "system", "value": "Revert \"use utf-8 by default\"\n\nThis reverts commit a986aac5e3b4f065d6c2ab70129bde105651d2ca.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.\n# Use of this sourc...
python
chosen
[ { "from": "system", "value": "Make the personal condor config world readable\n" }, { "from": "human", "value": "from os.path import join\n\nimport osgtest.library.core as core\nimport osgtest.library.files as files\nimport osgtest.library.condor as condor\nimport osgtest.library.osgunittest as o...
python
chosen
[ { "from": "system", "value": "Make distinction between local and runner action payload templates.\nAdded small description for sanitizing the NetAPI payload for logging.\n" }, { "from": "human", "value": "import yaml\n\naction_meta = {\n \"name\": \"\",\n \"parameters\": {\n \"actio...
python
chosen
[ { "from": "system", "value": "Use numpy for readin and add errorbars.\n" }, { "from": "human", "value": "#! /usr/bin/env python3\n# coding: utf-8\n\nfrom collections import namedtuple\nimport matplotlib.pyplot as plt\n\nBCand = namedtuple('BCand', ['m', 'merr', 'pt', 'p'])\n\nbs = []\n\nwith ope...
python
chosen
[ { "from": "system", "value": "Add args to exception to display the correct message in the UI.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n# Odoo, Open Source Management Solution\n# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>\n#\n# This program is free software: you...
python
chosen
[ { "from": "system", "value": "Add add bucket list feature\n" }, { "from": "human", "value": "from flask import Flask, render_template, url_for, redirect, request\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n return render_template('login.html')\n\n\n\n@app.route('/save', metho...
python
chosen
[ { "from": "system", "value": "Add actual things that do real stuff\n" }, { "from": "human", "value": "from flask import Flask\nfrom flow import Flow\n\nfrom config import ORG_ID, CHANNEL_ID\n\nflow = Flow('botbotbot')\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n flow.send_messa...
python
chosen