conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Bugfix: Allow private excerpts (form validation)\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import gettext_lazy\n\n\nclass NewExcerptForm(forms.Form):\n new_excerpt_name = forms.CharField(label=gettext_lazy('Excerpt... | python | chosen |
[
{
"from": "system",
"value": "Update ipywidgets to expect jupyter-js-widgets 2.2.0"
},
{
"from": "human",
"value": "# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nversion_info = (6, 0, 0)\n__version__ = '.'.join(map(str, version_info))\n_... | python | chosen |
[
{
"from": "system",
"value": "Add workaround for PyPy round() bug with NumPy data types\n"
},
{
"from": "human",
"value": "\"\"\"\n``python-future``: pure Python implementation of Python 3 round().\n\"\"\"\n \ndef newround(number, ndigits=None):\n \"\"\"\n See Python 3 documentation: uses ... | python | chosen |
[
{
"from": "system",
"value": "Add this fix from the master branch\n\n(It was in the import_nc management command file, but newer\ncode places it here.)\n"
},
{
"from": "human",
"value": "DEFAULT_URL = \"https://s3-us-west-2.amazonaws.com/openpolicingdata/TS_2016_04_13T13.38.34.887.zip\" # noqa\... | python | chosen |
[
{
"from": "system",
"value": "Update script with proper git-ing.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import division, unicode_literals\n\nimport bikeshed\nimport os\nimport subprocess\n\ndef main():\n\tscriptPath = os.path.dirname(... | python | chosen |
[
{
"from": "system",
"value": "linters: Check for WARN macro with space separating it from its paren\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# A linter to warn for ASSERT macros which are separated from their argument\n# list by a space, which Clang's CPP barfs on\n\nfrom lin... | python | chosen |
[
{
"from": "system",
"value": "Handle empty YAML files in parse()\n\nRefs valohai/valohai-cli#170\n"
},
{
"from": "human",
"value": "from typing import IO, Union\n\nfrom valohai_yaml.objs import Config\n\nfrom .utils import read_yaml\n\n\ndef parse(yaml: Union[dict, list, bytes, str, IO], validat... | python | chosen |
[
{
"from": "system",
"value": "Return a list of identifiers instead of almost all info\n"
},
{
"from": "human",
"value": "from flask import Flask, abort, jsonify\nfrom flask_caching import Cache\nfrom flask_cors import CORS\n\nimport main\n\napp = Flask(__name__)\ncache = Cache(app, config={'CACH... | python | chosen |
[
{
"from": "system",
"value": "Replace T.norm in the cosine similarity\n"
},
{
"from": "human",
"value": "import theano\nimport theano.tensor as T\nimport numpy as np\n\n\ndef cosine_similarity(x, y, eps=1e-9):\n y = y.dimshuffle(1, 0)\n z = T.dot(x, y)\n z /= x.norm(2) * y.norm(2, axis=... | python | chosen |
[
{
"from": "system",
"value": "Add Login & Logout Routing\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom .views import HomePage\n\nurlpatterns = [\n url(r'^', HomePage.as_view(), name='HomePage'),\n]\n"
},
{
"from": "gpt",
"value": "from django.conf.urls ... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in Element to allow subclassing\n"
},
{
"from": "human",
"value": "\n\nclass Button(object):\n \"\"\"Button object, used for creating button messages\"\"\"\n\n def __init__(self, type=None, title=\"\", payload=\"\"):\n # Type: request param key\... | python | chosen |
[
{
"from": "system",
"value": "Comment out some hub tests, as they do not currently work\n"
},
{
"from": "human",
"value": "\"\"\"Test Moksha's Hub \"\"\"\n\nfrom nose.tools import eq_, assert_true\nfrom moksha.hub import MokshaHub\n\nclass TestHub:\n\n def setUp(self):\n self.hub = Mok... | python | chosen |
[
{
"from": "system",
"value": "Use os independent line seperator\n"
},
{
"from": "human",
"value": "import requests\nfrom os import path\n\n\nproject_gutenberg_bible_url = 'http://www.gutenberg.org/cache/epub/10/pg10.txt'\nbible_filename = 'bible.txt'\nbible_path = path.join('..', 'data', bible_f... | python | chosen |
[
{
"from": "system",
"value": "Fix relative import in appnope\n\nCloses gh-6409\n"
},
{
"from": "human",
"value": "\ntry:\n from appnope import *\nexcept ImportError:\n __version__ = '0.0.5'\n import sys\n import platform\n from distutils.version import LooseVersion as V\n\n if ... | python | chosen |
[
{
"from": "system",
"value": "Make sure vtgatev2.VTGateConnection is registered.\n"
},
{
"from": "human",
"value": "# Copyright 2012, Google Inc. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can\n# be found in the LICENSE file.\n\n# PEP 249 complient db... | python | chosen |
[
{
"from": "system",
"value": "Return result as json, not properly formatted as of yet.\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module is responsible for handling web requests using Flask. \n\nRequests are of the form (start, end) in unix time and are passed on to the db\nmanager, which t... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug where splitlines was called twice for parse_file\n"
},
{
"from": "human",
"value": "class Parser(object):\n \"\"\"Base class for all parsers to inheret with common interface\"\"\"\n\n def iterparse(self, iterator, **kwargs):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Speed up user message address formatting test\n\nThe common set-up is moved to the fixture, then the fixture's scope is\nwidened so that it is used for all test cases in the module, avoiding\nduplicate work.\n"
},
{
"from": "human",
"value": "\"\"\"\n:Copyright: 200... | python | chosen |
[
{
"from": "system",
"value": "Add optional use of requests_cache\n"
},
{
"from": "human",
"value": "import argparse\nimport logging\n\nimport yaml\n\nfrom mklocale import transifex\nfrom mklocale.cats import merge_by_language, write_catalog\nfrom mklocale.utils import listify\n\nlog = logging.ge... | python | chosen |
[
{
"from": "system",
"value": "Extend pytest's `markexpr` conf in case it already exists\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\n\ntry:\n # TODO: this file is read/executed even when called from ``readthedocsinc``,\n # so it's overriding the options that w... | python | chosen |
[
{
"from": "system",
"value": "Change import error to a warning\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''Consolidates settings from defaults.py and local.py.\n\n::\n >>> from api.base import settings\n >>> settings.API_BASE\n 'v2/'\n'''\nfrom .defaults import * # n... | python | chosen |
[
{
"from": "system",
"value": "Set develop version to 1.3.0-dev\n"
},
{
"from": "human",
"value": "__version_info__ = (1, 2, 4, None)\n\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join([str(i) for i in __version_info__[:-1]])\nif __version_info__[-1] ... | python | chosen |
[
{
"from": "system",
"value": "wni: Add qrexec-client path to WNI settings\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2\n\nfrom __future__ import absolute_import\n\nfrom qubes.storage.wni import QubesWniVmStorage\n\ndef apply(system_path, vm_files, defaults):\n system_path['qubes_base... | python | chosen |
[
{
"from": "system",
"value": "Disable pylint signature-differs in md.py\n"
},
{
"from": "human",
"value": "import os\nimport multiprocessing.util\n\n\ndef apply_workaround():\n # Implements:\n # https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57\n #\n #... | python | chosen |
[
{
"from": "system",
"value": "Switch yaml CLI argument from file to file path.\n"
},
{
"from": "human",
"value": "\"\"\"\n ydf/cli\n ~~~~~~~\n\n Defines the command-line interface.\n\"\"\"\n\nimport click\nimport sys\n\nfrom ydf import templating, yaml_ext\n\n\n@click.command('ydf')\n@c... | python | chosen |
[
{
"from": "system",
"value": "Clean up order of imports\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\nimport hashlib\n\n# Add the lib directory to the path for Lambda to load our libs\nsys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))\nimport requ... | python | chosen |
[
{
"from": "system",
"value": "Fix broken URL reverse, introduced in 933649f\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.urls import reverse\n\n\nclass SmokeTest(TestCase):\n def test_landing(self):\n url = reverse('static:open-image')\n resp ... | python | chosen |
[
{
"from": "system",
"value": "Make HttpLibHttpService compatible with Exception (no kwarg).\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom . import HttpService\nfrom . import Response\nfrom httplib import HTTPConnection\nfrom httplib import HTTPException\nfrom ht... | python | chosen |
[
{
"from": "system",
"value": "Update command docs for conda index\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport os\nfrom locale import getpreferredencoding\nfrom os.path import abspath\n\nfrom conda.compat import PY... | python | chosen |
[
{
"from": "system",
"value": "Fix some urllib3 import issues\n"
},
{
"from": "human",
"value": "\"\"\" Resolves OpenSSL issues in some servers:\n https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/\n https://github.com/kennethreitz/requests/pull/799\n\"\"\"\nfrom distutils.v... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.4.3\n\nPiperOrigin-RevId: 343898649\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | python | chosen |
[
{
"from": "system",
"value": "Remove a logging call, not needed anymore.\n"
},
{
"from": "human",
"value": "import time\nfrom contextlib import contextmanager\nimport six\nimport inspect\nimport importlib\nimport logging\n\nfrom redis.exceptions import RedisError\nfrom django_redis import get_re... | python | chosen |
[
{
"from": "system",
"value": "Refactor selection sort w/ adding comments\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef selection_sort(a_list):\n \"\"\"Selection Sort algortihm.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Use the print function for python 3 support\n"
},
{
"from": "human",
"value": "import statemachine as fsm\n\n\nclass TrafficLight(fsm.Machine):\n initial_state = 'red'\n count = 0\n\n @fsm.after_transition('red', 'green')\n def chime(self):\n prin... | python | chosen |
[
{
"from": "system",
"value": "Add starting position to the list of visited locations\n"
},
{
"from": "human",
"value": "x = y = direction = 0\nmoves = open('input.txt', 'r').readline().strip().split(', ')\nvisited = set()\n\nfor move in moves:\n\tif move[0] == 'L':\n\t\tif direction == 0:\n\t\t\... | python | chosen |
[
{
"from": "system",
"value": "Remove check for pyOpenSSL as it is only needed in pegasus-service to use ssl certs.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport sys\n\nif not sys.version_info >= (3, 5):\n sys.stderr.write('Pegasus requires Python 3.5 or above\\n')\n sys.e... | python | chosen |
[
{
"from": "system",
"value": "Create database if it doesn't exist\n"
},
{
"from": "human",
"value": "from behave import given, when, then\nfrom mock import patch, call\nfrom tinkerforge.ip_connection import IPConnection\nfrom pytoon.models import Electricity, db\n\nfrom pytoon.connection import ... | python | chosen |
[
{
"from": "system",
"value": "Fix region factory to reflect region model\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nimport factory\nimport random\n\nfrom .models import Location, Region\n\n\nclass RegionFactory(factory.Factory):\n FACTORY_FOR = Region\n\n name = factory.Sequence... | python | chosen |
[
{
"from": "system",
"value": "Fix travis by removing abc metaclass.\n"
},
{
"from": "human",
"value": "import abc\n\nimport sublime\nimport sublime_plugin\n\nfrom ..helpers import is_js_source\n\n\nclass BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):\n \"\"\"Common properties... | python | chosen |
[
{
"from": "system",
"value": "Add configuration keys to allow turning on/off easy access to openid servers"
},
{
"from": "human",
"value": "SECRET_KEY = 'changeme please'\n\n# TODO -- May I set this to true?\nFAS_OPENID_CHECK_CERT = False\n\n#ADMIN_GROUPS = ['sysadmin-web']\n\nFMN_FEDORA_OPENID ... | python | chosen |
[
{
"from": "system",
"value": "Fix the handler for the log level\n"
},
{
"from": "human",
"value": "import logging\nfrom configs import EnjoliverConfig\n\nformatter = logging.Formatter('\\r%(levelname)-7s %(module)-13s %(funcName)s %(message)s')\n\nconsoleHandler = logging.StreamHandler()\nconsol... | python | chosen |
[
{
"from": "system",
"value": "Backup / restore original appslist to handle backward case properly\n"
},
{
"from": "human",
"value": "from moulinette.utils.log import getActionLogger\nfrom yunohost.app import app_fetchlist, app_removelist, _read_appslist_list\nfrom yunohost.tools import Migration... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in getting superclass of AutoID"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\nimport datetime as dt\nfrom sqlalchemy.types import DateTime\nfrom sqlalchemy.ext.declarative import declared_a... | python | chosen |
[
{
"from": "system",
"value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.... | python | chosen |
[
{
"from": "system",
"value": "Fix management command for submitted exercises\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 *-*\n\n# This file is part of wger Workout Manager.\n#\n# wger Workout Manager is free software: you can redistribute it and/or modify\n# it under the terms of the ... | python | chosen |
[
{
"from": "system",
"value": "Add test examples to assert against exceptions\n"
},
{
"from": "human",
"value": "from unittest import TestCase\nfrom mock import NonCallableMock, patch\n\nfrom modules.web_caller import get_google, GOOGLE_URL\n\n\nclass TestWebCaller(TestCase):\n \"\"\"\n Tes... | python | chosen |
[
{
"from": "system",
"value": "Update tests for molecule 3 compatibility\n"
},
{
"from": "human",
"value": "import pytest\nimport os\nimport shutil\nfrom subprocess import call\nfrom cookiecutter.main import cookiecutter\n\n\nplaybook_setup_commands = ['pip install -r https://raw.githubuserconten... | python | chosen |
[
{
"from": "system",
"value": "FIX import of RuleConnectable instead of RuleChainable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 16.08.2017 19:28\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom .RuleChainable import RuleConnectable\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 1.2\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name = 'fancypants',\n version = '1.1',\n py_modules = ['fancypants'],\n url = 'http://netcetera.org/',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix blockquote missing from markdown filter\n"
},
{
"from": "human",
"value": "from django import template\nimport markdown as md\nimport bleach\n\nregister = template.Library()\n\ndef markdown(value):\n \"\"\"convert to markdown\"\"\"\n return md.markdown(ble... | python | chosen |
[
{
"from": "system",
"value": "Make Ignores try to find '.mnignore'\n\nIf it doesn't find it, that's okay, and no action is required.\n"
},
{
"from": "human",
"value": "import os\nfrom fnmatch import fnmatchcase\nimport click\n\nclass Ignores(object):\n @classmethod\n def read(cls, path):\n... | python | chosen |
[
{
"from": "system",
"value": "Add proper printing for py2\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"pikalang module.\n\nA brainfuck derivative based off the vocabulary of Pikachu from Pokemon.\n\nCopyright (c) 2019 Blake Grotewold\n\"\"\"\n\nimport ... | python | chosen |
[
{
"from": "system",
"value": "TST: Test properly, including the dtype.\n"
},
{
"from": "human",
"value": "\nfrom dipy.io.utils import decfa\nfrom nibabel import Nifti1Image\nimport numpy as np\n\ndef test_decfa():\n data_orig = np.zeros((4, 4, 4, 3))\n data_orig[0, 0, 0] = np.array([1, 0, ... | python | chosen |
[
{
"from": "system",
"value": "Enable the keras dtensor API in OSS.\n\nPiperOrigin-RevId: 438858608\n"
},
{
"from": "human",
"value": "# Copyright 2022 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file... | python | chosen |
[
{
"from": "system",
"value": "Handle both possible JSON formats for data bag items.\n\nThis won't work if there is an actual data bag\nitem key called 'json_class', but that would be silly."
},
{
"from": "human",
"value": "import abc\nimport collections\n\nfrom chef.base import ChefObject, ChefQ... | python | chosen |
[
{
"from": "system",
"value": "Test commit (removed extra blank line)\n\ngit-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@98988 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "from TestFormats import GoogleTest, ShTest, TclTest\nfrom TestFormats import SyntaxCheckTest,... | python | chosen |
[
{
"from": "system",
"value": "Add ProtectedFile, ProtectedImage, AdminFile and AdminImage.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.contenttypes.admin import GenericTabularInline\nfrom .models import (Location, Permanence, Equipment, Lending, Posit... | python | chosen |
[
{
"from": "system",
"value": "Move serializer into the class so it can be subclassed."
},
{
"from": "human",
"value": "import cPickle as pickle\nimport logging\nimport time\n\nser = logging.getLogger('testserializer')\n\nclass Serializer(object):\n \"\"\"A pluggable Serializer class\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Move news urlpatterns to Django 2.0 preferred method\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom . import views\n\napp_name = 'news'\nurlpatterns = [\n url(r'^$', views.IndexView.as_view(), name='index'),\n url(r'^(?P<year>\\d{4... | python | chosen |
[
{
"from": "system",
"value": "Define returns all entries for given query.\n"
},
{
"from": "human",
"value": "import json\nimport random\n\nclass Noah(object):\n def __init__(self, dictionary_file):\n self.dictionary = json.load(dictionary_file)\n\n def list(self):\n return '\... | python | chosen |
[
{
"from": "system",
"value": "Update test script to use a provided start time\n"
},
{
"from": "human",
"value": "import os\nimport tempfile\nfrom Chandra.Time import DateTime\nfrom Ska.Shell import bash\nimport mica.common\n\n# Override MICA_ARCHIVE with a temporary directory\nTESTDIR = tempfile... | python | chosen |
[
{
"from": "system",
"value": "Remove unwanted dependency to 'packaging'"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom packaging.version import Version\nimport django\n\n# Set default_app_config only with Django up to 3.1. This prevents a Warning on newer releases\n# See https://docs.dja... | python | chosen |
[
{
"from": "system",
"value": "Add stats for each partition.\n"
},
{
"from": "human",
"value": "import urllib2\nimport json\nimport sys\nfrom statsd import statsd\n\nstatsd.connect('localhost', 8125)\n\ntopology = sys.argv[1]\n\nstate = urllib2.urlopen(\n \"http://localhost:9000/api/status?top... | python | chosen |
[
{
"from": "system",
"value": "Make it easier to clean up tests by closing db sessions\n\nAlso added a convenience test base class\n"
},
{
"from": "human",
"value": "import gc\nimport sys\nPYPY = hasattr(sys, 'pypy_version_info')\n\nfrom .. import pg_connection\n\nclass DBSetup(object):\n\n ma... | python | chosen |
[
{
"from": "system",
"value": "Add a comment for my print hack\n"
},
{
"from": "human",
"value": "from pylua.objspace import ObjectSpace\nfrom pylua.luaframe import LuaBuiltinFrame, SReturnValue\nfrom pylua.helpers import debug_print\nfrom pylua.bytecode import Constant\n\ndef m_print(arg):\n ... | python | chosen |
[
{
"from": "system",
"value": "Convert tabs to spaces, and set up vim modeline to expand tabs going forward.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n\"\"\"dwalk: walk a directory tree, printing entries hierarchically\n + top\n | > file\n | > file\n | + dir\n | | > f... | python | chosen |
[
{
"from": "system",
"value": "Include a NullHandler to avoid logging warnings\n"
},
{
"from": "human",
"value": "\"\"\"\nRejected is a Python RabbitMQ Consumer Framework and Controller Daemon\n\n\"\"\"\n__author__ = 'Gavin M. Roy <gavinmroy@gmail.com>'\n__since__ = \"2009-09-10\"\n__version__ = ... | python | chosen |
[
{
"from": "system",
"value": "Update to new log location\n"
},
{
"from": "human",
"value": "######################################################\n# logs time, fahrenheit and humidity every 5 minutes\n#\n######################################################\n\nimport time\nimport HTU21DF\nimpo... | python | chosen |
[
{
"from": "system",
"value": "Set CORS header for add-on search API\n"
},
{
"from": "human",
"value": "from rest_framework import generics, serializers\nfrom rest_framework.response import Response\n\nfrom waffle.decorators import waffle_switch\n\nimport amo\nfrom addons.models import Addon\n\n\... | python | chosen |
[
{
"from": "system",
"value": "UPdate to duolingo for the API\n"
},
{
"from": "human",
"value": "def process_single_user(username, password):\n try:\n lingo = duolingo.Duolingo(username, password)\n except ValueError:\n raise Exception(\"Username Invalid\")\n\n print(\"Tryi... | python | chosen |
[
{
"from": "system",
"value": "Test unit test constructor and destructor\n"
},
{
"from": "human",
"value": "#/usr/bin/env python\nimport unittest\nfrom my_calc import my_add\nclass test_func(unittest.TestCase):\n def test_my_add(self):\n res = my_add(1, 2)\n self.assertEqual(res,... | python | chosen |
[
{
"from": "system",
"value": "Add test tasks to the celery includes.\n"
},
{
"from": "human",
"value": "import os\nimport raven\n\nfrom celery import Celery, Task\nfrom classtools import reify\nfrom redis import StrictRedis\nfrom raven.contrib.celery import register_signal, register_logger_signa... | python | chosen |
[
{
"from": "system",
"value": "Add ImportError to exception instead of bare \"except\"\n\nFixes lint error on develop.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nTest the core grains\n'''\n\n# Import python libs\nfrom __future__ import absolute_import\n\n# Import Salt Testin... | python | chosen |
[
{
"from": "system",
"value": "Make test case base compatible with Python 3\n"
},
{
"from": "human",
"value": "\n'''\nPEXPECT LICENSE\n\n This license is approved by the OSI and FSF as GPL-compatible.\n http://opensource.org/licenses/isc-license.txt\n\n Copyright (c) 2012, Noah Spurr... | python | chosen |
[
{
"from": "system",
"value": "Update the documentation link for doc migration\n\nThis patch is proposed according to the Direction 10 of doc\nmigration(https://etherpad.openstack.org/p/doc-migration-tracking).\n\nChange-Id: I62ae28d10f70d63ba693ac0ab6581faf85f1bf6e\n"
},
{
"from": "human",
"valu... | python | chosen |
[
{
"from": "system",
"value": "Modify get_logger to set level and formatter, add get_driver method.\n"
},
{
"from": "human",
"value": "import logging\n\n__all__ = [\n 'get_logger'\n]\n\ndef get_logger(name):\n logger = logging.getLogger(name)\n # TODO: set level, add handler\n return ... | python | chosen |
[
{
"from": "system",
"value": "Update the equality test for database files\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2015--, micronota development team.\n#\n# Distributed under the te... | python | chosen |
[
{
"from": "system",
"value": "Add filter for rejecting practice topic\n"
},
{
"from": "human",
"value": "class Filterable:\n no_delays_filter = lambda filterable: filterable.condition.record_id == str(6)\n query_delay_filter = lambda filterable: filterable.condition.record_id == str(7)\n docu... | python | chosen |
[
{
"from": "system",
"value": "Print statement was breaking python 3 builds"
},
{
"from": "human",
"value": "import nose\nfrom nose.tools import raises\nimport dpath.path\nimport dpath.exceptions\nimport dpath.options\n\n@raises(dpath.exceptions.InvalidKeyName)\ndef test_path_paths_invalid_keynam... | python | chosen |
[
{
"from": "system",
"value": "Sort the final table by keplerid\n"
},
{
"from": "human",
"value": "\"\"\"Creates an SQLite database detailing all the K2 target pixel files.\n\nTODO\n----\n* Sort the final table by EPIC ID.\n* Add an index to the sqlite table?\n\"\"\"\nimport glob\nimport logging\... | python | chosen |
[
{
"from": "system",
"value": "Add more tests to logic test\n"
},
{
"from": "human",
"value": "\nimport testify as T\n\nfrom git_code_debt.create_tables import get_metric_ids\nfrom git_code_debt.discovery import get_metric_parsers\nfrom git_code_debt.logic import get_metric_mapping\nfrom testing.... | python | chosen |
[
{
"from": "system",
"value": "Update release version to 0.5.2\n"
},
{
"from": "human",
"value": "\"\"\"\nChatterBot is a machine learning, conversational dialog engine.\n\"\"\"\nfrom .chatterbot import ChatBot\n\n__version__ = '0.5.1'\n__author__ = 'Gunther Cox'\n__email__ = 'gunthercx@gmail.com... | python | chosen |
[
{
"from": "system",
"value": "Increase repeater post timeout to 75 seconds\n\n99DOTS responses sometimes take ~60s to process, which leads us to mark those\nrecords as failed\n"
},
{
"from": "human",
"value": "from datetime import timedelta\n\n\nMAX_RETRY_WAIT = timedelta(days=7)\nMIN_RETRY_WAIT... | python | chosen |
[
{
"from": "system",
"value": "Add gender to Customer model.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom ..base import Resource\n\n\nclass Customer(Resource):\n _resource_name = 'customers'\n _is_listable = False\n _is_parent_resource = True\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for _get_docker_env\n"
},
{
"from": "human",
"value": "import os\nimport tempfile\nimport shutil\n\nfrom unittest import TestCase\nimport yaml\n\nfrom dusty import constants\nfrom dusty.runner.compose import _write_composefile\n\nclass TestComposeRunner(T... | python | chosen |
[
{
"from": "system",
"value": "Fix URLs for login/logout, and password changes.\n"
},
{
"from": "human",
"value": "import django.contrib.auth.views as auth_views\nfrom django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.conf.urls.static import static\nfrom django.c... | python | chosen |
[
{
"from": "system",
"value": "Add test cases for parse modue\n"
},
{
"from": "human",
"value": "from hypothesis_auto import auto_pytest_magic\n\nfrom isort import parse\n\nauto_pytest_magic(parse.import_comment)\n"
},
{
"from": "gpt",
"value": "from hypothesis_auto import auto_pytest... | python | chosen |
[
{
"from": "system",
"value": "Add basic tests for ttfmt get_vars method"
},
{
"from": "human",
"value": "import unittest\r\n\r\nclass TestTtFmt(unittest.TestCase):\r\n\r\n def testName(self):\r\n pass\r\n\r\nif __name__ == \"__main__\":\r\n unittest.main()"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "system",
"value": "Create autostart folder for tests\n"
},
{
"from": "human",
"value": "import os\nfrom unittest import TestCase\n\nimport requests\n\nfrom furikura import utils\n\n\ndef test_request():\n requests.get('https://example.com')\n\nclass TestUtils(TestCase):\n def te... | python | chosen |
[
{
"from": "system",
"value": "Allow user to input url\n\nAllows the user to input a URL which will then be retrieved"
},
{
"from": "human",
"value": "print 'This script will be used to get the page and information from tiwtter'\n"
},
{
"from": "gpt",
"value": "import urllib2\n\nprint... | python | chosen |
[
{
"from": "system",
"value": "Add credentials + read webhook_url from notifier arguments\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport pika\nimport json\nimport requests\n\nSLACK_WEBHOOK_URL = os.environ[\"SLACK_WEBHOOK_URL\"]\nRABBIT_MQ_SERVER = os.environ[\"RABBIT_MQ_SERVER\... | python | chosen |
[
{
"from": "system",
"value": "Fix bug that returned a zip object instead of list\n"
},
{
"from": "human",
"value": "from . import chunktagger, lemmatizer, postagger, stemmer, tokenizer\n\n\nclass Summarizer(object):\n def __init__(self, text):\n self.text = text\n\n def execute(self... | python | chosen |
[
{
"from": "system",
"value": "Add is_staff to user serializer\n"
},
{
"from": "human",
"value": "#from phonenumber_field.serializerfields import PhoneNumberField\nfrom rest_framework import serializers\nfrom drf_extra_fields.geo_fields import PointField\n\nfrom .models import User\n\n\nclass Use... | python | chosen |
[
{
"from": "system",
"value": "Set vv cron script to use Agg backend\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport mica.vv\nmica.vv.update()\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport mica.vv\nmica.vv... | python | chosen |
[
{
"from": "system",
"value": "DOC: Add line break to connect scatter plot doc string\n"
},
{
"from": "human",
"value": "\"\"\"\nConnected Scatterplot (Lines with Custom Paths)\n-----------------------------------------------\n\nThis example show how the order encoding can be used to draw a custo... | python | chosen |
[
{
"from": "system",
"value": "Handle namespacing properly so pylons imports without errors.\n\n--HG--\nbranch : trunk\n"
},
{
"from": "human",
"value": "\"\"\"Base objects to be exported for use in Controllers\"\"\"\nfrom paste.registry import StackedObjectProxy\n\nfrom pylons.configuration impo... | python | chosen |
[
{
"from": "system",
"value": "Remove line numbers from recipe code\n\nThe larger font made the numbers not match the code.\nAdded better link text to download the recipe.\n"
},
{
"from": "human",
"value": "\"\"\"\nGenerate the rst files for the cookbook from the recipes.\n\"\"\"\nimport sys\nimp... | python | chosen |
[
{
"from": "system",
"value": "Make client key checking actually work.\n"
},
{
"from": "human",
"value": "from locksmith.common import apicall\n\ntry:\n from django.conf import settings\n SIGNING_KEY = settings.LOCKSMITH_SIGNING_KEY,\n API_NAME = settings.LOCKSMITH_API_NAME\n ENDPOINT... | python | chosen |
[
{
"from": "system",
"value": "Remove unused AttributeMeta type constants\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\n\nfrom malcolm.core.serializable import Serializable\n\n\nclass AttributeMeta(Serializable):\n \"\"\"Abstract base class for Meta objects\"\"\"\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix setting reference for FLATMENU_MENU_ICON\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.conf import settings\n\nACTIVE_CLASS = getattr(\n\tsettings, 'WAGTAILMENUS_ACTIVE_CLASS', 'active')\n\nACTIVE_ANCESTOR_CLASS = getattr(\n\tsettings, ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.