conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update price attribute to price_history list as well as update function accordingly.\n"
},
{
"from": "human",
"value": "class Stock:\n def __init__(self, symbol):\n self.symbol = symbol\n self.price = None\n\n def update(self, timestamp, price):\... | python | chosen |
[
{
"from": "system",
"value": "Set a higher default for darks\n"
},
{
"from": "human",
"value": "from celery import Celery\n\nfrom allsky import single_image_raspistill\n\ncelery = Celery('tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0')\n\n@celery.task\ndef backgrou... | python | chosen |
[
{
"from": "system",
"value": "Fix load order to fix routes.\n"
},
{
"from": "human",
"value": "# Copyright 2015 Canonical Ltd. This software is licensed under the\n# GNU Affero General Public License version 3 (see the file LICENSE).\n\nfrom pyramid.config import Configurator\n\n\ndef main(glob... | python | chosen |
[
{
"from": "system",
"value": "Switch to paho-mqtt and make ready for py3\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2\n# \n# test-messages.py - This script publish a random MQTT messages every 2 s.\n#\n# Copyright (c) 2013-2015, Fabian Affolter <fabian@affolter-engineering.ch>\n# Releas... | python | chosen |
[
{
"from": "system",
"value": "Add __slots__ to satisfy tests (rudimentary_repr is still ordinary __repr__ if __slots__ are there).\n"
},
{
"from": "human",
"value": "class Bad(Exception):\n def __repr__(self):\n raise RuntimeError(\"I'm a bad class!\")\n\n\ndef a():\n x = Bad()\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the unnecessary list comprehension\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport re\n\nimport requests\n\nfrom zhihudaily.cache import cache\n\n\n@cache.mem... | python | chosen |
[
{
"from": "system",
"value": "Fix import of common module\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ndef main():\n import argparse\n from ranwinconf.common import generate_host_config\n\n parser = argparse.ArgumentParser()\n parser.add_argument('host', type=str, help... | python | chosen |
[
{
"from": "system",
"value": "Replace all extra characters with commas in queries; improves matching\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nimport json\nimport traceback\nfrom bottle import route, run, get, reques... | python | chosen |
[
{
"from": "system",
"value": "Add NullHandler to poyo root logger\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom .exceptions import PoyoException\nfrom .parser import parse_string\n\n__author__ = 'Raphael Pierzina'\n__email__ = 'raphael@hackebrot.de'\n__version__ = '0.3.0'\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix for truncated whitespace on DB level\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Scroll(models.Model):\n # Constants\n SCROLL_TOP = \"\"\"```\nββ€ββββββββββββββββββββββββββββββββββββββββββββββ€β‘\n β Scroll ### ... | python | chosen |
[
{
"from": "system",
"value": "Handle edge case with zero count\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\nfrom collections import Counter\n\n\ndef isValid(s):\n return \"YES\" if containsOnlyOneDifferentCharacterCount(s) ... | python | chosen |
[
{
"from": "system",
"value": "Use Netmiko to change the logging buffer size (logging buffered <size>) on pynet-rtr2.\n"
},
{
"from": "human",
"value": "from getpass import getpass\nfrom netmiko import ConnectHandler\n\n\ndef main():\n\n password = getpass()\n\n pynet_rtr2 = {'device_type':... | python | chosen |
[
{
"from": "system",
"value": "Change unicode rep to use Subject text\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import models\n\nfrom website.util import api_v2_url\n\nfrom osf.models.base import BaseModel, ObjectIDMixin\n\n\nclass Subject(ObjectIDMixin, BaseModel... | python | chosen |
[
{
"from": "system",
"value": "Test autojit specialized extension attribute type recognition\n"
},
{
"from": "human",
"value": "\"\"\"\n>>> test_typeof()\n\"\"\"\n\nimport sys\nimport numba\nfrom numba import *\nfrom nose.tools import raises\n\n@jit\nclass Base(object):\n\n value1 = double\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix zmq communications module\nDoes not hang when connection is unavailable\n"
},
{
"from": "human",
"value": "import zmq\n\n\ndef send_message(msg, hostname='localhost', port=5556):\n \"\"\"\n sends a message to openephys ZMQ socket.\n :param msg: string\n... | python | chosen |
[
{
"from": "system",
"value": "Remove the __MARCONI_SETUP_ global from init\n\nThis was used to know when Marconi was being loaded and avoid\nregistering configuration options and doing other things. This is not\nnecessary anymore.\n\nChange-Id: Icf43302581eefb563b10ddec5831eeec0d068872\nPartially-Implements... | python | chosen |
[
{
"from": "system",
"value": "Add missing libapol rolequery import.\n"
},
{
"from": "human",
"value": "\"\"\"The SETools SELinux policy analysis library.\"\"\"\n# Copyright 2014, Tresys Technology, LLC\n#\n# This file is part of SETools.\n#\n# SETools is free software: you can redistribute it an... | python | chosen |
[
{
"from": "system",
"value": "Replace phone number and avoid sending SMS for load testing\n"
},
{
"from": "human",
"value": "# coding: utf-8\n# pylint: disable=W7936\nfrom locust import HttpLocust, TaskSet, task\nfrom random import randint\n\n\nclass SmsSponsorWorkflow(TaskSet):\n\n @task(1)\... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.5.0"
},
{
"from": "human",
"value": "__version__ = '0.5.0.dev0'\n\n# this should ensure that we can still import constants.py as climlab.constants\nfrom climlab.utils import constants\nfrom climlab.utils import thermo, legendre\n# some ... | python | chosen |
[
{
"from": "system",
"value": "Order by -count, name as there are duplicate names\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.core.urlresolvers import reverse\nfrom django.template.defaultfilters import slugify\n\nclass CachedCount(models.Model):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Update translate plugin to new message format\n"
},
{
"from": "human",
"value": "\"\"\"\nYandex Translation API\n\"\"\"\nimport logging\nfrom urllib.parse import quote\n\nfrom telegram import Bot, Update\nfrom telegram.ext import Updater\nfrom requests import post\n... | python | chosen |
[
{
"from": "system",
"value": "Implement fallback for tokenizing non-nphs tagged users\n"
},
{
"from": "human",
"value": "\"\"\"\nGiven a tweet, tokenize it and shit.\n\"\"\"\n\nimport nltk\nfrom nltk.tokenize import TweetTokenizer\n\nfrom SocialNPHS.sources.twitter.auth import api\nfrom SocialNP... | python | chosen |
[
{
"from": "system",
"value": "Copy test backend code from couch model to sql model\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom corehq.apps.sms.mixin import SMSBackend\nfrom corehq.apps.sms.models import SQLSMSBackend\nfrom corehq.apps.sms.forms import BackendForm\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix dedupe not preserving order\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom nodes import Node\n\nclass Deduplicate(Node):\n char = \"}\"\n args = 1\n results = 2\n \n @Node.test_func([2], [4])\n @Node.test_func([1.5], [3])\n ... | python | chosen |
[
{
"from": "system",
"value": "fix: Fix wrong formula for y position\n\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom math import pi, sin, cos\n\nfrom .trajectory import Trajectory\n\n\nclass LissajousTrajectory(object, Trajectory):\n def __init__(self, A, B, a, b, period, delt... | python | chosen |
[
{
"from": "system",
"value": "Disable falsely reported pylint errors due to unresolved library type\n\nSigned-off-by: Morgawr <528620cabbf4155b02d05fdb6013cd6bb6ad54b5@gmail.com>\n"
},
{
"from": "human",
"value": "\"\"\"Module hosting class representing connection to GoL.\"\"\"\n\nimport json\ni... | python | chosen |
[
{
"from": "system",
"value": "Add unit test, update documentation\n"
},
{
"from": "human",
"value": "from unittest import TestCase\n\nfrom phi import math\nfrom phi.geom import Box\nfrom phi import field\nfrom phi.physics import Domain\n\n\nclass TestFieldMath(TestCase):\n\n def test_gradient... | python | chosen |
[
{
"from": "system",
"value": "Add a check that coveralls is actually called\n"
},
{
"from": "human",
"value": "#!/bin/env/python\n# -*- coding: utf-8\n\nimport os\n\nfrom subprocess import call\n\nif __name__ == '__main__':\n if 'TRAVIS' in os.environ:\n rc = call('coveralls')\n ... | python | chosen |
[
{
"from": "system",
"value": "Add logtacts domain to allowed hosts\n"
},
{
"from": "human",
"value": "from .base import *\nimport dj_database_url\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES['default'] = dj_database_url.parse(get_env_variable('LOGTACTS_DB_URL'))\n\nSECRET_KEY = get_env_... | python | chosen |
[
{
"from": "system",
"value": "Raise exception if step value is invalid.\n"
},
{
"from": "human",
"value": "import math\n\ndef get_range(val, step):\n\tstepvals = [i*step for i in xrange(int(math.ceil(val/step)))][1:]\n\tif not stepvals[-1] == val: # if last element isn't the actual value\n\t\tst... | python | chosen |
[
{
"from": "system",
"value": "Set available options for weekday field of reminder's model\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.db.models.signals import post_save\n\nclass Reminder(models.Model... | python | chosen |
[
{
"from": "system",
"value": "Add method for final probability vector, which\ncorresponds to all-photobleached collection."
},
{
"from": "human",
"value": "import numpy\nfrom palm.aggregated_kinetic_model import AggregatedKineticModel\nfrom palm.probability_vector import make_prob_vec_from_state... | python | chosen |
[
{
"from": "system",
"value": "Update base 62 id after paste creation.\n"
},
{
"from": "human",
"value": "from sqlalchemy import create_engine\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import scoped_session, sessionmaker\n\nfrom hashlib import md5\n\nengine = c... | python | chosen |
[
{
"from": "system",
"value": "Fix one more flake8 error.\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\r\n\r\nurlpatterns = patterns(\r\n '',\r\n url(r'^checks$', 'what_json.views.checks'),\r\n url(r'^add_torrent$', 'what_json.views.add_torrent')... | python | chosen |
[
{
"from": "system",
"value": "Add command line argument to set bot name"
},
{
"from": "human",
"value": "import ircbotframe\nimport sys\n\nclass Handler:\n def __init__(self, host, port=6667, name=\"MediaWiki\", description=\"MediaWiki recent changes bot\", channels=[]):\n self.channel... | python | chosen |
[
{
"from": "system",
"value": "Make queue_to_send a celery task\n"
},
{
"from": "human",
"value": "import datetime\nimport logging\n\nfrom celery.task import task\nfrom django.core.mail.backends.smtp import EmailBackend\nfrom django.contrib.auth.models import User\n\nfrom pigeonpost.models import... | python | chosen |
[
{
"from": "system",
"value": "Disable health checks for distro builds\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nGeneral-purpose fixtures for vdirsyncer's testsuite.\n'''\nimport logging\nimport os\n\nimport click_log\n\nfrom hypothesis import HealthCheck, Verbosity, settin... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fix unit test python3 compatibility.\"\n\nThis reverts commit 6807e5a5966f1f37f69a54e255a9981918cc8fb6.\n"
},
{
"from": "human",
"value": "import base64\nimport os\nfrom distutils.core import Command\n\n\nclass TestCommand(Command):\n description = \"Lau... | python | chosen |
[
{
"from": "human",
"value": "Add some basic pydoc documentation.\n\nSigned-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>\n"
},
{
"from": "gpt",
"value": "\"\"\"\nClass for automated operating system installation.\n\nOz is a set of classes to do automated operatin... | python | chosen |
[
{
"from": "system",
"value": "Test more than one thing\n\nThe test _should_ have tested two boundaries with different `featurecla`, but ended up being a copy/paste error. This fixes that."
},
{
"from": "human",
"value": "# NE data - no OSM elements\n# boundary between NV and CA is _also_ a \"sta... | python | chosen |
[
{
"from": "system",
"value": "Update import syntax to fit python3"
},
{
"from": "human",
"value": "from plugin import websocket\nfrom server import GeventWebSocketServer\n\n__all__ = ['websocket', 'GeventWebSocketServer']\n__version__ = '0.2.8'\n"
},
{
"from": "gpt",
"value": "from .... | python | chosen |
[
{
"from": "system",
"value": "Remove rogue debugger how embarassing\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\nfrom api.base.utils import absolute_reverse\nfrom api.base.serializers import JSONAPISerializer, RelationshipField, IDField, LinksField\n\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "posts: Add ability to filter posts by site\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom reversion import VersionAdmin\n\nfrom base.admin import PrettyFilterMixin, RestrictedCompetitionAdminMixin\nfrom base.util import admin_commentable, ... | python | chosen |
[
{
"from": "system",
"value": "Fix relative import that does not work with py 3.\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may o... | python | chosen |
[
{
"from": "system",
"value": "Fix line endings in file\n"
},
{
"from": "human",
"value": "import numpy as np\r\n\r\nfrom poliastro.core import util\r\n\r\n\r\ndef test_rotation_matrix_x():\r\n result = util.rotation_matrix(0.218, 0)\r\n expected = np.array(\r\n [[1.0, 0.0, 0.0], [0.... | python | chosen |
[
{
"from": "system",
"value": "Fix relative import in top numpy.distutils.\n"
},
{
"from": "human",
"value": "\nfrom __version__ import version as __version__\n\n# Must import local ccompiler ASAP in order to get\n# customized CCompiler.spawn effective.\nimport ccompiler\nimport unixccompiler\n\n... | python | chosen |
[
{
"from": "system",
"value": "Save the generated noise image.\n"
},
{
"from": "human",
"value": "\nfrom PIL import Image # Depends on the Pillow lib\n\nfrom opensimplex import OpenSimplexNoise\n\nWIDTH = 512\nHEIGHT = 512\nFEATURE_SIZE = 24\n\ndef main():\n simplex = OpenSimplexNoise()\n i... | python | chosen |
[
{
"from": "system",
"value": "Use sqlite if no DEV_DATABASE specified in development env\n"
},
{
"from": "human",
"value": "import os\n\n\nclass Config:\n SECRET_KEY = os.environ.get('SECRET_KEY')\n SQLALCHEMY_COMMIT_ON_TEARDOWN = True\n\n @staticmethod\n def init_app(app):\n ... | python | chosen |
[
{
"from": "system",
"value": "Correct function name and put report_timing_summary at end of script.\n\nSigned-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>\n"
},
{
"from": "human",
"value": "\"\"\" Utility for generating TCL script to output timing inf... | python | chosen |
[
{
"from": "system",
"value": "Put weblink on separate line\n"
},
{
"from": "human",
"value": "# https://www.openstreetmap.org/way/28825404\nassert_has_feature(\n 16, 10476, 25242, 'roads',\n { 'id': 28825404, 'kind': 'minor_road', 'highway': 'raceway' })\n\n# Thunderoad Speedway Go-carts h... | python | chosen |
[
{
"from": "system",
"value": "Return if keyword is already being tracked.\n"
},
{
"from": "human",
"value": "import time\n\nfrom noisytweets.tweetstreamer import TweetStreamer\n\nclass KeywordsManager:\n\n max_keywords = 100\n ping_timeout = 30\n\n def __init__(self):\n self._key... | python | chosen |
[
{
"from": "system",
"value": "Handle inplace generation of __config__.\n\ngit-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@5583 94b884b6-d6fd-0310-90d3-974f1d3f35e1\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ndef configuration(parent_package='',top_path=None):\n from numpy... | python | chosen |
[
{
"from": "system",
"value": "Remove locking logic from sync watchdog\n"
},
{
"from": "human",
"value": "from tapiriik.database import db, close_connections\nfrom tapiriik.sync import SyncStep\nimport os\nimport signal\nimport socket\nfrom datetime import timedelta, datetime\n\nprint(\"Sync watc... | python | chosen |
[
{
"from": "system",
"value": "Make mypy ignore auto-generated file\n\nIt won't be present in CI, and may not be present when developing.\n"
},
{
"from": "human",
"value": "from todoman import version\n\n__version__ = version.version\n__documentation__ = \"https://todoman.rtfd.org/en/latest/\"\n"... | python | chosen |
[
{
"from": "system",
"value": "Move ValidationError messages to a dictionary that can be accessed from PinForm.clean\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom .models import Pin\n\n\nclass PinForm(forms.ModelForm):\n url = forms.CharField(required=False)\n image = ... | python | chosen |
[
{
"from": "system",
"value": "[REF] openacademy: Modify copy method into inherit\n"
},
{
"from": "human",
"value": "from openerp import models, fields, api\n \n\n\nclass Course(models.Model):\n _name = 'openacademy.course' # Model odoo name\n\n name = fields.Char(string='Title', required=... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in function that lists existing jterator projects\n"
},
{
"from": "human",
"value": "from tmlib.workflow.args import Argument\nfrom tmlib.workflow.args import BatchArguments\nfrom tmlib.workflow.args import SubmissionArguments\nfrom tmlib.workflow.args impor... | python | chosen |
[
{
"from": "system",
"value": "Fix (another) syntax error. Thanks, bumpversion\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__author__ = \"\"\"Jason Emerick\"\"\"\n__email__ = 'jason@mobelux.com'\n__version__ = '__version__ = '__version__ = '__version__ = '0.2.7''''\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Define default values for host and port\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask import request\nfrom flask import jsonify\nimport json\nimport subprocess\n\napp = Flask(__name__)\nconfig = None\n\n@app.route('/', methods=['POST'])\ndef... | python | chosen |
[
{
"from": "system",
"value": "Create class for the reflectors\n"
},
{
"from": "human",
"value": "import string\n\n\nclass Steckerbrett:\n def __init__(self):\n pass\n\n\nclass Walzen:\n def __init__(self):\n pass\n\n\nclass Enigma:\n def __init__(self):\n pass\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update timeout to 10 seconds\n"
},
{
"from": "human",
"value": "from collections import OrderedDict\n\nACTORS = list('NRAIOVF')\n\nFILE_COMMANDS = ['copy', 'compare']\n\nVERBOSITY = OrderedDict(\n [ ('RETURN_CODE', 0),\n ('RESULT' , 1),\n... | python | chosen |
[
{
"from": "system",
"value": "Drop FIREBASE_SECRET (since been revoked)\n"
},
{
"from": "human",
"value": "# Fill out with value from\n# https://firebase.corp.google.com/project/trogdors-29fa4/settings/database\nFIREBASE_SECRET = \"ZiD9uLhDnrLq2n416MjWjn0JOrci6H0oGm7bKyVN\"\nFIREBASE_EMAIL = \"\... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug - salome.py is not imported here and this causes run-time Python exception\n"
},
{
"from": "human",
"value": "import SMESH\n\ndef BuildGroupLyingOn(theMesh, theElemType, theName, theShape):\n aMeshGen = salome.lcc.FindOrLoadComponent(\"FactoryServer\", ... | python | chosen |
[
{
"from": "system",
"value": "Correct unit tests to comply with new team name RE\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.template.defaultfilters import slugify\nfrom django.core.exceptions import ValidationError\n\nfrom competition.validators import great... | python | chosen |
[
{
"from": "system",
"value": "Set bplan default email to english as default\n"
},
{
"from": "human",
"value": "from adhocracy4.emails import Email\n\n\nclass OfficeWorkerNotification(Email):\n template_name = 'meinberlin_bplan/emails/office_worker_notification'\n\n @property\n def offic... | python | chosen |
[
{
"from": "system",
"value": "Add verification for removing key from netrc file\n"
},
{
"from": "human",
"value": "import re, click\nfrom shub.utils import get_key_netrc, NETRC_FILE\n\n@click.command(help='remove Scrapinghug API key from the netrc file')\n@click.pass_context\ndef cli(context):\n... | python | chosen |
[
{
"from": "system",
"value": "Add helper method to turn queries into json-serializable lists\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\n\n\ndef model_to_json(model):\n \"\"\" Returns a JSON representation of an SQLAlchemy-backed object.\n\n... | python | chosen |
[
{
"from": "system",
"value": "Make import statements explicit relative imports\n"
},
{
"from": "human",
"value": "VERSION='2.4.5'\n\nfrom client import *\nfrom oauth2 import *\nfrom util import *\n"
},
{
"from": "gpt",
"value": "VERSION='2.4.5'\n\nfrom .client import *\nfrom .oauth2 ... | python | chosen |
[
{
"from": "system",
"value": "Correct import behavior to prevent Runtime error\n"
},
{
"from": "human",
"value": "\"\"\"\nsentry.utils.imports\n~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Change version ID to make PyPi happy\n"
},
{
"from": "human",
"value": "# inspired from:\n\n# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/\n# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py\n\n__title__ = ... | python | chosen |
[
{
"from": "system",
"value": "Change lab assistant constant to one word\n"
},
{
"from": "human",
"value": "\"\"\"App constants\"\"\"\n\nSTUDENT_ROLE = 'student'\nGRADER_ROLE = 'grader'\nSTAFF_ROLE = 'staff'\nINSTRUCTOR_ROLE = 'instructor'\nLAB_ASSISTANT_ROLE = 'lab assistant'\nVALID_ROLES = [STU... | python | chosen |
[
{
"from": "system",
"value": "Expand 5xx coverage; log exceptions\n"
},
{
"from": "human",
"value": "import opentracing.ext.tags as ext\nimport opentracing\nimport wrapt\n\n\n@wrapt.patch_function_wrapper('urllib3', 'PoolManager.urlopen')\ndef urlopen_with_instana(wrapped, instance, args, kwargs... | python | chosen |
[
{
"from": "system",
"value": "Add method for uncalibrated values of iOS Gyroscope\n"
},
{
"from": "human",
"value": "'''\niOS Gyroscope\n---------------------\n'''\n\nfrom plyer.facades import Gyroscope\nfrom pyobjus import autoclass\n\nfrom pyobjus.dylib_manager import load_framework\n\nload_fr... | python | chosen |
[
{
"from": "system",
"value": "Rewrite URLs for playbook app\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom ansible.forms import AnsibleForm1, AnsibleForm2\nfrom ansible.views import (\n PlaybookWizard, PlaybookListView, PlaybookDetailView,\n PlaybookFileCreateVie... | python | chosen |
[
{
"from": "system",
"value": "Send request_count and error_count outside sensor_data\n"
},
{
"from": "human",
"value": "import json\nimport requests\nimport time\n\nfrom collections import Counter\nfrom multiprocessing import Process, Queue\nfrom queue import Empty\n\nshared_queue = None\n\n\nde... | python | chosen |
[
{
"from": "system",
"value": "Make sure @ notify is the first decorator\n\nfixes #91"
},
{
"from": "human",
"value": "\"\"\"Example of integration between Fabric and Datadog.\n\"\"\"\n\nfrom fabric.api import *\nfrom fabric.colors import *\nfrom dogapi.fab import setup, notify\n\nsetup(api_key =... | python | chosen |
[
{
"from": "system",
"value": "Change resp processing to cassandra -- need to fix tests for postgres\n"
},
{
"from": "human",
"value": "DEBUG = False\n\nBROKER_URL = 'amqp://guest@localhost'\n\nRECORD_HTTP_TRANSACTIONS = False\n\nCELERY_EAGER_PROPAGATES_EXCEPTIONS = True\n\nRAW_PROCESSING = ['cas... | python | chosen |
[
{
"from": "system",
"value": "Use EmptyOTFCompiler for test compilation\n"
},
{
"from": "human",
"value": "from string import split\nfrom os import remove\nfrom mojo.roboFont import version\n\nfrom jkRFoTools.FontChooser import ProcessFonts\n\ndef test_compilation(font):\n temp_font = font.co... | python | chosen |
[
{
"from": "system",
"value": "Refactor import path and usage\n"
},
{
"from": "human",
"value": "\nimport os\nimport sys\nimport MySQLdb\nsys.path.append('D:\\\\Projects\\\\PySQLKits\\\\lib\\\\simplequery')\nfrom table_data import *\nfrom simplequery import *\n\n\ndef get_mysql_connection():\n ... | python | chosen |
[
{
"from": "system",
"value": "Set request language in admin panel if user request a different language\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCopyright 2010 Asidev s.r.l.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou... | python | chosen |
[
{
"from": "system",
"value": "Add Admin beginner task field TaxonomyNode\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom datasets.models import Dataset, Sound, Vote, Taxonomy, DatasetRelease, TaxonomyNode\n\n\nclass TaxonomyNodeAdmin(admin.ModelAdmin):\n fields = ('n... | python | chosen |
[
{
"from": "system",
"value": "Update on the method names\n"
},
{
"from": "human",
"value": "from time import strftime\n\n\"\"\"logger.py: A simple logging module\"\"\"\n\n__author__ = \"Prajesh Ananthan\"\n\n\ndef printDebug(text):\n print(strftime('%d/%b/%Y %H:%M:%S DEBUG | {}'.format(text))... | python | chosen |
[
{
"from": "system",
"value": "Test step for check the Gremlin response structure\n"
},
{
"from": "human",
"value": "\"\"\"Tests for Gremlin database.\"\"\"\nimport os\nimport requests\n\nfrom behave import given, then, when\nfrom urllib.parse import urljoin\n\n\n@when('I access Gremlin API')\nde... | python | chosen |
[
{
"from": "system",
"value": "Remove comment for running under uwsgi"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nfrom flask_script import Manager, Server\nfrom flask_script.commands import ShowUrls, Clean\nfrom mothership import create_app\nfrom mothership.models impor... | python | chosen |
[
{
"from": "system",
"value": "Add url for listing protocols\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\n\nurlpatterns = patterns('protocols.views',\n url(r'^archive/$', 'list_all_protocols', name='list_all_protocols'),\n url(r'^add/$', 'add', name='add_... | python | chosen |
[
{
"from": "system",
"value": "MNT: Make io module docstring conform to standards\n\nPicked up by pydocstyle 3.0.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015,2016,2018 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Claus... | python | chosen |
[
{
"from": "system",
"value": "Use id as required parameter\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n\tsphinxcontrib.openstreetmap\n\t===========================\n\n\tEmbed OpenStreetMap on your documentation.\n\n\t:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gmai... | python | chosen |
[
{
"from": "system",
"value": "Use the user that has been threaded through the request by the authentication middleware\n\nNOTE If the DummyAuthenticator is being used, then this will be the root\nuser in every request, per the semantics of the original\n"
},
{
"from": "human",
"value": "\"\"\"\n... | python | chosen |
[
{
"from": "system",
"value": "Fix outdated command line help\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\nfrom .flag import FLAGS, FlagAdder\nfrom .estimator import def_estimator\nfrom .inputs import def_def_train_input_fn\nfrom .inputs import def_def_eval_input_fn\n\n\ndef def_... | python | chosen |
[
{
"from": "system",
"value": "Change delivery of communication to manual digital by default\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2016 Compassion CH (http://www.compassio... | python | chosen |
[
{
"from": "system",
"value": "Add owner as a primary, foreign key"
},
{
"from": "human",
"value": "from flock import db\n\nclass Event(db.Model):\n\t\n\tid = db.Column(db.Integer, primary_key=True)\n\n\tdef __init__(self):\n\t\tpass\n"
},
{
"from": "gpt",
"value": "from flock import ... | python | chosen |
[
{
"from": "system",
"value": "Send proper response time even if non-200\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom maas_common import (status_ok, status_err, metric, get_keystone_client,\n get_auth_ref)\nfrom requests import Session\nfrom requests im... | python | chosen |
[
{
"from": "system",
"value": "Update version: add python 3.3 to classifiers.\n"
},
{
"from": "human",
"value": "ο»Ώ__version = (1, 0, 4)\n\n__version__ = version = '.'.join(map(str, __version))\n__project__ = PROJECT = __name__\n\n#from .jsonrpc import JSONRPCProtocol, JSONRPCRequest, JSONRPCRespo... | python | chosen |
[
{
"from": "system",
"value": "Add ScrollableDropdown import to ipywidgets\n"
},
{
"from": "human",
"value": "from .widget import Widget, CallbackDispatcher, register, widget_serialization\nfrom .domwidget import DOMWidget\n\nfrom .trait_types import Color, EventfulDict, EventfulList\n\nfrom .wid... | python | chosen |
[
{
"from": "system",
"value": "Make this work with python2 too.\n"
},
{
"from": "human",
"value": "# see https://ipython.org/ipython-doc/3/config/custommagics.html\n# for more details on the implementation here\nimport uuid\n\nfrom IPython.core.getipython import get_ipython\nfrom IPython.core.mag... | python | chosen |
[
{
"from": "system",
"value": "Use pprint instead of json for formatting\n\njson.dumps fails to print anything for an object. I would prefer to show\na representation of the object rather than filter it out so rely on\npprint instead.\n"
},
{
"from": "human",
"value": "# Licensed under the Apache... | python | chosen |
[
{
"from": "system",
"value": "admin_screenshow: Add form for irc messages.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import forms\nfrom django.core.exceptions import ValidationError\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Submi... | python | chosen |
[
{
"from": "system",
"value": "Use relative imports in datasets.\n"
},
{
"from": "human",
"value": "from base import load_diabetes\nfrom base import load_digits\nfrom base import load_files\nfrom base import load_iris\nfrom mlcomp import load_mlcomp\n"
},
{
"from": "gpt",
"value": "fr... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to the view mixin\n"
},
{
"from": "human",
"value": "from django.views.generic.list import MultipleObjectMixin\n\n__all__ = ('FilterFormMixin',)\n\n\nclass FilterFormMixin(MultipleObjectMixin):\n \"\"\"\n Mixin that adds filtering behaviour for ... | python | chosen |
[
{
"from": "system",
"value": "Use custom modules in modules.py\n\n"
},
{
"from": "human",
"value": "from Synopsis.Config import Base\nclass Config (Base):\n class Formatter (Base.Formatter):\n\tclass HTML (Base.Formatter.HTML):\n\t toc_output = 'links.toc'\n\t pages = [\n\t\t'ScopePages... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.