conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix markdown issue on pypi\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nimport logging\n\n# Logging configuration\nlog = logging.getLogger(__name__) # noqa\nlog.addHandler(logging.NullHandler()) # noqa\n\nfrom netmiko.ssh_dispatcher ... | python | chosen |
[
{
"from": "system",
"value": "Add the form for Comment\n"
},
{
"from": "human",
"value": "from .models import BlogPost\nfrom django import forms\n\nclass BlogPostForm(forms.ModelForm):\n class Meta:\n model = BlogPost\n exclude = ('user',)\n"
},
{
"from": "gpt",
"val... | python | chosen |
[
{
"from": "system",
"value": "Make the SSH configuration more resilient.\n\nIf you don't have certain values specified in your ~/.ssh/config, use\nthe defaults instead of erroring out.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__author__ = 'John Moylan'\n\nimport sys\n\nfrom pa... | python | chosen |
[
{
"from": "system",
"value": "Remove single quote escaping for router js\n\nThis used to be a html field which crippled the json when a single quote\nwas present. In the current usage it's required to print this json in a\nscript tag so this quote issue doesn't exist anymore\n"
},
{
"from": "human",... | python | chosen |
[
{
"from": "system",
"value": "Add EbicsPy Launchpad repository url\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': \"l10n_fr_ebics\",\n\n 'summary': \"\"\"Implementation of the EBICS banking protocol\"\"\",\n\n 'description': \"\"\"\n This module provides... | python | chosen |
[
{
"from": "system",
"value": "Correct logging level for messages.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom chunk import Chunk\nimport logging\nimport struct\n\nclass Parser(object):\n ChunkAliasMap = {}\n\n def __init__(self, kind):\n self._kind = kind\n self._chu... | python | chosen |
[
{
"from": "system",
"value": "Make sure package works even if ipopt is not installed\n\nSigned-off-by: Matthias Kümmerer <e388d34fd3c0456122779e95f262c0d70198a168@matthias-k.org>\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom .optimization import ParameterManag... | python | chosen |
[
{
"from": "system",
"value": "Fix close connection only when called as script.\n"
},
{
"from": "human",
"value": "from models.base_model import db\nfrom models.user_model import UserModel\nfrom models.waifu_model import WaifuModel\nfrom models.waifu_message_model import WaifuMessageModel\n\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Add save as pdf feature.\n"
},
{
"from": "human",
"value": "import sublime, sublime_plugin\nimport os\nimport re\n\nfrom .mistune import markdown\n\nHTML_START = '<!DOCTYPE html><html><head><meta charset=\"utf-8\"></head><body>'\nHTML_END = '</body></html>'\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Copy template structure for the create command\n"
},
{
"from": "human",
"value": "import os\n\nfrom finny.command import Command\n\nclass GenerateStructure(Command):\n\n def __init__(self, name, path):\n self.name = name\n self.path = path\n\n def run(self):... | python | chosen |
[
{
"from": "system",
"value": "Switch output to to use TEST_FILES path"
},
{
"from": "human",
"value": "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nimport unittest\nfrom pathlib import Path\n\nfrom pymatgen.util.testing import ... | python | chosen |
[
{
"from": "system",
"value": "Fix RawPostDataException on request.body access.\n\nDjango's HttpRequest class doesn't like the `request.body` to be accessed more than one time. Upon the second attempt to read from `request.body`, Django throws a `RawPostDataException`. Since the previous code in this spot ... | python | chosen |
[
{
"from": "system",
"value": "Support all metrics for points.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom numpy import *\nfrom scipy import *\nfrom scipy.interpolate import interp1d\nfrom scipy.interpolate import pchip\nimport sys\nimport os\nimport argparse\nimport json\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix colorspace determinism with OrderedDict\n"
},
{
"from": "human",
"value": "\nfrom .psparser import LIT\n\nimport six #Python 2+3 compatibility\n\n## PDFColorSpace\n##\nLITERAL_DEVICE_GRAY = LIT('DeviceGray')\nLITERAL_DEVICE_RGB = LIT('DeviceRGB')\nLITERAL_DEVIC... | python | chosen |
[
{
"from": "system",
"value": "Add sensible defaults for ElasticSearch settings\n"
},
{
"from": "human",
"value": "MONGO_HOST = 'localhost'\nMONGO_PORT = 27017\nMONGO_DATABASE = 'pupa'\n\nSCRAPELIB_RPM = 60\nSCRAPELIB_TIMEOUT = 60\nSCRAPELIB_RETRY_ATTEMPTS = 3\nSCRAPELIB_RETRY_WAIT_SECONDS = 20\n... | python | chosen |
[
{
"from": "system",
"value": "Add option for determining requirement of 'state' parameter.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.config import settings\nfrom appconf import AppConf\n\nclass DJOAuthConf(AppConf):\n class Meta:\n prefix = 'djoauth'\n\n ACCESS_TOKEN_L... | python | chosen |
[
{
"from": "system",
"value": "Test correctly incrementing stream IDs.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\ntest/test_connection\n~~~~~~~~~~~~~~~~~~~~~\n\nTests for the SPDYConnection object.\n\"\"\"\nimport spdypy\nimport spdypy.connection\n\n\nclass TestSPDYConnec... | python | chosen |
[
{
"from": "system",
"value": "Add maybe right connection for name\n"
},
{
"from": "human",
"value": "from django import forms\nfrom registration.forms import RegistrationFormUniqueEmail\n\nfrom preferences.models import Preferences\n\nfrom opencivicdata.models.people_orgs import Person\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Update (c) year and line"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport sys\nsys.path.insert(0, '../')\n#needs_sphinx = '1.0'\n\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',\n 'sphinx.ext.intersphinx']\n\nintersphinx_mapp... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Should break travis integration\"\n\nThis reverts commit a0dc0168e103ec836e434019c34b345b51e16257.\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for {{ project_name }} project.\n\nThis module contains the WSGI application used by Django's developme... | python | chosen |
[
{
"from": "system",
"value": "Test that the user is logged out\n"
},
{
"from": "human",
"value": "from behave import *\n\n\n# Unique to Scenario: User logs out\n@when('I click on the logout link')\ndef impl(context):\n context.browser.find_link_by_text('Logout').first.click()\n\n@then('I am n... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded variable from test.\n"
},
{
"from": "human",
"value": "from textwrap import dedent\n\nfrom twisted.python.filepath import FilePath\nfrom twisted.trial.unittest import SynchronousTestCase\n\nfrom flocker import __version__ as version\nfrom flocker.com... | python | chosen |
[
{
"from": "system",
"value": "Add useful method to know if a chunk has a tag\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom cms.models.fields import PlaceholderField\nfrom managers import ChunkManager\n\n\nclass Chunk(models.Model):\n tags = models.CharField(max_length=... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in load_tags function\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom dtags.utils import halt, expand_path\n\nTAGS = os.path.expanduser('~/.dtags')\n\n\ndef load_tags():\n \"\"\"Load the tags from disk.\"\"\"\n if not os.path.exists... | python | chosen |
[
{
"from": "system",
"value": "Update the version to 3.1.1\n\nChange-Id: Ia24c8a9e62330243fa7413a649f885c2a40dd4fb\n"
},
{
"from": "human",
"value": "# Copyright 2012-2014 Hewlett Packard Development Company, L.P.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (th... | python | chosen |
[
{
"from": "system",
"value": "Fix bug with JSONPointer if part passed via __truediv__ is integer\n"
},
{
"from": "human",
"value": "\"\"\"\nExtended JSONPointer from python-json-pointer_\n==============================================\n\n.. _python-json-pointer: https://github.com/stefankoegl/py... | python | chosen |
[
{
"from": "system",
"value": "Add missing newline for PEP8.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n\"\"\"\nCreated on 2016-08-23\n@author: naoey\n\"\"\"\n\nclass SlashBotError(Exception):\n pass\n\n\nclass ConfigError(SlashBotError):\n def __init__(self, config_attr=None):\n... | python | chosen |
[
{
"from": "system",
"value": "Add list of entities and ETL classes for CSV files\n"
},
{
"from": "human",
"value": "from base import BaseCSV, get_local_handles, ingest_feeds, create_seasons\nfrom overview import (ClubIngest, CountryIngest, CompetitionIngest, PlayerIngest, PersonIngest)\nfrom fin... | python | chosen |
[
{
"from": "system",
"value": "Use round_fn to specify built-in round function\n"
},
{
"from": "human",
"value": "from mapbox_vector_tile.encoder import on_invalid_geometry_make_valid\nfrom mapbox_vector_tile import encode as mvt_encode\n\n\ndef encode(fp, feature_layers, coord, bounds_merc):\n ... | python | chosen |
[
{
"from": "system",
"value": "Create function to handle full pipeline.\n"
},
{
"from": "human",
"value": "import indra.tools.assemble_corpus as ac\n\ndef process_statements(stmts):\n stmts = ac.map_grounding(stmts)\n stmts = ac.map_sequence(stmts)\n stmts = ac.run_preassembly(stmts, ret... | python | chosen |
[
{
"from": "system",
"value": "Remove ability to recieve messages\n"
},
{
"from": "human",
"value": "from http_client import HttpClient\n\n\"\"\"\n@breif Facebook messenger bot\n\"\"\"\nclass Bot():\n\n def __init__(self, token):\n self.api_token = token\n self.client = HttpClien... | python | chosen |
[
{
"from": "system",
"value": "Put the session factory in threadLocal, not the session\n"
},
{
"from": "human",
"value": "\"\"\"\nInteract with your school website with telegram!\n\nCopyright (c) 2016-2017 Paolo Barbolini <paolo@paolo565.org>\nReleased under the MIT license\n\"\"\"\n\nfrom sqlalc... | python | chosen |
[
{
"from": "system",
"value": "Add proper timezone data for trac\n"
},
{
"from": "human",
"value": "import logging\n\nfrom pylons import response, config, tmpl_context as c\nfrom pylons.controllers.util import abort\n\n# Monkey patch the lazywriter, since mercurial needs that on the stdout\nimpor... | python | chosen |
[
{
"from": "system",
"value": "Add a TODO for the Wizard\n"
},
{
"from": "human",
"value": "from PyQt4.QtGui import *\nfrom PyQt4 import uic\nimport os\nfrom os.path import join\nimport api\n\n\nclass MasterPage(QWizardPage):\n path = \"qtui/ui/page1_master.ui\"\n\n def __init__(self, proje... | python | chosen |
[
{
"from": "system",
"value": "Return stderr on script failure\n"
},
{
"from": "human",
"value": "import sh\nimport tempfile\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef fetch_bash(conf, **kwargs):\n code = conf['script']\n logger.info(\"Executing bash fetcher\")\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix saving when number of items is less than configured bundle size\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport pickle\nimport os.path\nimport glob\nimport uuid\nimport sys\nimport os.path\nimport numpy as np\n\n\ndef main():\n if len(sys.a... | python | chosen |
[
{
"from": "system",
"value": "Add CR2 to allowed files\n"
},
{
"from": "human",
"value": "import os\nfrom addict import Dict\n\nfrom gallery.models import File\n\ndef get_dir_file_contents(dir_id):\n print(File.query.filter(File.parent == dir_id).all())\n return File.query.filter(File.pare... | python | chosen |
[
{
"from": "system",
"value": "Remove spaces in empty lines"
},
{
"from": "human",
"value": "from __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom builtins import * # NOQA\nfrom future import ... | python | chosen |
[
{
"from": "system",
"value": "Add logging level to settings\n"
},
{
"from": "human",
"value": "import os\nimport re\n\nfrom imap import EmailCheckError, EmailServer\nfrom postgresql import DatabaseServer\n\n\n# If this is set to a valid path, all CSV files extracted from emails will be\n# stored... | python | chosen |
[
{
"from": "system",
"value": "Add --studies as an alias for --view studies.\n"
},
{
"from": "human",
"value": "import argparse\n\nfrom lenrmc.nubase import System\nfrom lenrmc.terminal import TerminalView, StudiesTerminalView\n\n\nclass App(object):\n\n def __init__(self, **kwargs):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove pbr dependency at run time\n\nThis change is based on the following commit in the Swift tree.\n\n 0717133 Make pbr a build-time only dependency\n\nChange-Id: I43956f531a9928ade296236b3b605e52dc2f86f3\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012-20... | python | chosen |
[
{
"from": "system",
"value": "Remove the object from selection if it is selected\n\nThis cleans up any leftovers due to the object being selected.\n\nFixes #42\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or higher.\n... | python | chosen |
[
{
"from": "system",
"value": "Add comment to gender class\n"
},
{
"from": "human",
"value": "from .gender import Gender\nfrom _ctypes import ArgumentError\n\nclass Genders(object):\n @classmethod\n def match(cls, data):\n \"\"\" Check is data list of genders \"\"\"\n if type(... | python | chosen |
[
{
"from": "system",
"value": "Make task for top100_ids atomic\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom django.core.cache import cache\n\nfrom celery import shared_task\nfrom haystack.query import SearchQuerySet\n\nfrom astrobin.models import Image\n\n\n@s... | python | chosen |
[
{
"from": "system",
"value": "Use _meta.model_name instead of _meta.module_name\n"
},
{
"from": "human",
"value": "\"\"\"Migrations for Zinnia\"\"\"\nfrom django.contrib.auth import get_user_model\n\nUser = get_user_model()\nuser_name = User.__name__\nuser_table = User._meta.db_table\nuser_orm_l... | python | chosen |
[
{
"from": "system",
"value": "Fix phone number formatting in emails\n"
},
{
"from": "human",
"value": "import i18naddress\nfrom django import template\nfrom django.utils.translation import pgettext\n\nregister = template.Library()\n\n\n@register.inclusion_tag(\"formatted_address.html\")\ndef for... | python | chosen |
[
{
"from": "system",
"value": "Set name_scope of entire network to the dataset it handles\n"
},
{
"from": "human",
"value": "import tensorflow as tf\nimport numpy as np\nimport itertools as it\nimport importlib\n\nfrom flowfairy.conf import settings\nfrom flowfairy.utils import take\nfrom flowfai... | python | chosen |
[
{
"from": "system",
"value": "Revert \"tests: Don't redefine PYTHONPATH\"\n\nThis reverts commit 6be5cc0f1b1d34521fa8d8c91ca1cc2a96a65b69.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport os\nimport subprocess\nimport sys\nimport unittest\n\nimport mopidy\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix test run failures with double-registration on ICEkitURLField\n\nUse the new `ICEkitURLField.register_model_once` method available in\ndjango-icekit to safely register base events for `ICEkitURLField`\nwithout the risk that they will be re-registered (and therefore fail)\nbe... | python | chosen |
[
{
"from": "system",
"value": "Remove sending error to general channel\n"
},
{
"from": "human",
"value": "DEFAULT_REPLY = \"Sorry, I did not understand you.\"\nERRORS_TO = 'general'\n\nPLUGINS = [\n 'plugins.witai'\n ]\n"
},
{
"from": "gpt",
"value": "DEFAULT_REPLY = \"S... | python | chosen |
[
{
"from": "system",
"value": "Save dates from Bisnode correctly\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom .constants import COMPANY_RATING_REPORT, RATING_CHOICES\n\nfrom .bisnode import get_bisnode_company_report\n\n\nclass BisnodeRatingReport(models.Model):\n or... | python | chosen |
[
{
"from": "system",
"value": "Add TODO to think about.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n#\n# Copyright 2013 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 compliance with the Licen... | python | chosen |
[
{
"from": "system",
"value": "Update setdefault to ensure commit is called\n"
},
{
"from": "human",
"value": "import yaml\n\n\nclass _Storage:\n def __getitem__(self, key):\n pass\n\n def __setitem__(self, key, value):\n pass\n\n def __delitem__(self, key):\n pass\n... | python | chosen |
[
{
"from": "system",
"value": "Add API version into response header\n"
},
{
"from": "human",
"value": "from flask import Flask, g, request\nimport uuid\nimport requests\n\napp = Flask(__name__)\n\napp.config.from_pyfile(\"config.py\")\n\n\n@app.before_request\ndef before_request():\n # Sets th... | python | chosen |
[
{
"from": "system",
"value": "examples: Use custom message instead of dict\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport pykka\n\n\nclass PlainActor(pykka.ThreadingActor):\n def __init__(self):\n super().__init__()\n self.stored_messages = []\n\n def on_... | python | chosen |
[
{
"from": "system",
"value": "FIX: Set up RunEngine with required metadata.\n"
},
{
"from": "human",
"value": "from bluesky.examples import *\nfrom bluesky.standard_config import RE\nfrom matplotlib import pyplot as plt\nfrom xray_vision.backend.mpl.cross_section_2d import CrossSection\nimport n... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary imports form dummy tests.\n"
},
{
"from": "human",
"value": "\"\"\"\nBraubuddy Dummy thermometer unit tests\n\"\"\"\n\nimport unittest\nfrom mock import patch, call, MagicMock\nfrom braubuddy.thermometer import dummy \nfrom braubuddy.thermometer i... | python | chosen |
[
{
"from": "system",
"value": "Add the answer of seventh question of Assignment 3\n"
},
{
"from": "human",
"value": "\"\"\" Q7- Assume s is a string of lower case characters. Write a program that\nprints the number of times the string 'bob' occurs in s. For example, if s =\n'azcbobobegghakl', the... | python | chosen |
[
{
"from": "system",
"value": "Update how get_clinic_code fetches/extracts info from external service\n\nWe were sending the external API a message to ask for a list of clinic codes and then checking whether the code was in that list of clinic codes.\nInstead we send a message which includes the clinic code,... | python | chosen |
[
{
"from": "system",
"value": "Add config option for nginx"
},
{
"from": "human",
"value": "from genes.apt import commands as apt\nfrom genes.brew import commands as brew\nfrom genes.debian.traits import is_debian\nfrom genes.mac.traits import is_osx\nfrom genes.ubuntu.traits import is_ubuntu\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make the nonce more secure and faster to generate\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Import nacl libs\nimport libnacl\nimport libnacl.encode\n\n# Import python libs\nimport datetime\nimport binascii\n\n\nclass BaseKey(object):\n '''\n... | python | chosen |
[
{
"from": "system",
"value": "[login] Add apps on list that will be used on the test databases\n\nAdded apps sites and contenttypes to the list.\nThese apps were causing troubles on the test databases.\n\nSigned off by: Heitor Reis <marcheing@gmail.com>\nSigned off by: Filipe Vaz <vazfilipe92@gmail.com>\n"
... | python | chosen |
[
{
"from": "system",
"value": "Add endpoint for flask app.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom electro.errors import ResourceDuplicatedDefinedError\n\nclass API(object):\n\n def __init__(self, app=None, decorators=None,\n catch_all_404s=None):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix static path to match the /suppliers URL prefix\n"
},
{
"from": "human",
"value": "import os\nimport jinja2\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config(object):\n DEBUG = False\n SECRET_KEY = 'this is not secret'\n STATIC_UR... | python | chosen |
[
{
"from": "system",
"value": "Exclude redirected locales from homepage language selector functional tests\n"
},
{
"from": "human",
"value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You c... | python | chosen |
[
{
"from": "system",
"value": "Use a secondary language database for development\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom flask import Blueprint, render_template\nimport subprocess\nimport tempfile\nimport os\n\nadmin_controller = Blueprint('admin_cont... | python | chosen |
[
{
"from": "system",
"value": "Create a compatible ast.parse with PY3\n\nCreated a function compatible with both PY2 and PY3 equivalent to\nast.parse.\n"
},
{
"from": "human",
"value": "import sys\nimport types\n\nPY2 = sys.version_info[0] == 2\nPYPY = hasattr(sys, 'pypy_translation_info')\n\n_id... | python | chosen |
[
{
"from": "system",
"value": "Add documentation and utility functions\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.conf import settings\n\nimport urllib, urllib2\n\nC2DM_URL = 'https://android.apis.google.com/c2dm/send'\n\nclass C2DMProfile(models.Model):\n dev... | python | chosen |
[
{
"from": "system",
"value": "Add a test for running tasks\n"
},
{
"from": "human",
"value": "import hashlib\n\nfrom wsstat.main import WebsocketTestingClient, ConnectedWebsocketConnection\n\nclass Tests(object):\n def setup(self):\n self.client = WebsocketTestingClient('wss://testserv... | python | chosen |
[
{
"from": "system",
"value": "Add unittest for correct function in spell module\n\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport datetime\nimport os\nimport sys\nimport unittest\n\nfrom pythainlp.spell import NorvigSpellChecker, correct, spell\n\n\nclass TestSpellPackage(un... | python | chosen |
[
{
"from": "system",
"value": "Fix for representation of InvalidatedToken model.\n"
},
{
"from": "human",
"value": "from src.main import db\nfrom sqlalchemy.sql import func\n\nclass InvalidatedToken(db.Model):\n token = db.Column(db.String(120), primary_key=True)\n invalidated_date = db.Col... | python | chosen |
[
{
"from": "system",
"value": "Increment minor version for :fire: HOTFIX release\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Author: Taylor Smith <taylor.smith@alkaline-ml.com>\n#\n# The pyramid module\n\n__version__ = \"0.6.1-dev0\"\n\ntry:\n # this var is injected in the... | python | chosen |
[
{
"from": "system",
"value": "Use a more efficient regex\n"
},
{
"from": "human",
"value": "import sys, re\n\ncounts = {}\nfor line in sys.stdin:\n for word in re.findall(r'[A-Za-z\\']+', line.lower()):\n counts[word] = counts.get(word, 0) + 1\n\nfor word, count in sorted(counts.items(... | python | chosen |
[
{
"from": "system",
"value": "Make plot_instantaneous_measure accessible from root of plots\n"
},
{
"from": "human",
"value": "\"\"\"Plotting functions.\"\"\"\n\nfrom .time_series import plot_time_series, plot_bursts\nfrom .filt import plot_filter_properties, plot_frequency_response, plot_impuls... | python | chosen |
[
{
"from": "system",
"value": "Fix missing paren (copy and paste error)"
},
{
"from": "human",
"value": "# Simple demo of reading the tsl2591 lux sensor from the\n# ESP8266 running micropython.\n\nfrom antevents import *\nfrom tsl2591 import Tsl2591\ntsl = Tsl2591('lux-1')\ntsl.sample()\nsched = ... | python | chosen |
[
{
"from": "system",
"value": "Add install for nipype ipython profile.\n\ngit-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1352 ead46cd0-7350-4e37-8683-fc4c6f79bf00\n"
},
{
"from": "human",
"value": "from os.path import join\n\ndef configuration(parent_package='',top_path=None):\n from num... | python | chosen |
[
{
"from": "system",
"value": "Delete long edges if there are multiple edges between the same two nodes\n"
},
{
"from": "human",
"value": "class DijkstraNew:\n def __init__(self,edges,start):\n self.edges = edges\n self.take_shorter_edges() # Bei doppelten Kanten kürzere nehmen\n... | python | chosen |
[
{
"from": "system",
"value": "Use threading when restoring snapshots during testing\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nfrom threading import Thread\nimport subprocess\nfrom functions import *\n\ndef runTest(branch,os):\n subprocess.call(test_script + \" \" + branch + \" \" ... | python | chosen |
[
{
"from": "system",
"value": "Halo: Remove support for windows till fully tested\n"
},
{
"from": "human",
"value": "\"\"\"Utilities for Halo library.\n\"\"\"\nimport platform\nimport six\nimport codecs\n\nfrom colorama import init, Fore\nfrom termcolor import colored\n\ninit(autoreset=True)\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Make mock Model class extend object for Python 2 compat\n"
},
{
"from": "human",
"value": "from django.test import TestCase as BaseTestCase\n\nfrom django.test import RequestFactory\n\nfrom permissions import PermissionsRegistry as BasePermissionsRegistry\n\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Add some common config options\n"
},
{
"from": "human",
"value": "import itertools\n\nimport searchlight.common.wsgi\n\n\ndef list_opts():\n return [\n ('DEFAULT',\n itertools.chain(searchlight.common.wsgi.bind_opts,\n searc... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 1.1.0\n"
},
{
"from": "human",
"value": "__version_info__ = (1, 0, 6)\n__version__ = '.'.join(map(str, __version_info__))\n"
},
{
"from": "gpt",
"value": "__version_info__ = (1, 1, 0)\n__version__ = '.'.join(map(str, __version... | python | chosen |
[
{
"from": "system",
"value": "Add output with images mixed with binary version of output labels\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\ndef add_output_images(images, logits, labels):\n cast_labels = tf.cast(labels, tf.uint8) * 128\n cast_labels = cast_labels[...,None]... | python | chosen |
[
{
"from": "system",
"value": "Move from_date() into an abstract base class.\n"
},
{
"from": "human",
"value": "from datetime import date, timedelta\n\nclass DateWithCalendar(object):\n def __init__(self, calendar_class, date):\n self.calendar = calendar_class\n self.date = date\... | python | chosen |
[
{
"from": "system",
"value": "Update log time, remove messages\n"
},
{
"from": "human",
"value": "######################################################\n# logs time, fahrenheit and humidity every 5 minutes\n#\n######################################################\n\nimport time\nimport HTU21DF... | python | chosen |
[
{
"from": "system",
"value": "Add logger name to default log format.\n"
},
{
"from": "human",
"value": "\"\"\"\nA logging handler that's tty aware.\n\"\"\"\n\nimport logging\nfrom . import rendering\n\n\nclass VTMLHandler(logging.StreamHandler):\n \"\"\" Parse VTML messages to colorize and em... | python | chosen |
[
{
"from": "system",
"value": "Fix formatting to follow PEP8\n"
},
{
"from": "human",
"value": "from enum import Enum\nfrom app import db\n\n\nclass AwardCategory(Enum):\n Champions = 0\n Research = 1\n Presentation = 2\n Innovative_Solution = 3\n Mechanical_Design = 4\n Program... | python | chosen |
[
{
"from": "system",
"value": "Add seperate key log handler\n"
},
{
"from": "human",
"value": "\"\"\"Run a server that takes all GET requests and dumps them.\"\"\"\n\nfrom flask import Flask, request, send_from_directory\n\nfrom flask_cors import CORS\nfrom w3lib.html import replace_entities\n\na... | python | chosen |
[
{
"from": "system",
"value": "Make it yet even easier to read key logger output\n"
},
{
"from": "human",
"value": "\"\"\"Run a server that takes all GET requests and dumps them.\"\"\"\n\nfrom flask import Flask, request, send_from_directory\n\nfrom flask_cors import CORS\nfrom w3lib.html import ... | python | chosen |
[
{
"from": "system",
"value": "Update pelcian conf to reflect theme change\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = 'Mike'\nSITENAME = 'Conversations with Mike the Turtle'\nSITEURL = ''\nRELATIVE_URLS ... | python | chosen |
[
{
"from": "system",
"value": "Use no_async api by default in FailAction\n"
},
{
"from": "human",
"value": "from bot.action.core.action import Action\nfrom bot.action.util.textformat import FormattedText\n\n\nclass FailAction(Action):\n def process(self, event):\n api = self.api\n ... | python | chosen |
[
{
"from": "system",
"value": "Test that set_(g|u)id actually changes the id\n"
},
{
"from": "human",
"value": "from __future__ import print_function, absolute_import, division\n\nfrom unittest2 import TestCase\nfrom mock import patch\n\nfrom succubus import Daemon\n\n\n\nclass TestDaemonize(Test... | python | chosen |
[
{
"from": "system",
"value": "Allow Markdown editor to be resized\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm,Textarea,TextInput\n\n\nfrom .models import Post\n\n\nclass PostForm(ModelForm):\n class Meta:\n model = Post\n fields = ('subject','body')\n ... | python | chosen |
[
{
"from": "system",
"value": "Add the malt parser directory name in the unittest\n\nFixes https://nltk.ci.cloudbees.com/job/nltk/TOXENV=py34-jenkins,jdk=jdk8latestOnlineInstall/lastCompletedBuild/testReport/%3Cnose/suite/ContextSuite_context_gluesemantics_malt_fixt__setup/"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Add print statements to debug BlogPostListView\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom staticgen.staticgen_pool import staticgen_pool\nfrom staticgen.staticgen_views import StaticgenView\n\nfrom .... | python | chosen |
[
{
"from": "system",
"value": "Call out public beta key\n"
},
{
"from": "human",
"value": "from IPython.display import Image\n\nimport requests\n\nAPI_ENDPOINT = 'http://api.giphy.com/v1/gifs/random'\nAPI_KEY = 'dc6zaTOxFJmzC'\n\ndef giphy(tag):\n params = {\n 'api_key': API_KEY,\n ... | python | chosen |
[
{
"from": "system",
"value": "Add mockup creator property to AnonymousItems\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom adhocracy4.models.base import TimeStampedModel\nfrom adhocracy4.modules import models as module_models\nfrom apps.extprojects.models import External... | python | chosen |
[
{
"from": "system",
"value": "Switch to signal based dispatch in LineAnalyser\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\"\"\"\n pyalysis.analysers.raw\n ~~~~~~~~~~~~~~~~~~~~~~\n\n :copyright: 2014 by Daniel Neuhäuser and Contributors\n :license: BSD, see LICENSE.rst for de... | python | chosen |
[
{
"from": "system",
"value": "Complete fiboncci_dp() by dynamic programming\n"
},
{
"from": "human",
"value": "\"\"\"Fibonacci series:\n\n0, 1, 1, 2, 3, 5, 8,... \n\n- Fib(0) = 0\n- Fib(1) = 1\n- Fib(n) = Fib(n - 1) + Fib(n - 2)\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ ... | python | chosen |
[
{
"from": "system",
"value": "Improve formatting of resend action description\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Record\nfrom .tasks import send_personnel_code\n\n\nclass RecordAdmin(admin.ModelAdmin):\n list_display = [\n \"id\",... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.