conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Convert Extension item to new line style\n" }, { "from": "human", "value": "\"\"\"\nExtensionItem -- Graphical representation of an association.\n\"\"\"\n\n# TODO: for Extension.postload(): in some cases where the association ends\n# are connected to the same Class,...
python
chosen
[ { "from": "system", "value": "Add a random <Route> to a generated <Client>\n\nIssue #214\n" }, { "from": "human", "value": "# coding=utf-8\nimport factory\nimport datetime\nimport random\nfrom django.contrib.auth.models import User\nfrom member.models import Member, Address, Contact, Client, PAY...
python
chosen
[ { "from": "system", "value": "Update RMG example minimal_sensitivity with multiplicity label\n" }, { "from": "human", "value": "# Data sources\ndatabase(\n thermoLibraries = ['primaryThermoLibrary'],\n reactionLibraries = [],\n seedMechanisms = [],\n kineticsDepositories = ['training...
python
chosen
[ { "from": "system", "value": "Migrate profile tests to pytest\n" }, { "from": "human", "value": "from nose.tools import eq_\nfrom mock import MagicMock, patch\n\nfrom buffpy.models.profile import Profile, PATHS\n\nmocked_response = {\n 'name': 'me',\n 'service': 'twiter',\n 'id': 1\n}\n\ndef ...
python
chosen
[ { "from": "system", "value": "Set file permissions to readable in export_signatures\n" }, { "from": "human", "value": "import os\nimport shutil\nfrom tempfile import mkstemp\n\nfrom django.core.management import call_command\n\nfrom celeryconf import app\n\nSIGNATURES_ZIP = os.path.realpath(os.p...
python
chosen
[ { "from": "system", "value": "Refactor to use map and filter\n" }, { "from": "human", "value": "#!/bin/python3\n\nimport itertools\nimport collections\n\ndef sliding_window(n, seq):\n \"\"\"\n Copied from toolz\n https://toolz.readthedocs.io/en/latest/_modules/toolz/itertoolz.html#slidi...
python
chosen
[ { "from": "system", "value": "Change the default __getattr_ value\n" }, { "from": "human", "value": "class Card:\n \"\"\"\n A wrapper around a Scryfall json card object.\n \"\"\"\n\n def __init__(self, cardData):\n self._data = cardData\n\n def __getattr__(self, attr):\n ...
python
chosen
[ { "from": "system", "value": "Update docs to version v0.17.0\n" }, { "from": "human", "value": "__version__ = \"0.16.1-dev\"\n__libnetwork_plugin_version__ = \"v0.7.0-dev\"\n__libcalico_version__ = \"v0.11.0-dev\"\n__felix_version__ = \"1.3.0a6-dev\"\n" }, { "from": "gpt", "value": "...
python
chosen
[ { "from": "system", "value": "Change the use of score_board object due to our change in score_board.py\n" }, { "from": "human", "value": "import board\nimport score_board\nfrom os.path import expanduser\n\n\nSCORE_FILE_PATH = expanduser('~/.config/my2048/scores.conf')\nKEY_MOVE_MAP = {\n 'a': b...
python
chosen
[ { "from": "system", "value": "Choose the pulses to update depending on library\n" }, { "from": "human", "value": "#update waveforms in target sequence from current ChanParams settings.\n#Warning: this updates all channels, beware of possible conflicts\nimport argparse\nimport sys, os\nparser = a...
python
chosen
[ { "from": "system", "value": "Fix bug in blurred context recognition\n" }, { "from": "human", "value": "import cv2\nimport numpy\nimport tempfile\nimport subprocess\n\nfrom .. import get_data\nfrom whole_blur import is_blurred as whole_blur\n\n\ndef run_object_extraction(image_path):\n temp1 ...
python
chosen
[ { "from": "system", "value": "Raise an exception if File exist where download directory should be.\n" }, { "from": "human", "value": "import os\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef setup_download_dir(directory_name):\n \"\"\"\n A helper function to create the do...
python
chosen
[ { "from": "system", "value": "Fix import in ssh connection\n" }, { "from": "human", "value": "# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Pu...
python
chosen
[ { "from": "system", "value": "Update testes (Chamber of Deputies changed real world data)\n" }, { "from": "human", "value": "import os\nfrom datetime import date\n\nfrom unittest import main, TestCase\n\nimport numpy as np\n\nfrom serenata_toolbox.chamber_of_deputies.official_missions_dataset im...
python
chosen
[ { "from": "system", "value": "Test both failure and success of check for required fields\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport defcon\nimport pytest\n\nfr...
python
chosen
[ { "from": "system", "value": "Remove another reference to DeferredResult.\n" }, { "from": "human", "value": "#!/usr/bin/python\n\"\"\"\nA flask web application that downloads a page in the background.\n\"\"\"\n\nimport logging\nfrom flask import Flask, session, escape\nfrom crochet import setup,...
python
chosen
[ { "from": "system", "value": "Remove the carousel fixture for the sake of simplicity\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\n\ndef test_app_title(app):\n \"\"\"Simply tests if the default app title meets the expectations.\n\n Args:\n app (:class:...
python
chosen
[ { "from": "system", "value": "Allow Ref's in addition to basestrings\n" }, { "from": "human", "value": "# Copyright (c) 2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty\nfrom .validators import integer, posit...
python
chosen
[ { "from": "system", "value": "Add a note about root and nmap binary dependency.\n" }, { "from": "human", "value": "import nmap\nfrom st2actions.runners.pythonrunner import Action\n\nclass PortScanner(Action):\n\n def run(self, host):\n result = []\n port_details = {}\n ps = nmap.PortSc...
python
chosen
[ { "from": "system", "value": "Add modeladmin classes for Season, JuryMember, Partner models\n" }, { "from": "human", "value": "from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register\nfrom cpm_data.models import JuryMember\n\n\nclass MyPageModelAdmin(ModelAdmin):\n mode...
python
chosen
[ { "from": "system", "value": "Print version in command line.\n" }, { "from": "human", "value": "\"\"\" CLI interface.\n\"\"\"\nimport argparse\nimport bud_get\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"infile\", help = \"the input data file\")\n parser.a...
python
chosen
[ { "from": "system", "value": "Remove extra seating students during sync\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nimport logging\nfrom datetime import date\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.db import transaction\n\nfrom validate_email...
python
chosen
[ { "from": "system", "value": "Use /usr/bin/python for sine table script\n" }, { "from": "human", "value": "#!/usr/local/bin/python\n\nimport sys\nimport math\nimport struct\n\nsteps = 256\n\ntry:\n fname = sys.argv[1]\n f = open(fname, 'wb')\n for x in range(0, steps):\n sine = i...
python
chosen
[ { "from": "system", "value": "Check directory is git repo\n" }, { "from": "human", "value": "#!/usr/bin/env python \n\n\"\"\" \nA simple echo client \n\"\"\" \n\nfrom login import LoginController\n\ndef main():\n\tlogin = LoginController()\n\tprint login.USERNAME\n\n# import socket \n\n# host = ...
python
chosen
[ { "from": "system", "value": "MAINT: Add a missing subscription slot to `NestedSequence`\n" }, { "from": "human", "value": "\"\"\"\nThis file defines the types for type annotations.\n\nThese names aren't part of the module namespace, but they are used in the\nannotations in the function signatur...
python
chosen
[ { "from": "system", "value": "Update social pipeline to social_core\n" }, { "from": "human", "value": "\"\"\"\nA django-socialauth based client for the IX Profile server\n\"\"\"\n\ntry:\n # Django 1.7+\n from django.apps import AppConfig\nexcept ImportError:\n # Stub for old Django\n ...
python
chosen
[ { "from": "system", "value": "Disable and run and help commands; don't read settings.\n" }, { "from": "human", "value": "import argparse, os, sys\nfrom .. import log\nfrom .. project.importer import import_symbol\nfrom .. project.preset_library import PresetLibrary\n\n__all__ = ['main']\n\nCOMMA...
python
chosen
[ { "from": "system", "value": "Update the netstring code with newfound knowledge.\n" }, { "from": "human", "value": "grammar = \"\"\"\n\ndigit = anything:x ?(x.isdigit())\nnonzeroDigit = anything:x ?(x != '0' and x.isdigit())\ndigits = <'0' | nonzeroDigit digit*>:i -> int(i)\n\nnetstring = digits...
python
chosen
[ { "from": "system", "value": "Add import error message to example\n" }, { "from": "human", "value": "from cron_descriptor import Options, ExpressionDescriptor\nimport re\n\n\nclass CrontabReader(object):\n\n \"\"\"\n Simple example reading /etc/contab\n \"\"\"\n rex = re.compile(\"^(...
python
chosen
[ { "from": "system", "value": "Add userid to query to get socio-economic studies\n" }, { "from": "human", "value": "from django.contrib.auth.decorators import user_passes_test, login_required\nfrom django.shortcuts import render\nfrom perfiles_usuario.utils import is_capturista\nfrom estudios_soc...
python
chosen
[ { "from": "system", "value": "Make Django to find the pydoc-tool.py script tests" }, { "from": "human", "value": "import unittest\nfrom django.test import TestCase\n\n\nclass AccessTests(TestCase):\n \"\"\"\n Simple tests that check that basic pages can be accessed\n and they contain so...
python
chosen
[ { "from": "system", "value": "Switch chromium.linux slaves to buildbot 0.8.\n\nReview URL: https://chromiumcodereview.appspot.com/10912181\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@155812 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "value": "# Copyright (c) 2012 T...
python
chosen
[ { "from": "system", "value": "Use a logger instead of printing to stdout\n" }, { "from": "human", "value": "# coding=utf-8\n\n\"\"\"\nCommand line interface for brandon\n\"\"\"\n\nimport argparse\n\nfrom devpi_builder import requirements, wheeler, devpi\n\n\ndef main(args=None):\n parser = ar...
python
chosen
[ { "from": "system", "value": "Revert \"Port with_metaclass from flask\"\n\nThis reverts commit db23ed0d62789ca995d2dceefd0a1468348c488b.\n" }, { "from": "human", "value": "# -*- coding: utf8 -*-\n# flake8: NOQA\nimport sys\n\nPY2 = sys.version_info[0] == 2\n\nif PY2:\n unichr = unichr\n te...
python
chosen
[ { "from": "system", "value": "[vagrant] Add safeguard against namenode formatting" }, { "from": "human", "value": "from fabric.api import *\nfrom inventory import runs_on\n\n@task\n@runs_on('hadoop_master')\ndef start_hdfs():\n with cd('$HADOOP_HOME'):\n run('sbin/start-dfs.sh')\n\n@ta...
python
chosen
[ { "from": "system", "value": "Add some abstract methods to backend\n\nAdded some methods in base.py that should probably be defined in\nevery backend\n\nChange-Id: I6f99994b82c2f17083d83b4723f3b4d61fc80160\n" }, { "from": "human", "value": "# Copyright (C) 2013 Yahoo! Inc. All Rights Reserved.\n...
python
chosen
[ { "from": "system", "value": "Remove vue from selectors and just use embedded html" }, { "from": "human", "value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jack Brewer\n# Copyright (c) 2015 Jack Brewer\n#\n# License: MIT\n\n\"\"\...
python
chosen
[ { "from": "system", "value": "Patch a migration to work with postgres\n" }, { "from": "human", "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 ('mea...
python
chosen
[ { "from": "system", "value": "Make rates parsing more readable\n" }, { "from": "human", "value": "from __future__ import division\nfrom __future__ import unicode_literals\n\nfrom decimal import Decimal\n\nimport requests\nfrom django.conf import settings\nfrom django.core.exceptions import Impro...
python
chosen
[ { "from": "system", "value": "Add third_party/android_tools/sdk/platform-tools to PATH if available\n\nR=whesse@google.com\n\nReview URL: https://codereview.chromium.org/1938973002 .\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# Copyright (c) 2011, the Dart project authors. Please...
python
chosen
[ { "from": "system", "value": "Use 8 characters for email address rather than 10.\n" }, { "from": "human", "value": "from google.appengine.ext import db\nimport random\nimport string\n\ndef make_address():\n \"\"\"\n Returns a random alphanumeric string of 10 digits. Since there\n are 5...
python
chosen
[ { "from": "system", "value": "Support django-contrib-comments instead of django.contrib.comments for Django 1.8\n" }, { "from": "human", "value": "\"\"\"\nA simple wrapper library, that makes sure that the template\n``fluent_blogs/entry_detail/comments.html`` can still be rendered\nwhen ``django...
python
chosen
[ { "from": "system", "value": "Support currently removed for gifs because of bugs\n" }, { "from": "human", "value": "#!/usr/bin/env python\n'''\nAuthor : Bhavyanshu Parasher\nEmail : bhavyanshu@codershangout.org\nDescription : This file contains all the main functions for the GUI.\n'''\ntry:\n\tf...
python
chosen
[ { "from": "system", "value": "Fix dangling default in kwargs 'shell_cmd'\n" }, { "from": "human", "value": "import sublime, sublime_plugin\n\nimport os\n\n\ndef wrapped_exec(self, *args, **kwargs):\n settings = sublime.load_settings(\"SublimeExterminal.sublime-settings\")\n \n if settin...
python
chosen
[ { "from": "system", "value": "Add comment to resultclass tag" }, { "from": "human", "value": "from django import template\nfrom django.core.urlresolvers import reverse\n\nregister = template.Library()\n\n@register.simple_tag\ndef leagueurl(name, league_tag=None, season_id=None, *args, **kwargs):...
python
chosen
[ { "from": "system", "value": "Move fedmsg topics listened to by a plugin to a class variable.\n" }, { "from": "human", "value": "import statscache.plugins\n\n\nclass Plugin(statscache.plugins.BasePlugin):\n name = \"releng, cloud images upload base\"\n summary = \"Build logs for successful...
python
chosen
[ { "from": "system", "value": "Read in some environment variables\n" }, { "from": "human", "value": "from transporter import create_app\n\n\napplication = create_app(__name__)\n\n\nif __name__ == '__main__':\n application.run(host='0.0.0.0', debug=True)\n" }, { "from": "gpt", "valu...
python
chosen
[ { "from": "system", "value": "Read and print all data files.\n" }, { "from": "human", "value": "import pandas as pd\n\ndirectory = 'ml-1m/'\n\nunames = ['user_id', 'gender', 'age', 'occupation', 'zip']\nusers = pd.read_table(directory + 'users.dat', sep='::', header=None, names=unames, engine='p...
python
chosen
[ { "from": "system", "value": "Update cloud summary message header version num\n" }, { "from": "human", "value": "'''\n Copyright 2011 Will Rogers\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You...
python
chosen
[ { "from": "system", "value": "Update stats daemon to update ZSets and memoization as necessary\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\n\nimport api\nimport api.group\nimport api.stats\n\n\ndef run():\n \"\"\"Run the stat caching daemon.\"\"\"\n with api.create_app().ap...
python
chosen
[ { "from": "system", "value": "Fix a lint required empty lines issue\n" }, { "from": "human", "value": "from ..constants import MD\nfrom ..converter import KnowledgePostConverter\nfrom knowledge_repo.utils.files import read_text\n\nclass MdConverter(KnowledgePostConverter):\n _registry_keys = ...
python
chosen
[ { "from": "system", "value": ": Create documentation of DataSource Settings \n\nTask-Url: " }, { "from": "human", "value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.stoettner@stoeps.de\n# Documentation: http://scri...
python
chosen
[ { "from": "system", "value": "Add command line args to App\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nfrom command import Command\nfrom database import DatabaseSQLite\nfrom client import Client\nfrom server import Server\n \nclass App:\n def run(self, testname, database):\n\t...
python
chosen
[ { "from": "system", "value": "Add containers in hosts so we can rsync into containers" }, { "from": "human", "value": "#!/usr/bin/env python\n#############################################################################\n# Copyright (c) 2017 SiteWare Corp. All right reserved\n###################...
python
chosen
[ { "from": "system", "value": "V8: Add buildbucket integration to v8.ports\n\nBUG=595708\nTBR=tandrii@chromium.org, kjellander@chromium.org\n\nReview URL: https://codereview.chromium.org/1810113002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@299357 0039d316-1c4b-4281-b951-d872f2087c98\n" }, {...
python
chosen
[ { "from": "system", "value": "Fix route for index page\n" }, { "from": "human", "value": "# -*- coding: utf8 -*-\n\"\"\"Views modules for libcrowds-data.\"\"\"\n\nfrom flask import render_template\nfrom pybossa.core import project_repo\n\n\n@blueprint.route('/')\ndef index():\n \"\"\"Return t...
python
chosen
[ { "from": "system", "value": "Update Twitter test to be more robust\n" }, { "from": "human", "value": "from unfurl import Unfurl\n\nimport unittest\n\nclass TestTwitter(unittest.TestCase):\n\n def test_twitter(self):\n \"\"\" Test a tyipcal and a unique Discord url \"\"\"\n \n ...
python
chosen
[ { "from": "system", "value": "Make debug logging even more convenient.\n\nI'm sure we'll remove the globals() usage eventually.\n" }, { "from": "human", "value": "from .context import Context\nfrom .argument import Argument # Mostly for importing via invoke.parser.<x>\n\n\nclass Parser(object):\...
python
chosen
[ { "from": "system", "value": "Add version for removing image\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom collections import defaultdict\nimport subprocess\nimport os\n\nKEEP_LAST_VERSIONS = os.environ.get('KEEP_LAST_VERSIONS', 4)\n\n\ndef find_obsolete_images(images):\n for...
python
chosen
[ { "from": "system", "value": "Add todos and stubs for osx" }, { "from": "human", "value": "from genes import apt\nimport platform\n\nclass Config:\n OS = platform.system()\n (DIST, _, CODE) = platform.linux_distribution()\n REPO = DIST.lower() + '-' + CODE\n\ndef main():\n if Config....
python
chosen
[ { "from": "system", "value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8" }, { "from": "human", "value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph....
python
chosen
[ { "from": "system", "value": "Bugfix: Make sure the ``context`` is not overriden.\n\nThe variable name for the string template context was removing\nthe actual ``context`` of the tempalte where the tag was\nembeded.\n" }, { "from": "human", "value": "from django import template\nfrom django.temp...
python
chosen
[ { "from": "system", "value": "Allow user to get popular or new quotes\n" }, { "from": "human", "value": "import requests\nfrom bs4 import BeautifulSoup\n\nclass GoodReads(object):\n def __init__(self):\n print \"Starting...\"\n\n def get_quotes(self, url):\n r = requests.get(...
python
chosen
[ { "from": "system", "value": "Include catalog setup in 3031 upgrade\n" }, { "from": "human", "value": "from Products.CMFPlone.utils import _createObjectByType\nfrom zExceptions import BadRequest\n\n\ndef upgrade(tool):\n portal = aq_parent(aq_inner(tool))\n setup = portal.portal_setup\n ...
python
chosen
[ { "from": "system", "value": "Update latex parser to better-handle edge cases\n" }, { "from": "human", "value": "\"\"\"Latex parsing functionality\n\nThis module provides functions to parse latex text\n\"\"\"\n\nimport re\n\n######################################################################\...
python
chosen
[ { "from": "system", "value": "Remove test functions and, clean code in preperation for posting a pull request\n" }, { "from": "human", "value": "import random\nclass die_bag():#Class for rolling die/dices\n\t\n\tdef __init__(self):\n\t\tself.data = []\n\t\n\t\n\tdef die(self, x, y = 1):#Roll a d...
python
chosen
[ { "from": "system", "value": "Disable bts plugin for general usage\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom functools import wraps\nfrom pollirio import commands\n\ndef old_expose(cmd):\n def inner(fn):\n def wrapped(*args, **kwargs):\n commands[cmd...
python
chosen
[ { "from": "system", "value": "Change to 0.3.8, not alpha\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nVERSION = (0, 3, 7, 'alpha')\n\n# pragma: no cover\nif VERSION[-1] != \"final\":\n __version__ = '.'.join(map(str, VERSION))\nelse:\n # pragma: no cover\n __version__ = '...
python
chosen
[ { "from": "system", "value": "Add more time to mqtt.test.client\n" }, { "from": "human", "value": "import time\nfrom django.test import TestCase\n\nfrom django.contrib.auth.models import User\nfrom django.conf import settings\n\nfrom rest_framework.renderers import JSONRenderer\nfrom rest_framew...
python
chosen
[ { "from": "system", "value": "Update for newer versions of Django\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom mysql_fuzzycount.queryset import FuzzyCountQuerySet\n\n\nclass FuzzyCountModelAdminMixin(object):\n\n def queryset(self, request):\n qs = super(...
python
chosen
[ { "from": "system", "value": "Test for incorrect serialisation of PacketLocation\n\nAlthough the `serialize` method is returning the right thing, when we\nserialize it with the `OpenPGPJsonEncoder`, it's being serialized as a\nJSON array. Test to capture that behaviour.\n" }, { "from": "human", ...
python
chosen
[ { "from": "system", "value": "Add more detail to module docstring\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"A collection of tools to help when functional testing\n\nIt contains utilities that assist with tasks like running a browser in a\nheadless environment, or checking...
python
chosen
[ { "from": "system", "value": "Fix lint in example script\n" }, { "from": "human", "value": "from libcloud.compute.types import Provider\nfrom libcloud.compute.providers import get_driver\n\ncls = get_driver(Provider.AZURE_ARM)\ndriver = cls(tenant_id='tenant_id', subscription_id='subscription_id...
python
chosen
[ { "from": "system", "value": ":bug: Remove test condition for permissions\n\nOtherwise I would not be able to test them properly\n" }, { "from": "human", "value": "from functools import wraps\nfrom flask import abort, current_app\nfrom flask_login import current_user\nfrom labsys.auth.models imp...
python
chosen
[ { "from": "system", "value": "Replace static_file by open call\n" }, { "from": "human", "value": "# coding: utf-8\n\nimport bottle\n\nfrom lglass.web.helpers import render_template, with_config\n\napp = bottle.Bottle()\n\ndef index_handler():\n\treturn render_template(\"index.html\")\n\n@with_co...
python
chosen
[ { "from": "system", "value": "Update test_package version number to match the package\n" }, { "from": "human", "value": "from conans import ConanFile, CMake\nimport os\n\nclass MyTestConan(ConanFile):\n settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n requires = \"OpenCV/3.2.0-1...
python
chosen
[ { "from": "system", "value": "Upgrade clang to 9.0 on Windows." }, { "from": "human", "value": "# 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 this file,\n# You can obtain one at https://mozilla.org/MPL/2.0/...
python
chosen
[ { "from": "system", "value": "Use context manager for the offline tests\n" }, { "from": "human", "value": "# coding: utf-8\nfrom __future__ import unicode_literals, print_function\nimport os\nimport pytest\n\nfrom codecs import open\nfrom contextlib import contextmanager\n\nfrom requests import ...
python
chosen
[ { "from": "system", "value": "Add function for parsing cli arguments\n" }, { "from": "human", "value": "import collections\n\n\nclass Command:\n\n def __init__(self, cmd, args=None):\n '''\n Single command and it's output representation\n\n >>> c = Command('/remote-eq/sta...
python
chosen
[ { "from": "system", "value": "Add 'testinfra' test method 'test_mongo_host_port'\n" }, { "from": "human", "value": "import os\n\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(\n os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n...
python
chosen
[ { "from": "system", "value": "Add message for when command is not supplied any arguments.\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom thezombies.tasks.main import crawl_agency_datasets\n\n\nclass Command(BaseCommand):\n \"\"\"Start a task that ...
python
chosen
[ { "from": "system", "value": "Return different values for carry and output.\n" }, { "from": "human", "value": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain...
python
chosen
[ { "from": "system", "value": "Fix periodic tasks model display\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom celerybeatmongo.models import PeriodicTask as BasePeriodicTask, PERIODS\n\nfrom udata.i18n import lazy_gettext as _\nfrom uda...
python
chosen
[ { "from": "system", "value": "Add flush for dummy exec worker\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom __future__ import print_function\nimport socket\nimport time\nimport sys\n\nDEFAULT_IP = '127.0.0.1'\nDEFAULT_PORT = 8125\n\nif __name__ == '__main__':\n s = socket.s...
python
chosen
[ { "from": "system", "value": "Add a default ListenerBase.setup implementation.\n" }, { "from": "human", "value": "from sc2reader import log_utils\n\nclass ListenerBase(object):\n def __init__(self):\n self.logger = log_utils.get_logger(self.__class__)\n\n def accepts(self, event):\n...
python
chosen
[ { "from": "system", "value": "Change to use --extra-index-url instead\n" }, { "from": "human", "value": "import subprocess\n\ndef download(packages, index_url, additional_args = None):\n additional_args = [] if additional_args is None else additional_args\n subprocess.check_call([\"pip\", ...
python
chosen
[ { "from": "system", "value": "Add error field to expected JSON\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom django.test.client import Client\nfrom django.core.urlresolvers import reverse\nfrom whats_fresh_api.models import *\nfrom django.contrib.gis.db import models\...
python
chosen
[ { "from": "system", "value": "Fix script up to search branches\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport re\nimport sys\nimport subprocess\n\nexamples = \"\"\"+ 61c8ca9 fix: navbar not responsive on mobile\n+ 479c48b test: prepared test cases for user authentication\n+ a99...
python
chosen
[ { "from": "system", "value": "Use python script to send json\n" }, { "from": "human", "value": "# A simpel test script for netfortune server\n# Copyright © 2017 Christian Rapp\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Publi...
python
chosen
[ { "from": "system", "value": "[AC-4875] Improve history sorting and remove dead comments\n" }, { "from": "human", "value": "# MIT License\n# Copyright (c) 2017 MassChallenge, Inc.\n\nfrom rest_framework.response import Response\nfrom rest_framework.views import APIView\n\nfrom impact.permissions...
python
chosen
[ { "from": "system", "value": "Validate command not only exists but was used\n\nWithout this, it just uses the first command module that exists, even if that option is `False` (it wasn't passed by the user)" }, { "from": "human", "value": "\"\"\"\nskele\n\nUsage:\n skele hello\n skele -h | --he...
python
chosen
[ { "from": "system", "value": "Enable configuration from home directory\n\nThis adds the possibility of defining multiple locations for the config-files. The given example first searches in ~/.magpie and if it doesn't find any config-files there, it searches in the default path. This enables configuration fo...
python
chosen
[ { "from": "system", "value": "Handle errors in case of a country mismatch.\n" }, { "from": "human", "value": "from urlparse import urljoin\n\nfrom django.conf import settings\n\nfrom django_countries import countries\nimport requests\n\n\nCOUNTRY_CODES = {key: value for (value, key) in list(coun...
python
chosen
[ { "from": "system", "value": "Use Django 1.7 syntax for URLs\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\n\n\nadmin.autodiscover()\n\n\nurlpa...
python
chosen
[ { "from": "system", "value": "Add test to recreate error in this bug\n" }, { "from": "human", "value": "import json\nfrom django.test import TestCase\n\n\nclass PreviewResourceTestCase(TestCase):\n def test_get(self):\n response = self.client.get('/api/data/preview/',\n HTTP...
python
chosen
[ { "from": "system", "value": "Remove UNICORE_DISTRIBUTE_API from test settings\n\nThis stopped being used in 11457e0fa578f09e7e8a4fd0f1595b4e47ab109c\n" }, { "from": "human", "value": "from testapp.settings.base import *\n\n\nENABLE_SSO = True\n\nMIDDLEWARE_CLASSES += (\n 'molo.core.middlewar...
python
chosen
[ { "from": "system", "value": "Fix tests to allow use of random, but not change each time\n" }, { "from": "human", "value": "import simplecoin\nimport unittest\nimport datetime\n\nimport simplecoin.models as m\n\nfrom decimal import Decimal\nfrom simplecoin import db\n\n\nclass UnitTest(unittest....
python
chosen
[ { "from": "system", "value": "Make module imports 2.5 compatible\n" }, { "from": "human", "value": "from .plugin import *\nfrom .funcargs import *\nfrom .marks import *\n" }, { "from": "gpt", "value": "from pytest_django.plugin import *\nfrom pytest_django.funcargs import *\nfrom pyt...
python
chosen
[ { "from": "system", "value": "Add threading to allow for client and server to be run from a single script\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport socket\nimport sys\n\n\ndef main():\n message = sys.argv[1]\n port = 50000\n address = '127.0.0.1'\n client_socke...
python
chosen
[ { "from": "system", "value": "Fix bug in server, connection closes after returning message, socket closes on KeyboardInterupt\n" }, { "from": "human", "value": "import socket\n\n\ntry:\n while True:\n server_socket = socket.socket(\n socket.AF_INET,\n socket.SOCK_...
python
chosen