conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update count of things in DB\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport unittest\nimport tempfile\n\nsys.path.insert(0, os.environ.get('BLOG_PATH'))\nfrom blog.blog import *\n\nclass BlogUnitTestCase(unittest.TestCase):\n\n def test_connect_... | python | chosen |
[
{
"from": "system",
"value": "Make the difference between PV names and values clearer.\n"
},
{
"from": "human",
"value": "# Load the machine\nimport pkg_resources\npkg_resources.require('aphla')\nimport aphla as ap\n# Other stuff\nfrom cothread.catools import caget, caput, ca_nothing\n\n# Load t... | python | chosen |
[
{
"from": "system",
"value": "Save the tasks in the proper way.\n"
},
{
"from": "human",
"value": "import enki\nimport json\n\n\ne = enki.Enki('key', 'http://localhost:5001', 'translations')\n\ne.get_all()\n\ntasks = []\n\nfor t in e.tasks:\n options = dict()\n i = 0\n for k in e.task_r... | python | chosen |
[
{
"from": "system",
"value": "Fix errors when user click execution id\n\nMissing request argument when calling task list\n\nChange-Id: Idc282c267fc99513dd96a80f6f4a745bfefec2c8\nCloses-Bug: #1471778\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2014 - StackStorm, Inc... | python | chosen |
[
{
"from": "system",
"value": "Remove of debug prints.\nFix of invalid key name.\n"
},
{
"from": "human",
"value": "from uuid import uuid4\nfrom random import randint\nfrom basic_http import BasicHttp\n\ndef random_pk(length=8):\n s = uuid4().hex\n\n f = randint(0, (len(s) - length))\n t... | python | chosen |
[
{
"from": "system",
"value": "Fix display of tildes in PDF output."
},
{
"from": "human",
"value": "# encoding: utf-8\n\nimport sys\n\nlines = sys.stdin.readlines()\n\n# Contact details are expected to begin on the fourth line, following the\n# header and a blank line, and extend until the next ... | python | chosen |
[
{
"from": "system",
"value": "Add a specific test for the updatesfromdict hard coded foreignkey fields\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.db import models as djangomodels\n\nfrom opal.models import UpdatesFromDictMixin\n\nclass UpdatesFromDictMixinTe... | python | chosen |
[
{
"from": "system",
"value": "Add an interface to change table_name\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\n\nfrom ..interface import TableLoaderInterface\n\... | python | chosen |
[
{
"from": "system",
"value": "Add debug mode to the development version\n"
},
{
"from": "human",
"value": "\"\"\"\nKraller\n\nAn application to allow signups for accounts on a server with a key.\n\"\"\"\n\nfrom flask import Flask\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n r... | python | chosen |
[
{
"from": "system",
"value": "Fix check for empty min/max years.\n"
},
{
"from": "human",
"value": "\nfrom django import template\nfrom django.db.models import Min, Max\n\nfrom gnotty.models import IRCMessage\nfrom gnotty.conf import settings\n\n\nregister = template.Library()\n\n\n@register.inc... | python | chosen |
[
{
"from": "system",
"value": "Add handling for creating scheduled action for bulk send\n"
},
{
"from": "human",
"value": "from go.vumitools.conversation.definition import (\n ConversationDefinitionBase, ConversationAction)\n\n\nclass BulkSendAction(ConversationAction):\n action_name = 'bul... | python | chosen |
[
{
"from": "system",
"value": "Remove broken import in skipped tests\n"
},
{
"from": "human",
"value": "import pytest\nfrom os.path import dirname, join, realpath\n\nimport hacksport.deploy\nfrom hacksport.deploy import deploy_problem\nfrom shell_manager.util import default_config\n\nPATH = dirna... | python | chosen |
[
{
"from": "system",
"value": "Add None when request arg is pop, in case we access the form in get\n"
},
{
"from": "human",
"value": "from django.forms.models import ModelForm\nfrom .models import Photo\nfrom artists.models import Artists\n\nclass UploadPhotoForm(ModelForm):\n\n class Meta:\n ... | python | chosen |
[
{
"from": "system",
"value": "Ch09: Add HTTP method condition to tag_create().\n"
},
{
"from": "human",
"value": "from django.shortcuts import (\n get_object_or_404, render)\n\nfrom .models import Startup, Tag\n\n\ndef startup_detail(request, slug):\n startup = get_object_or_404(\n ... | python | chosen |
[
{
"from": "system",
"value": "Ch22: Add name and joined date field to Profile.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.contrib.auth.models import (\n AbstractBaseUser, PermissionsMixin)\nfrom django.core.urlresolvers import reverse\nfrom django.db impo... | python | chosen |
[
{
"from": "system",
"value": "Update MathJax URL to 2.7.2\n"
},
{
"from": "human",
"value": "# This file is part of python-markups module\n# License: BSD\n# Copyright: (C) Dmitry Shachnev, 2012-2017\n\nimport os.path\n\n# Some common constants and functions\n(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE... | python | chosen |
[
{
"from": "system",
"value": "Rename models to groups for corresponding with method name\n"
},
{
"from": "human",
"value": "from django.apps import apps as dj_apps\nfrom django.conf.urls import include, url\nfrom django.template.response import TemplateResponse\nfrom django.utils.text import cap... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding error in Python 3.\n"
},
{
"from": "human",
"value": "from ..converter import KnowledgePostConverter\n\nfrom .html import HTMLConverter\n\n\nclass PDFConverter(KnowledgePostConverter):\n '''\n Use this as a template for new KnowledgePostConverters... | python | chosen |
[
{
"from": "system",
"value": "[MIG] Bump module version to 10.0.1.0.0\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (C) 2009 Renato Lima - Akretion\n# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n\n{\n 'name': 'Brazilian Localization Purchase',\n ... | python | chosen |
[
{
"from": "system",
"value": "tests: Add test to print full KeyError exc from failed dict lookup.\n"
},
{
"from": "human",
"value": "# basic dictionary\n\nd = {}\nprint(d)\nd[2] = 123\nprint(d)\nd = {1:2}\nd[3] = 3\nprint(len(d), d[1], d[3])\nd[1] = 0\nprint(len(d), d[1], d[3])\nprint(str(d) == ... | python | chosen |
[
{
"from": "system",
"value": "Adjust the settings reset to work with Django 1.4\n\nDjango changed the `settings._wrapped` value from `None` to the special\n`empty` object. This change maintains backwards compatibility for\n1.3.X, while using the new method for all other versions of Django.\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add loads-dumps test for Appinfo\n"
},
{
"from": "human",
"value": "import io\nimport os\nimport pickle\nimport pytest\nfrom steamfiles import appinfo\n\ntest_file_name = os.path.join(os.path.dirname(__file__), 'test_data/appinfo.vdf')\n\n\n@pytest.yield_fixture\nde... | python | chosen |
[
{
"from": "system",
"value": "Update test for cookies fixture\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\ndef test_cookies_fixture(testdir):\n \"\"\"Make sure that pytest accepts the `cookies` fixture.\"\"\"\n\n # create a temporary pytest test module\n testdir.makep... | python | chosen |
[
{
"from": "system",
"value": "Add casuarius to the list of required packages.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2007-2013 by Enthought, Inc.\n# All rights reserved.\n\"\"\" A multi-platform object drawing library.\n Part of the Enable project of the Enthought Tool Suite.\n\... | python | chosen |
[
{
"from": "system",
"value": "Change 2nd hidden layer size\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\n\nclass ANN:\n def __init__(self):\n self.inputNodes = 7\n self.hiddenNodes = 64\n self.hiddenNodes2 = 32 # weight3\n self.outputNodes = 1\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix multivar for nodes with variable lenght stacks\n"
},
{
"from": "human",
"value": "\nfrom nodes import Node\n\nclass MultiVar(Node):\n char = \"'\"\n args = 0\n results = None\n contents = -1\n \n def __init__(self, node_1: Node.NodeSingle, node... | python | chosen |
[
{
"from": "system",
"value": "Remove lab_members/ from project URLs\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom cms.sitemaps import CMSSitemap\nfrom django.conf.urls import * # NOQA\nfrom django.conf.urls.i18n import i18n_patterns\nfrom django.contrib.staticfi... | python | chosen |
[
{
"from": "system",
"value": "Use \"id\" instead of \"plot_id\"\n\nFor the fake utf grid\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\nfrom django.http import HttpResponse\n\nfrom opentreemap import urls\n\ntesting_id = 1\n\n\ndef full_utf8_grid(reques... | python | chosen |
[
{
"from": "system",
"value": "[wip] Monitor new records and add them to the database\n"
},
{
"from": "human",
"value": "import os\nimport pymongo\n\nfrom .db import connect_to_db\n\n\nfiles_to_check = [\n '/home/irvind/test.log',\n '/home/irvind/test2.log'\n]\n\n\ndef run_scanner():\n _... | python | chosen |
[
{
"from": "system",
"value": "Use master path as the argument, which is crucial for single-locale repositories\n"
},
{
"from": "human",
"value": "\nimport commonware\n\nfrom celery.task import task\nfrom pontoon.base.models import Project\nfrom pontoon.administration.views import _update_from_re... | python | chosen |
[
{
"from": "system",
"value": "Use ugettext_lazy instead of ugettext to support Django 1.7 migrations\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.sites.models import Site\nfrom django.utils.translation import ugettext as _\n\n\nclass Feedback(models.Model)... | python | chosen |
[
{
"from": "system",
"value": "Use only lowercase letters in the source link as well\n"
},
{
"from": "human",
"value": "\"\"\"Simple blueprint.\"\"\"\nimport os\n\nfrom flask import Blueprint, current_app, render_template\n\nblueprint = Blueprint('simple', __name__, url_prefix='/simple',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix index page example URL.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom flask import Flask, abort, jsonify, request\nfrom icalendar import Calendar\nfrom urllib import urlopen\n\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n return... | python | chosen |
[
{
"from": "system",
"value": "Add logging and some minor error handling.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport types\n\n_subscribers = {}\n\nclass func:\n def __init__(self, inst, method):\n self._inst = inst\n self._method =... | python | chosen |
[
{
"from": "system",
"value": "Reorder ENV urls redis providers.\n"
},
{
"from": "human",
"value": "import os\n\nfrom django.conf import settings\n\n\nSESSION_REDIS_HOST = getattr(\n settings,\n 'SESSION_REDIS_HOST',\n '127.0.0.1'\n)\nSESSION_REDIS_PORT = getattr(\n settings,\n 'SE... | python | chosen |
[
{
"from": "system",
"value": "Disable union wrap for clickhouse\n"
},
{
"from": "human",
"value": "from .enums import Dialects\nfrom .queries import (\n Query,\n QueryBuilder,\n)\n\n\nclass MySQLQuery(Query):\n \"\"\"\n Defines a query class for use with MySQL.\n \"\"\"\n\n @cl... | python | chosen |
[
{
"from": "system",
"value": "TST: Check mean and STD of returned ECG signal\n"
},
{
"from": "human",
"value": "from __future__ import division, print_function, absolute_import\n\nimport pytest\nfrom numpy.testing import assert_equal, assert_allclose\nfrom scipy._lib._numpy_compat import suppres... | python | chosen |
[
{
"from": "system",
"value": "Remove uwsgi support, add support for simple alternative responses\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nfrom flask import Flask\n\napp = Flask(__name__)\n\n@app.route('/')\ndef hello():\n return 'Hi... | python | chosen |
[
{
"from": "system",
"value": "Fix python import for problem 9\n"
},
{
"from": "human",
"value": "import sys\nimport os\nsys.path.append(os.path.abspath(os.path.dirname('./utils/python')))\nfrom python.decorators import timeit\n\n\n@timeit\ndef solution():\n n = 1000\n for b in xrange(1, n)... | python | chosen |
[
{
"from": "system",
"value": "Convert Pi version to use application modules\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom time import sleep\nimport subprocess\nimport httplib, urllib\nimport RPi.GPIO as GPIO\nimport config\nimport logger\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(c... | python | chosen |
[
{
"from": "system",
"value": "Add some channel validity checking to digital attenuator\n\n--CAR\n"
},
{
"from": "human",
"value": "from .instrument import Instrument, VisaInterface\nfrom types import MethodType\n\nclass Attenuator(Instrument):\n NUM_CHANNELS = 3\n\n \"\"\"BBN 3 Channel Ins... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with creating tables\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom pytoon.connection import BrickConnection\n\n\napp = Flask(__name... | python | chosen |
[
{
"from": "system",
"value": "Use UTF-8 on windows where HDF5 >= 1.10.6\n"
},
{
"from": "human",
"value": "\"\"\"\nCompatibility module for high-level h5py\n\"\"\"\nimport sys\nfrom os import fspath, fsencode, fsdecode\n\nWINDOWS_ENCODING = \"mbcs\"\n\n\ndef filename_encode(filename):\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Update class to get image description if available and use it as the update message.\n"
},
{
"from": "human",
"value": "import exifread\nimport os\n\n\nclass TweetS3Images(object):\n def __init__(self, twitter, s3_client):\n self._twitter = twitter\n ... | python | chosen |
[
{
"from": "system",
"value": "Restructure app and display commit count as a disabled menu item\n"
},
{
"from": "human",
"value": "\n# Github Tray App\n\nimport rumps\nimport config\nimport contribs\n\nusername = config.get_username()\n\nclass GithubTrayApp(rumps.App):\n\n @rumps.timer(60*5)\n... | python | chosen |
[
{
"from": "system",
"value": "Use get() instead of setdefault().\n"
},
{
"from": "human",
"value": "\nclass ObservableMemory:\n def __init__(self, subject=None):\n if subject is None:\n subject = 0x10000 * [0x00]\n self._subject = subject\n\n self._read_subscri... | python | chosen |
[
{
"from": "system",
"value": "Update recommended libspotify and pyspotify version\n"
},
{
"from": "human",
"value": "\"\"\"A backend for playing music from Spotify\n\n`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend\nuses the official `libspotify\n<http://developer.... | python | chosen |
[
{
"from": "system",
"value": "Implement set_current_user for CapturingAuthentication (NC-529)\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nimport threading\n\n_locals = threading.local()\n\n\ndef get_event_context():\n return getattr(_locals, 'context', None)\... | python | chosen |
[
{
"from": "system",
"value": "Use the src directory instead of the src/levels directory as the cwd.\n"
},
{
"from": "human",
"value": "# Copyright 2013 Daniel Stokes, Mitchell Stokes\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except... | python | chosen |
[
{
"from": "system",
"value": "Fix __COPYRIGHT__ and __REVISION__ in new Darwin module.\n\n\n"
},
{
"from": "human",
"value": "\"\"\"engine.SCons.Platform.darwin\n\nPlatform-specific initialization for Mac OS X systems.\n\nThere normally shouldn't be any need to import this module directly. It\n... | python | chosen |
[
{
"from": "system",
"value": "Add RGD as part of the regular update pipeline\n\nI'm not sure if this will always be part of the update, but it is for at\nleast for this release.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright [2009-2017] EMBL-European Bioinformati... | python | chosen |
[
{
"from": "system",
"value": "Use the settings' wiki root, if any.\n"
},
{
"from": "human",
"value": "from flask import Flask, abort\n\n# Create the main app.\napp = Flask(__name__)\napp.config.from_object('wikked.settings')\napp.config.from_envvar('WIKKED_SETTINGS', silent=True)\n\nif app.confi... | python | chosen |
[
{
"from": "system",
"value": "Add utility method to add documents\n"
},
{
"from": "human",
"value": "from os import environ\n\nfrom eve import Eve\n\nfrom settings import API_NAME\n\napi = Eve(API_NAME)\n\nif __name__ == '__main__':\n # Heroku support: bind to PORT if defined, otherwise defau... | python | chosen |
[
{
"from": "system",
"value": "Change shebang to use python3 instead of python\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom src.TwircBot import TwircBot\nimport sys\n\ntry:\n bot = TwircBot(sys.argv[1])\nexcept IndexError:\n bot = TwircBot()\n\nbot.print_config()\nbot.st... | python | chosen |
[
{
"from": "system",
"value": "Add numeric time column (hour) that respects editions.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\nimport sys\n\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql.functions import lit, col\n\nif __name__ == \"__main__\":\n if ... | python | chosen |
[
{
"from": "system",
"value": "Make test file PEP8 compliant.\n"
},
{
"from": "human",
"value": "import falcon.testing\nimport json\n\nfrom displacy_service.server import APP\n\n\nclass TestAPI(falcon.testing.TestCase):\n def __init__(self):\n self.api = APP\n\n\ndef test_deps():\n t... | python | chosen |
[
{
"from": "system",
"value": "Change from request.ENABLED to settings.ENABLED"
},
{
"from": "human",
"value": "import re\nfrom django_seo_js import settings\nfrom django_seo_js.backends import SelectedBackend\nfrom django_seo_js.helpers import request_should_be_ignored\n\nimport logging\nlogger ... | python | chosen |
[
{
"from": "system",
"value": "Trim whitespace on rendered templates\n"
},
{
"from": "human",
"value": "from flask import Flask, render_template, request\nimport requests\nfrom requests_oauthlib import OAuth1\n\napp = Flask(__name__)\napp.config.from_pyfile('app.config')\n\n\n@app.route('/')\ndef... | python | chosen |
[
{
"from": "system",
"value": "Add databse config to production settings file\n"
},
{
"from": "human",
"value": "from gigs.settings_base import *\n\nDEBUG = False\nTEMPLATE_DEBUG = False\n\nADMINS = ()\n\nINSTALLED_APPS += (\n 'gunicorn',\n)\n\nLOGGING = {\n 'version': 1,\n 'disable_exis... | python | chosen |
[
{
"from": "system",
"value": "Update presubmit to use 'dart format' command\n\nThe presubmit checks will then work with the Flutter SDK in the path.\nThis is the case when working on the Flutter web app current_results_ui.\n\nChange-Id: I8a8d5db4454b57bc7936197032460e877037b386\nReviewed-on: https://dart-re... | python | chosen |
[
{
"from": "system",
"value": "Update enum value to an is-instance check\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom enum import Enum\nfrom typing import TypeVar, Optional, Any, Type # noqa\n\nfrom odin.exceptions import ValidationError\nfrom . import Field\... | python | chosen |
[
{
"from": "system",
"value": "Use requests built-in .json(), pass verify=False.\n"
},
{
"from": "human",
"value": "import requests\nimport json\nimport logging\nfrom glanerbeard import show\nlog = logging.getLogger(__name__)\n\nclass Server:\n\tdef __init__(self, name, url, apikey):\n\t\tself.na... | python | chosen |
[
{
"from": "system",
"value": "Make the null value consistent between vertical and tabular output.\n"
},
{
"from": "human",
"value": "from .tabulate import _text_type\n\ndef pad(field, total, char=u\" \"):\n return field + (char * (total - len(field)))\n\ndef get_separator(num, header_len, dat... | python | chosen |
[
{
"from": "system",
"value": "Add a test for a proper response, not just proper request\n"
},
{
"from": "human",
"value": "from urllib.parse import urljoin, parse_qs\n\nimport responses\n\nfrom tests.constants import *\nfrom tests.fixtures import PushoverAPI\nfrom tests.util import messages_call... | python | chosen |
[
{
"from": "system",
"value": "Add note about directed graphs\n\n--HG--\nextra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401776\n"
},
{
"from": "human",
"value": "\"\"\"\nEgo graph.\n\n\"\"\"\n# Copyright (C) 2010 by \n# Aric Hagberg <hagberg@lanl.gov>\n... | python | chosen |
[
{
"from": "system",
"value": "Add constant for badge url\n"
},
{
"from": "human",
"value": "CONVERSATIONALIST = ('conversationalist', 'Conversationalist')\nTEAM_PLAYER = ('team', 'Team player')\n\nBADGES_KEY = 'badges'\nBADGE_NOT_FOUND_ERROR = 'There exists no badge with id {badge_id}'\nBADGE_TY... | python | chosen |
[
{
"from": "system",
"value": "Add message about where we're listening for connections\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom argparse import ArgumentParser, ArgumentDefaultsHelpFormatter\nimport os, http.server\n\ndef main(args):\n os.chdir(args.directory)\n addr =... | python | chosen |
[
{
"from": "system",
"value": "Test setting our own alias via PEP\n\nAstonishingly, this was untested...\n"
},
{
"from": "human",
"value": "\n\"\"\"\nTest alias setting support.\n\"\"\"\n\nfrom servicetest import EventPattern\nfrom gabbletest import exec_test, acknowledge_iq\nimport constants as ... | python | chosen |
[
{
"from": "system",
"value": "Add test for setting as boolean value\n"
},
{
"from": "human",
"value": "from scoring_engine.models.setting import Setting\n\nfrom tests.scoring_engine.unit_test import UnitTest\n\n\nclass TestSetting(UnitTest):\n\n def test_init_setting(self):\n setting =... | python | chosen |
[
{
"from": "system",
"value": "Fix for failing test test_captures_and_measures_elapsed_time: TypeError: unsupported operand type(s) for -: 'float' and 'list'\n"
},
{
"from": "human",
"value": "from datetime import timedelta\nfrom django_performance_testing.timing import TimeCollector\nfrom freeze... | python | chosen |
[
{
"from": "system",
"value": "Remove yield from on redshift_client\n"
},
{
"from": "human",
"value": "import asyncio\n\nimport botocore.exceptions\n\nfrom bigcrunch import webapp\n\n\n@asyncio.coroutine\ndef shutdown():\n client = yield from webapp.redshift_client()\n cluster_control = web... | python | chosen |
[
{
"from": "system",
"value": "Make aggregation script compatible with python 3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom csv import reader\n\nwith open(\"data/public/labos.departements.csv\") as f:\n data = list(reader(f))\n\noutput = {}\nkeys = data.pop(0)\nkeys.remove... | python | chosen |
[
{
"from": "system",
"value": "Use connection pool for jsonrpc\n"
},
{
"from": "human",
"value": "from heisen.config import settings\nfrom heisen.core.log import logger\nfrom jsonrpclib.request import Connection\n\n\ndef get_rpc_connection():\n servers = {\n 'self': [\n ('127... | python | chosen |
[
{
"from": "system",
"value": "Implement secure RBAC for service providers API\n\nThis commit updates the policies for service providers API\nto understand scope checking and account for a read-only role.\n\nThis is part of a broader series of changes across OpenStack to\nprovide a consistent RBAC experience... | python | chosen |
[
{
"from": "system",
"value": "Add changes to url thingies\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\nfrom flask import Blueprint\n\nfrom flask.ext.restful import Api\n\n\napi = Blueprint(\"api\", __name__, template_folder=\"templates\")\n\nrest = Api(api)\n\nfrom karma.api.cha... | python | chosen |
[
{
"from": "system",
"value": "FIX dependency on aeroo rpoert\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': 'Argentinian Like Sale Order Aeroo Report',\n 'version': '1.0',\n 'category': 'Localization/Argentina',\n 'sequence': 14,\n 'summary': '',\n 'des... | python | chosen |
[
{
"from": "system",
"value": "Add environment variable for ability to set the output directory\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport configargparse\nfrom goodline_iptv.importer import do_import\n\n\nif __name__ == '__main__':\n parser = configargparse.ArgParser()... | python | chosen |
[
{
"from": "system",
"value": "Add pboothe temporarily for testing\n"
},
{
"from": "human",
"value": "\n# NOTE: User roles are not managed here. Visit PlanetLab to change user roles.\nuser_list = [('Stephen', 'Stuart', 'sstuart@google.com'),\n ('Will', 'Hawkins', 'hawkinsw@opentec... | python | chosen |
[
{
"from": "system",
"value": "Allow '.' in package name\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nfrom manager import views\n\n_PACKAGE_NAME_REGEX = r'(?P<package_name>[a-zA-Z0-9_+-]+)'\n_PACKAGE_NAME_REGEX_WITH_EMPTY = r'(?P<package_name>[a-zA-Z0-9_+-]*)'\n_BUILD_NU... | python | chosen |
[
{
"from": "system",
"value": "Add test_a1_to_coord() to assert that only valid board coordinates are in teh _a1_to_coord dictionary\n"
},
{
"from": "human",
"value": "import engine\n\n\nVALID_COORDS = [(x, y) for x in xrange(97, 105) for y in xrange(49, 57)]\nINVALID_COORDS = [\n (0, 0), (-1,... | python | chosen |
[
{
"from": "system",
"value": "Add new serializer for StatAdd that doesn't have activity\n"
},
{
"from": "human",
"value": "# from django.contrib.auth.models import User\nfrom rest_framework import serializers\nfrom .models import Activity, Stat\n\n\nclass StatSerializer(serializers.HyperlinkedMo... | python | chosen |
[
{
"from": "system",
"value": "Move request construction to init\n"
},
{
"from": "human",
"value": "from .request import Request\nfrom .response import response\n\n\nclass Handler(object):\n '''\n Simple dispatcher class.\n '''\n\n def __call__(self, event, context):\n self.req... | python | chosen |
[
{
"from": "system",
"value": "Add default rank to User for simplified tests\n"
},
{
"from": "human",
"value": "import re\nclass User:\n Groups = {' ':0,'+':1,'☆':1,'%':2,'@':3,'*':3.1,'&':4,'#':5,'~':6}\n @staticmethod\n def compareRanks(rank1, rank2):\n try:\n return ... | python | chosen |
[
{
"from": "system",
"value": "Add day 12 part two solution in python\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/python3\n\nimport json\n\nimport pathlib\n\ninput_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt')\n\n\ndef sum_data(d):\n total = 0\n if isinstan... | python | chosen |
[
{
"from": "system",
"value": "Change the library version number.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n# This is the cabb_scheduler Python library.\n# Jamie Stevens 2017\n# ATCA Senior Systems Scientist\n# Jamie.Stevens@csiro.au\n\nsetup(name='cabb_scheduler',\n ... | python | chosen |
[
{
"from": "system",
"value": "Create fast node that is twice the speed of slow node to get to center of list\n"
},
{
"from": "human",
"value": "# Given a singly linked list of integers, determine whether or not it's a palindrome\nclass Node(object): # define constructor\n\tdef __init__(self, val... | python | chosen |
[
{
"from": "system",
"value": "Add tests for sorted() function\nand check that sorted(list) produces same output as list.sort()\n"
},
{
"from": "human",
"value": "l = [1, 3, 2, 5]\nprint(l)\nl.sort()\nprint(l)\nl.sort(key=lambda x: -x)\nprint(l)\nl.sort(key=lambda x: -x, reverse=True)\nprint(l)\n... | python | chosen |
[
{
"from": "system",
"value": "Send data to elasticsearch asynchronously.\n"
},
{
"from": "human",
"value": "import os\n\nfrom elasticsearch_raven.transport import ElasticsearchTransport\nfrom elasticsearch_raven.utils import get_index\n\nhost = os.environ.get('ELASTICSEARCH_HOST', 'localhost:920... | python | chosen |
[
{
"from": "system",
"value": "Include the position into the graph\n"
},
{
"from": "human",
"value": "from networkx import OrderedGraph\n\n\ndef translate_df_to_graph(buses_df, lines_df, transformers_df=None):\n graph = OrderedGraph()\n\n buses = buses_df.index\n # add nodes\n graph.a... | python | chosen |
[
{
"from": "system",
"value": "Fix serious file overwriting problem.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python3\n\nimport sys\nimport json\n\nfor arg in sys.argv[1:]:\n with open(arg) as f:\n equajson = json.load(f)\n\n field_list = [\n \"always-an-integer\",\n... | python | chosen |
[
{
"from": "system",
"value": "Change the way to determine path to config file\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nfrom argh import arg, ArghParser\nfrom functools import wraps\n\n\nCONFIG = os.environ.get('ALFRED_LISTENER_CONFIG')\n\n\ndef with_app(func, args):... | python | chosen |
[
{
"from": "system",
"value": "Fix argument inputs to list()\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nfrom mnist_sequence_api import MNIST_Sequence_API\nimport sys\n\n\ndef main():\n arguments = list(sys.argv[1:])\n if len(arguments) == 4:\n sequence,... | python | chosen |
[
{
"from": "system",
"value": "FEAT: Add opencv version of load_image_as_array()\n"
},
{
"from": "human",
"value": "# ==============================================================================\n# LOAD_IMAGE_AS_ARRAY\n# ===============... | python | chosen |
[
{
"from": "system",
"value": "Use SphereDataSpectral instead of SphereDataPhysical\n\nThe script for physical data requires CSV files as default output files,\nwhereas the spectral script uses .sweet binary files as default.\nSince libpfasst_swe_sphere's CSV output is not in the same format as\nswe_sphere's... | python | chosen |
[
{
"from": "system",
"value": "Fix urlencode in webhook url"
},
{
"from": "human",
"value": "from django.contrib.sites.shortcuts import get_current_site\nfrom django.urls import reverse\nfrom django.core.signing import TimestampSigner\n\n\nclass BaseEngine:\n def __init__(self):\n self.... | python | chosen |
[
{
"from": "system",
"value": "Clean code and conform to python conventions\n\nSome things are still a bit weird, mostly due to my limited knowledge of\nPython.\n\nAlso fixed code to conform to Python naming conventions for\nvariables/functions.\n"
},
{
"from": "human",
"value": "\"\"\"\nmd5bot.p... | python | chosen |
[
{
"from": "system",
"value": "feat: Update regex. Add file write-out.\n\nRegex is bugged, however. Need to fix regex pattern.\n"
},
{
"from": "human",
"value": "\"\"\"\n Copyright 2016 Dee Reddy\n\n\"\"\"\nimport sys\nimport re\n\nargs = sys.argv[1:]\n\n\ndef minify(filepath, comments=False):... | python | chosen |
[
{
"from": "system",
"value": "Allow dot notation to map to nested dictionaries\n"
},
{
"from": "human",
"value": "# piperename.py\n#\n\nfrom pipe2py import util\n\n\ndef pipe_rename(context, _INPUT, conf, **kwargs):\n \"\"\"This operator renames or copies fields in the input source. \n\n K... | python | chosen |
[
{
"from": "system",
"value": "Update webmention plugin to new version\n"
},
{
"from": "human",
"value": "from webmentiontools.send import WebmentionSend\nfrom webmentiontools.urlinfo import UrlInfo\n \ndef handle_new_or_edit(post):\n url = post.permalink_url\n info = UrlInfo(url)\n i... | python | chosen |
[
{
"from": "system",
"value": "Fix bug with comment POST (created_date was required)\n"
},
{
"from": "human",
"value": "from .models import Comment\nfrom .models import Motel\nfrom .models import Town\nfrom rest_framework import serializers\n\nclass CommentSerializer(serializers.ModelSerializer):... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.