conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add autodetect for Cisco IOS\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom netmiko.cisco_base_connection import CiscoSSHConnection\nfrom netmiko.cisco_base_connection import CiscoTelnetConnection\n\n\nclass CiscoIosSSH(CiscoSSHCo... | python | chosen |
[
{
"from": "system",
"value": "Simplify CORS model and improve wording\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\n\ndef _set_cors_field_options(name, bases, attrs):\n cls = type(name, bases, attrs... | python | chosen |
[
{
"from": "system",
"value": "Fix creating revisions of ObjectOwner of Comment\n"
},
{
"from": "human",
"value": "# Copyright (C) 2016 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\n\"\"\"A module with Comment object creation hooks\"\"\"\n\nfrom gg... | python | chosen |
[
{
"from": "system",
"value": "Customize salutation form field a bit\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom .models import NewsletterSubscription\n\n\nclass SubscribtionForm(forms.ModelForm):\n class Meta:\n ... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "from openerp import models, fields\n\n'''\nThis module create module of Courso\n'''\n\n\nclass Course(models.Model):\n '''\n This class create module of Course\n '''\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update feed tests to use a person object when creating LoggedAction\n\nOtherwise the notification signal attached to LoggedAction for the\nalerts throws an error as it expects a Person to exist\n"
},
{
"from": "human",
"value": " # -*- coding: utf-8 -*-\n\nfrom __fu... | python | chosen |
[
{
"from": "system",
"value": "Introduce many strictly typed datetime helper functions\n"
},
{
"from": "human",
"value": "from typing import NewType\nfrom datetime import datetime, time, timezone, date\n\n\nTimeTz = NewType('TimeTz', time)\nDateTimeTz = NewType('DateTimeTz', datetime)\nDateTimeNo... | python | chosen |
[
{
"from": "system",
"value": "Make the irrelevant object a constant\n"
},
{
"from": "human",
"value": "irrelevant = object()\n\n\nclass ChangeWatcher(object):\n\n def __init__(self, thing, *args, **kwargs):\n self.thing = thing\n self.args = args\n self.kwargs = kwargs\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix latexs output encoding to latin1.\n"
},
{
"from": "human",
"value": "import os\n\nfrom .errors import parse_log\n\n\nclass LatexError(Exception):\n pass\n\n\nclass LatexBuildError(LatexError):\n \"\"\"LaTeX call exception.\"\"\"\n\n def __init__(self, l... | python | chosen |
[
{
"from": "system",
"value": "Use shlex to split command line\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport subprocess\nimport argparse\n\ndef readArguments():\n parser = argparse.ArgumentParser()\n parser.add_argument('-f','--file', action=\"store\", dest=\"file\", required=T... | python | chosen |
[
{
"from": "system",
"value": "rave: Remove -d command line argument in favour of __debug__.\n"
},
{
"from": "human",
"value": "import argparse\nimport sys\nfrom os import path\n\n\ndef parse_arguments():\n parser = argparse.ArgumentParser(description='A modular and extensible visual novel eng... | python | chosen |
[
{
"from": "system",
"value": "Add gdb to the toolchain\n"
},
{
"from": "human",
"value": "import xyz\n\nclass ArmToolchain(xyz.BuildProtocol):\n group_only = True\n pkg_name = 'arm-toolchain'\n supported_targets = ['arm-none-eabi']\n deps = [('gcc', {'target': 'arm-none-eabi'}),\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix deprecation warnings due to invalid escape sequences.\n"
},
{
"from": "human",
"value": "\nAWS_SECRET_ACCESS_KEY = 'A8+6AN5TSUZ3vysJg68Rt\\A9E7duMlfKODwb3ZD8'\n"
},
{
"from": "gpt",
"value": "\nAWS_SECRET_ACCESS_KEY = r'A8+6AN5TSUZ3vysJg68Rt\\A9E7duM... | python | chosen |
[
{
"from": "system",
"value": "Update state daily dataset ID\n"
},
{
"from": "human",
"value": "# first party\nfrom delphi.epidata.acquisition.covid_hosp.common.network import Network as BaseNetwork\n\n\nclass Network(BaseNetwork):\n\n DATASET_ID = '823dd0e-c8c4-4206-953e-c6d2f451d6ed'\n\n def ... | python | chosen |
[
{
"from": "system",
"value": "Add a simple test for Attribuet class naming conventions.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom jawa.attribute import get_attribute_classes\n\n\ndef test_mandatory_attributes():\n for parser_class in get_attribute_classes().values():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add __bool__ redirect to buttondebounce\n"
},
{
"from": "human",
"value": "import wpilib\n\nclass ButtonDebouncer:\n '''Useful utility class for debouncing buttons'''\n \n def __init__(self, joystick, buttonnum, period=0.5):\n '''\n :param joy... | python | chosen |
[
{
"from": "system",
"value": "Add download to snappy bouncer\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom snappybouncer.models import Conversation, UserAccount, Ticket\n\nadmin.site.register(Conversation)\nadmin.site.register(UserAccount)\nadmin.site.register(Ticket)... | python | chosen |
[
{
"from": "system",
"value": "Use version of slots admin already in production\n\nWhile building the schedule for the conference, the admin view for\n`schedule.models.Slot` was changed in production* to figure out what\nimplementation made the most sense. This formalizes it as the preferred\nversion.\n\nClo... | python | chosen |
[
{
"from": "system",
"value": "Make `InMemoryRequest` work on Twisted<14.0.0\n"
},
{
"from": "human",
"value": "from twisted.web import http\nfrom twisted.web.test.requesthelper import DummyRequest\n\n\n\nclass InMemoryRequest(DummyRequest):\n \"\"\"\n In-memory `IRequest`.\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Update out() processor to extend CollectionPipelineOutput class\n"
},
{
"from": "human",
"value": "from collection_pipelines.http import http\nfrom collection_pipelines.json import *\n\n\nclass cat(CollectionPipelineProcessor):\n def __init__(self, fname):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix 404 handler not handling exception argument\n"
},
{
"from": "human",
"value": "from django.shortcuts import render_to_response\nfrom django.shortcuts import render\nfrom django.template import RequestContext\nfrom django.shortcuts import redirect\n\n\ndef handle... | python | chosen |
[
{
"from": "system",
"value": "Add slugify to the jinja2's globals scope\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.bootstrap import Bootstrap\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.login import LoginManager\nfrom flask.ext.uploads import Uplo... | python | chosen |
[
{
"from": "system",
"value": "Make formatter example more realistic\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n"
},
{
"from": "human",
"value": "\nfrom DebianChangesBot import MailParser\n\nclass SecurityAnnounce(MailParser):\n\n def parse(self, ... | python | chosen |
[
{
"from": "system",
"value": "Add .yaml extension on default cassette name.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nimport inspect\nimport logging\nimport os\nimport unittest\nimport vcr\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass V... | python | chosen |
[
{
"from": "human",
"value": "Add register_adapter to have type adaptions\n"
},
{
"from": "gpt",
"value": "import numpy\nfrom psycopg2.extensions import register_adapter, AsIs\n\n\ndef adapt_numpy_int64(numpy_int64):\n \"\"\" Adapting numpy.int64 type to SQL-conform int type using psycopg exte... | python | chosen |
[
{
"from": "system",
"value": "Simplify label model serial ID\n"
},
{
"from": "human",
"value": "from sqlalchemy import Column, String, Sequence, Integer\n\nfrom virtool.postgres import Base\n\n\nclass Label(Base):\n __tablename__ = 'labels'\n\n id = Column(Integer, Sequence('labels_id_seq'... | python | chosen |
[
{
"from": "system",
"value": "Update init to latest version number"
},
{
"from": "human",
"value": "from .testenv import testenv\n\n__version__ = \"0.1.1\"\n\n__all__ = [\"testenv\"]\n"
},
{
"from": "gpt",
"value": "from .testenv import testenv\n\n__version__ = \"0.2.0\"\n\n__all__ =... | python | chosen |
[
{
"from": "system",
"value": "Fix imports to work with Python3\n"
},
{
"from": "human",
"value": "\"\"\"Portal Service Layer\n\nThe service layer provides an API on top of Django models to build useful outputs for consumers such as views. This layer helps keep views thin, encourages reusability ... | python | chosen |
[
{
"from": "system",
"value": "Improve Logger to support variable text params\n"
},
{
"from": "human",
"value": "import time\n\nfrom bot.action.util.textformat import FormattedText\nfrom bot.logger.message_sender import MessageSender\n\n\nLOG_ENTRY_FORMAT = \"{time} [{tag}] {text}\"\n\n\nclass Lo... | python | chosen |
[
{
"from": "system",
"value": "Fix: Use st2common log and not logging\n"
},
{
"from": "human",
"value": "from datetime import timedelta\nimport eventlet\nimport logging\nimport sys\nfrom threading import Thread\nimport time\n\n# Constants\nSUCCESS_EXIT_CODE = 0\n\neventlet.monkey_patch(\n os=T... | python | chosen |
[
{
"from": "system",
"value": "Fix keyword names in example code\n"
},
{
"from": "human",
"value": "import random\nimport tables\nprint 'tables.__version__', tables.__version__\n\nnrows=10000-1\n\nclass Distance(tables.IsDescription):\n frame = tables.Int32Col(pos=0)\n distance = tables.Flo... | python | chosen |
[
{
"from": "system",
"value": "Add comments for timed shoot\n"
},
{
"from": "human",
"value": "try:\r\n import wpilib\r\nexcept ImportError:\r\n from pyfrc import wpilib\r\nfrom common.autonomous_helper import StatefulAutonomous, timed_state\r\n\r\nclass TimedShootAutonomous(StatefulAutonom... | python | chosen |
[
{
"from": "system",
"value": "Move .lower() method call for readability\n"
},
{
"from": "human",
"value": "def word_count(s):\n words = strip_punc(s.lower()).split()\n return {word: words.count(word) for word in set(words)}\n\n\n\ndef strip_punc(s):\n return \"\".join(ch if ch.isalnum()... | python | chosen |
[
{
"from": "system",
"value": "Add enough hackish machinery for the CLI downloader to download one bug\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport argparse\nimport sys\n\ndef main(raw_arguments):\n parser = argparse.ArgumentParser(description='Simple oh-bugimporters crawl ... | python | chosen |
[
{
"from": "system",
"value": "Remove confidence parameter in django test case\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom chatterbot.ext.django_chatterbot.models import Statement\n\n\nclass OutputIntegrationTestCase(TestCase):\n \"\"\"\n Tests to make sure tha... | python | chosen |
[
{
"from": "system",
"value": "Add value check for -limit\n"
},
{
"from": "human",
"value": "import praw\nimport argparse\n\nparser = argparse.ArgumentParser(description='Stream self posts from any subreddit.')\nparser.add_argument('-sub', required=False, default='all', help='Subreddit name (defa... | python | chosen |
[
{
"from": "system",
"value": "mscgen: Change package name to sphinxcontrib-mscgen\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nlong_desc = '''\nThis package contains the mscgen Sphinx extension.\n\nAllow mscgen-formatted Message Seq... | python | chosen |
[
{
"from": "system",
"value": "Add description of assertions raised"
},
{
"from": "human",
"value": "#!/usr/bin/python -tt\n\n\"\"\"Solves problem B from Google Code Jam Qualification Round Africa 2010\n(https://code.google.com/codejam/contest/351101/dashboard#s=p1)\n\"Reverse Words\"\n\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix a typo in an error message\n\nintegeer -> integer"
},
{
"from": "human",
"value": "# This file is part of the myhdl library, a Python package for using\n# Python as a Hardware Description Language.\n#\n# Copyright (C) 2003-2008 Jan Decaluwe\n#\n# The myhdl l... | python | chosen |
[
{
"from": "system",
"value": "Make migration logging more verbose\n"
},
{
"from": "human",
"value": "\"\"\"\nRun all migrations\n\"\"\"\nimport imp\nimport os\nimport sys\nimport pymongo\nfrom os.path import join\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\n\nROOT_PATH = os.path.... | python | chosen |
[
{
"from": "system",
"value": "Use __all__ to make it not overwrite .models randomly.\n"
},
{
"from": "human",
"value": "\nfrom denorm.fields import denormalized\nfrom denorm.dependencies import depend_on_related,depend_on_q\n"
},
{
"from": "gpt",
"value": "\nfrom denorm.fields import... | python | chosen |
[
{
"from": "system",
"value": "Simplify defaulting the sale and payment channels for Amazon sales.\n"
},
{
"from": "human",
"value": "from osv import osv, fields\nimport time\nimport datetime\nimport inspect\nimport xmlrpclib\nimport netsvc\nimport os\nimport logging\nimport urllib2\nimport base6... | python | chosen |
[
{
"from": "system",
"value": "Add function to list donors and total donations.\n"
},
{
"from": "human",
"value": "# Charles Robison\n# 2016.10.16\n# Mailroom Lab\n\n#!/usr/bin/env python\n\ndonors = {\n 'Smith':[100, 125, 100],\n 'Galloway':[50],\n 'Williams':[22... | python | chosen |
[
{
"from": "system",
"value": "Remove leftover text key from our own payload creation\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\"\"\"A payload based version of page.\"\"\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Use more sensible name for post data\n"
},
{
"from": "human",
"value": "from Cookie import SimpleCookie\nfrom urlparse import parse_qs\n\nfrom utils import MultiDict, cached_property\n\n\nclass Request(object):\n def __init__(self, event, context):\n self.... | python | chosen |
[
{
"from": "system",
"value": "Update bundles example after configuration provider refactoring\n"
},
{
"from": "human",
"value": "\"\"\"Run 'Bundles' example application.\"\"\"\n\nimport sqlite3\nimport boto3\n\nfrom dependency_injector import containers\nfrom dependency_injector import providers... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in fab script\n"
},
{
"from": "human",
"value": "from fabric.api import *\n\n@task\n@role('ci')\ndef install():\n sudo(\"apt-get install git\")\n sudo(\"apt-get install maven2\") # TODO: maven3\n sudo(\"apt-get install groovy\") # TODO: groovy-1.8,... | python | chosen |
[
{
"from": "system",
"value": "Return returncode from shell command."
},
{
"from": "human",
"value": "# encoding: utf-8\n# ---------------------------------------------------------------------------\n# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.\n# Distributed under th... | python | chosen |
[
{
"from": "system",
"value": "Fix code style issues with Black\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os\n\nfrom scout.demo import coverage_qc_report \nfrom scout.commands import cli\n\n\ndef test_load_coverage_qc_report(mock_app, case_obj):\n \"\"\"Testing the loa... | python | chosen |
[
{
"from": "system",
"value": "Fix payload_handler in api-server to generate proper JWTs\n"
},
{
"from": "human",
"value": "from datetime import timedelta\nfrom logging import getLogger\nfrom flask import request\nfrom flask_jwt import JWT\nfrom .models import User\nfrom .roles import roles\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Print usage if not enough args\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\nfrom parse_docker_args import parse_mount\n\ndef can_access(path, perm):\n mode = None\n if perm == 'r':\n mode = os.R_OK\n elif perm == 'w':\n ... | python | chosen |
[
{
"from": "system",
"value": "Bring the standard __future__ imports over\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom .core import Conveyor\n\n\ndef main():\n Conveyor().run()\n\nif __name__ == \"__main__\":\n main()\n"
},
{
"from": "gpt",
"... | python | chosen |
[
{
"from": "system",
"value": "Switch to using argparse for the main script.\n"
},
{
"from": "human",
"value": "import gzip\nimport sys\n\nfrom . import zone_iterator, zone_dict_to_str, ZONE_FMT_STR\n\ntry:\n from colorama import Fore, init as colorama_init\nexcept ImportError:\n HAS_COLOR ... | python | chosen |
[
{
"from": "system",
"value": "Add try, catch statement to ensure data migration can be performed.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import migrations\n\napp = 'model_logging'\nmodel = 'LogEntry'\n\n\ndef move_data(apps, schema_editor):\n LogEntry = app... | python | chosen |
[
{
"from": "system",
"value": "Remove commentsInLine for RedditUser because there is no longer foreignKey from Comment to RedditUser\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom reddit.models import RedditUser,Submission,Comment,Vote\n\n# Register your models here.\nc... | python | chosen |
[
{
"from": "system",
"value": "Change jobs_list object name to job_list\n"
},
{
"from": "human",
"value": "from django.views.generic.list import ListView\n\nfrom edxmako.shortcuts import render_to_response\n\nfrom .models import Job\n\n\nclass JobListView(ListView):\n\n model = Job\n contex... | python | chosen |
[
{
"from": "system",
"value": "Add new OE test folder\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom neo.rawio.openephysbinaryrawio import OpenEphysBinaryRawIO\nfrom neo.test.rawiotest.common_rawio_test import BaseTestRawIO\n\n\nclass TestOpenEphysBinaryRawIO(BaseTestRawIO, unittest.T... | python | chosen |
[
{
"from": "system",
"value": "Check version for latest cask behaviour changed\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n# -*- coding: utf8 -*-\n\nimport argparse\nimport shutil\nfrom subprocess import check_output, run\n\nparser = argparse.ArgumentParser(description='Update ev... | python | chosen |
[
{
"from": "system",
"value": "Make mrnet depend on boost.\n"
},
{
"from": "human",
"value": "from spack import *\n\nclass Mrnet(Package):\n \"\"\"The MRNet Multi-Cast Reduction Network.\"\"\"\n homepage = \"http://paradyn.org/mrnet\"\n url = \"ftp://ftp.cs.wisc.edu/paradyn/mrnet/mr... | python | chosen |
[
{
"from": "system",
"value": "Add default IP and PORT\n"
},
{
"from": "human",
"value": "import os\nimport logging\nimport importlib\n\n# All configuration defaults are set in this module\n\nTRACKER_HOST = 'rutracker.org'\n\n# Timeone for the tracker times\nTZNAME = 'Europe/Moscow'\n\nLOGLEVEL =... | python | chosen |
[
{
"from": "system",
"value": "Use compat module instead of ctypes-based implementation.\n\n\n"
},
{
"from": "human",
"value": "from pysndfile import formatinfo, sndfile\nfrom pysndfile import supported_format, supported_endianness, \\\n supported_encoding\nf... | python | chosen |
[
{
"from": "system",
"value": "Add error message for future breakers-of-tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom nose.tools import * # flake8: noqa\n\nfrom tests.base import ApiTestCase\n\nfrom api.base.pagination import MaxSizePagination\n\nclass TestMaxPagination(... | python | chosen |
[
{
"from": "system",
"value": "Print modules being imported (for easier debugging)\n"
},
{
"from": "human",
"value": "\"\"\"\n SoftLayer.tests.CLI.modules.import_test\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n :license: MIT, see LICENSE for more details.\n\"\"\"\nfrom SoftLayer.tests ... | python | chosen |
[
{
"from": "system",
"value": "Add unit tests for all package directories\n"
},
{
"from": "human",
"value": "\"\"\"\ntest_perma_base.py\n tests of the perma_base component of permamodel\n\"\"\"\n\nfrom permamodel.components import frost_number\nimport os\nimport numpy as np\nfrom .. import perma... | python | chosen |
[
{
"from": "system",
"value": "Change senlin dashboard to not be the default dashboard\n\nChange-Id: I81d492bf8998e74f5bf53b0226047a070069b060\nCloses-Bug: #1754183\n"
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file ... | python | chosen |
[
{
"from": "system",
"value": "Add __package_version__ for version description\n\nExample: \"masterfile 0.1.0dev\""
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nfrom ._metadata import version as __version__, author as __author__, email as __... | python | chosen |
[
{
"from": "system",
"value": "Update a string with the latest formatting approach\n"
},
{
"from": "human",
"value": "from abc import ABCMeta\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\nclass SubclassRegisteringABCMeta(ABCMeta):\n\n def __init__(cls, name, bases, dct):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add sleep to simulate work\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom ddsc_worker.celery import celery\n\n\n@celery.task\ndef add(x, y):\n return x + y\n\n\n@celery.task\ndef mul(x, y):\n return x + y\n"
},
{
"from"... | python | chosen |
[
{
"from": "system",
"value": "Change development version to 0.1.7"
},
{
"from": "human",
"value": "__version__ = '0.1.6'\n__author__ = 'sukrit'\n\nimport logging\nfrom conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL\n\n\nlogging.basicConfig(format=LOG_FORMAT, datefmt=LOG_DATE, level=L... | python | chosen |
[
{
"from": "system",
"value": "main: Fix bux when using Git directory\n\nIf a Git directory is passed in, it needs to be in a list of one.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Script for updating a directory of repositories.\"\"\"\nimport logging\nimport os\n\nimport cl... | python | chosen |
[
{
"from": "system",
"value": "Raise a `RuntimeError` if the device cannot be opened\n"
},
{
"from": "human",
"value": "import threading\n\nfrom robotd.native import _cvcapture\n\nclass CaptureDevice(object):\n def __init__(self, path=None):\n if path is not None:\n argument_... | python | chosen |
[
{
"from": "system",
"value": "Remove temp directory creation... not worth it\n"
},
{
"from": "human",
"value": "import os\r\nfrom .exceptions import IncompleteEnv\r\nfrom tempfile import TemporaryDirectory\r\nimport time\r\n\r\n\r\nclass Environment(object):\r\n def __init__(self, *args, **kw... | python | chosen |
[
{
"from": "system",
"value": "Use the pytest fixture for the URL\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8\n\"\"\"\nThis test checks that all the internal links in the site (links that point to\nother pages on the site) are pointing at working pages.\n\"\"\"\n\nfrom http_crawler i... | python | chosen |
[
{
"from": "system",
"value": "Make sure to cast to int as this does not work on old numpy versions\n"
},
{
"from": "human",
"value": "import afnumpy\nimport arrayfire\nimport numpy\nfrom .. import private_utils as pu\n\ndef tile(A, reps):\n try:\n tup = tuple(reps)\n except TypeErro... | python | chosen |
[
{
"from": "system",
"value": "Add option to pick single test file from the runner\n\ngit-svn-id: 150a648d6f30c8fc6b9d405c0558dface314bbdd@620 b426a367-1105-0410-b9ff-cdf4ab011145\n"
},
{
"from": "human",
"value": "import doctest\nimport glob\nimport pkg_resources\n\ntry:\n pkg_resources.requi... | python | chosen |
[
{
"from": "system",
"value": "Update MockRequest to work with Django 1.9's session validation\n\ntouch #124\n"
},
{
"from": "human",
"value": "##\n# Copyright (C) 2014 Jessica Tallon & Matt Molyneaux\n#\n# This file is part of Inboxen.\n#\n# Inboxen is free software: you can redistribut... | python | chosen |
[
{
"from": "system",
"value": "Support testscenarios by default in BaseTestCase\n\nThis allows one to use the scenario framework easily\nfrom any test class.\n\nChange-Id: Ie736138fe2d1e1d38f225547dde54df3f4b21032\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2013 - N... | python | chosen |
[
{
"from": "system",
"value": "Add complete path of spotify.processed.h\n\nAdd complete path of spotify.processed.h so it points to the same directory where is the file"
},
{
"from": "human",
"value": "from cffi import FFI\nffi = FFI()\n\n#Header generated with cpp spotify.h > spotify.processed.h... | python | chosen |
[
{
"from": "system",
"value": "Add shim for python_2_unicode_compatible in tests\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport sys\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible... | python | chosen |
[
{
"from": "system",
"value": "Use more explicit variable names.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport subprocess\nimport sys\n\n\ndef build(pkgpath):\n os.chdir(pkgpath)\n targets = [\n 'build',\n 'package',\n 'install',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add flag passthrough for 'test'\n"
},
{
"from": "human",
"value": "from invoke import ctask as task\n\n\n@task(help={\n 'module': \"Just runs tests/STRING.py.\",\n 'runner': \"Use STRING to run tests instead of 'spec'.\"\n})\ndef test(ctx, module=None, runner=... | python | chosen |
[
{
"from": "system",
"value": "Make the testing coverage great again\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom apps.curia_vista.models import Council\n\n\nclass TestCouncil(TestCase):\n def setUp(self):\n self.T = Council(id=1, updated='2010-12-26T13:07... | python | chosen |
[
{
"from": "system",
"value": "Add option to set locale for created documentation\n"
},
{
"from": "human",
"value": "from django.core.management.base import AppCommand\n\n\nclass Command(AppCommand):\n help = \"Generate sphinx documentation skeleton for given apps.\"\n \n def handle_app(... | python | chosen |
[
{
"from": "system",
"value": "Add homepage to LongT5 dataset collection\n\nPiperOrigin-RevId: 479013251\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Copyright 2022 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use ... | python | chosen |
[
{
"from": "system",
"value": "Clean up Node delete handler.\n"
},
{
"from": "human",
"value": "from astral.api.handlers.base import BaseHandler\nfrom astral.models.node import Node\nfrom astral.api.client import NodesAPI\nimport sys\n\n\nimport logging\nlog = logging.getLogger(__name__)\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Add type for storing enums\n"
},
{
"from": "human",
"value": "from bloop import String\n\n\nclass Position(String):\n \"\"\" stores [2, 3, 4] as '2:3:4' \"\"\"\n def dynamo_load(self, value):\n values = value.split(\":\")\n return list(map(int, v... | python | chosen |
[
{
"from": "system",
"value": "Change the xml parser to output gas mixture content\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\nimport argparse\nfrom xml.dom import minidom\n\nparser = argparse.ArgumentParser(description='Parse a dive in xml formt.')\nparser.add_argument('-f', '--file',... | python | chosen |
[
{
"from": "system",
"value": "Add support for program editor to create and update snapshots\n"
},
{
"from": "human",
"value": "# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\nscope = \"Private Program\"\ndescription = \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test for simbad query\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom k2catalogue import models\n\n\n@pytest.fixture\ndef epic():\n return models.EPIC(epic_id=12345, ra=12.345, dec=67.894,\n mag=None, campaign_id=1)\n\n\ndef tes... | python | chosen |
[
{
"from": "system",
"value": "Add a method to extract the domain url from a full url\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module contains useful utility methods.\n\"\"\"\n\n\ndef jq_format(code):\n \"\"\"\n Use before throwing raw code such as 'div[tab=\"advanced\"]' into jQuery... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with deleting event subscriptions\n"
},
{
"from": "human",
"value": "\"\"\"This module contains the SQLAlchemy EventSubscription class definition.\"\"\"\nfrom server.models.db import db\n\n\nclass EventSubscription(db.Model):\n\n \"\"\"SQLAlchemy EventS... | python | chosen |
[
{
"from": "system",
"value": "[tests] Remove deprecated \"gen\" parameter of NoReferencesBot\n\nChange-Id: I8140117cfc2278cfec751164a6d1d8f12bcaef84\n"
},
{
"from": "human",
"value": "\"\"\"Test noreferences bot module.\"\"\"\n#\n# (C) Pywikibot team, 2018-2020\n#\n# Distributed under the terms ... | python | chosen |
[
{
"from": "system",
"value": "Allow more discourse hostnames to fix CSP error\n"
},
{
"from": "human",
"value": "csp = {\n 'default-src': '\\'self\\'',\n 'style-src': [\n '\\'self\\'',\n '\\'unsafe-inline\\''\n ],\n 'script-src': [\n '\\'self\\'',\n 'cdn.h... | python | chosen |
[
{
"from": "system",
"value": "Add \"home\" url for testing\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\n\nurlpatterns = [\n url(r\"^\", include(\"formly.urls\", namespace=\"formly\")),\n]\n"
},
{
"from": "gpt",
"value": "from django.conf.urls impor... | python | chosen |
[
{
"from": "system",
"value": "Add PDFDisplay view to the test app\n"
},
{
"from": "human",
"value": "\"\"\"testapp 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:\nFunction ... | python | chosen |
[
{
"from": "system",
"value": "Print additional stats for each projects\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom xbrowse_server.base.models import Project\n\nclass Command(BaseCommand):\n \"\"\"Command to generate a ped file for a given pro... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in action serializer\n\nDon't try to get URL of items that have been deleted\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom editorsnotes.main.models.auth import (LogActivity, ADDITION, CHANGE,\n ... | python | chosen |
[
{
"from": "system",
"value": "Make SFC test a python call to main()\n\nInstead of python -> bash -> python, call\nthe SFC test using the execute() method that\nis inherited from FeatureBase and it's a bash\ncall by default.\nWith this change, we call the SFC test using main()\nof run_tests.py of SFC repo an... | python | chosen |
[
{
"from": "system",
"value": "Update python3 html parser depricated method.\n"
},
{
"from": "human",
"value": "import re\n\n\ndef clean_whitespace(text):\n \"\"\"\n Remove any extra whitespace and line breaks as needed.\n \"\"\"\n # Replace linebreaks with spaces\n text = text.rep... | python | chosen |
[
{
"from": "system",
"value": "CHANGE mnc route to POST message\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)\n# Releasing children ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.