conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update AsynchronousAction default values of min_workers to 0 and max_seconds_idle to 60\n"
},
{
"from": "human",
"value": "from bot.action.core.action import IntermediateAction\nfrom bot.multithreading.work import Work\n\n\nclass AsynchronousAction(IntermediateActio... | python | chosen |
[
{
"from": "system",
"value": "Remove mandatory dependency on twisted\n"
},
{
"from": "human",
"value": "from uplink.clients.io.interfaces import (\n Client,\n Executable,\n IOStrategy,\n RequestTemplate,\n)\nfrom uplink.clients.io.execution import RequestExecutionBuilder\nfrom uplink... | python | chosen |
[
{
"from": "system",
"value": "Add template field to SimpleMarkdownPlugin model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom cms.models.pluginmodel import CMSPlugin\n\n\nclass SimpleMarkdownPlugin(CMSPlugin):\n m... | python | chosen |
[
{
"from": "system",
"value": "Fix metric dimensions having only key\n\nWhen metric dimensions have only key, query parameter will be ending with\n':' delimiter. But api can not handle this query parameter.\nSo change to eliminate ':' delimiter when metric dimensions have only key.\n\nChange-Id: I1327f8fe641... | python | chosen |
[
{
"from": "system",
"value": "Add comment about button name on google example\n"
},
{
"from": "human",
"value": "import re\nimport mechanicalsoup\n\n# Connect to Google\nbrowser = mechanicalsoup.StatefulBrowser()\nbrowser.open(\"https://www.google.com/\")\n\n# Fill-in the form\nbrowser.select_fo... | python | chosen |
[
{
"from": "system",
"value": "Fix hello world example broken imports\n"
},
{
"from": "human",
"value": "# -----------------------------------------------------------------------------\n# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.\n# Distributed under the (new) BSD License.\... | python | chosen |
[
{
"from": "system",
"value": "Add method to create a database session in the internal library\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n'''\nInternal library for the fresque application.\n\nThis module and all its files contains all the operations independant of the\nframewor... | python | chosen |
[
{
"from": "system",
"value": "Add decorator for saving plts\n"
},
{
"from": "human",
"value": "\"\"\"Utility functions for NeuroDSP plots.\"\"\"\n\nimport matplotlib.pyplot as plt\n\n###################################################################################################\n############... | python | chosen |
[
{
"from": "system",
"value": "Set up the factory for the default route\n"
},
{
"from": "human",
"value": "import logging\nlog = logging.getLogger(__name__)\n\nfrom pyramid.config import Configurator\nfrom sqlalchemy import engine_from_config\n\nfrom .models import DBSession\n\nrequired_settings ... | python | chosen |
[
{
"from": "system",
"value": "Add trailing slash to chrome_proxy telemetry test page URL.\n\nBUG=507797\n\nReview URL: https://codereview.chromium.org/1229563002\n\nCr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#337895}\n"
},
{
"from": "human",
"value": "# Copyright 2014 The Chro... | python | chosen |
[
{
"from": "system",
"value": "Refactor uploader tests to use the fixture module.\n"
},
{
"from": "human",
"value": "\"\"\"Tests for the uploader module\"\"\"\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import a... | python | chosen |
[
{
"from": "system",
"value": "Make sure to use the same version of chef as the vagrant\n"
},
{
"from": "human",
"value": "from fabric.api import env, local, run, sudo\nenv.user = 'root'\n#env.hosts = ['204.232.205.6']\n\nenv.code_dir = '/home/docs/sites/readthedocs.org/checkouts/readthedocs.org'... | python | chosen |
[
{
"from": "system",
"value": "Add default encoding parameter to configure subcommand\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __fu... | python | chosen |
[
{
"from": "system",
"value": "Fix traceback being emitted when updating a proxy-mode rus (RCE-2260)\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# Copyright (c) SAS Institute Inc.\n#\n\nimport sys\nimport os\nimport pwd\nfrom conary.server import schema\nfrom conary.lib import cfgtyp... | python | chosen |
[
{
"from": "system",
"value": "Add surrogate compdb package, linking to signac.\n\nProvided to guarantee compatibility.\nPrints warning on import.\n"
},
{
"from": "human",
"value": "import warnings\n\nfrom signac import *\n\nmsg = \"compdb was renamed to signac. Please import signac in the future... | python | chosen |
[
{
"from": "system",
"value": "Fix engine extension names for jyulb and openfoam\n"
},
{
"from": "human",
"value": "import unittest\nimport os\n\nfrom stevedore.extension import ExtensionManager\n\nENGINES = [\n 'lammps',\n 'openfoam',\n 'kratos',\n 'jyulb']\n\nif os.getenv(\"HAVE_NUM... | python | chosen |
[
{
"from": "system",
"value": "Allow a bunch of different combinations of password.\n\nSigned-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>\n"
},
{
"from": "human",
"value": "from django.contrib.auth.backends import ModelBackend\n\nfrom .models import Email\n\nclass Lib... | python | chosen |
[
{
"from": "system",
"value": "Add unit testing of dates and fetch functions\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport unittest\nimport pandas as pd\n\nfrom fetch_trends import fetch_hourly_data\n\n\nclass TestFetch(unittest.TestCase):\n\n def test_fetch_type(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Load steps (CommandLineTools) from new directory\n\nThis also required changes to scriptcwl; scriptcwl now checks whether\na cwl-file contains a CommandLineTool or a Workflow. If it contains a\nWorkflow, an empty step is added to the steps library. This needs to\nbe fixed.\n"
... | python | chosen |
[
{
"from": "system",
"value": "Bump version: 0.1.2 → 0.1.3\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*\n\"\"\"\n`grappa_http` provides HTTP protocol assertion for `grappa` testing library.\n\nExample::\n\n import grappa\n import grappa_http\n\n # Register plugin\n grappa... | python | chosen |
[
{
"from": "system",
"value": "TST: Update import location of TestPluginBase\n"
},
{
"from": "human",
"value": "# ----------------------------------------------------------------------------\n# Copyright (c) 2016--, Ben Kaehler\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# ... | python | chosen |
[
{
"from": "system",
"value": "Mark strings in AuthTokenSerializer as translatable\n"
},
{
"from": "human",
"value": "from django.contrib.auth import authenticate\nfrom rest_framework import serializers\n\n\nclass AuthTokenSerializer(serializers.Serializer):\n username = serializers.CharField(... | python | chosen |
[
{
"from": "system",
"value": "test: Add ability to test requests\n\nDisable CSRF and set the SECRET_KEY in tests so that it's possible to\nwrite HTTP based tests.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom controller import c3bottles, db\nfrom view.user import User\n\n\nNAME = 'u... | python | chosen |
[
{
"from": "system",
"value": "Fix some test breakages with Hypothesis.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\nimport os\nimport json\nimport sys\n\nif sys.version_info[0] == 2:\n from codecs import open\n\n# This pair of generator expressions are pretty lam... | python | chosen |
[
{
"from": "system",
"value": "test: Print \"still alive\" progress when testing on travis\n"
},
{
"from": "human",
"value": "import pytest\n\n\ndef pytest_addoption(parser):\n parser.addoption(\"--travis\", action=\"store_true\", default=False,\n help=\"Only run tests mark... | python | chosen |
[
{
"from": "system",
"value": "Use %z directive in parse_datetime\n\n"
},
{
"from": "human",
"value": "# Tweepy\n# Copyright 2010-2022 Joshua Roesslein\n# See LICENSE for details.\n\nimport datetime\n\n\ndef list_to_csv(item_list):\n if item_list:\n return ','.join(map(str, item_list))\... | python | chosen |
[
{
"from": "system",
"value": "Use in memory test database\n"
},
{
"from": "human",
"value": "import django\n\nfrom os import path\n\n\nSECRET_KEY = 'not secret'\nINSTALLED_APPS = ('dumper', 'test', 'django.contrib.contenttypes')\nTEMPLATE_DEBUG = DEBUG = True\nDATABASES = {\n 'default': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Replace http by https in demo\n"
},
{
"from": "human",
"value": "# This configuration has been configured for this demo, not all\n# normal sigal settings have an effect in this theme.\n\n# ---------------------\n# General configuration\n# ---------------------\n\nso... | python | chosen |
[
{
"from": "system",
"value": "Enable timezone support in tests.\n"
},
{
"from": "human",
"value": "DATABASES = {\n 'default' : {\n 'ENGINE': 'django.db.backends.sqlite3'\n }\n}\n\nINSTALLED_APPS = (\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.con... | python | chosen |
[
{
"from": "system",
"value": "Update docstring and remove unused code from UI blueprint.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"The OCSPdash homepage UI blueprint.\"\"\"\n\nfrom flask import Blueprint, render_template\n\nfrom ocspdash.web.proxies import manager\n\n__... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding of email content\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nimport smtplib\nfrom email.mime.text import MIMEText\nfrom django.conf import settings\n\n\ndef send_text(sender, receiver, subject, body):\n msg = MIMEText(body, _chars... | python | chosen |
[
{
"from": "system",
"value": "Modify buy and sell interface to take market tuples\n"
},
{
"from": "human",
"value": "class Exchange(object):\n def get_markets(self):\n \"\"\"\n Returns a list of tuples of the form ('XXX', 'YYY') representing the \n available markets on th... | python | chosen |
[
{
"from": "system",
"value": "Fix region resolve on non Integer\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom api.region import views\n\n\nurlpatterns = patterns(\n '',\n url(r'^$', views.RegionList.as_view(), name='region-list'),\n url(\n r'... | python | chosen |
[
{
"from": "system",
"value": "Disable test that fails on bot\n\nI will look at it.\nrdar://35264910\n"
},
{
"from": "human",
"value": "# TestPOUnwrapping.py\n#\n# This source file is part of the Swift.org open source project\n#\n# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project author... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings in Enterprise class\n"
},
{
"from": "human",
"value": "from .base import AuthenticationBase\n\n\nclass Enterprise(AuthenticationBase):\n\n def __init__(self, domain):\n self.domain = domain\n\n def saml_metadata(self, client_id):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add named format support if dict\n"
},
{
"from": "human",
"value": "from django import template\nregister=template.Library()\n\n@register.filter\ndef stringformat(value, fmt='{}'):\n '''\n format the value\n '''\n return fmt.format(value)\n"
},
{
"fr... | python | chosen |
[
{
"from": "system",
"value": "Fix ci build by adjust static root and media root path\n"
},
{
"from": "human",
"value": "from .base import * # noqa\n\n\nSECRET_KEY = 'test'\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': base_dir_join('db.sqli... | python | chosen |
[
{
"from": "system",
"value": "Simplify creation of MetaData in SQLBackend\n\nSquash a few lines into one.\n"
},
{
"from": "human",
"value": "from sqlalchemy import MetaData, Table, Column, types, create_engine, select\n\nfrom .base import BaseBackend\n\n\nclass SQLBackend(BaseBackend):\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Allow entry of usernames in email field.\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.auth import authenticate\nfrom django.contrib.auth.forms import AuthenticationForm as Form\nfrom django.utils.translation import ugettext_lazy a... | python | chosen |
[
{
"from": "system",
"value": "Update scrape fish to handle different size url sets and to specify to google that we want fish\n"
},
{
"from": "human",
"value": "import pandas as pd\nfrom subprocess import check_output\nimport sys\n\nfish_df = pd.read_csv(sys.argv[1],names=['fish'])\n\nurl_dict =... | python | chosen |
[
{
"from": "system",
"value": "Set 4s timeout for img client\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n This example demonstrates a client fetching images from a server running img_server.py.\n\n The first packet contains the number of chunks to expect, and then that... | python | chosen |
[
{
"from": "system",
"value": "Change to support new binding model\n"
},
{
"from": "human",
"value": "import pyxb.binding.generate\nimport pyxb.utils.domutils\nfrom xml.dom import Node\n\nimport os.path\nschema_path = '%s/../schemas/test-facets.xsd' % (os.path.dirname(__file__),)\ncode = pyxb.bin... | python | chosen |
[
{
"from": "system",
"value": "Allow user to choose what to run in amaranth.ml\n\nChoose between the executables for training the model or interacting\nwith the model.\n"
},
{
"from": "human",
"value": "# Lint as: python3\n\"\"\"This script is used to run the amaranth.ml module as an executable.\... | python | chosen |
[
{
"from": "system",
"value": "Complete factorial_recur(), factorial_memo() & factorial_dp() from Hokaido\n"
},
{
"from": "human",
"value": "\"\"\"Factorial series:\n\n1!, 2!, 3!, ...\n\n- Factorial(1) = 1! = 1\n- Factorial(2) = 2! = 2\n- Factorial(n) = n! = n * (n - 1)! = n * Factorial(n - 1)\n\... | python | chosen |
[
{
"from": "system",
"value": "Use StringIO.StringIO instead of the io.StringIO.\n\nThe io library is new to Python 2.6, we still support 2.5. And the doc for\nthe io library encourages us to continue to use StringIO.StringIO:\n\nhttp://docs.python.org/whatsnew/2.6.html#pep-3116-new-i-o-library\n\ngit-svn-i... | python | chosen |
[
{
"from": "system",
"value": "Include quick sample for water level identification\n"
},
{
"from": "human",
"value": "'''\nCreated on Aug 1, 2017\n\n@author: alkaitz\n'''\n\nif __name__ == '__main__':\n pass"
},
{
"from": "gpt",
"value": "'''\nCreated on Aug 1, 2017\n\n@author: alk... | python | chosen |
[
{
"from": "system",
"value": "Fix URLs so APPEND_SLASH works\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n # eg: /footballseason/\n url(r'^$', views.index, name='index'),\n\n # eg: /footballseason/3\n url(r'^(?P<week_i... | python | chosen |
[
{
"from": "system",
"value": "Add a one-liner about module functionality and tidy double quotes\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\n\n__version__ = \"0.0.1.1\"\n__author__ = \"Fyndiq\"\n__license__ = \"MIT\"\n__copyright__ = \"Copyright 2016 Fyndiq AB\"\n"... | python | chosen |
[
{
"from": "system",
"value": "Add option to print only last step of iteration.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom argparse import ArgumentParser\nfrom itertools import groupby\n\n\ndef iterate(n):\n result = 0\n digits = [int(i) for i in str(n)]\n for k, g... | python | chosen |
[
{
"from": "system",
"value": "Add a skip_publish flag to the deploy task.\n"
},
{
"from": "human",
"value": "\"\"\"Django project fabfile.\"\"\"\n\nimport os\nfrom fabric.api import puts, task\nfrom fabric.utils import indent\n\nfrom deploy import deploy_to_heroku, prepare_to_deploy, tag_project... | python | chosen |
[
{
"from": "system",
"value": "Add FileListing to objects we export\n"
},
{
"from": "human",
"value": "import os\nfrom .core import LogFileOutput, Mapper, IniConfigFile, LegacyItemAccess # noqa: F401\nfrom .core.plugins import mapper, reducer, make_response, make_metadata # noqa: F401\nfrom .ma... | python | chosen |
[
{
"from": "system",
"value": "Set variable to future default\n\nDeprecation warning was:\n\n RemovedInDjango19Warning: Default value of 'RedirectView.permanent' will\n change from True to False in Django 1.9. Set an explicit value to\n silence this warning.\n"
},
{
"from": "human",
"val... | python | chosen |
[
{
"from": "system",
"value": "Remove whitespace from name when checking for bye\n"
},
{
"from": "human",
"value": "from django.core.exceptions import ValidationError\nfrom django.template.defaultfilters import slugify\nimport re\n\nNAME_REGULAR_EXPRESSION = re.compile(r'^[a-zA-Z0-9]+[\\w\\-\\.: ... | python | chosen |
[
{
"from": "system",
"value": "Migrate to new Storage API\n\nfor Django 1.8\n"
},
{
"from": "human",
"value": "\"\"\"\nA storage implementation that overwrites exiting files in the storage\n\nSee \"Writing a custom storage system\"\n(https://docs.djangoproject.com/en/1.3/howto/custom-file-storage... | python | chosen |
[
{
"from": "system",
"value": "Update default PR sandbox subdomain to not overlap existing sandboxes\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n#\n# Copyright (c) 2015, OpenCraft\n#\n\n# Imports #####################################################################\n\nfrom huey.... | python | chosen |
[
{
"from": "system",
"value": "Return a response for the membership webhook.\n"
},
{
"from": "human",
"value": "from flask.ext.hookserver import Hooks\n\nfrom .models import db, User\n\n\nhooks = Hooks()\n\n\n@hooks.hook('ping')\ndef ping(data, guid):\n return 'pong'\n\n\n@hooks.hook('membersh... | python | chosen |
[
{
"from": "system",
"value": "Use right command to select teams\n"
},
{
"from": "human",
"value": "from gather.organiser import NotEnoughPlayersError\n\n\ndef strip_help(bot):\n messages = []\n\n for regex, action in bot.actions.values():\n if action.__doc__:\n messages.a... | python | chosen |
[
{
"from": "system",
"value": "Add check to verify if model is in config callback state.\n"
},
{
"from": "human",
"value": "import importlib\nimport logging\nfrom volttron.platform.agent import utils\n\n_log = logging.getLogger(__name__)\nutils.setup_logging()\n__version__ = \"0.1\"\n\n__all__ = ... | python | chosen |
[
{
"from": "system",
"value": "Remove test that can't be fulfilled\n"
},
{
"from": "human",
"value": "from pyxform.tests_v1.pyxform_test_case import PyxformTestCase\n\nclass WhitespaceTest(PyxformTestCase):\n def test_over_trim(self):\n self.assertPyxformXform(\n name='issue9... | python | chosen |
[
{
"from": "system",
"value": "Use `gevent.signal_handler` not `gevent.signal` (gevent1.5).\n"
},
{
"from": "human",
"value": "import os\nimport signal\nimport sys\n\nimport click\nimport gevent\n\nimport pyinfra\n\nfrom .legacy import run_main_with_legacy_arguments\nfrom .main import cli, main\n... | python | chosen |
[
{
"from": "system",
"value": "Remove redundant 'repo' in WrapperPath()\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright (C) 2014 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in ... | python | chosen |
[
{
"from": "system",
"value": "Set size nonce at the beginning of the script\n"
},
{
"from": "human",
"value": "from fontTools.pens.cocoaPen import CocoaPen\n\n# Some configuration\npage_format = 'A4' # See http://drawbot.readthedocs.org/content/canvas/pages.html#size for other size-values\nmy_se... | python | chosen |
[
{
"from": "system",
"value": "Bump the version of html-manager for the embed script."
},
{
"from": "human",
"value": "# Copyright (c) Jupyter Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nversion_info = (7, 0, 0, 'beta', 9)\n\n_specifier_ = {'alpha': 'a', 'beta... | python | chosen |
[
{
"from": "system",
"value": "Remove is_autheticated check as by default all the endpoints are authenticated\n"
},
{
"from": "human",
"value": "from rest_framework import throttling\n\n\nclass ThrottlingBySession(throttling.SimpleRateThrottle):\n \"\"\"\n Limits the rating of facility ser... | python | chosen |
[
{
"from": "system",
"value": "Fix serialization bug in CSVKitWriter that was breaking 4 tests.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom csvkit.unicsv import UnicodeCSVReader, UnicodeCSVWriter\n\nclass CSVKitReader(UnicodeCSVReader):\n \"\"\"\n A unicode-aware CSV re... | python | chosen |
[
{
"from": "system",
"value": "Use six to improve python 3 compatibility.\n\n* StringIO\n\nChange-Id: I8471e525566a0353d9276529be4b0d0e0cbf6cd6\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013 Mirantis Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may ... | python | chosen |
[
{
"from": "system",
"value": "Clear output from colors in test cases\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, absolute_import\n\nimport sys\nimport unittest\nimport mock\n\nfrom fm import Fm\n\n\nclass TestFm(unittest.TestCase):\n\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove test for use_setuptools, as it fails when running under pytest because the installed version of setuptools is already present.\n"
},
{
"from": "human",
"value": "import sys\nimport os\nimport tempfile\nimport unittest\nimport shutil\nimport copy\n\nCURDIR = o... | python | chosen |
[
{
"from": "system",
"value": "Add complete question constructor test\n"
},
{
"from": "human",
"value": "from pywatson.question.question import Question\n\n\nclass TestQuestion:\n def test___init___basic(self, questions):\n question = Question(questions[0]['questionText'])\n asse... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in Python script\n"
},
{
"from": "human",
"value": "def transform_scalars(dataset):\n \"\"\"Reinterpret a signed integral array type as its unsigned counterpart.\n This can be used when the bytes of a data array have been interpreted as a\n signed ... | python | chosen |
[
{
"from": "system",
"value": "Modify UID to be passed as number.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom health_monitor import views\n\n\nurlpatterns = [\n url(r'^health/(?P<uid>[\\w-]*)/$', views.read, name='read'),\n url(r'^health/(?P<uid>[\\w-]*)/update... | python | chosen |
[
{
"from": "system",
"value": "Replace index_to_column_id with iterative fx\n\nThe recursive one was neat but a bit too clever."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Part of the masterfile package: https://github.com/njvack/masterfile\n# Copyright (c) 2017 Board of Regents... | python | chosen |
[
{
"from": "system",
"value": "PIO-129: Remove Unittests done as integrationtests, due to NotImplementedErrors from moto\n"
},
{
"from": "human",
"value": "from unittest2 import TestCase\nimport simplejson as json\nimport boto3\nfrom moto import mock_s3\nimport permission_lambda\n\n\nclass Permis... | python | chosen |
[
{
"from": "system",
"value": "Clean up thread pool code.\n"
},
{
"from": "human",
"value": "from concurrent.futures import ThreadPoolExecutor\nfrom myDevices.utils.singleton import Singleton\nimport inspect\n\nexecutor = ThreadPoolExecutor(max_workers=4)\nclass ThreadPool(Singleton):\n\tdef Sub... | python | chosen |
[
{
"from": "system",
"value": "Remove a little noise from this lab tool\n"
},
{
"from": "human",
"value": "import os, sys\r\n\r\nglobal nest\r\nnest = 0\r\n\r\ndef trace(frame, event, arg):\r\n #if event == 'line':\r\n global nest\r\n \r\n print \"%s%s %s %d (%r)\" % (\r\n \" ... | python | chosen |
[
{
"from": "system",
"value": "Add <output_file> parameter to the IEPY runner script.\n"
},
{
"from": "human",
"value": "\"\"\"\nRun IEPY core loop\n\nUsage:\n iepy_runner.py <dbname> <seeds_file>\n iepy_runner.py -h | --help | --version\n\nOptions:\n -h --help Show this screen... | python | chosen |
[
{
"from": "system",
"value": "Add CoulombMatrix to dc.feat import\n"
},
{
"from": "human",
"value": "\"\"\"\nMaking it easy to import in classes.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n__author__ = \"Bharath Ram... | python | chosen |
[
{
"from": "system",
"value": "Add default import for crystal and kernel\n"
},
{
"from": "human",
"value": "from .atom import * # NOQA\nfrom .molecule import * # NOQA\n"
},
{
"from": "gpt",
"value": "from .atom import * # NOQA\nfrom .molecule import * # NOQA\nfrom .crystal import ... | python | chosen |
[
{
"from": "system",
"value": "Handle nicely keyboard interruption (ctrl+c)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n Command line script main\n\"\"\"\n\nfrom rapydo.do.app import Application\nimport better_exceptions as be\n\n\ndef main():\n be # activate better... | python | chosen |
[
{
"from": "system",
"value": "Add a datetime localization function\n"
},
{
"from": "human",
"value": "import pandas as pd\n\n\ndef date_features(input_df, datetime_column='tms_gmt'):\n \"\"\"\n Given a datetime column, extracts useful date information\n (minute, hour, dow...)\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Make messaging test more reliable\n"
},
{
"from": "human",
"value": "\"\"\"Tests the message framework.\"\"\"\n\nimport threading\nimport time\nimport unittest\n\nfrom messaging.message_consumer import consume_messages\nfrom messaging.message_producer import Message... | python | chosen |
[
{
"from": "system",
"value": "Move log enabling out of submodule\n"
},
{
"from": "human",
"value": "# __BEGIN_LICENSE__\n# Copyright (C) 2008-2010 United States Government as represented by\n# the Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n# __EN... | python | chosen |
[
{
"from": "system",
"value": "Add a couple of dependencies\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\ndescription = 'ssheepdog'\nlong_desc = description\n\nsetup(\n name='ssheepdog',\n version='0.0.1',\n url='https://github.com/SheepDogInc/ssheepdog',\n instal... | python | chosen |
[
{
"from": "system",
"value": "Update to 0.0.93, because PyPI didn't seem to let anyone download 0.0.92 even though it uploaded fine.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nVERSION = (0, 0, 92, 'alpha')\n\n# pragma: no cover\nif VERSION[-1] != \"final\":\n __version__ = '.... | python | chosen |
[
{
"from": "system",
"value": "Allow loading settings from brewmeister.cfg\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask.ext.pymongo import PyMongo\nfrom flask.ext.babel import Babel\nfrom flask.ext.cache import Cache\nfrom brew.io import TemperatureController\nfrom brew.... | python | chosen |
[
{
"from": "system",
"value": "Use old legacy runtest files for Django 1.4\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\ncmds = [\n 'python runtests_bootstrap.py',\n 'python runtests_bootstrap3.py',\n 'python runtests_uniform.py',\n]\n\nfor cmd in c... | python | chosen |
[
{
"from": "system",
"value": "Simplify zipstream following the simplification of the zip routines implemented\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nimport os\nfrom zipfile import ZipFile\n\nfrom twisted.internet.defer import inlineCallbacks\n\nfrom globaleaks.db.dataini... | python | chosen |
[
{
"from": "system",
"value": "Make LDAP check even better\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom config import config\nimport ldap\n\n# DEFAULTS\nldap_config = {\n\t'timeout': 5\n}\n# /DEFAULTS\n\n# CONFIG\nif \"ldap\" in config:\n\tldap_config.update(con... | python | chosen |
[
{
"from": "system",
"value": "Add docs and tracker to metadata\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 Narlock'\n__github__ = 'https://github.c... | python | chosen |
[
{
"from": "system",
"value": "Add a rel_db_type to UnsignedBigIntAutoField\n"
},
{
"from": "human",
"value": "\"\"\"\nCustom fields for use in the coursewarehistoryextended django app.\n\"\"\"\n\nfrom django.db.models.fields import AutoField\n\n\nclass UnsignedBigIntAutoField(AutoField):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Add ending slash in position URLs.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom . import views\nfrom .feeds import LatestPositionsFeed\n\nurlpatterns = [\n url(r'^position/(?P<source>[\\w]+)/(?P<job_id>[\\w]+)$', views.PositionDetai... | python | chosen |
[
{
"from": "system",
"value": "Remove the lazy signup backend's hard dependency on django.contrib.auth.user (and remove the inconsistency in checking for whether a user is lazy or not)."
},
{
"from": "human",
"value": "from django.contrib.auth.backends import ModelBackend\nfrom django.contrib.aut... | python | chosen |
[
{
"from": "system",
"value": "Make BYCEPS-specific types actual lightweight types\n\nThis makes mypy report the custom type names in error messages instead of the existing types the alias.\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.typing\n~~~~~~~~~~~~~\n\nBYCEPS-specific type aliases for... | python | chosen |
[
{
"from": "system",
"value": "Fix project links broken by anchor\n"
},
{
"from": "human",
"value": "\"\"\"Boxout module for Dribdat projects.\"\"\"\n\nimport pystache\n\nTEMPLATE_PROJECT = r\"\"\"\n<div class=\"onebox honeycomb\">\n <a href=\"{{link}}\"\n class=\"hexagon\n {{#is_... | python | chosen |
[
{
"from": "system",
"value": "Change le numéro de version pour 2.0.0.pre\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import unicode_literals\n\n\n__version__ = 1, 8, 3\nget_version = lambda: '.'.join(str(i) for i in __version__)\n__verbose_name__ = 'Dezède'\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Test hotfix with advanced develop and cloned repo\n"
},
{
"from": "human",
"value": "# -----------------------------------------------------------------------------\n\n__title__ = 'lamana'\n__version__ = '0.4.10'\n__author__ = 'P. Robinson II'\n__license__ = 'BSD3'\... | python | chosen |
[
{
"from": "system",
"value": "Fix Django Debug Toolbar installation for new DjDT version\n"
},
{
"from": "human",
"value": "from django.conf.urls import * # NOQA\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\nfrom django.contrib import admin\nfrom django.conf import setti... | python | chosen |
[
{
"from": "system",
"value": "Implement properties and methods for the User model class to enable the Flask-Login module\n"
},
{
"from": "human",
"value": "from app_factory import db\nfrom models.session import Session\n\n\nclass User(db.Model):\n __tablename__ = 'users'\n id = db.Column(d... | python | chosen |
[
{
"from": "system",
"value": "Use importlib from std (if possible)"
},
{
"from": "human",
"value": "\"\"\"\nAn implementation of JSON Schema for Python\n\nThe main functionality is provided by the validator classes for each of the\nsupported JSON Schema versions.\n\nMost commonly, `validate` is ... | python | chosen |
[
{
"from": "system",
"value": "Add callback to disable users by AD userAccountControl flags\n"
},
{
"from": "human",
"value": "def removed_user_deactivate(user):\n if user.is_active:\n user.is_active = False\n user.save()\n\n\ndef removed_user_delete(user):\n user.delete()\n"
... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.