conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Return an empty activity log list for unauthenticated users.\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets\nfrom rest_framework.permissions import IsAuthenticatedOrReadOnly\n\nfrom .. import models\nfrom ..serializers.activity_log import Act... | python | chosen |
[
{
"from": "system",
"value": "Add a wait option to Process.terminate\n"
},
{
"from": "human",
"value": "version = (0, 1, 0)\n\n__title__ = \"Process Kit\"\n__author__ = \"Oleiade\"\n__license__ = \"MIT\"\n\n__version__ = '.'.join(map(str, version))\n\nfrom pkit.process import Process\n"
},
{... | python | chosen |
[
{
"from": "system",
"value": "Add one route so that our monitoring system stops thinking this system is down\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, jsonify, make_response, request, current_app\nfrom gevent import monkey\nfrom gevent import wsgi\nimport app\n... | python | chosen |
[
{
"from": "system",
"value": "Add note about why register is a separate endpoint.\n"
},
{
"from": "human",
"value": "from allauth.account.forms import SignupForm\nfrom rest_framework.response import Response\n\nfrom keybar.api.base import Endpoint, ListEndpoint\nfrom keybar.models.user import Us... | python | chosen |
[
{
"from": "system",
"value": "Remove unused imports from database tests\n"
},
{
"from": "human",
"value": "from .query_tests import QueryTestCase\nfrom .sql_builder_tests import SqlBuilderTestCase\nfrom .transaction_tests import TransactionTestCase\n\nfrom rebel.database import Database\nfrom re... | python | chosen |
[
{
"from": "system",
"value": "Fix and Gate on H303 (no wildcard imports)\n\nWildcard imports make reading code unnecessarily confusing because they\nmake it harder to see where a functions comes from. We had two types of\nwildcard imports in the code. Unneeded ones in test files that are just\nremoved, and... | python | chosen |
[
{
"from": "system",
"value": "refactor: Make the test look fancy\n\nUse fancy decorators to make the simple test look fancy.\n"
},
{
"from": "human",
"value": "import pytest\nimport broadbean as bb\n\n\n@pytest.fixture\ndef virgin_blueprint():\n \"\"\"\n Return an empty instance of BluePri... | python | chosen |
[
{
"from": "system",
"value": "Enable running layout demo standalone\n\ngit-svn-id: de585c8a1036fae0bde8438f23c67a99526c94d0@627 286bb87c-ec97-11de-a004-2f18c49ebcc3\n"
},
{
"from": "human",
"value": "from rctkdemos.demos import serve_demo\nfrom rctk.widgets import StaticText\nfrom rctk.layouts i... | python | chosen |
[
{
"from": "system",
"value": "Add double quotes to sql statement in CreateExtension module.\n"
},
{
"from": "human",
"value": "from django.db.migrations.operations.base import Operation\n\nclass CreateExtension(Operation):\n\n def __init__(self, name):\n self.name = name\n\n def sta... | python | chosen |
[
{
"from": "system",
"value": "Fix example Article.__str__ in Python 3\n"
},
{
"from": "human",
"value": "from django.core.urlresolvers import reverse\nfrom django.db import models\nfrom fluent_comments.moderation import moderate_model, comments_are_open, comments_are_moderated\nfrom fluent_comme... | python | chosen |
[
{
"from": "system",
"value": "Create a parent with the same dataset type\n"
},
{
"from": "human",
"value": "import ckan.logic as logic\nfrom ckan.logic.action.get import package_show as ckan_package_show\nfrom ckan.plugins import toolkit\n\nfrom ckanext.datasetversions.helpers import get_context... | python | chosen |
[
{
"from": "system",
"value": "Refactor populate_db pyinvoke task to use it in tests\n"
},
{
"from": "human",
"value": "import json\nfrom pathlib import Path\n\nimport sys\nimport sqlalchemy as sa\nfrom invoke import task\n\nFANTASY_DB_SQL = Path.cwd() / 'fantasy-database' / 'schema.sql'\nFANTASY... | python | chosen |
[
{
"from": "system",
"value": "Set additional fields when mapping inputs and outputs\n\nThis will reduce the risk of unnecessary lazy fetching\n"
},
{
"from": "human",
"value": "from sevenbridges.models.file import File\n\n\ndef map_input_output(item, api):\n \"\"\"\n Maps item to appropria... | python | chosen |
[
{
"from": "system",
"value": "Fix error in Questionable Content crawler when feed entry does not contain date\n"
},
{
"from": "human",
"value": "from comics.crawler.crawlers import BaseComicCrawler\n\nclass ComicCrawler(BaseComicCrawler):\n def _get_url(self):\n self.feed_url = 'http:/... | python | chosen |
[
{
"from": "system",
"value": "Make arc distance test size bigger to better show the difference.\n\nNow on the web site, 5 on the 7 test case have speed of 0.001, the minimal value.\n"
},
{
"from": "human",
"value": "# Authors: Yuancheng Peng\n# License: MIT\n\"\"\"Computes the arc distance betwe... | python | chosen |
[
{
"from": "system",
"value": "Add vector as valid grid type.\n"
},
{
"from": "human",
"value": "from nose.tools import (assert_is_instance, assert_less_equal, assert_equal,\n assert_greater, assert_in)\n# from nose import with_setup\n\n# from .utils import setup_func, tear... | python | chosen |
[
{
"from": "system",
"value": "Set the version number to 0.3.0.\n\n\ngit-svn-id: f25caaa641ea257ccb5bc415e08f7c71e4161381@214 b0b80210-5d09-0410-99dd-b4bd03f891c0\n"
},
{
"from": "human",
"value": "\"\"\"A collection of classes for MusicBrainz.\n\nThis package contains the following modules:\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update a click in a test\n"
},
{
"from": "human",
"value": "from seleniumbase import BaseCase\n\n\nclass MyTestClass(BaseCase):\n\n def test_basic(self):\n self.open('http://xkcd.com/353/')\n self.assert_element('img[alt=\"Python\"]')\n self.... | python | chosen |
[
{
"from": "system",
"value": "Remove file logger enabled by default\n"
},
{
"from": "human",
"value": "\"\"\"\nThe fmcapi __init__.py file is called whenever someone imports the package into their program.\n\"\"\"\n\n# from .fmc import *\n# from .api_objects import *\n# from .helper_functions im... | python | chosen |
[
{
"from": "system",
"value": "Decrease log level for memcache setup\n"
},
{
"from": "human",
"value": "\"\"\"The application's Globals object\"\"\"\nimport logging\n\nimport memcache\n\n\nlog = logging.getLogger(__name__)\n\n\nclass Globals(object):\n\n \"\"\"Globals acts as a container for o... | python | chosen |
[
{
"from": "system",
"value": "Remove useless/obsolete social pipeline function (it's done in social_auth post_save()+task to make pipeline independant and faster).\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nu\"\"\"\nCopyright 2013-2014 Olivier Cortès <oc@1flow.io>.\n\nThis file ... | python | chosen |
[
{
"from": "system",
"value": "Fix rpc argument handling when constructing a Request\n"
},
{
"from": "human",
"value": "from .exceptions import MalformedRequestException\n\n\nclass Request(object):\n def __init__(self, version, metadata, **kwargs):\n self._version = version\n sel... | python | chosen |
[
{
"from": "system",
"value": "Update knowledge provider to work with API changes.\n"
},
{
"from": "human",
"value": "\"\"\"\nKnowledge provider that will respond to requests made by the rdf publisher or another bot.\n\"\"\"\nfrom sleekxmpp.plugins.base import base_plugin\nfrom rhobot.components.... | python | chosen |
[
{
"from": "system",
"value": "Add missing return types to scope factory methods\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.snippet.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for detai... | python | chosen |
[
{
"from": "system",
"value": "Fix typos: encoding, data -> self.encoding, self.data\n"
},
{
"from": "human",
"value": "#! /bin/env python\n\nfrom landlab.io.vtk.writer import VtkWriter\nfrom landlab.io.vtk.vtktypes import VtkUniformRectilinear\nfrom landlab.io.vtk.vtkxml import (\n VtkRootEle... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add pandas dataframe capability in variance_inflation_factor\n"
},
{
"from": "human",
"value": "from numpy.testing import assert_almost_equal\n\nfrom statsmodels.datasets import statecrime\nfrom statsmodels.regression.linear_model import OLS\nfrom statsmodels.s... | python | chosen |
[
{
"from": "system",
"value": "Fix failing command on Linux.\n"
},
{
"from": "human",
"value": "# :coding: utf-8\n# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips\n# :license: See LICENSE.txt.\n\nimport subprocess\nimport pickle\nimport base64\n\ntry:\n from shlex import quote\nexcept... | python | chosen |
[
{
"from": "system",
"value": "Revert \"enrollment api endpoint has been updated to accept trailing forward slashes\"\n"
},
{
"from": "human",
"value": "\"\"\"\nURLs for the Enrollment API\n\n\"\"\"\nfrom django.conf import settings\nfrom django.conf.urls import patterns, url\n\nfrom .views impor... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with Python 2 to 3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport gettext\n\nimport eventlet\nimport os\nfrom stand.socketio_events import StandSocketIO\n\nlocales_path = os.path.join(os.path.... | python | chosen |
[
{
"from": "system",
"value": "Add in windows drive pattern match.\n\nAs title.\n"
},
{
"from": "human",
"value": "from numba.cuda.testing import unittest, SerialMixin, skip_on_cudasim\nfrom numba import cuda\nfrom numba.core import config\n\n\nclass MyError(Exception):\n pass\n\n\nregex_patte... | python | chosen |
[
{
"from": "system",
"value": "Improve velocity list initialisation in SGD\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom .base import Base\n\n\nclass SGD(Base):\n def __init__(self, cost, params, lr=0.1, momentum=0.9):\n super().__init__(cost, params, lr)\n self.mom... | python | chosen |
[
{
"from": "system",
"value": "Modify the flask version retrieval (thanks donri)\n"
},
{
"from": "human",
"value": "import pkg_resources\n\nfrom flaskext.debugtoolbar.panels import DebugPanel\n\n_ = lambda x: x\n\nflask_version = pkg_resources.working_set.require('flask')[0].version\n\nclass Vers... | python | chosen |
[
{
"from": "system",
"value": "Use Requests to encode stop as query param, verify API status code.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os, requests, getSchedule\nfrom flask import Flask, request, jsonify, render_template, abort\n\napp = Flask(__name__)\n\n@app.route... | python | chosen |
[
{
"from": "system",
"value": "Add indexes on account payment models\n\nThe fields where the indexes are added are used in searches in\naccount_payment_order, which becomes really slow when a database have\nmany lines.\n"
},
{
"from": "human",
"value": "# Copyright 2016 Akretion (http://www.akret... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings and comment to small scripts test\n"
},
{
"from": "human",
"value": "\"\"\"This module tests the small scripts - admin, model, and wsgi.\"\"\"\n\nimport unittest\n\n\nclass SmallScriptsTest(unittest.TestCase):\n def test_admin(self):\n impor... | python | chosen |
[
{
"from": "system",
"value": "Add mime type for sourcemaps.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.template import RequestContext\nfrom django.http import HttpResponse, HttpResponseNotFound\nfrom django.template import Template\nfrom cancer_browser.core.... | python | chosen |
[
{
"from": "system",
"value": "Add trailing slashes to docs links\n\nThis avoids hitting the app only to have it redirect back to nginx.\n"
},
{
"from": "human",
"value": "from tangled.web import Resource, config\n\nfrom tangled.site.resources.entry import Entry\n\n\nclass Docs(Entry):\n\n @co... | python | chosen |
[
{
"from": "system",
"value": "Replace bankid with fid to avoid duplicate config options.\n"
},
{
"from": "human",
"value": "\"\"\"OFX downloader.\"\"\"\n\nfrom ofxtools.Client import OFXClient, BankAcct\nfrom ofxtools.Types import DateTime\nfrom yapsy.IPlugin import IPlugin\n\n\ndef make_date_kw... | python | chosen |
[
{
"from": "system",
"value": "Test conversion of Transfer to standard types works\n"
},
{
"from": "human",
"value": "\nfrom unittest import TestCase\n\nfrom pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix\n\nclass PipetteOpTests(TestCase):\n def setUp(self):\n self.... | python | chosen |
[
{
"from": "system",
"value": "Add satan sha to glockfile script\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport re\nimport subprocess\n\ndef main():\n source = open(\".gitmodules\").read()\n paths = re.findall(r\"path = (.*)\", source)\n\n for path in paths:\n prin... | python | chosen |
[
{
"from": "system",
"value": "Fix for some error messages that were split into several messages\n\nThe exception handler expects the error to be a list on line 33. In my\ncase they were a string, which lead to the split of the string into\nmultiple errors containing one character\n"
},
{
"from": "hu... | python | chosen |
[
{
"from": "system",
"value": "Remove glob imports from sympy.geometry.\n"
},
{
"from": "human",
"value": "\"\"\"\nA geometry module for the SymPy library. This module contains all of the\nentities and functions needed to construct basic geometrical data and to\nperform simple informational queri... | python | chosen |
[
{
"from": "system",
"value": "Add version to module init\n"
},
{
"from": "human",
"value": "# allow high-level functions to be accessed directly from the mappyfile module\nfrom mappyfile.utils import load, loads, find, findall, dumps, write"
},
{
"from": "gpt",
"value": "# allow high... | python | chosen |
[
{
"from": "system",
"value": "Add name to vote view URL\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\n\nfrom django.views.generic import TemplateView\n\nfrom votes.views import VoteView\n\nurlpatterns = [\n url(r'^(?P<vote_name>[\\w-]+)$', VoteView.as_view()),\... | python | chosen |
[
{
"from": "system",
"value": "Fix mock needing config_file variable\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, unicode_literals\n\nimport argparse\nimport unittest\n\nfrom nose.tools import ok_\ntry:\n from unittest.mock import patch\nexcept ImportError:\n f... | python | chosen |
[
{
"from": "system",
"value": "Update imported to use arg parser\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nsys.path.append('.')\n\nfrom vacker.importer import Importer\n\nimporter = Importer()\n# Need to obtain from arguments\nimporter.import_directory('../sample_photos'... | python | chosen |
[
{
"from": "system",
"value": "Add pyparsing to the dependencies.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as stream:\n long_desc = stream.read()\n\nrequires = ['Sphinx>=0.6']\n\nsetup(\n name='sphin... | python | chosen |
[
{
"from": "system",
"value": "Apply `repr()` to values passed to `ReprBuilder.add`, too\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbyceps.util.instances\n~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for detail... | python | chosen |
[
{
"from": "system",
"value": "Check accepted uploads List-Id, otherwise we get false +ves from bugs-dist\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom DebianChangesBot import MailParser\... | python | chosen |
[
{
"from": "system",
"value": "Use accessor to use in sort.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport re\nfrom . import export\n\n@export\ndef fuzzyfinder(input, collection, accessor=lambda x: x):\n \"\"\"\n Args:\n input (str): A partial string which is typi... | python | chosen |
[
{
"from": "system",
"value": "Move andorid webkit tests to main waterfall and CQ\n\nThey have been stable and fast on FYI bots for a week.\n\nTBR=yfriedman@chromium.org\n\nReview URL: https://codereview.chromium.org/12093034\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@179266 0039d316-1c4b-4281-b... | python | chosen |
[
{
"from": "system",
"value": "Refactor test name to include the word 'To'\n\nPrevious: testNewFileUploadExistingBucket\nCurrent: testNewFileUploadToExistingBucket\n"
},
{
"from": "human",
"value": "import unittest, boto, os\nfrom bucketeer import commit\n\nclass BuckeeterTest(unittest.TestCase):... | python | chosen |
[
{
"from": "system",
"value": "tests/main: Add test for valid ssh_config\n\nSigned-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>\n"
},
{
"from": "human",
"value": "import pytest\nimport ceph_medic.main\n\n\nclass TestMain(object):\n def test_main(self):\n asse... | python | chosen |
[
{
"from": "system",
"value": "Use keyword arguments in code\n"
},
{
"from": "human",
"value": "import json\nfrom functools import partial\n\nfrom . import handlers # noqa\nfrom .message import send_error\nfrom .registry import HANDLERS\n\nREQUIRED_FIELDS = ['type', 'id']\n\n\ntry:\n DECODE_E... | python | chosen |
[
{
"from": "system",
"value": "Fix in output to help command.\n\nSigned-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>\n"
},
{
"from": "human",
"value": "# The client of DDuplicated tool.\nfrom os import path as opath, getcwd\nfrom pprint import pprint\nfrom sys import ar... | python | chosen |
[
{
"from": "system",
"value": "Use expanduser to prevent hardcoding username\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom s3backup.clients import compare, LocalSyncClient\n\n\ndef sync():\n local_client = LocalSyncClient('/home/michael/Notebooks')\n current = local_cli... | python | chosen |
[
{
"from": "system",
"value": "Remove import from non-existing module\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .stop_words import STOP_WORDS\n\nfrom ..tokenizer_exceptions import BASE... | python | chosen |
[
{
"from": "system",
"value": "Allow Rdio to use default signature handling\n"
},
{
"from": "human",
"value": "from werkzeug.urls import url_decode\nfrom oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_BODY\n\nimport foauth.providers\n\n\nclass Rdio(foauth.providers.OAuth1):\n # General info abo... | python | chosen |
[
{
"from": "system",
"value": "Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.\n"
},
{
"from": "human",
"value": "from getpass import getpass\nfrom netmiko import ConnectHandler\n\ndef main():\n\n password = getpass()\n\n pynet_rtr1 = {'device_type': 'cisco_ios... | python | chosen |
[
{
"from": "system",
"value": "lint: Remove settings exemption for possibly undefined star imports.\n\nSigned-off-by: Anders Kaseorg <dfdb7392591db597bc41cf266a9c3bc12a2706e5@zulip.com>\n"
},
{
"from": "human",
"value": "import argparse\n\nfrom typing import List\n\nfrom zulint.linters import run... | python | chosen |
[
{
"from": "system",
"value": "Handle empty location and leads data\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.core.exceptions import ValidationError\n\nfrom wye.profiles.models import UserType\n\nfrom . import models\n\n\nclass RegionalLeadForm(forms.ModelForm):\n\n... | python | chosen |
[
{
"from": "system",
"value": "Remove BootstrapSplitDateTimeWidget as it's no longer needed\n"
},
{
"from": "human",
"value": "from speeches.tasks import transcribe_speech\nfrom django.forms.widgets import SplitDateTimeWidget\n\n\"\"\"Common utility functions/classes\nThings that are needed by mu... | python | chosen |
[
{
"from": "system",
"value": "Handle the case where there are no logs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport json\nimport requests\n\nES_HOST = 'localhost'\nES_PORT = '9200'\nELASTICSEARCH = 'http://{0}:{1}'.format(ES_HOST, ES_PORT)\n\n\ndef find_indices():\n \"\"\"F... | python | chosen |
[
{
"from": "system",
"value": "Remove Unused config imported from openedoo_project, pylint.\n"
},
{
"from": "human",
"value": "from openedoo_project import db\nfrom openedoo_project import config\n\n\nclass Setting(db.Model):\n __tablename__ = 'module_employee_site_setting'\n __table_args__... | python | chosen |
[
{
"from": "system",
"value": "Update make WM ontmap with SOFIA\n"
},
{
"from": "human",
"value": "from indra.sources import eidos\nfrom indra.sources.hume.make_hume_tsv import make_file\nfrom indra.java_vm import autoclass\n\neidos_package = 'org.clulab.wm.eidos'\n\nif __name__ == '__main__':\n ... | python | chosen |
[
{
"from": "system",
"value": "Use iter's sentinel arg instead of infinite loop\n"
},
{
"from": "human",
"value": "from functools import partial\nfrom itertools import imap\nfrom itertools import islice\nfrom operator import itemgetter\n\n\ndef yield_getter_of(getter_maker, iterator):\n \"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Set dev version to 1.26.0dev after releasing 1.25.1\n\nSigned-off-by: Ulysses Souza <9b58b28cc7619bff4119b8572e41bbb4dd363aab@gmail.com>\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\n__version__... | python | chosen |
[
{
"from": "system",
"value": "Remove a test which behaves differently depending on the the version of asyncio/trollius\n"
},
{
"from": "human",
"value": "import tests\n\nclass CallbackTests(tests.TestCase):\n def test_hello_world(self):\n result = []\n\n def hello_world(loop):\n... | python | chosen |
[
{
"from": "system",
"value": "Create parent directories as needed."
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom __future__ import print_function\n\nfrom argparse import ArgumentParser\nimport json\nimport os\nfrom urllib.request import urlopen\nimport subprocess\nimport sys\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Load current settings from .env file\n\nOIPA-645\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"OIPA.settings\")\n\n from django.core.managem... | python | chosen |
[
{
"from": "system",
"value": "Migrate org notif tests to pytest\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals, absolute_import\n\nfrom udata.models import MembershipRequest, Member\n\nfrom udata.core.user.factories import UserFactory\nfrom ud... | python | chosen |
[
{
"from": "system",
"value": "Add alt-f binding for auto-suggestion.\n"
},
{
"from": "human",
"value": "\"\"\"\nKey bindings for auto suggestion (for fish-style auto suggestion).\n\"\"\"\nfrom __future__ import unicode_literals\nfrom prompt_toolkit.application.current import get_app\nfrom prompt... | python | chosen |
[
{
"from": "system",
"value": "Make package-level import at the top (pep8)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\nUSDA National Agricultural Statistics Service API wrapper\n\nThis Python wrapper implements the public API for the USDA National\nAgricultural Statistics ... | python | chosen |
[
{
"from": "system",
"value": "Add read organization scope for OAuth\n\nThis will enable to access jobs service even for not public organization\nmembers.\n"
},
{
"from": "human",
"value": "from flask import session\nfrom flask_oauthlib.client import OAuth\nimport f8a_jobs.defaults as configurati... | python | chosen |
[
{
"from": "system",
"value": "Revert \"use pop instead of get because it doens't cause uncaught exceptions.\"\n\nThis reverts commit 7aa3e4128b9df890a2683faee0ebe2ee8e64ce33.\n"
},
{
"from": "human",
"value": "from core.build.subnet import build_subnet\nfrom core.network.models import Network\nf... | python | chosen |
[
{
"from": "system",
"value": "Use database connection instead of old-style functions\n"
},
{
"from": "human",
"value": "from django.test.utils import setup_test_environment, teardown_test_environment\nfrom django.db.backends.creation import create_test_db, destroy_test_db\nimport nose\n\ndef run... | python | chosen |
[
{
"from": "system",
"value": "Add test for device 0 v0.3.0\n"
},
{
"from": "human",
"value": "from path import path\r\nfrom nose.tools import raises\r\n\r\nfrom dmf_device import DmfDevice\r\nfrom utility import Version\r\n\r\ndef test_load_dmf_device():\r\n \"\"\"\r\n test loading DMF dev... | python | chosen |
[
{
"from": "system",
"value": "Split out the app detail lookup into function\n"
},
{
"from": "human",
"value": "\"\"\"\nparagoo plugin for retrieving card on an Android app\n\"\"\"\nimport os\nimport requests\nfrom bs4 import BeautifulSoup\n\n\nclass AppNotFoundException(Exception):\n pass\n\n... | python | chosen |
[
{
"from": "system",
"value": "Remove rate limit from do_sympa_update"
},
{
"from": "human",
"value": "from celery import task\nfrom django.conf import settings\nfrom django.core import mail\n\nimport smtplib\n\n\n@task(rate_limit=0.2)\ndef do_sympa_update(user, listname, subscribe):\n\tif subscr... | python | chosen |
[
{
"from": "system",
"value": "Metadata: Update to cihai software foundation, add github and pypi\n"
},
{
"from": "human",
"value": "__title__ = 'unihan-db'\n__package_name__ = 'unihan_db'\n__description__ = 'SQLAlchemy models for UNIHAN database'\n__version__ = '0.1.0'\n__author__ = 'Tony Narloc... | python | chosen |
[
{
"from": "system",
"value": "Use 'open' instead of 'file' (no longer available in Python 3).\n"
},
{
"from": "human",
"value": "# wwwhisper - web access control.\n# Copyright (C) 2013 Jan Wrobel <jan@mixedbit.org>\n\nimport os\n\nfrom django.utils.decorators import method_decorator\nfrom django... | python | chosen |
[
{
"from": "system",
"value": "Replace not_spam validator with not_blacklisted_nor_spam in form class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom flask_wtf import Form\nfrom wtforms import StringField, validators\n\nfrom .validation import not_spam\n\n\nclass ShortenedUrlForm... | python | chosen |
[
{
"from": "system",
"value": "[actions/attitude] Update the knowledge base according to the emotion\n"
},
{
"from": "human",
"value": "import logging; logger = logging.getLogger(\"robot.\" + __name__)\n\nfrom robots.exception import RobotError\n\nfrom robots.actions.look_at import sweep\nfrom ro... | python | chosen |
[
{
"from": "system",
"value": "Use urn from certificate to create username\n"
},
{
"from": "human",
"value": "'''\nCreated on Aug 12, 2010\n\n@author: jnaous\n'''\nimport logging\nimport re\nfrom django.contrib.auth.backends import RemoteUserBackend\nfrom django.conf import settings\nfrom expedie... | python | chosen |
[
{
"from": "system",
"value": "Fix in groups.py for get_custom_views function.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: <encoding-name> -*-\n\n'''\nCopyright 2015 Hewlett Packard Enterprise Development LP\n\nLicensed under the Apache License, Version 2.0 (the “Licen... | python | chosen |
[
{
"from": "system",
"value": "Add RunTests step for Android buildbots\n\nRequires https://codereview.appspot.com/5966078 ('Add AddRunCommandList(), a cleaner way of running multiple shell commands as a single buildbot step') to work.\nReview URL: https://codereview.appspot.com/5975072\n\ngit-svn-id: 32fc27f... | python | chosen |
[
{
"from": "system",
"value": "Allow all languages on pretix\n"
},
{
"from": "human",
"value": "from pretix.settings import * # noqa\n\nSECRET_KEY = \"{{secret_key}}\"\n\nLOGGING[\"handlers\"][\"mail_admins\"][\"include_html\"] = True # noqa\nSTATICFILES_STORAGE = (\n \"django.contrib.static... | python | chosen |
[
{
"from": "system",
"value": "Move Weapon durability hits to Attack.after()\n"
},
{
"from": "human",
"value": "\"\"\"\nBase game rules (events, etc)\n\"\"\"\nfrom .actions import Attack, Damage, Destroy, Hit\nfrom .dsl.selector import FRIENDLY_HERO, MINION, SELF\n\n\nPOISONOUS = Damage(MINION, N... | python | chosen |
[
{
"from": "system",
"value": "Remove FindStudentID from preprocessors init\n"
},
{
"from": "human",
"value": "from .headerfooter import IncludeHeaderFooter\nfrom .lockcells import LockCells\nfrom .clearsolutions import ClearSolutions\nfrom .findstudentid import FindStudentID\nfrom .saveautograde... | python | chosen |
[
{
"from": "system",
"value": "Make sure to parse OBO documents in order\n"
},
{
"from": "human",
"value": "import os\n\nimport fastobo\n\nfrom .base import BaseParser\nfrom ._fastobo import FastoboParser\n\n\nclass OboParser(FastoboParser, BaseParser):\n @classmethod\n def can_parse(cls, p... | python | chosen |
[
{
"from": "system",
"value": "Add site number and application type to properties. For better filtering of new and old biz.\n"
},
{
"from": "human",
"value": "import csv\nimport datetime\n\n\nclass Row(dict):\n\n def __init__(self, *args, **kwargs):\n super(Row, self).__init__(*args, **... | python | chosen |
[
{
"from": "system",
"value": "Update dict.items() for Python 3 compatibility\n\nIn Python 3 `items()` return iterators, and a list is never fully\nbuild. The `items()` method in Python 3 works like `viewitems()` in\nPython 2.7.\n\nFor more information see:\nhttps://docs.python.org/3/whatsnew/3.0.html#views-... | python | chosen |
[
{
"from": "system",
"value": "Make it runnable directly from cli, no python in front\n"
},
{
"from": "human",
"value": "import sys\nimport argparse\nimport os\nfrom harvester.couchdb_init import get_couchdb\nimport couchdb\nfrom harvester.couchdb_sync_db_by_collection import delete_collection\n\... | python | chosen |
[
{
"from": "system",
"value": "Remove default route for serving static files from URL map.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nGewebehaken\n~~~~~~~~~~~\n\nThe WSGI application\n\n:Copyright: 2015 `Jochen Kupperschmidt <http://homework.nwsnet.de/>`_\n:License: MIT... | python | chosen |
[
{
"from": "system",
"value": "Add in the minion module function to download files from the master\n"
},
{
"from": "human",
"value": "'''\nMinion side functions for salt-cp\n'''\nimport os\n\ndef recv(files, dest):\n '''\n Used with salt-cp, pass the files dict, and the destination\n '''... | python | chosen |
[
{
"from": "system",
"value": "Remove useless mocked unit test\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`\n'''\n# Import Python libs\nfrom __future__ import absolute_import\n\n# Import Salt Testing Libs\nfrom sa... | python | chosen |
[
{
"from": "system",
"value": "Add unit test for masking key:value of YAML\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Import python libs\nfrom __future__ import absolute_import, print_function, unicode_literals\nfrom salt.ext.six import text_type as text\n\n# Import Salt Libs... | python | chosen |
[
{
"from": "system",
"value": "Add function to get a question\n"
},
{
"from": "human",
"value": "from redis import StrictRedis\n\nclass QuizDB(StrictRedis):\n def get_all_quizzes(self):\n return self.smembers('quiz')\n"
},
{
"from": "gpt",
"value": "from redis import StrictR... | python | chosen |
[
{
"from": "system",
"value": "Convert bytes to str for assertion\n"
},
{
"from": "human",
"value": "import requests\n\n\ndef test_notifications_admin_index():\n # response = requests.request(\"GET\", \"http://localhost:6012\")\n response = requests.request(\"GET\", \"http://notifications-a... | python | chosen |
[
{
"from": "system",
"value": "Add a test for Twitter accounts with long identifier.\n"
},
{
"from": "human",
"value": "from __future__ import print_function, unicode_literals\n\nfrom gittip.elsewhere import twitter\nfrom gittip.testing import Harness\n\n\nclass TestElsewhereTwitter(Harness):\n\n... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.