conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Handle getting and setting the Mixer levels correctly\n"
},
{
"from": "human",
"value": "import copy\nfrom . import parallel\nfrom .. util import color_list\n\n\nclass Mixer(parallel.Parallel):\n def __init__(self, *args, levels=None, master=1, **kwds):\n ... | python | chosen |
[
{
"from": "system",
"value": "Update command to use nlppln utils\n\n- fixes the double extension of output files\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport click\nimport os\nimport codecs\nimport json\n\nfrom xtas.tasks._frog import parse_frog, frog_to_saf\n\n\n@click.comma... | python | chosen |
[
{
"from": "system",
"value": "Add support for trwikivoyage to Pywikibot\n\nBug: T271263\nChange-Id: I96597f57522147d26e9b0a86f89c67ca8959c5a2\n"
},
{
"from": "human",
"value": "\"\"\"Family module for Wikivoyage.\"\"\"\n#\n# (C) Pywikibot team, 2012-2020\n#\n# Distributed under the terms of the ... | python | chosen |
[
{
"from": "system",
"value": "Fix deprecation warnings with Django 1.5\n\ndjango/utils/hashcompat.py:9: \r\nDeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead"
},
{
"from": "human",
"value": "import logging\nlogger = logging.getLogger(__name__)\n\nimport random\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Print failures and errors in test run\n"
},
{
"from": "human",
"value": "\nimport unittest\nimport os.path\n\nif __name__ == '__main__':\n HERE = os.path.dirname(__file__)\n\n loader = unittest.loader.TestLoader()\n suite = loader.discover(HERE)\n result... | python | chosen |
[
{
"from": "system",
"value": "Update verison check test, note it's an integration test\n"
},
{
"from": "human",
"value": "\"\"\"\nUnit tests for One Codex\n\"\"\"\nfrom onecodex.lib.auth import check_version\nfrom onecodex.version import __version__\n\n\nSERVER = 'https://app.onecodex.com/'\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix order for installer API routes\n"
},
{
"from": "human",
"value": "# pylint: disable=C0103\nfrom __future__ import absolute_import\nfrom django.conf.urls import url\nfrom games.views import installers as views\n\n\nurlpatterns = [\n url(r'revisions/(?P<pk>[\\d... | python | chosen |
[
{
"from": "system",
"value": "TST: Add some tests for unused function\n"
},
{
"from": "human",
"value": "import pandas\nimport numpy as np\n\nfrom scikits.statsmodels.tools import data\n\ndef test_missing_data_pandas():\n \"\"\"\n Fixes GH: #144\n \"\"\"\n X = np.random.random((10,5)... | python | chosen |
[
{
"from": "system",
"value": "Set SITE_ID=1 in tests (corresponds to that in the test fixtures)"
},
{
"from": "human",
"value": "import os, sys\nfrom django.conf import settings\n\n# -- Setup Django configuration appropriately\n\nTESTDIR = os.path.abspath(os.path.dirname(__file__))\nsettings.MOD... | python | chosen |
[
{
"from": "system",
"value": "Remove todo comment, no settings support\n"
},
{
"from": "human",
"value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon Surrell\n# Copyright (c) 2013 Jon Surrell\n#\n# License: MIT\n#\n\n\"\"\"This m... | python | chosen |
[
{
"from": "system",
"value": "Move the SERVER_NAME to the start of the default config\n\nMinor nit but the SERVER_NAME is one of the more important settings\non a per app basis.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __fut... | python | chosen |
[
{
"from": "system",
"value": "Clean up article serializer a bit\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom apps.article.models import Article, Tag\nfrom apps.authentication.serializers import UserSerializer\n\n\nclass ArticleSerializer(serializers.ModelSeri... | python | chosen |
[
{
"from": "system",
"value": "Add equal method to model with uuid\n\nChange-Id: Iefa05d50f2f591399d5423debd699f88074a574e\n"
},
{
"from": "human",
"value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright 2014 Eugene Frolov <eugene@frolov.net.ru>\n#\n# All Rights Reserved.\n#\n# L... | python | chosen |
[
{
"from": "system",
"value": "[Http] Check this commits description for more information\n\n- sendRequest() and postRequest now have better error handling and display the error via console\r\n- No longer toggles error on 403, instead it toggles everything but 200"
},
{
"from": "human",
"value": ... | python | chosen |
[
{
"from": "system",
"value": "Add Flask app variable to use with gunicorn\n"
},
{
"from": "human",
"value": "# TODO: migrate to Flask CLI instead of Flask-Script\n'''This module enables command line interface for randompeople app.'''\nfrom flask_script import Manager\nfrom app import create_app,... | python | chosen |
[
{
"from": "system",
"value": "Change the default value for SELENIUM_SERVER\n\n with this change it is possible to use webstr on localhost without any action\n\nChange-Id: Ife533552d7a746401df01c03af0b2d1caf0702b5\nSigned-off-by: ltrilety <b0b91364d2d251c1396ffbe2df56e3ab774d4d4b@redhat.com>\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Change the base URL for the Twitter API\n"
},
{
"from": "human",
"value": "import email\nimport datetime\nimport re\n\nfrom django.conf import settings\nimport twitter\n\nfrom parliament.core.models import Politician, PoliticianInfo\nfrom parliament.activity import ... | python | chosen |
[
{
"from": "system",
"value": "Enhance swf errors wrapping via an exception helper\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2013, Theo Crevon\n# Copyright (c) 2013, Greg Leclercq\n#\n# See the file LICENSE for copying permission.\n\n\nclass PollTimeout(Excepti... | python | chosen |
[
{
"from": "system",
"value": "Bump version for future dev\n"
},
{
"from": "human",
"value": "from datetime import datetime\n__version__ = '0.2.dev{}'.format(datetime.now().strftime('%Y%m%d%H%M%S'))\n\ntry:\n # we need __version__ for setup.py, sphinx stuff, just to generally be nice, etc.,\n ... | python | chosen |
[
{
"from": "system",
"value": "Make bot respond to mentions.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport asyncio\nimport configparser\nimport discord\nimport os\nimport logging\nfrom discord.ext import commands\n\nlogging.basicConfig(level=logging.INFO)\n\n# Parse the config and... | python | chosen |
[
{
"from": "system",
"value": "Remove ability to run module directly\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"{{ cookiecutter.description }}\"\"\"\n# Copyright (C) {{cookiecutter.year}} {{cookiecutter.author_name}}. See LICENSE for terms of use.\nimport sys\nimport logging\... | python | chosen |
[
{
"from": "system",
"value": "Remove too many newlines (pep8 E303)\n"
},
{
"from": "human",
"value": "from ajax_select import register, LookupChannel\nfrom members.models import *\nfrom django.utils.html import escape\n\n\n@register('member')\nclass MemberLookup(LookupChannel):\n\n model = Me... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import on test url's\n"
},
{
"from": "human",
"value": "from mailviews.utils import is_django_version_greater\n\nfrom django.conf.urls import include, url\n\n\nfrom mailviews.previews import autodiscover, site\n\n\nautodiscover()\n\nurlpatterns = [\n ... | python | chosen |
[
{
"from": "system",
"value": "colors: Fix bug with i3 titlebars not being the right color.\n"
},
{
"from": "human",
"value": "\"\"\"\nReload programs.\n\"\"\"\nimport shutil\nimport subprocess\n\nfrom pywal.settings import CACHE_DIR\nfrom pywal import util\n\n\ndef reload_i3():\n \"\"\"Reload... | python | chosen |
[
{
"from": "system",
"value": "Use URLs from the prototype app\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.conf.urls.static import static\n... | python | chosen |
[
{
"from": "system",
"value": "Add __all__ variable to top level package\n"
},
{
"from": "human",
"value": "\"\"\"Quick and Distributed TensorFlow command framework\"\"\"\n\nfrom .flag import *\nfrom .run import def_run\n"
},
{
"from": "gpt",
"value": "\"\"\"Quick and Distributed Tens... | python | chosen |
[
{
"from": "system",
"value": "Remove test data folder with contents\n"
},
{
"from": "human",
"value": "import logging\nimport unittest\nimport os\n\nfrom sqlalchemy import create_engine\n\nfrom rtrss import config, database\n\n\nlogging.disable(logging.ERROR)\n\nengine = create_engine(config.SQL... | python | chosen |
[
{
"from": "system",
"value": "Enforce that tests run with anonymous access off.\n"
},
{
"from": "human",
"value": "# Case Conductor is a Test Case Management system.\n# Copyright (C) 2011-2012 Mozilla\n#\n# This file is part of Case Conductor.\n#\n# Case Conductor is free software: you can redis... | python | chosen |
[
{
"from": "system",
"value": "Change mock to be env dependant\n"
},
{
"from": "human",
"value": "# Generates validation/input definitions as if they were created by splunk for tests\nclass MockDefinitions(object):\n def __init__(self, session_key=None):\n self.session_key = session_key... | python | chosen |
[
{
"from": "system",
"value": "Add and remove now work with minimal error checking.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# My solution to the following challenge: https://redd.it/39ws1x\n\nfrom datetime import date\nfrom collections import defaultdict\n\nclass Todo:\n def ... | python | chosen |
[
{
"from": "system",
"value": "Change version to 1.2.1 (dev)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n##############################################################################\n{\n 'name'... | python | chosen |
[
{
"from": "system",
"value": "Add settings that can set various defaults\n\nThis makes it very simple to use pyramid_authsanity with one of two\nsources, as well as allowing the user to tweak the settings for the\nsource of their choosing.\n"
},
{
"from": "human",
"value": "from .interfaces impo... | python | chosen |
[
{
"from": "system",
"value": "Add tests for adding stuff through the ModelView\n"
},
{
"from": "human",
"value": "from django.test import TestCase\n\nfrom towel import deletion\n\nfrom testapp.models import Person, EmailAddress\n\n\nclass ModelViewTest(TestCase):\n def test_list_view(self):\n... | python | chosen |
[
{
"from": "system",
"value": "Fix the option and update the note\n"
},
{
"from": "human",
"value": "# Copyright (c) Metakernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nfrom metakernel import Magic, option\n\n\nclass PlotMagic(Magic):\n\n @option(\n ... | python | chosen |
[
{
"from": "system",
"value": "Change logs for google music\n"
},
{
"from": "human",
"value": "from gmusicapi import Mobileclient\n\n\ndef create_playlist(playlist_name, artists, email, password, max_top_tracks=2):\n api = Mobileclient()\n logged_in = api.login(email, password, Mobileclient... | python | chosen |
[
{
"from": "system",
"value": "Add : to the id:jobs set key\n"
},
{
"from": "human",
"value": "'''\nReturn data to a redis server\nThis is a VERY simple example for pushing data to a redis server and is not\nnessisarily intended as a usable interface.\n'''\n\nimport redis\nimport json\n\n__opts__... | python | chosen |
[
{
"from": "system",
"value": "Correct meervoud modellen van appolo\n"
},
{
"from": "human",
"value": "from django.db import models\n\nclass Locatie(models.Model):\n def __unicode__(self):\n return self.naam\n naam = models.CharField(max_length=200)\n lat = models.FloatField()\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for using card docstrings as names\n"
},
{
"from": "human",
"value": "from hearthstone.enums import CardType, GameTag, Rarity\n\nimport utils\n\n\nCARDS = utils.fireplace.cards.db\n\n\ndef test_all_tags_known():\n\t\"\"\"\n\tIterate through the card datab... | python | chosen |
[
{
"from": "system",
"value": "Add test for `play_track` function\n\nNew tests make sure that `play_track` raises a TrackError when an\ninvalid track is requested.\n"
},
{
"from": "human",
"value": "\"\"\"\ntest_itunes.py\n\nCopyright © 2015 Alex Danoff. All Rights Reserved.\n2015-08-02\n\nThis f... | python | chosen |
[
{
"from": "system",
"value": "Add test to check gear value\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nline = \" 0:00 InitGame: \\g_matchmode\\1\\g_gametype\\7\\g_allowvote\\536871039\\g_gear\\KQ\\mapname\\ut4_dust2_v2\\gamename\\q3urt43\\g_survivor\\0\\... | python | chosen |
[
{
"from": "system",
"value": "Make tests working with python 2 and 3\n"
},
{
"from": "human",
"value": "import unittest\nimport permstruct\nimport permstruct.dag\n\nclass TestTravis(unittest.TestCase):\n def test_travis(self):\n perm_prop = lambda p: p.avoids([2,3,1])\n perm_bou... | python | chosen |
[
{
"from": "system",
"value": "Make second_candidate not required in sign up form\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom polling.models import CANDIDATES\nfrom polling.models import CANDIDATES_THIRD_PARTY\nfrom polling.models import STATES\n\n\nclass LandingPageForm(f... | python | chosen |
[
{
"from": "system",
"value": "Fix bug and delete unused library\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport cv2\nimport sys\nimport numpy as np\n\ndef resize(src, w_ratio, h_ratio):\n height = src.shape[0]\n width = src.shape[1]\n dst = cv2.resize(src,(width/100*w... | python | chosen |
[
{
"from": "system",
"value": "Add a dummy safe filter for Django compat\n"
},
{
"from": "human",
"value": "import ast\n\nfrom knights.library import Library\n\nregister = Library()\n\n\n@register.tag\ndef static(parser, token):\n src = parser.parse_expression(token)\n return ast.Yield(valu... | python | chosen |
[
{
"from": "system",
"value": "Fix events to work on mysql\n\nCloses https://bugs.launchpad.net/graphite/+bug/993625\n"
},
{
"from": "human",
"value": "import time\nimport os\n\nfrom django.db import models\nfrom django.contrib import admin\n\nif os.environ.get('READTHEDOCS'):\n TagField = lam... | python | chosen |
[
{
"from": "system",
"value": "Use version 1 of Filepicker.js"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.forms import widgets\n\n#JS_URL is the url to the filepicker.io javascript library\nJS_VERSION = 0\nJS_URL = \"//api.filepicker.io/v%d/filepicker.js\" % (JS... | python | chosen |
[
{
"from": "system",
"value": "Return Post object in PostForm save method\n"
},
{
"from": "human",
"value": "from flask_pagedown.fields import PageDownField\nfrom wtforms.fields import StringField\nfrom wtforms.validators import DataRequired\n\nfrom app.models import Post, Tag\nfrom app.utils.hel... | python | chosen |
[
{
"from": "system",
"value": "Generalize import_units to enable custom directories\n"
},
{
"from": "human",
"value": "# Copyright 2017 John Reese\n# Licensed under the MIT license\n\nimport os.path\nimport logging\n\nfrom pathlib import Path\nfrom importlib import import_module\nfrom types impor... | python | chosen |
[
{
"from": "system",
"value": "Add errors attribute with setter/getter\n"
},
{
"from": "human",
"value": "__version__ = (2014, 10, 0)\n\n\ndef get_version():\n \"\"\"\n :rtype: str\n \"\"\"\n return '.'.join(str(i) for i in __version__)\n\n\nclass Gignore(object):\n BASE_URL = 'htt... | python | chosen |
[
{
"from": "system",
"value": "Include m in colour code string instead of appending it later.\n"
},
{
"from": "human",
"value": "import sys\nimport os\n\nansi_colour_list = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']\nansi_colour_code = dict((name, str(code)) for code,... | python | chosen |
[
{
"from": "system",
"value": "Set USE_TZ=True, django 4 raises a warning if this is not set to a value\n"
},
{
"from": "human",
"value": "# Minimum settings that are needed to run django test suite\nimport os\nimport secrets\nimport tempfile\n\nSECRET_KEY = secrets.token_hex()\n\nif \"postgresql... | python | chosen |
[
{
"from": "system",
"value": "Implement shortcut to compute initial p super digit\n"
},
{
"from": "human",
"value": "#!/bin/python3\n\ndef superDigit(n, k):\n p = create_p(n, k)\n return get_super_digit(p)\n\ndef get_super_digit(p):\n if len(p) == 1:\n return int(p)\n else:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix app error handler raising an attribute error\n\nWe're using a single error handler to return a JSON response for\nany error code.\n\nThe handler expects a flask HTTP error exception with `.code` and\n`.description` attributes (like the ones raised by `abort`).\n\nHowever, i... | python | chosen |
[
{
"from": "system",
"value": "Fix 404 page template static resources\n"
},
{
"from": "human",
"value": "from flask import render_template\nfrom . import main\n\n\n@main.app_errorhandler(404)\ndef page_not_found(e):\n return render_template(\"404.html\"), 404\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Add copyright header to test\n"
},
{
"from": "human",
"value": "import txkazoo\n\nfrom twisted.trial.unittest import SynchronousTestCase\n\n\nclass VersionTests(SynchronousTestCase):\n \"\"\"\n Tests for programmatically acquiring the version of txkazoo.\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for utils.make_unique_obj_list\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\n radish\n ~~~~~~\n\n Behavior Driven Development tool for Python - the root from red to green\n\n Copyright: MIT, Timo Furrer <tuxtimo@gmail.c... | python | chosen |
[
{
"from": "system",
"value": "Update version of Wikidata dump to 20150126\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport wikidata\n\n\n# The data (= ID) of the Wikidata dump\ndump_id = '20150105'\n\n# The files to download\ndownload_urls = [\n \"ht... | python | chosen |
[
{
"from": "system",
"value": "Add signal handler to quit the application\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nimport sys\nfrom PyQt5.QtWidgets import QApplication\nfrom keyboard.ui.widgets import KeyboardWindow\n\nif __name__ == '__main__':\n app = QApplication([])\n wind... | python | chosen |
[
{
"from": "system",
"value": "Add utility method to DefinedObject base class\n"
},
{
"from": "human",
"value": "class DefinedObject(object):\n pass\n"
},
{
"from": "gpt",
"value": "from StringIO import StringIO\n\nclass DefinedObject(object):\n\n def to_xml(self):\n \"\"... | python | chosen |
[
{
"from": "system",
"value": "Add a test for the AE experiment\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\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... | python | chosen |
[
{
"from": "system",
"value": "Add a debugging line to the echo command\n"
},
{
"from": "human",
"value": "'''\nModule for shelling out commands, inclusion of this module should be\nconfigurable for security reasons\n'''\n\ndef echo(text):\n '''\n Return a string - used for testing the conn... | python | chosen |
[
{
"from": "system",
"value": "Use DB_URL set in heroku to avoid sqlalchemy dialect issue\n"
},
{
"from": "human",
"value": "import os\n\n\nclass Config(object):\n DEBUG = False\n TESTING = False\n SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']\n SQLALCHEMY_TRACK_MODIFICATIONS =... | python | chosen |
[
{
"from": "system",
"value": "Fix submit view in registration\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, redirect\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect\nfrom django.views import View\nfrom members.programmes import DEGREE_PRO... | python | chosen |
[
{
"from": "system",
"value": "Test self request without authentication\n"
},
{
"from": "human",
"value": "from uuid import uuid4\n\nfrom changes.config import db\nfrom changes.models import Author\nfrom changes.testutils import APITestCase\n\n\nclass AuthorBuildListTest(APITestCase):\n def te... | python | chosen |
[
{
"from": "system",
"value": "Use DATABASE_URL instead of CLEARDB_DATABASE_URL\n\nFor Postgress this is what we need, because this is what the following\ncommand sets:\n$ heroku pg:promote HEROKU_POSTGRESQL_BLUE_URL\nPromoting HEROKU_POSTGRESQL_BLUE_URL to DATABASE_URL... done\n"
},
{
"from": "human... | python | chosen |
[
{
"from": "system",
"value": "Set minimum query length to 10 nts\n\nThe shortest length that the nhmmer alphabet guesser will work on is 10.\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright [2009-2014] EMBL-European Bioinformatics Institute\nLicensed under the Apache License, Version 2.0 (th... | python | chosen |
[
{
"from": "system",
"value": "Add SQLALCHEMY_TRACK_MODIFICATION to supress warnings\n"
},
{
"from": "human",
"value": "import os\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n\nclass Config:\n SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd'\n SQLALCHEMY_COMMIT_ON_TEARDOWN = True... | python | chosen |
[
{
"from": "system",
"value": "Fix script to update offering on instances\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n\nclass UpdateInstances(object):\n\n @staticmethod\n def do():\n from dbaas_cloudstack.models import DatabaseInfraOffering\n from dbaas_cloudstack.mo... | python | chosen |
[
{
"from": "system",
"value": "Clear parameters before editing/adding. Before it was been unpossible to call two functions in sequence.\n"
},
{
"from": "human",
"value": "import json\nimport api\n\nclass WWWDomain(api.API):\n\n def __init__(self, auth_handler):\n self.url = auth_handler... | python | chosen |
[
{
"from": "system",
"value": "Add type filter by slug\n"
},
{
"from": "human",
"value": "from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter\n\nfrom falmer.events.models import Curator\nfrom . import models\n\n\nclass EventFilterSet(FilterSet):\n... | python | chosen |
[
{
"from": "system",
"value": "Remove this test for now\n"
},
{
"from": "human",
"value": "\"\"\"geohash unit tests.\"\"\"\nimport unittest\nimport os\nimport json\n\nimport gtfs\n\nclass TestGTFSReader(unittest.TestCase):\n test_gtfs = os.path.join('examples', 'sample-feed.zip')\n \n def test... | python | chosen |
[
{
"from": "system",
"value": "Change 'pass' statements to 'continue' statements."
},
{
"from": "human",
"value": "class ConfigReader():\n\t\n\tdef __init__(self):\n\t\tself.keys={}\n\t#Read Keys from file\n\tdef readKeys(self):\n\t\tkeysFile=open(\"config.txt\",\"r\")\n\t\tfileLines=keysFile.rea... | python | chosen |
[
{
"from": "system",
"value": "Fix the database session init to work with the flask debug server.\n\nThe debug webserver consists of two parts: the watcher that watches\nthe files for changes and the worker that is forked and will be restarted\nafter each modification. Sqlachemy uses a SingletonPool that wil... | python | chosen |
[
{
"from": "system",
"value": "Add schema to repo for now\n"
},
{
"from": "human",
"value": "import sys\nprint(\"FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us\"\n \"ing 'make schema' before packaging.\")\nsys.exit(1)\n"
},
{
"from": "gpt",
"value": "impo... | python | chosen |
[
{
"from": "system",
"value": "Add writer metadata to the STL writer plugin so it can be used in Cura\n"
},
{
"from": "human",
"value": "from . import STLWriter\ndef getMetaData():\n return {\n 'type': 'mesh_writer',\n 'plugin': {\n \"name\": \"STL Writer\"\n }\... | python | chosen |
[
{
"from": "system",
"value": "Increase repo size to 20Mb\n"
},
{
"from": "human",
"value": "# Copyright (C) Ivan Kravets <me@ikravets.com>\n# See LICENSE for details.\n\nimport json\nimport logging.config\nimport os\nfrom time import tzset\n\n\nVERSION = (0, 3, 0)\n__version__ = \".\".join([str(... | python | chosen |
[
{
"from": "system",
"value": "Update for custom user model support"
},
{
"from": "human",
"value": "# -*- coding: UTF-8 -*-\nfrom django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\nfrom django.utils.translation im... | python | chosen |
[
{
"from": "system",
"value": "Fix people autosuggest with winthrop_only flag\n"
},
{
"from": "human",
"value": "from django.http import JsonResponse\nfrom dal import autocomplete\nfrom .models import Person\nfrom winthrop.books.models import PersonBook\nfrom django.db.models import BooleanField,... | python | chosen |
[
{
"from": "system",
"value": "Fix package ImportError for Python3\n\nhttps://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax\n\"The only acceptable syntax for relative imports is\nfrom .[module] import name. All import forms not starting with . are\ninterpreted as absolute imports. (PEP 0328)\"\n"
},... | python | chosen |
[
{
"from": "system",
"value": "Update serial port and baud rate\n"
},
{
"from": "human",
"value": "import sys\nimport serial\nimport threading\nfrom blueplayer import blueplayer\n\n\ndef main():\n args = sys.argv[1:]\n # first argument should be a serial terminal to open\n if not len(arg... | python | chosen |
[
{
"from": "system",
"value": "Use the config_file attribute to find .jscs.json"
},
{
"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 Ilya Akhmadullin\n#\n# License: MIT\n#... | python | chosen |
[
{
"from": "system",
"value": "Use an IRC username that's not already registered.\n"
},
{
"from": "human",
"value": "from buildbot.status import html, words\nfrom buildbot.status.web.authz import Authz\nfrom .djangoauth import DjangoAuth\n\nauthz = Authz(\n auth = DjangoAuth(),\n gracefulSh... | python | chosen |
[
{
"from": "system",
"value": "NG: Add a regression test for displaying escaped HTML in the blog\n\nA fixed version of the test that Chris Mytton suggested in:\n\n https://github.com/mysociety/pombola/pull/1587\n"
},
{
"from": "human",
"value": "import unittest\nimport doctest\nfrom . import vie... | python | chosen |
[
{
"from": "system",
"value": "Set the parent class 'ensure_hyphenated_names' and set 'ctx.max_line_len' to 70\n\nThis is to match the settings that BBF uses when validating its modules. The max_line_len setting won't override an explicit --max-line-len from the command line.\n"
},
{
"from": "human",... | python | chosen |
[
{
"from": "system",
"value": "Add password to User model.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport datetime\nfrom ._base import db\n\n\nclass User(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n name = db.Column(db.String(50), unique=True)\n email = db.Colu... | python | chosen |
[
{
"from": "system",
"value": "Fix name of spell checker.\n"
},
{
"from": "human",
"value": "import traceback\nfrom routes import Mapper\n\nimport ppp_core\nimport example_ppp_module as flower\nimport ppp_questionparsing_grammatical as qp_grammatical\nimport ppp_cas\n#import ppp_nlp_ml_standalone... | python | chosen |
[
{
"from": "system",
"value": "Fix test so it works with python 2.5.\n\n\ngit-svn-id: 9ad005ce451fa0ce30ad6352b03eb45b36893355@1342997 13f79535-47bb-0310-9956-ffa450edef68\n"
},
{
"from": "human",
"value": "import sys\nimport unittest\n\nfrom mock import Mock\n\nfrom libcloud.common.openstack imp... | python | chosen |
[
{
"from": "system",
"value": "[crawler] Handle correctly paths with symbols '(' and ')'.\n"
},
{
"from": "human",
"value": "#!/opt/local/bin/python\nimport json\nimport os\nimport re\nimport string\nimport sys\n\nmyPath = os.path.dirname(os.path.realpath(__file__))\n\nfor i, line in enumerate(sy... | python | chosen |
[
{
"from": "system",
"value": "Fix virtualenv path on PythonAnywhere\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport argparse\nimport os\n\nimport requests\n\nmy_domain = \"www.proporti.onl\"\nusername = \"emptysquare\"\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\... | python | chosen |
[
{
"from": "system",
"value": "Fix find_seed behavior when the word is not present\n"
},
{
"from": "human",
"value": "import random\n\nclass Markov:\n def __init__(self, source, k=5):\n self.source = source\n self.k = k\n self._init_source()\n\n def _init_source(self):\... | python | chosen |
[
{
"from": "system",
"value": "Add a \"project\" hash function, for projecting certain keys out of a dict"
},
{
"from": "human",
"value": "def merge(default, to_mutate):\n for key, value in default.items():\n to_mutate.setdefault(key, value)\n\n return to_mutate \n\ndef combine(defau... | python | chosen |
[
{
"from": "system",
"value": "Abort if privileges can't be dropped\n"
},
{
"from": "human",
"value": "import grp\nimport logging\nimport os\nimport pwd\nimport sys\n\nfrom hades.common.cli import (\n ArgumentParser, parser as common_parser, setup_cli_logging,\n)\n\nlogger = logging.getLogger(... | python | chosen |
[
{
"from": "system",
"value": "Add variables with info access router\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport urllib2 as http\n\n# URL with GET to reboot router or status main page to tests\n#url_get_reboot = 'http://10.11.12.254/log/in?un=admin... | python | chosen |
[
{
"from": "system",
"value": "Rename some copy pasted variable.\n"
},
{
"from": "human",
"value": "from graphql.core.type import GraphQLScalarType\n\n\nclass ScalarMeta(type):\n def __new__(mcs, name, bases, attrs):\n if attrs.pop('abstract', False):\n return super(ScalarMet... | python | chosen |
[
{
"from": "system",
"value": "Update package version to 0.8.7\n"
},
{
"from": "human",
"value": "\"\"\"\nChatterBot is a machine learning, conversational dialog engine.\n\"\"\"\nfrom .chatterbot import ChatBot\n\n__version__ = '0.8.6'\n__author__ = 'Gunther Cox'\n__email__ = 'gunthercx@gmail.com... | python | chosen |
[
{
"from": "system",
"value": "Increment counter in wikia example per @satoru"
},
{
"from": "human",
"value": "# -*- coding: utf-8 *-*\nimport os, sys, pprint; sys.path.insert(0, os.path.join(\"..\", \"..\"))\n\nfrom pattern.web import Wikia, WikiaArticleSet, URLTimeout\n\n# This example retrieve... | python | chosen |
[
{
"from": "system",
"value": "Add request index page test.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport unittest\nimport http.client\n\nurl = \"localhost:8000\"\n\nclass Client:\n\tdef test_Connect(self):\n\t\tconnected = 0\n\t\ttry:\n\t\t\tself.conn = http.client.HTTPConn... | python | chosen |
[
{
"from": "system",
"value": "Store raw data as well as content hash\n\n..for now.\nTrying to work out why the content hashes are\nchanging when I am not expecting them to.\n"
},
{
"from": "human",
"value": "import datetime\nimport hashlib\nimport os\n\n# hack to override sqlite database filenam... | python | chosen |
[
{
"from": "system",
"value": "Add Tests for the lists adventure\n"
},
{
"from": "human",
"value": "from py101 import Story\nfrom py101 import variables\nfrom py101 import lists\nimport unittest\n\nclass TestStory(unittest.TestCase):\n def test_name(self):\n self.assertEqual(Story().nam... | python | chosen |
[
{
"from": "system",
"value": "Kill fuzzers when we've found a crash or timed out\n"
},
{
"from": "human",
"value": "import redis\nfrom celery import Celery\n\nfrom .Fuzzer import Fuzzer\n\nimport os\nimport time\nimport driller.config as config\nimport logging\n\nl = logging.getLogger(\"fuzzer.t... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.