conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Remove infinity from valid bounds\n"
},
{
"from": "human",
"value": "from citrination_client.views.descriptors.descriptor import MaterialDescriptor\n\n\nclass RealDescriptor(MaterialDescriptor):\n def __init__(self, key, lower_bound=\"-Infinity\", upper_bound=\"I... | python | chosen |
[
{
"from": "system",
"value": "Update for new nose plugin location.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nnose runner script.\n\nOnly use this script if setuptools is not available, i.e. such as\non Python 3K. Otherwise consult README.unittests for the \nrecommended m... | python | chosen |
[
{
"from": "system",
"value": "Add missing user_id_seq in migration script\n"
},
{
"from": "human",
"value": "from sqlalchemy.sql import text\nfrom c2corg_api.scripts.migration.migrate_base import MigrateBase\n\n\nclass UpdateSequences(MigrateBase):\n sequences = [\n ('guidebook', 'docu... | python | chosen |
[
{
"from": "system",
"value": "Return recent statement data in GET response.\n"
},
{
"from": "human",
"value": "from django.views.generic import View\nfrom django.http import JsonResponse\nfrom chatterbot import ChatBot\nfrom chatterbot.ext.django_chatterbot import settings\n\n\nclass ChatterBotV... | python | chosen |
[
{
"from": "system",
"value": "Allow run-test.py to be launched by './run-test.py' command.\n"
},
{
"from": "human",
"value": "import unittest\n\n\ndef main(): # pragma: no cover\n test_suite = unittest.TestLoader().discover('tests/')\n results = unittest.TextTestRunner(verbosity=1).run(tes... | python | chosen |
[
{
"from": "system",
"value": "Fix documentation of top sort.\n\nChange wording from list to sequence and include note about how to\nspecify no dependencies.\n\nSigned-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>\n"
},
{
"from": "human",
"value": "\ndef topolo... | python | chosen |
[
{
"from": "system",
"value": "Add AppSettings dict to app config and inject it\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom flask_login import LoginManager\nfrom flask_misaka import Misaka\nfrom flask_moment import Moment\nfrom flask_security import Security, SQLAlchemyUserDa... | python | chosen |
[
{
"from": "system",
"value": "Allow count method to be used the same way as find.\n"
},
{
"from": "human",
"value": "class Countable(object):\n @classmethod\n def count(cls, options={}):\n return int(cls.get(\"count\", **options))\n\n\nclass Metafields(object):\n def metafields(s... | python | chosen |
[
{
"from": "system",
"value": "Fix connection error when you run \"create_tables\"\n"
},
{
"from": "human",
"value": "from flask.cli import AppGroup\nfrom flask_migrate import stamp\nmanager = AppGroup(help=\"Manage the database (create/drop tables).\")\n\n\n@manager.command()\ndef create_tables(... | python | chosen |
[
{
"from": "system",
"value": "Fix bot infinte image loop\n"
},
{
"from": "human",
"value": "from modules.module_base import ModuleBase\nfrom tools.nsfw import Nsfw\n\n\nclass ModuleNSFW(ModuleBase):\n def __init__(self, bot):\n ModuleBase.__init__(self, bot)\n self.name = \"NSFW... | python | chosen |
[
{
"from": "system",
"value": "Change format of sub-module names in the object module to str\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom __future__ import unicode_literals\n\nimport six\n\n\n__all__ = [\n 'collaboration',\n 'events',\n 'file',\n 'folder',\n 'group',\... | python | chosen |
[
{
"from": "system",
"value": "Add initial check file check\n"
},
{
"from": "human",
"value": "\"\"\"Tests the isort API module\"\"\"\nimport pytest\n\nfrom isort import api, exceptions\n\n\ndef test_sort_file_invalid_syntax(tmpdir) -> None:\n \"\"\"Test to ensure file encoding is respected\"\... | python | chosen |
[
{
"from": "system",
"value": "Add equlaity comparisons to LineChange class.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom enum import Enum\n\nclass LineChange:\n\n class ChangeType(Enum):\n added = 1\n deleted = 2\n modified = 3\n\n def ... | python | chosen |
[
{
"from": "system",
"value": "Make Station.lines into a property\n"
},
{
"from": "human",
"value": "class Color(object):\n def __init__(self, r, g, b):\n self.r = r\n self.g = g\n self.b = b\n\n\nclass Line(object):\n def __init__(self, name, api_code, bg_color, fg_col... | python | chosen |
[
{
"from": "system",
"value": "Add missing import to test to fix travis\n"
},
{
"from": "human",
"value": "import unittest\nimport logging\nimport types\nimport time\n\nfrom util import EC2\n\nclass TestEC2(unittest.TestCase):\n\n def test_metadata(self):\n # Skip this step on travis\n ... | python | chosen |
[
{
"from": "system",
"value": "Rewrite str tests with hypothesis\nRemove lists from testing\n"
},
{
"from": "human",
"value": "import pytest\nfrom hypothesis import given\nfrom hypothesis.strategies import lists, text\nfrom datatyping.datatyping import validate\n\n\n@given(ss=lists(text()))\ndef ... | python | chosen |
[
{
"from": "system",
"value": "FIx broken Python code in chat bot tutorial\n\n"
},
{
"from": "human",
"value": "# Address of the beam website.\n# No trailing slash.\nbeam_addr = 'https://beam.pro'\n\n# Username of the account.\nusername = 'username'\n\n# Password of the account.\npassword = 'pass... | python | chosen |
[
{
"from": "system",
"value": "Create a game class to store information about an instantiated game object\n"
},
{
"from": "human",
"value": "from PodSixNet.Channel import Channel\nfrom PodSixNet.Server import Server\n\nfrom time import sleep\n\n#Create the channel to deal with our incoming reques... | python | chosen |
[
{
"from": "system",
"value": "Add more HTTP headers to GhettoOauth\n\nThe official iPhone Twitter client uses \nHTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION when it's\nconnecting to image upload services."
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nimport re\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Update post view to save username references and save a post id in user entity\n"
},
{
"from": "human",
"value": "from flask import render_template, redirect, url_for\nfrom flask_classy import FlaskView, route\nfrom flask_user import login_required\nfrom ..models im... | python | chosen |
[
{
"from": "system",
"value": "Adjust module and class references to accessible from package top level.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n__author__ = \"\"\"Franz Woellert\"\"\"\n__email__ = 'franz.woellert@gmail.com'\n__version__ = '0.1.0'\n"
},
{
"from": "gpt... | python | chosen |
[
{
"from": "system",
"value": "Fix a bug in the GC% formatting.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n\n\"\"\"\\\nPerform various simple manipulations on DNA sequences.\n\nUsage:\n dna len <seq>\n dna rc <seq>\n dna gc <seq> [--fraction]\n\nCommands:\n len: Print... | python | chosen |
[
{
"from": "system",
"value": "Add insertion sort with duplicate values test\n"
},
{
"from": "human",
"value": "from random import shuffle\nimport pytest\n\nfrom insertion_sort import in_sort\n\n\ndef test_insertion_sort():\n expected = range(20)\n unsorted = expected[:]\n shuffle(unsort... | python | chosen |
[
{
"from": "system",
"value": "Use the full option name for clarity and also search in the user's home directory\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Ilya Akhmadullin\n# Copyright (c) 2013 Ily... | python | chosen |
[
{
"from": "system",
"value": "Use generic path for ALS on iio device0.\n"
},
{
"from": "human",
"value": "# todo: chargedness of battery\n\nimport time\nfrom datetime import datetime\nimport numpy as np\n\ntry:\n from whereami.predict import Predicter\n p = Predicter()\nexcept ImportError:... | python | chosen |
[
{
"from": "system",
"value": "Use Memory.size field for read/write checks\n"
},
{
"from": "human",
"value": "class Memory(object):\n def __init__(self, size):\n self.size = size\n self.memory = bytearray([0] * size)\n\n def read(self, addr, count):\n if addr + count > ... | python | chosen |
[
{
"from": "system",
"value": "Support python 2 and 3\n\nAdd source argument.\nUpdate arguments to use long names from GNU netcat.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python2\nimport argparse\nimport socket\nimport sys\n\nparser = argparse.ArgumentParser(description='Simple netcat in pu... | python | chosen |
[
{
"from": "system",
"value": "Add rest_framework view to obtain auth token\n"
},
{
"from": "human",
"value": "from django.conf.urls import url, include\nfrom . import views\n\nurlpatterns = [\n url(r'^generate_pdf/(?P<bill_id>\\d+)$', views.generate_pdf,\n name='generate-pdf'),\n ur... | python | chosen |
[
{
"from": "system",
"value": "Change Challenges model block column to type Integer\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom downstream_node.startup import db\n\n\nclass Files(db.Model):\n __tablename__ = 'files'\n\n id = db.Column(db.Integer()... | python | chosen |
[
{
"from": "system",
"value": "Send email to Blink gardeners when tree closes.\n\nR=eseidel@chromium.org,iannucci@chromium.org\nBUG=323059\n\nReview URL: https://codereview.chromium.org/84973002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@237359 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Fix signature because of test failure\n"
},
{
"from": "human",
"value": "\"\"\"\nThis signature contains tests to see if the site is running on Hippo CMS.\n\"\"\"\n__author__ = \"Jeroen Reijn\"\n__copyright__ = \"CM Fieldguide\"\n__credits__ = [\"Jeroen Reijn\",]\n_... | python | chosen |
[
{
"from": "system",
"value": "Create user_profile automatically after user creation\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass UserProfile(models.Model):\n user = models.OneToOneField(User)\n description = models.Text... | python | chosen |
[
{
"from": "system",
"value": "Test char rnn with static batch size\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\nfrom .char_rnn import char_rnn\n\n\ndef test_char_rnn():\n for i, (sentence_shape, labels_shape) in enumerate([\n [[None, 64, 8], [None, 64]],\n ... | python | chosen |
[
{
"from": "system",
"value": "Update script-src to include newrelic\n"
},
{
"from": "human",
"value": "# define flask extensions in separate file, to resolve import dependencies\n\nfrom flask_sqlalchemy import SQLAlchemy\ndb = SQLAlchemy()\n\nfrom flask_caching import Cache\ncache = Cache()\n\nf... | python | chosen |
[
{
"from": "system",
"value": "Update timestamp on screenx post\n"
},
{
"from": "human",
"value": "title=\"ScreenX TV: First Impressions\"\ndescription=\"\"\"\nMy initial thoughts of [ScreenX TV](http://screenx.tv), a way to broadcast\nyour terminal to the world.\n\"\"\"\ntime=\"2012-12-07 Fri 09... | python | chosen |
[
{
"from": "system",
"value": "Add alias to appropriate raw bytes for this Python.\n"
},
{
"from": "human",
"value": "__description__ = \"VOEvent Broker\"\n__url__ = \"http://comet.transientskp.org/\"\n__author__ = \"John Swinbank\"\n__contact__ = \"swinbank@princeton.edu\"\n__version__ = \"2.1.0... | python | chosen |
[
{
"from": "system",
"value": "Fix in test file key error\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport tensorflow as tf\nfrom tensorflow_datasets.image import places365_small\nimport tenso... | python | chosen |
[
{
"from": "system",
"value": "Fix time delta with utcnow\n"
},
{
"from": "human",
"value": "import datetime\nimport misaka\nfrom flask.ext.babel import gettext as _\n\n\ndef timeago(dt):\n now = datetime.datetime.now()\n delta = now - dt\n print delta\n if delta < datetime.timedelta(... | python | chosen |
[
{
"from": "system",
"value": "Fix regexp for rpmlint output\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by skulanov,,,\n# Copyright (c) 2015 skulanov,,,\n#\n# License: MIT\n#\n\n\"\"\"This module expor... | python | chosen |
[
{
"from": "system",
"value": "Add missing max_length on temporary thumbnail_url migration\n\nFixes #7323\n"
},
{
"from": "human",
"value": "from django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"wagtailembeds\", \"0007_populate_ha... | python | chosen |
[
{
"from": "system",
"value": "Check for website title before replying\n"
},
{
"from": "human",
"value": "from smartbot import utils\n\nclass Plugin:\n def __call__(self, bot):\n bot.on_hear(r\"(https?:\\/\\/[^\\s]+)\", self.on_hear)\n bot.on_help(\"websites\", self.on_help)\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add '%' in coverage badge\n"
},
{
"from": "human",
"value": "# -*- coding: utf8 -*-\nimport requests\nfrom django.contrib.staticfiles import finders\nfrom django.core.cache import cache\n\n\ndef get_badge(succeeded):\n key = 'badge{}'.format(succeeded)\n badge... | python | chosen |
[
{
"from": "system",
"value": "Tweak nccmp to be more spack-compatible.\n\n- Spack doesn't set F90, but it confuses the nccmp build. Just remove\n it from the environment.\n\n- TODO: should build environment unset this variable?\n"
},
{
"from": "human",
"value": "from spack import *\nimport os\... | python | chosen |
[
{
"from": "system",
"value": "Add a library version test\n"
},
{
"from": "human",
"value": "from cloudbridge.cloud import interfaces\nfrom test.helpers import ProviderTestBase\n\n\nclass CloudInterfaceTestCase(ProviderTestBase):\n\n def __init__(self, methodName, provider):\n super(Clo... | python | chosen |
[
{
"from": "system",
"value": "Tag v0.5.11 and update copyright year\n"
},
{
"from": "human",
"value": "__title__ = 'kaptan'\n__package_name__ = 'kaptan'\n__version__ = '0.5.10'\n__description__ = 'Configuration manager'\n__email__ = 'mail@emreyilmaz.me'\n__url__ = 'https://github.com/emre/kaptan... | python | chosen |
[
{
"from": "system",
"value": "Add popdb() and edit descriptions\n"
},
{
"from": "human",
"value": "from os.path import abspath\n\nfrom flask import current_app as app\nfrom app import create_app, db\n# from app.model import init_db\nfrom flask.ext.script import Manager\n\nmanager = Manager(creat... | python | chosen |
[
{
"from": "system",
"value": "Allow script args to be passed; reconstitute sys.argv for script\n\nSigned-off-by: Dan Mick <b07550071eaa6a9296289c43bbd6c90559196431@inktank.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport os\nimport pdb\n\nimport pkg_resour... | python | chosen |
[
{
"from": "system",
"value": "TEST: Update test that relies on fragile string comparison\n\nIt is a string comparison of formulae. The new output differs from the\nreference in terms of whitespace and redundant parens.\n"
},
{
"from": "human",
"value": "import logging\nlogging.basicConfig(level=... | python | chosen |
[
{
"from": "system",
"value": "Move to fix column names.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 12/11/16\nClass: Introduction to Python\nAssignment: Final Project\n\nDescription:\nCode for Final Project\n\"\"\"\n\nimport pandas\nfrom datetime import datetime\n\n# Chan... | python | chosen |
[
{
"from": "system",
"value": "Enable search of paginated pages\n"
},
{
"from": "human",
"value": "from bs4 import BeautifulSoup\nimport requests\n\ndef get_html():\n r = requests.get('http://vancouver.craigslist.ca/search/cto?query=Expedition')\n print(r.status_code)\n print(r.text)\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"do not use minified js on prod\"\n\nThis reverts commit 338f5f9c3ff8be9a87abff2b235408c8fed26346.\n"
},
{
"from": "human",
"value": "import os\n\nfrom rmc.config.flask_base import *\nimport rmc.shared.secrets as s\n\nJS_DIR = 'js'\nDEBUG = False\nENV = 'pro... | python | chosen |
[
{
"from": "system",
"value": "Fix header of Python file\n\nNow correctly points to the Python interpretor\n"
},
{
"from": "human",
"value": "#!/usr/bin/env/python\n\nimport socket, fcntl, sys\n\n#Lock to only allow one instance of this program to run\npid_file = '/tmp/send.pid'\nfp = open(pid_fi... | python | chosen |
[
{
"from": "system",
"value": "Add simple end-to-end test case for beta rules\n\nSigned-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>\n"
},
{
"from": "human",
"value": "from pymanopt.optimizers import ConjugateGradient\n\nfrom .._test import TestCase\n\n\nclass TestConj... | python | chosen |
[
{
"from": "system",
"value": "Add invalid bg_color test cases\n"
},
{
"from": "human",
"value": "import pytest\nimport webview\nfrom .util import destroy_window, run_test\n\ndef bg_color():\n import webview\n destroy_window(webview)\n webview.create_window('Background color test', 'http... | python | chosen |
[
{
"from": "system",
"value": "Add test for latest datasets\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom tests import api\n\n\nRESULT_ATTRIBUTES = [\n 'id',\n 'total_products',\n 'total_stores',\n 'total_inventories',\n 'total_product_inventory_count',\n 'total_produ... | python | chosen |
[
{
"from": "system",
"value": "Allow inactive sessions to last 14 days instead of 1 day\n"
},
{
"from": "human",
"value": "import datetime\n\nfrom db import session\nimport model\n\n\nclass UserInfo:\n\n def __init__(self, user=None, token=None):\n self.id = user.id if user else None\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a way to reload the tests from the main command file\n"
},
{
"from": "human",
"value": "import unittest\n\n# Remember: \n# Import your package here\n# Install AAAPT package to run the tests\n\nclass Test_{package_name}Command(unittest.TestCase):\n pass"
... | python | chosen |
[
{
"from": "system",
"value": "Sort initial_data/ files by filename\n"
},
{
"from": "human",
"value": "from base.constants import *\n\n\nfrom django.dispatch import receiver\nfrom django.db.models.signals import post_syncdb\nfrom south.signals import post_migrate\n\n\n# South doesn't automaticall... | python | chosen |
[
{
"from": "system",
"value": "Add NDDataBase to package import\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nThe `astropy.nddata` subpackage provides the `~astropy.nddata.NDData`\nclass and related tools to manage n-dimensional arra... | python | chosen |
[
{
"from": "system",
"value": "Allow other parts of the lib to enable debugging\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom cas.config import DEBUG\nimport logging\n\nLOG = logging.getLogger()\n\nif DEBUG:\n logging.basicConfig()\n LOG.setLevel(logging.... | python | chosen |
[
{
"from": "system",
"value": "Fix nan comparison in new dimensionless beta nan test\n"
},
{
"from": "human",
"value": "from plasmapy.physics.dimensionless import (beta)\n\nimport astropy.units as u\nimport numpy as np\n\nB = 1.0 * u.T\nn = 5e19 * u.m ** -3\nT = 1e6 * u.K\n\n\ndef test_beta_dimen... | python | chosen |
[
{
"from": "system",
"value": "Improve the error handling, better use of ArgumentParser.\n"
},
{
"from": "human",
"value": "# This file is part of Viper - https://github.com/botherder/viper\n# See the file 'LICENSE' for copying permission.\n\nimport argparse\n\n\nclass ArgumentParser(argparse.Arg... | python | chosen |
[
{
"from": "system",
"value": "Remove if branch to test django > 1.7\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nimport dj_database_url\nimport django\nfrom colour_runner.django_runner import ColourRunnerMixin\nfrom django.conf import settings\nfrom django.test.runner import Disco... | python | chosen |
[
{
"from": "system",
"value": "Add factory functions for dmenu and rofi in root dynmen file\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom .menu import Menu, MenuError\ndel menu\n\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\nfrom .menu import Menu, MenuE... | python | chosen |
[
{
"from": "system",
"value": "Fix broken tests in 1.8-1.10\n"
},
{
"from": "human",
"value": "from django.contrib.auth import get_user_model\nfrom django.db import models\nfrom django.utils.six import python_2_unicode_compatible\n\n\nUser = get_user_model()\n\n\n@python_2_unicode_compatible\ncla... | python | chosen |
[
{
"from": "system",
"value": "Create counter CFs for tests if version > 0.7\n"
},
{
"from": "human",
"value": "from pycassa.system_manager import *\n\nTEST_KS = 'PycassaTestKeyspace'\n\ndef setup_package():\n sys = SystemManager()\n if TEST_KS in sys.list_keyspaces():\n sys.drop_key... | python | chosen |
[
{
"from": "system",
"value": "Set default_auto_field on simple_translation app config\n\nPrevents the warning \"simple_translation.SimpleTranslation: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.\" when running under Django 3.2.\n"... | python | chosen |
[
{
"from": "system",
"value": "Add message attribute to DisplayError\n\nThe .message attribute was dropped from the base exception class\nin py3. Since we use it, set it directly.\n\nChange-Id: I27124c6d00216b335351ef6985ddf869f2fd1366\n"
},
{
"from": "human",
"value": "# Copyright 2014 OpenStac... | python | chosen |
[
{
"from": "system",
"value": "Set default response to 0\n"
},
{
"from": "human",
"value": "\nclass Player:\n def betRequest(self, game_state):\n return 453\n\n def showdown(self, game_state):\n pass\n\n"
},
{
"from": "gpt",
"value": "\nclass Player:\n def betRe... | python | chosen |
[
{
"from": "system",
"value": "Use g-cloud-10 services mapping for tests\n"
},
{
"from": "human",
"value": "\nimport pytest\nimport pathlib\nimport json\n\nimport app.mapping\n\n\nmappings_dir = (pathlib.Path(__file__).parent / \"../mappings\").resolve()\nservices_mappings = (\n \"services\",\... | python | chosen |
[
{
"from": "system",
"value": "Add relaunch to rfreceiver node\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport rospy\nimport serial\nfrom std_msgs.msg import Byte\n\ndef main():\n buttondown_pub = rospy.Publisher('/rfreceiver/buttondown', Byte, queue_size = 1)\n rospy.init_no... | python | chosen |
[
{
"from": "system",
"value": "Fix libnacl recipe missing libsodium\n"
},
{
"from": "human",
"value": "from pythonforandroid.toolchain import PythonRecipe\n\nclass LibNaClRecipe(PythonRecipe):\n version = '1.4.4'\n url = 'https://github.com/saltstack/libnacl/archive/v{version}.tar.gz'\n ... | python | chosen |
[
{
"from": "system",
"value": "Add test of detection using lanczos method\n"
},
{
"from": "human",
"value": "import unittest\nimport pandas as pd\nfrom banpei.sst import SST\n\n\nclass TestSST(unittest.TestCase):\n\n def setUp(self):\n self.raw_data = pd.read_csv('tests/test_data/period... | python | chosen |
[
{
"from": "system",
"value": "Fix string type comparison for py2\n"
},
{
"from": "human",
"value": "import pytest\nimport six\n\nfrom tilezilla import sensors\n\n\ndef test_friendly_names_data():\n # Test this variable is dict\n # Should contain [SENSOR (str)]:[MAPPING (dict)]\n # where... | python | chosen |
[
{
"from": "system",
"value": "Adjust default times to 1.5 and 5 seconds\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Blitz speed reading trainer add-on for Anki\n#\n# Copyright (C) 2016 Jakub Szypulka, Dave Shifflett\n#\n# This program is free software: you can redistribute i... | python | chosen |
[
{
"from": "system",
"value": "Set default for General.output to tsstats.html\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\ntry:\n from configparser import RawConfigParser\nexcept ImportError:\n from ConfigParser import RawConfigParser\n\nimport logging\n\nlogger = logging.g... | python | chosen |
[
{
"from": "system",
"value": "Add Tviit and profile url patterns\n"
},
{
"from": "human",
"value": "from django.contrib.auth import views as auth_views\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls import url\nfrom django.contrib import admin\nfrom . import views\nf... | python | chosen |
[
{
"from": "system",
"value": "Remove NipypeTester from doc generation.\n\ngit-svn-id: 24f545668198cdd163a527378499f2123e59bf9f@1373 ead46cd0-7350-4e37-8683-fc4c6f79bf00\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Script to auto-generate interface docs.\n\"\"\"\n# stdlib impor... | python | chosen |
[
{
"from": "system",
"value": "Change in the implementation of normal distribution\n"
},
{
"from": "human",
"value": "import numpy\n\nclass dist:\n normal, random = range(2)\n\n# Monte carlo simulation data\ndef montecarlo(callback, samples, **kwargs):\n \"\"\" generate random samples based... | python | chosen |
[
{
"from": "system",
"value": "Delete unnecessary vars attr of Proj\n"
},
{
"from": "human",
"value": "\"\"\"proj.py: aospy.Proj class for organizing work in single project.\"\"\"\nimport time\n\nfrom .utils import dict_name_keys\n\n\nclass Proj(object):\n \"\"\"Project parameters: models, reg... | python | chosen |
[
{
"from": "system",
"value": "Use full name (-d => --decode), and needed a comma"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Handles decoding flac files\"\"\"\nimport subprocess\nimport config\n\nHANDLES=['flac','fla']\n\ndef decode(inF, outF):\n st = subprocess.call([\"flac... | python | chosen |
[
{
"from": "system",
"value": "Prepare first beta for testing of 0.20.2\n"
},
{
"from": "human",
"value": "################################################################################\r\n#\r\n# Copyright 2015-2020 Félix Brezo and Yaiza Rubio\r\n#\r\n# This program is part of OSRFramewor... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in broadcasts endpoint usecase\n"
},
{
"from": "human",
"value": "from predicthq import Client\n\n# Please copy paste your access token here\n# or read our Quickstart documentation if you don't have a token yet\n# https://docs.predicthq.com/guides/quickstar... | python | chosen |
[
{
"from": "system",
"value": "Add test for shared container."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom flask import Flask\nfrom flask.ext.knot import Knot\n\n\ndef create_app():\n app = Flask(__name__)\n app.config['TESTING'] = True\n return app\n... | python | chosen |
[
{
"from": "system",
"value": "Fix date error in books model\n\nFix typos and the auto addition of date to the date_added field.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom datetime import date\nfrom django.utils import timezone\n# Create your models here.\n\nclass Book(... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Support adding an /etc/host entry for the data proxy, if asked.\"\n\nThis reverts commit 062f975d92c5795feb530e3ea1914d3c7dd3a96b.\n\nThere is no more need for this support in the docker image. It is fully\nexternally handled through docker run's `--add-host` feature.... | python | chosen |
[
{
"from": "system",
"value": "Add follow up with matrix traversal\n"
},
{
"from": "human",
"value": "def graph_dfs(matrix):\n rows, cols = len(matrix), len(matrix[0])\n visited = set()\n directions = ((0, 1), (0, -1), (1, 0), (-1, 0))\n def dfs(i, j):\n if (i, j) in visited:\n... | python | chosen |
[
{
"from": "system",
"value": "Add simple test for coverage.\n"
},
{
"from": "human",
"value": "\"\"\"\nTests utility scripts\n\"\"\"\nimport os\n\nfrom django.test import TestCase, RequestFactory\nfrom django.test.utils import override_settings\n\nimport pivot\nfrom pivot.utils import get_latest... | python | chosen |
[
{
"from": "system",
"value": "Make redis subscription work with python-redis' latest versions\n"
},
{
"from": "human",
"value": "\nimport redis\nimport re\nfrom common import get_db\nfrom datetime import datetime\n\nMSGPATTERN = re.compile('^(\\w+)\\|(\\d)\\|([\\s\\S]*)$')\nCHANNEL = 'logfire'\n... | python | chosen |
[
{
"from": "system",
"value": "Set a KEY_PREFIX for the Redis cache, so that we don't get collisions when running multiple sites on one server\n"
},
{
"from": "human",
"value": "from .base import *\n\nDEBUG = False\n\n\nWAGTAILSEARCH_BACKENDS = {\n 'default': {\n 'BACKEND': 'wagtail.wag... | python | chosen |
[
{
"from": "system",
"value": "Change concatination of parsed data\n"
},
{
"from": "human",
"value": "from django.core.validators import URLValidator\nfrom django.core.exceptions import ValidationError\n\nimport inspect\nimport requests, json \n\nclass FedoraConnectionManager:\n\n __oerUri = '... | python | chosen |
[
{
"from": "system",
"value": "Make docket export work (done last week, but not committed for some reason).\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport csv\nimport time\nfrom datetime import datetime\nfrom collections import namedtuple\nfrom pymongo i... | python | chosen |
[
{
"from": "system",
"value": "Add processing cmd to update routine\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nUpdate to the latest CAL-ACCESS snapshot and bake static website pages.\n\"\"\"\nimport logging\nfrom django.core.management import call_c... | python | chosen |
[
{
"from": "system",
"value": "Add some extras to the Markdown parser\n"
},
{
"from": "human",
"value": "from markdown2 import markdown\nfrom docutils.core import publish_parts\nfrom textile import textile\n\ndef rst(string):\n\t\"\"\"Wraps the ReST parser in Docutils.\n\t\n\tNote that Docutils w... | python | chosen |
[
{
"from": "system",
"value": "Improve unit test for settings helpers"
},
{
"from": "human",
"value": "from mock import patch\n\nimport os\n\nfrom glue.config import SettingRegistry\nfrom glue._settings_helpers import load_settings, save_settings\n\n\ndef test_roundtrip(tmpdir):\n\n settings =... | python | chosen |
[
{
"from": "system",
"value": "Add `audience` field back to Invoice resource\n\n- field should be exposed in both Document and Invoice resources\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom ..base import Resource\n\n\nclass Document(Resource):\n _resource_... | python | chosen |
[
{
"from": "system",
"value": "Fix url to keywords; fix cmd line usage\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom __future__ import print_function\nimport json\nimport os\nimport sys\n\nimport requests\n\nimport scraperwiki\n\ndef main(argv=None):\n if argv is None:\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Solve warning coming from django 4.0\"\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom django.apps import AppConfig\nfrom django.conf import settings\nfrom django.utils.module_loading import import_string\n\nfrom django_fsm.... | python | chosen |
[
{
"from": "system",
"value": "FIX keyword in field declaration\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Nicolas Bessi\n# Copyright 2013, 2014 Camptocamp SA\n#\n# This program ... | python | chosen |
[
{
"from": "system",
"value": "Make voices example work on 10.7-10.9\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport subprocess\nimport os\n\npkgs = [\n\t'\"VOICEID:com.apple.speech.synthesis.voice.anna.premium_2\" IN tags',\n\t'\"VOICEID:com.apple.speech.synthesis.voice.steffi.pre... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.