conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Enable easy login through browsable API (discovery through serializer_class)\n"
},
{
"from": "human",
"value": "from django.contrib.auth import logout\nfrom django.middleware.csrf import get_token as generate_csrf_token_for_frontend\nfrom rest_framework import statu... | python | chosen |
[
{
"from": "system",
"value": "Use curl instead of wget.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n################################################################################\n# broadcast_any_song.py\n#\n# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr ... | python | chosen |
[
{
"from": "system",
"value": "Change back this file name to version\n"
},
{
"from": "human",
"value": "from .api import * # noqa\nfrom .data import * # noqa\nfrom .utils import * # noqa\nfrom ._meta import __version__ # noqa\n"
},
{
"from": "gpt",
"value": "from .api import * # ... | python | chosen |
[
{
"from": "system",
"value": "Fix command line usage options\n"
},
{
"from": "human",
"value": "\"\"\"Calculate the number of Pomodori available within a time period.\n\nUsage:\n get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>\n get-pomodori (-h | --help | ... | python | chosen |
[
{
"from": "system",
"value": "Add Word model to shell context\n"
},
{
"from": "human",
"value": "import os\nimport coverage\nfrom flask_script import Manager, Shell\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom config import basedir\nfrom app import create_app, db\nfrom app.models i... | python | chosen |
[
{
"from": "system",
"value": "Revert \"trying to simplefy __init__\"\n\nThis reverts commit f2e3887bcd53b1c35af2d9dfe2363ea9e2a407f5.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom datetime import datetime\nimport logging\nimport os\nimport json\nimport urllib.request\nimport... | python | chosen |
[
{
"from": "system",
"value": "Add expand selection to word\n"
},
{
"from": "human",
"value": "import sublime_plugin\nfrom basic_expansions import foo\n\nclass ExpandRegionCommand(sublime_plugin.TextCommand):\n def run(self, edit):\n foo();"
},
{
"from": "gpt",
"value": "import su... | python | chosen |
[
{
"from": "system",
"value": "Refactor test so that it does not have to change every time we add a new organisation.\n"
},
{
"from": "human",
"value": "from flask import json\n\nfrom tests import create_authorization_header\n\n\ndef test_get_dvla_organisations(client):\n auth_header = create_... | python | chosen |
[
{
"from": "system",
"value": "Remove stay mention to BASE_URL\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nimport settings\nimport views\n\nurlpatterns = patterns('',\n (r'^papers/(?P<paper>.+)$', views.papers),\n (r'^publications/?$', views.publications, { '... | python | chosen |
[
{
"from": "system",
"value": "[IMP] Move maintainer key out of the manifest\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n##############################################################################\n#\n# Authors: Adrien Peiffer\n# Copyright (c) 2014 Acsone SA/NV (http:... | python | chosen |
[
{
"from": "system",
"value": "Add a TODO explaining why tasks.CompletionQueue needs a capacity limit\n"
},
{
"from": "human",
"value": "__all__ = [\n 'SocketServer',\n]\n\nimport errno\nimport logging\n\nfrom g1.asyncs.bases import servers\nfrom g1.asyncs.bases import tasks\n\nLOG = logging.g... | python | chosen |
[
{
"from": "system",
"value": "Use Docstring as default title value.\n"
},
{
"from": "human",
"value": "\"\"\"Module docstring. This talks about the module.\"\"\"\n\n# -*- coding: utf-8 -*-\n\n__author__ = \"\"\"Chris Tabor (dxdstudio@gmail.com)\"\"\"\n\nIS_MAIN = True if __name__ == '__main__' e... | python | chosen |
[
{
"from": "system",
"value": "Add test case for invalid headers and continuation lines\n"
},
{
"from": "human",
"value": "def test_multiple_same_headers():\n\tpass\n\ndef test_header_case_insensitivity():\n\tpass\n\ndef test_header_with_continuation_lines():\n\tpass\n\ndef test_request_without_h... | python | chosen |
[
{
"from": "system",
"value": "Normalize case in my assertion.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n\nCopyright (c) 2008 Dustin Sallings <dustin@spy.net>\n\"\"\"\n\nimport os\nimport sys\n\nsys.path.append(os.path.join(sys.path[0], '..', 'lib'))\nsys.path.append('lib... | python | chosen |
[
{
"from": "system",
"value": "Improve the error handling and error response message.\n"
},
{
"from": "human",
"value": "import json\n\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom vehicles.models import Vehicle\nimport control.tasks\n\n\n#@ap... | python | chosen |
[
{
"from": "system",
"value": "Make Watch also a context manager\n"
},
{
"from": "human",
"value": "import asyncio\n\n\nclass Watch:\n \"\"\"Represents an inotify watch as added by InotifyProtocol.watch()\"\"\"\n\n def __init__(self, watch_descriptor, callback, protocol):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Update label data to point at correct spots\n"
},
{
"from": "human",
"value": "import pandas as pd \nimport subprocess\nimport sys\nimport os\n\nsource = sys.argv[1]\ndest = sys.argv[2]\nlabels = sys.argv[3]\n\ndf = pd.read_csv(labels)\n\ndf = df.fillna('EMPTY')\n\n... | python | chosen |
[
{
"from": "system",
"value": "Use namespaces plt and vf for visualization and verification modules\n"
},
{
"from": "human",
"value": "\n# import subpackages \nfrom . import advection\nfrom . import cascade\nfrom . import io\nfrom . import noise\nfrom . import nowcasts\nfrom . import optflow\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add experimental support to run module as Blender addon\n"
},
{
"from": "human",
"value": "if 'loaded' in locals():\n import imp\n imp.reload(blendergltf)\n from .blendergltf import *\nelse:\n loaded = True\n from .blendergltf import *"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Stop exporting internal symbols from the shared libraries.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n#\n# Generate linker script to only expose symbols of the public API\n#\n\nimport sys\nimport re\n\n\nif __name__ == '__main__':\n\n funcs = li... | python | chosen |
[
{
"from": "system",
"value": "Add support for Django 1.10+\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.db.models.aggregates import Sum\nfrom django.db.models.sql.aggregates import Sum as BaseSQLSum\n\n\nclass SQLSum(BaseSQLSum):\n @property\n def sql_te... | python | chosen |
[
{
"from": "system",
"value": "Add district id to find_district response\n"
},
{
"from": "human",
"value": "from django.http import JsonResponse, HttpResponseBadRequest\n\nfrom legislature.sunlight.district import DistrictMatcher\n\n\ndef find_district(request):\n try:\n latitude = requ... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong import in collection\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) 2014, Nicolas P. Rougier. All rights reserved.\n# Distributed under the terms ... | python | chosen |
[
{
"from": "system",
"value": "REF: Change to Unix line endings\n"
},
{
"from": "human",
"value": "\"\"\"Provides convenience utilities for assorted data files.\r\n\r\nThis package provides a means of organizing the code developed\r\nat UKZN for handling the dataflow and processing of information... | python | chosen |
[
{
"from": "system",
"value": "Add id tot he beacon event dataset\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nThis package contains the loader modules for the salt streams system\n'''\n# Import salt libs\nimport salt.loader\n\n\nclass Beacon(object):\n '''\n This class ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Change careeropportunity migration dep\"\n\nThis reverts commit 60fdfab7e3b557e46276c225ff159f5773930525.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Print both output + error for bash command\n"
},
{
"from": "human",
"value": "import sublime, sublime_plugin\n\nimport os\nfrom .common.utils import run_bash_for_output\nfrom .common.utils import git_path_for_window\n\nlast_command = \"\"\n\nclass RunBash(sublime_pl... | python | chosen |
[
{
"from": "system",
"value": "Update ptvsd package metadata for 2.1 beta.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\r\n\r\n#-------------------------------------------------------------------------\r\n# Copyright (c) Microsoft. All rights reserved.\r\n#\r\n# Licensed under the Ap... | python | chosen |
[
{
"from": "system",
"value": "Reimplement day 10 using itertools combine.\n\nNow it DOES run using pypy, and is faster again.\n"
},
{
"from": "human",
"value": "def lookandsay(line):\n p = None\n n = 0\n result = []\n for c in line:\n if n > 0 and p is not c:\n resu... | python | chosen |
[
{
"from": "system",
"value": "Fix nierozpoznawania bledu pierwszego ruchu v.2\n"
},
{
"from": "human",
"value": "from game import Game\r\nfrom input_con import InputCon\r\nfrom output_con import OutputCon\r\n\r\n\r\nclass Harness():\r\n def __init__(self, output, inputs):\r\n self._game = Ga... | python | chosen |
[
{
"from": "system",
"value": "Make a default tree manager importable from the package.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2014 uralbash <root@uralbash.ru>\n#\n# Distributed under terms of the MIT license.\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Add setting to turn of search indexes.\n"
},
{
"from": "human",
"value": "from fluent_pages.pagetypes.flatpage.models import FlatPage\nfrom fluent_pages.pagetypes.fluentpage.models import FluentPage\nfrom haystack import indexes\n\n\nclass FluentPageIndex(indexes.Se... | python | chosen |
[
{
"from": "system",
"value": "Add cache header for columns\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Give back the columns of a CSV and the in\n# http://www.tutorialspoint.com/python/python_cgi_programming.htm\n\nimport cgi\nimport csv\nimport sys\nimport... | python | chosen |
[
{
"from": "system",
"value": "Remove default email sender from CozyLAN config\n\nBrand-specific emails should always use the sender from the\nbrand-specific email configuration.\n"
},
{
"from": "human",
"value": "# Examplary development configuration for the \"CozyLAN\" demo site\n\nDEBUG = True... | python | chosen |
[
{
"from": "system",
"value": "Add decode to version read from pkg_resources.\n"
},
{
"from": "human",
"value": "from pkg_resources import resource_string\n\n\nversion = resource_string(__name__, 'version.txt').strip()\n__version__ = version\n"
},
{
"from": "gpt",
"value": "from pkg_r... | python | chosen |
[
{
"from": "system",
"value": "Use contrail_vrouter_api instead of nova_contrail_vif.\n"
},
{
"from": "human",
"value": "import sys\n\nimport getopt\nimport logging\nimport socket\n\nfrom contrail_lib import rpc_client_instance, uuid_from_string\nimport nova_contrail_vif.gen_py.instance_service\n... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fix plate-solving on local development mode\"\n\nThis reverts commit 40897be402bd05ed5fb53e116f03d2d954720245.\n"
},
{
"from": "human",
"value": "# Python\nimport urllib2\n\n# Django\nfrom django.conf import settings\nfrom django.core.files import File\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add slug field to file upload meta table, rename table\n"
},
{
"from": "human",
"value": "from tables import engine\n\ndef create_tables():\n \"\"\"\n Create tables the lazy way... with raw SQL.\n \"\"\"\n conn = engine.raw_connection()\n cur = conn.c... | python | chosen |
[
{
"from": "system",
"value": "Fix how hppcorbaserver is killed in ServerManager\n"
},
{
"from": "human",
"value": "# Copyright (c) 2020, CNRS\n# Authors: Guilhem Saurel <guilhem.saurel@laas.fr>\n\nimport os\nimport subprocess\nimport time\n\ntry:\n from subprocess import DEVNULL, run\nexcept ... | python | chosen |
[
{
"from": "system",
"value": "Change the __unicode__ to __str__\n"
},
{
"from": "human",
"value": "from django.db import models\n\nBEER_CHOICES = (\n (1, 'Domestic'),\n (2, 'Import'),\n)\n\nclass Beer(models.Model):\n name = models.CharField(max_length=200)\n slug = models.SlugField(... | python | chosen |
[
{
"from": "system",
"value": "Mark pre-selected topics on form\n"
},
{
"from": "human",
"value": "\nfrom django.shortcuts import render, redirect\n\nfrom bills.utils import get_all_subjects, get_all_locations\n\nfrom opencivicdata.models import Bill\n\ndef bill_list(request):\n\n subjects = g... | python | chosen |
[
{
"from": "system",
"value": "Tweak unit tests parameters for boot_dqn.\n\nWe can speed this up further by setting num_ensemble = 2 (anything >1 gives full coverage).\nSetting num_episodes = 5 for consistency with other baseline unit tests.\n\nPiperOrigin-RevId: 307000268\nChange-Id: Id8c757c884860561e92c6d... | python | chosen |
[
{
"from": "system",
"value": "Add property to provide template fragment name\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.db import models\nfrom django.utils import timezone\n\nimport jsonfield\n\nfrom .signals import event_logged\n\n\nclass Log(models.Model):... | python | chosen |
[
{
"from": "system",
"value": "Stop using Signal(providing_args) deprected in Django 4.0\n\nCloses #393\n"
},
{
"from": "human",
"value": "import django.dispatch\n\ncache_read = django.dispatch.Signal(providing_args=[\"func\", \"hit\"])\ncache_invalidated = django.dispatch.Signal(providing_args=[... | python | chosen |
[
{
"from": "system",
"value": "Remove unused testing utility function\n\nSigned-off-by: Dougal Matthews <8f24f2c0fd825cfb6716a36822888c4a01678c88@dougalmatthews.com>\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Canonical Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the ... | python | chosen |
[
{
"from": "system",
"value": "Fix max elements in header\n"
},
{
"from": "human",
"value": "import falcon\nimport json\nimport rethinkdb as r\n\nMAX_OFFERS = 100\n\nclass OfferListResource:\n def __init__(self):\n self._db = r.connect('localhost', 28015)\n\n def on_get(self, req, re... | python | chosen |
[
{
"from": "system",
"value": "Use standard three-digits for now\n"
},
{
"from": "human",
"value": "\"\"\"\nCI tools is a collection of small configurations aimed to ease setting up\ncomplete CI system, targettet on django apps.\n\"\"\"\nVERSION = (0, 0, 1, 0)\n\n__version__ = VERSION\n__versions... | python | chosen |
[
{
"from": "system",
"value": "Implement Gref.tips() to fetch it's tips.\n"
},
{
"from": "human",
"value": "import os\n\n\nclass Gref(object):\n def __init__(self, store, channel, identifier):\n self.store = store\n self.channel = channel.replace(\"/\", \"_\")\n self.ident... | python | chosen |
[
{
"from": "system",
"value": "Change start-weblogic-server using jdk as default.\n\nCode reviewed by Edwin Tang\n"
},
{
"from": "human",
"value": "############################################################################ \n# Generic script applicable on any Operating Environments (Unix, Wind... | python | chosen |
[
{
"from": "system",
"value": "Set a random session key if none is configured\n"
},
{
"from": "human",
"value": "from flask import current_app\nfrom flask import Flask\nfrom flask import g\nfrom flask import jsonify\nfrom flask import redirect\nfrom flask import url_for\nfrom relengapi import cel... | python | chosen |
[
{
"from": "system",
"value": "Support for removing listeners by means of a listener id.\n"
},
{
"from": "human",
"value": "from twisted.words.xish.utility import EventDispatcher\n\nUSER_AGENT = 'btcx-bot'\n\nclass ExchangeEvent(EventDispatcher):\n def __init__(self, **kwargs):\n EventD... | python | chosen |
[
{
"from": "system",
"value": "Update for stayput master and ensure forward compatibility\n"
},
{
"from": "human",
"value": "from jinja2 import Environment, FileSystemLoader\n\nfrom stayput import Templater\n\n\nclass Jinja2Templater(Templater):\n\n def __init__(self, site, *args, **kwargs):\n... | python | chosen |
[
{
"from": "system",
"value": "Remove glob imports from sympy.printing.\n"
},
{
"from": "human",
"value": "\"\"\"Printing subsystem\"\"\"\n\nfrom pretty import *\nfrom latex import latex, print_latex\nfrom mathml import mathml, print_mathml\nfrom python import python, print_python\nfrom ccode imp... | python | chosen |
[
{
"from": "system",
"value": "Fix retrieval of model under viewsets without a statically defined queryset\n"
},
{
"from": "human",
"value": "from rest_framework.exceptions import APIException\nfrom rest_framework.serializers import ModelSerializer\n\n\nWRITE_OPERATIONS = ['create', 'update', 'pa... | python | chosen |
[
{
"from": "system",
"value": "Fix use of unicode() incompatible with Python 3\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom icekit.utils.admin.mixins import ThumbnailAdminMixin\n\nfrom . import models\n\n\nclass ImageAdmin(ThumbnailAdminMixin, admin.ModelAdmin):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add docstring to linters package\n"
},
{
"from": "human",
"value": "from . import changeling\n"
},
{
"from": "gpt",
"value": "\"\"\"\nLinters for verifying the correctness of certain character types\n\nThe `commands.lint` function can lint all basic file... | python | chosen |
[
{
"from": "system",
"value": "Use sort_keys=True for the ConsoleWritter pretty printing\n"
},
{
"from": "human",
"value": "import json\n\nfrom exporters.writers.base_writer import BaseWriter, ItemsLimitReached\n\n\nclass ConsoleWriter(BaseWriter):\n \"\"\"\n It is just a writer with testin... | python | chosen |
[
{
"from": "system",
"value": "Make fields readonly, skips rest_framework, validation, speeds up queries\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom . import models\nfrom scorecard.serializers import GeographySerializer\n\n\nclass FinancialYearSerializer(seri... | python | chosen |
[
{
"from": "system",
"value": "Add test for internode_compression: 'none'\n"
},
{
"from": "human",
"value": "from dtest import Tester, debug\nfrom tools import generate_ssl_stores, putget\n\n\nclass TestInternodeSSL(Tester):\n\n def __init__(self, *args, **kwargs):\n Tester.__init__(sel... | python | chosen |
[
{
"from": "system",
"value": "Change meal name to charfield\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\n\n\nclass Weekday(models.Model):\n \"\"\"Model representing the day of the week.\"\"\"\n\n name = models.CharField(max_len... | python | chosen |
[
{
"from": "system",
"value": "Add typing to java. It's not right yet though :)\n"
},
{
"from": "human",
"value": "from genes.apt import commands as apt\nfrom genes.brew import commands as brew\nfrom genes.debconf import commands as debconf\nfrom genes.debian.traits import is_debian\nfrom genes.m... | python | chosen |
[
{
"from": "system",
"value": "Add document store for locations\n"
},
{
"from": "human",
"value": "from corehq.form_processor.document_stores import ReadonlyFormDocumentStore, ReadonlyCaseDocumentStore\nfrom corehq.form_processor.utils import should_use_sql_backend\nfrom corehq.util.couch import ... | python | chosen |
[
{
"from": "system",
"value": "Change return to allow for original tuples to come out since we'll need them for chunking\n"
},
{
"from": "human",
"value": "import nltk\n\nclass PosTags:\n\n def tag(self, t):\n '''\n With a list of tokens, mark their part of speech and return\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix `language_choose_control` migration default value.\n\nCo-Authored-By: Éric <34afff4eac2f9b94bd269db558876db6be315161@users.noreply.github.com>\n"
},
{
"from": "human",
"value": "from django.db import migrations, models\n\n\nclass Migration(migrations.Migration):... | python | chosen |
[
{
"from": "system",
"value": "Copy reference object example.\nThis commit is just implemented to validate the medhod.\nBut this is not conveniant, because reference models must not be\nchanged.\nSo next step is to make them private attributes.\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix test broken due to delete_record change\n"
},
{
"from": "human",
"value": "# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: david@recipro... | python | chosen |
[
{
"from": "system",
"value": "Fix passing sets to batchable methods\n\nSets don't support indexing, so convert them to lists.\n"
},
{
"from": "human",
"value": "import functools\n\n\nITERABLE_TYPES = (\n list,\n set,\n tuple,\n)\n\ntry:\n from numpy import ndarray\n ITERABLE_TYPES... | python | chosen |
[
{
"from": "human",
"value": "Add some sort of simple image discovery\n"
},
{
"from": "gpt",
"value": "try:\n from urllib import urlretrieve\nexcept ImportError:\n from urllib.request import urlretrieve\n\n\ndef simple_discovery(path, secure=True):\n if secure:\n protocol = 'https... | python | chosen |
[
{
"from": "system",
"value": "Add my packages to featured list\n"
},
{
"from": "human",
"value": "import requests\nfrom . import packages\nfrom models import Package, Downloads\nfrom flask import jsonify\nfrom datetime import timedelta\nfrom app import cache\nfrom utils import cache_timeout\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove kwargs[\"input_controller\"] from the Game plugin template\n"
},
{
"from": "human",
"value": "from serpent.game import Game\n\nfrom .api.api import MyGameAPI\n\nfrom serpent.utilities import Singleton\n\nfrom serpent.input_controller import InputControllers\n... | python | chosen |
[
{
"from": "system",
"value": "Test Cases for is instance of Model function\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tes... | python | chosen |
[
{
"from": "system",
"value": "Remove Flask-SQLAlchemy dependency\nIt should be noted that the declarative base still has to be configured\nlike this:\n\n```python\nMyBase:\n query = session.query_property()\n```\n\nAlso decreased code duplication and removed unused imports.\n"
},
{
"from": "human... | python | chosen |
[
{
"from": "system",
"value": "Change unicode ip to string\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport click\nfrom vumi_http_proxy import http_proxy\n\n\n@click.command()\n@click.option('--interface', default=\"0.0.0.0\", help='eg 0.0.0.0')\n@click.option('--port', default=... | python | chosen |
[
{
"from": "system",
"value": "Update an example capabilities file\n"
},
{
"from": "human",
"value": "# Desired capabilities example file for Selenoid Grid\n#\n# The same result can be achieved on the command-line with:\n# --cap-string='{\"selenoid:options\": {\"enableVNC\": true}}'\n\ncapabi... | python | chosen |
[
{
"from": "system",
"value": "data: Add static value to LEFT, CENTER, RIGHT\n"
},
{
"from": "human",
"value": "from devito.tools import Tag\n\n__all__ = ['DOMAIN', 'OWNED', 'HALO', 'NOPAD', 'FULL',\n 'LEFT', 'RIGHT', 'CENTER']\n\n\nclass DataRegion(Tag):\n pass\n\n\nDOMAIN = DataReg... | python | chosen |
[
{
"from": "system",
"value": "Fix how tables are printed on smaller screens\n\n"
},
{
"from": "human",
"value": "\"\"\"Helper to output stuff\"\"\"\n\nfrom tabulate import tabulate\n\n\ndef print_list(header, entries):\n \"\"\"Prints out a list\"\"\"\n print(tabulate(entries, header, table... | python | chosen |
[
{
"from": "system",
"value": "Add database rollback to error handler\n"
},
{
"from": "human",
"value": "\"\"\"Module that contains error handlers.\"\"\"\nfrom flask import render_template, Blueprint\n\nerror = Blueprint('error', __name__)\n\n\n@error.app_errorhandler(404)\ndef page_not_found(e):... | python | chosen |
[
{
"from": "system",
"value": "Make this easier to test, which we'll get to a bit later\n"
},
{
"from": "human",
"value": "import os\nimport atexit\nimport logging\nimport socket\n\nfrom .preflight import preflight_check\nfrom .log import configure_logging\nfrom .notifier import notify\nfrom .con... | python | chosen |
[
{
"from": "system",
"value": "Add sample param to CV function\n\nBoolean param to make possible to calculate coefficient of variation\nfor population (default is sample).\n"
},
{
"from": "human",
"value": "from .standard_deviation import standard_deviation\nfrom .mean import mean\n\ndef coeffici... | python | chosen |
[
{
"from": "system",
"value": "Fix exception message formatting in Python3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom gym import error, envs\nfrom gym.envs import registration\nfrom gym.envs.classic_control import cartpole\n\ndef test_make():\n env = envs.make('CartPole-v... | python | chosen |
[
{
"from": "system",
"value": "Add grammar for test of recursive grammar\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\nfrom unittest import TestCase, main\nfrom grammpy ... | python | chosen |
[
{
"from": "system",
"value": "Fix unicode error when showing voucher error message\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import pgettext_lazy\n\nfrom .models import Voucher, NotApplicable\n\n\nclass VoucherField(forms.ModelChoiceField):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement app secret printing to social_auth migration tool\n"
},
{
"from": "human",
"value": "from allauth.socialaccount.models import SocialAccount\nfrom django.core.management.base import BaseCommand\nfrom django.db import IntegrityError\nfrom social_django.model... | python | chosen |
[
{
"from": "system",
"value": "Use simple_tag decorators as those tags can now also be used for assignments\n"
},
{
"from": "human",
"value": "from django import template\n\n\nregister = template.Library()\n\n\n@register.assignment_tag(takes_context=True)\ndef build_absolute_uri(context, url):\n ... | python | chosen |
[
{
"from": "system",
"value": "Test for XDG basedir creation\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport os, tempfile\n\nfrom cozify import config\nfrom cozify.test import debug\nfrom cozify.test.fixtures import tmp_hub\n\n\ndef test_config_XDG(tmp_hub):\n assert config... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in the region aggregation query.\n\nThere is no full_name column for regions; it is just name.\n"
},
{
"from": "human",
"value": "\n## this should show in red if the COUNT is less than the total\n## number of regions that exist for that relationshiop\n\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add another newline before author/date info\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__author__ = \"\"\"John Kirkham\"\"\"\n__email__ = \"kirkhamj@janelia.hhmi.org\"\n\nfrom ._version import get_versions\n__version__ = get_versions()['version']\... | python | chosen |
[
{
"from": "system",
"value": "Make find_versions return a namedtuple as documented\n"
},
{
"from": "human",
"value": "import git\n\nimport version_info.exceptions\n\n\n__all__ = (\n 'get_git_version',\n 'find_versions',\n)\n\n\ndef get_git_version(path):\n repo = git.Repo(path)\n hea... | python | chosen |
[
{
"from": "system",
"value": "Change landing URLs to website\n"
},
{
"from": "human",
"value": "import sublime, sublime_plugin, webbrowser\n\n\nQD_URL = \"https://app.1self.co\"\n\nclass GoTo1selfDashboardCommand(sublime_plugin.TextCommand):\n def run(self,edit):\n SETTINGS = {}\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove requirement on python > 2.7\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf8 -*-\n\n\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2014 Jarl Stefansson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof... | python | chosen |
[
{
"from": "system",
"value": "Fix import to list items\n"
},
{
"from": "human",
"value": "\"\"\"\nInitialization of the optimize subpackage\n\"\"\"\n\nfrom .scalar_maximization import brent_max\nfrom .root_finding import *\n"
},
{
"from": "gpt",
"value": "\"\"\"\nInitialization of th... | python | chosen |
[
{
"from": "system",
"value": "Fix outwork list view to properly filter on published=true in Solr\n"
},
{
"from": "human",
"value": "from django.views.generic import ListView\nfrom haystack.query import SearchQuerySet\nfrom haystack.inputs import Clean\n\nfrom derrida.outwork.models import Outwor... | python | chosen |
[
{
"from": "system",
"value": "Use default IPython profile when converting to HTML\n"
},
{
"from": "human",
"value": "from IPython.config.loader import Config\nfrom IPython.utils.traitlets import Unicode\n\nfrom nbgrader.apps.customnbconvertapp import CustomNbConvertApp\nfrom nbgrader.apps.custom... | python | chosen |
[
{
"from": "system",
"value": "Add check for minimum Python version\n"
},
{
"from": "human",
"value": "__author__ = 'Brian Wickman'\n__version__ = '0.5.2'\n__license__ = 'MIT'\n\nfrom pystachio.typing import (\n Type,\n TypeCheck,\n TypeFactory)\n\nfrom pystachio.base import Environment\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Implement assertions and a for instead of a while loop\n"
},
{
"from": "human",
"value": "def test_right_arrows(page):\n page.goto(\"index.html\")\n while(True):\n # Keeps going to the next page until there is no right arrow\n right_arrow = page.... | python | chosen |
[
{
"from": "system",
"value": "Add a test to verify plugin_parsing clears selected parsers after task\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, division, absolute_import\n\nfrom flexget.plugin import get_plugin_by_name, get_plugins\nfrom flexget.plugins.parsers i... | python | chosen |
[
{
"from": "system",
"value": "Make sure that the temporary file has a `wav` extension because a certain encoder was designed for Windows and thinks that you would never possibly have a file without an extension so adds `.wav` if it's not there on the input file"
},
{
"from": "human",
"value": "#... | python | chosen |
[
{
"from": "system",
"value": "Fix loop to delete branches from xml.\n"
},
{
"from": "human",
"value": "\"\"\"IEEE Xplore API Request.\n\nUsage:\n IEEE/main.py -h [-au AUTHOR] [-ti TITLE] [-ab ABSTRACT] [-py YEAR] [-hc\n NUMBER]\n\nOptions:\n -h --help show this\n -au AU... | python | chosen |
[
{
"from": "system",
"value": "Move python rl history file\n\njust to help clean up ~/\n"
},
{
"from": "human",
"value": "# pylint: disable=unused-import, unused-variable, missing-docstring\n\ndef _readline():\n try:\n import readline\n except ImportError:\n print(\"Module readline not av... | python | chosen |
[
{
"from": "system",
"value": "Add support for hyphens, and list of commands\n\nAdds a function to retrieve all commands, and converts incoming commands\nfrom hyphenated to underscored form.\n"
},
{
"from": "human",
"value": "import os\nimport string\nimport importlib\nimport traceback\nfrom .. i... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.