conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add task to upload documentation to github pages\n"
},
{
"from": "human",
"value": "# coding: utf8\n\nDOIT_CONFIG = {'default_tasks': []}\n\nCITEULIKE_GROUP = 19073\nBIBFILE = 'docs/pyfssa.bib'\n\n\ndef task_download_bib():\n \"\"\"Download bibliography from Cite... | python | chosen |
[
{
"from": "system",
"value": "Add light PWM control to test code.\n"
},
{
"from": "human",
"value": "from TSL2561 import TSL2561\nfrom MCP9808 import MCP9808\nimport time\n\ndef main():\n tsl = TSL2561(debug=0)\n mcp = MCP9808(debug=0)\n #tsl.set_gain(16)\n while True:\n full ... | python | chosen |
[
{
"from": "system",
"value": "Clean up after sync integration tests\n"
},
{
"from": "human",
"value": "from mock import patch\n\nfrom ...testcases import DustyIntegrationTestCase\nfrom ...fixtures import busybox_single_app_bundle_fixture\n\nclass TestSyncCLI(DustyIntegrationTestCase):\n def s... | python | chosen |
[
{
"from": "system",
"value": "Fix value/name ambiguity in ThingDefinition\n"
},
{
"from": "human",
"value": "from thinglang.lexer.symbols import LexicalGroupEnd\nfrom thinglang.lexer.symbols.base import LexicalIdentifier\nfrom thinglang.lexer.symbols.functions import LexicalDeclarationConstructo... | python | chosen |
[
{
"from": "system",
"value": "Enable morph rules for Danish\n"
},
{
"from": "human",
"value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .tokenizer_exceptions import TOKENIZER_EXCEPTIONS\nfrom .norm_exceptions import NORM_EXCEPTIONS\nfrom .stop_words import STOP_WORDS\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Set app in debug mode by default\n"
},
{
"from": "human",
"value": "from example import app\n\n\napp.debug = False\n\nSECRET_KEY = 'random-secret-key'\nSESSION_COOKIE_NAME = 'psa_session'\nDEBUG = False\nSQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'\nDEBUG_TB_INTERC... | python | chosen |
[
{
"from": "system",
"value": "Remove commented file loading code\n"
},
{
"from": "human",
"value": "import os\nimport json\n\n'''\ndata_dir = os.path.join(\n os.path.split(\n os.path.split(os.path.dirname(__file__))[0])[0], 'data')\n'''\ndata_dir = os.path.join(os.environ['PORTER'], 'd... | python | chosen |
[
{
"from": "system",
"value": "Move subprocess stuff to an execution module for Pelican.\n"
},
{
"from": "human",
"value": "import salt.exceptions\nimport subprocess\n\ndef build_site(name, output=\"/srv/www\"):\n # /srv/salt/_states/pelican.py\n # Generates static site with pelican -o $out... | python | chosen |
[
{
"from": "system",
"value": "Add new exception for malformed captions\n"
},
{
"from": "human",
"value": "\n\nclass MalformedFileError(Exception):\n \"\"\"Error raised when the file is not well formatted\"\"\"\n"
},
{
"from": "gpt",
"value": "\n\nclass MalformedFileError(Exception... | python | chosen |
[
{
"from": "system",
"value": "Make sure test works with new API\n"
},
{
"from": "human",
"value": "import luigi\nimport sciluigi as sl\nimport os\n\nTESTFILE_PATH = '/tmp/test.out'\n\nclass TestTask(sl.Task):\n\n def out_data(self):\n return sl.TargetInfo(self, TESTFILE_PATH)\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Switch to a test schedule based on the environment\n\nSwitching an environment variable and kicking the `clock` process feels\nlike a neater solution than commenting out one line, uncommenting\nanother, and redeploying.\n"
},
{
"from": "human",
"value": "from apsche... | python | chosen |
[
{
"from": "system",
"value": "Add missing installed apps for tests\n"
},
{
"from": "human",
"value": "\"\"\"\n\"\"\"\n\nimport os\nBASE_DIR = os.path.dirname(os.path.dirname(__file__))\n\n\nSECRET_KEY = 'hrzeqwz0@nps2#ns3_qkqz*#5=)1bxcdwa*h__hta0f1bqr2e!'\nDEBUG = True\nTEMPLATE_DEBUG = True\nAL... | python | chosen |
[
{
"from": "system",
"value": "Fix relative path not working properly 50% of the time…\n"
},
{
"from": "human",
"value": "import io\nimport pytest\nfrom steamfiles import acf\n\ntest_file_name = 'tests/test_data/appmanifest_202970.acf'\n\n\n@pytest.yield_fixture\ndef acf_data():\n with open(te... | python | chosen |
[
{
"from": "system",
"value": "Disable secure test until new test rig complete.\n"
},
{
"from": "human",
"value": "from nose.tools import assert_true, assert_false, assert_equal, \\\n assert_list_equal, raises\nimport datajoint as dj\nfrom . import CONN_INFO\nfrom pymysql.e... | python | chosen |
[
{
"from": "system",
"value": "Make sure to load the new mongo south adapter\n"
},
{
"from": "human",
"value": "\nfrom test_project.settings import *\n\nDATABASES['mongo'] = {\n 'ENGINE' : 'django_mongodb_engine',\n 'NAME' : 'mutant',\n 'OPTIONS': {\n 'OPERATIONS': {\n 'save' : {'safe'... | python | chosen |
[
{
"from": "system",
"value": "FIX: Check whether current config exists usinf os and if\n"
},
{
"from": "human",
"value": "import ConfigParser\nConfig = ConfigParser.ConfigParser()\n\nimport os\nprint os.getcwd()\ntry:\n Config.read('/opt/monstr/current.cfg')\nexcept Exception as e:\n print... | python | chosen |
[
{
"from": "system",
"value": "Allow accurate daily task time scheduling\n"
},
{
"from": "human",
"value": "\"\"\"\r\n SmartAPI Web Server Entry Point\r\n\r\n > python index.py\r\n\r\n\"\"\"\r\n\r\nimport os.path\r\n\r\nfrom tornado.ioloop import IOLoop, PeriodicCallback\r\nfrom utils.a... | python | chosen |
[
{
"from": "system",
"value": "Fix name of first argument to decorated validators\n"
},
{
"from": "human",
"value": "import functools\n\n\n_undefined = object()\n\n\ndef validator(f):\n @functools.wraps(f)\n def wrapper(value=_undefined, **kwargs):\n required = kwargs.pop('required',... | python | chosen |
[
{
"from": "system",
"value": "[JupyROOT] Update logic to check for IPython\n\nTo sync it with what was already introduced in ROOT/__init__.py\n"
},
{
"from": "human",
"value": "#-----------------------------------------------------------------------------\n# Author: Danilo Piparo <Danilo.Piparo... | python | chosen |
[
{
"from": "system",
"value": "Fix length (was 1 too short).\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport argparse\nimport random\nimport string\nimport sys\n\ndef main():\n # Set defaults\n default_length = 10\n default_seed = None\n default_population = string... | python | chosen |
[
{
"from": "system",
"value": "Update the API to make it more semantic.\n"
},
{
"from": "human",
"value": "\"\"\"\nDatabase Emulator for the teammetrics project\nTemporarily the data is generated by accessing data available at http://blend.debian.org/liststats\n\n\"\"\"\nimport urllib2\nimport lo... | python | chosen |
[
{
"from": "system",
"value": "Fix pool names in KCM help.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\n\"\"\"kcm.\n\nUsage:\n kcm (-h | --help)\n kcm --version\n kcm (init | describe | reconcile) [--conf-dir=<dir>]\n kcm isolate [--conf-dir=<dir>] --pool=<pool> <command> [--... | python | chosen |
[
{
"from": "system",
"value": "Optimize GIF palette (too many colors right now), better GIF timing options.\n"
},
{
"from": "human",
"value": "from PIL import Image\nfrom PIL import ImageDraw\n\n\ndef render(animation, out, scale=8):\n images = [render_frame(colors, scale=scale) for colors in an... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with config-nodemgr and cassandra-repair listening on same port\n\ncontrail-config-nodemgr spawns contrail-cassandra-repair using\nsubprocess.Popen and thus contrail-cassandra-repair inherits all\nthe fds including the listening fd. Then when contrail-config-nodemgr\n... | python | chosen |
[
{
"from": "system",
"value": "Allow users of the Machine Provider to specify the dev instance for API calls\n\nBUG=489837\n\nReview URL: https://codereview.chromium.org/1572793002\n"
},
{
"from": "human",
"value": "# Copyright 2015 The Swarming Authors. All rights reserved.\n# Use of this source... | python | chosen |
[
{
"from": "system",
"value": "Update example to show HTML class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nfrom operator import itemgetter\n\nimport monoidal_tables as mt\nfrom monoidal_tables import renderers\n\n\nif __name__ == '__mai... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding bug in TemplateCommandView\n"
},
{
"from": "human",
"value": "from telegrambot.bot_views.generic.responses import TextResponse, KeyboardResponse\nfrom telegram import ParseMode\nimport sys\nimport traceback\nimport logging\n\nlogger = logging.getLogger(... | python | chosen |
[
{
"from": "system",
"value": "Add form validation for victim\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm\nfrom breach.models import Target\n\n\nclass TargetForm(ModelForm):\n class Meta:\n model = Target\n fields = (\n 'name',\n 'e... | python | chosen |
[
{
"from": "system",
"value": "Add form for /attack with victim id\n"
},
{
"from": "human",
"value": "from django.forms import ModelForm\nfrom breach.models import Target, Victim\n\n\nclass TargetForm(ModelForm):\n class Meta:\n model = Target\n fields = (\n 'name',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the slow-mo gradient bug by flushing BlinkyTape response on updates\n"
},
{
"from": "human",
"value": "import blinkycolor\nimport serial\n\nclass BlinkyTape(object):\n def __init__(self, port, baud_rate = 115200, pixel_count = 60):\n self._serial = ser... | python | chosen |
[
{
"from": "system",
"value": "Remove references to stdout in OutputHandler\n"
},
{
"from": "human",
"value": "import threading\n\n\nclass IoHandler(object):\n def __init__(self, in_out_pairs, read_all):\n self._handlers = [\n OutputHandler(file_in, file_out)\n for... | python | chosen |
[
{
"from": "system",
"value": "Use temporary SAMP lock file\n"
},
{
"from": "human",
"value": "from ..hub_proxy import SAMPHubProxy\nfrom ..hub import SAMPHubServer\nfrom ..client import SAMPClient\n\n\nclass TestHubProxy(object):\n\n def setup_method(self, method):\n\n self.hub = SAMPH... | python | chosen |
[
{
"from": "system",
"value": "Fix `get_queue` call in `enqueue`\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.util.jobqueue\n~~~~~~~~~~~~~~~~~~~~\n\nAn asynchronously processed job queue based on Redis_ and RQ_.\n\n.. _Redis: http://redis.io/\n.. _RQ: http://python-rq.org/\n\n:Copyright: ... | python | chosen |
[
{
"from": "system",
"value": "Remove unused import because Travis is picky\n"
},
{
"from": "human",
"value": "import urlparse\n\nimport celery\nimport requests\nfrom celery.utils.log import get_task_logger\nfrom django.conf import settings\n\nfrom framework.tasks import app as celery_app\nfrom f... | python | chosen |
[
{
"from": "system",
"value": "Fix variable naming for comments\n"
},
{
"from": "human",
"value": "import codecs\nfrom string import Template\n\nimport os\n\nimport networkx as nx\nfrom networkx.readwrite import json_graph\n\n\npath = os.path.dirname(os.path.abspath(__file__))\n\ndef create_netwo... | python | chosen |
[
{
"from": "human",
"value": "Add table manger to handle and commit changes to the table\n"
},
{
"from": "gpt",
"value": "from networktables import NetworkTables \n\nTABLE_NAME = 'ImageProc'\nDO_WORK_NAME = 'calculate'\nHORIZONTAL_DATA_NAME = 'horizontal'\nVERTICAL_DATA_NAME = 'vertical'\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Add additional checks to update_language_list test\n\nAlso make language variable names independent of their actual values.\n"
},
{
"from": "human",
"value": "# test_update_language_list\n\nfrom __future__ import unicode_literals\n\nimport json\nimport os\nimport os... | python | chosen |
[
{
"from": "system",
"value": "Set up a default port of 5000 so it won't fail if you forget to specify one in config.yaml\n"
},
{
"from": "human",
"value": "from http import server\nfrom socketserver import TCPServer\nimport os\n\n\nclass Server:\n def __init__(self, own_config, config, builde... | python | chosen |
[
{
"from": "system",
"value": "Make sure example also runs if executed as scipt\n"
},
{
"from": "human",
"value": "import tadtool.tad as tad\nimport tadtool.plot as tp\n\n# load regions data set\nregions = tad.HicRegionFileReader().regions(\"chr12_20-35Mb_regions.bed\")\n\n# load matrix\nmatrix =... | python | chosen |
[
{
"from": "system",
"value": "Fix obsolete code + import\n\nI can now run this without anything crashing\n\n```\nC02KT61MFFT0:e-mission-server shankari$ ./e-mission-py.bash bin/purge_database_json.py localhost\nUSAGE: bin/purge_database_json.py\nC02KT61MFFT0:e-mission-server shankari$ ./e-mission-py.bash bi... | python | chosen |
[
{
"from": "system",
"value": "Remove unneeded shebang line that was triggering some linters.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# Copyright 2016 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fil... | python | chosen |
[
{
"from": "system",
"value": "[REF] Disable import of document_cancel and document_correction\n"
},
{
"from": "human",
"value": "# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n\nfrom . import res_country_state\nfrom . import res_partner\nfrom . import res_company\nfrom . impor... | python | chosen |
[
{
"from": "system",
"value": "Add GroupedTable to the top-level table classes\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom .table import Column, Table, TableColumns, Row, MaskedColumn\nfrom .np_utils import TableMergeError\nfrom .operat... | python | chosen |
[
{
"from": "system",
"value": "Remove outdated imports, oops sorry.\n"
},
{
"from": "human",
"value": "import time\n\nfrom influxdb import InfluxDBClient\nfrom influxdb import SeriesHelper\n\nfrom . import config\n\n# expects Cozify devices type json data\ndef getMultisensorData(data):\n out =... | python | chosen |
[
{
"from": "system",
"value": "Set the version number for the v0.5 release"
},
{
"from": "human",
"value": "\"\"\" Version module.\n\n Allows to define the version number uniquely.\n\"\"\"\n\n__version__ = \"0.5dev\"\n"
},
{
"from": "gpt",
"value": "\"\"\" Version module.\n\n Al... | python | chosen |
[
{
"from": "system",
"value": "Add Odoo Community Association (OCA) in authors\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP, Open Source Management Solution\n# This module copyright (... | python | chosen |
[
{
"from": "system",
"value": "Handle case with empty block\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"antimarkdown.handlers -- Element handlers for converting HTML Elements/subtrees to Markdown text.\n\"\"\"\nfrom collections import deque\n\nfrom antimarkdown import nodes\... | python | chosen |
[
{
"from": "system",
"value": "Fix traceback and exception handling\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport traceback\nfrom functools import wraps\n\nfrom hokusai.lib.common import print_red, get_verbosity\nfrom hokusai.lib.exceptions import CalledProcessError, HokusaiE... | python | chosen |
[
{
"from": "system",
"value": "Hide stacktrace for keyboard interrupts\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nSimple utility to display BSON files.\n\"\"\"\n\nimport sys\nimport errno\nfrom bson.json_util import dumps\nimport bson_lazy\n\nusage = '''\nUsage: %s FILE... ... | python | chosen |
[
{
"from": "system",
"value": "Add new-line at EOF, when dumping userdb\n"
},
{
"from": "human",
"value": "import json\n\n\nclass Database(dict):\n \"\"\"Holds a dict that contains all the information about the users in a channel\"\"\"\n def __init__(self, irc):\n super(Database, sel... | python | chosen |
[
{
"from": "system",
"value": "Fix url typo for stopping mapreduce task\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url, include\nimport djangae.contrib.mappers.urls\n\nurlpatterns = patterns('djangae.views',\n url(r'^start$', 'start'),\n url(r'^start$', 'stop'... | python | chosen |
[
{
"from": "system",
"value": "Add static content and front end routes to SPA example\n"
},
{
"from": "human",
"value": "from flask import Flask, send_file\napp = Flask(__name__)\n\n@app.route(\"/hello\")\ndef hello():\n return \"Hello World from Flask in a uWSGI Nginx Docker container with \\... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in changeling title fix - it used to remove some lines on the way...\n"
},
{
"from": "human",
"value": "import json\nimport logging\n\nif __name__ == \"__main__\":\n input = sys.argv[1]\n output = sys.argv[2]\n processor = fix_changeline_budget_titl... | python | chosen |
[
{
"from": "system",
"value": "Use `login_required` decorator on `switch_builder` view\n"
},
{
"from": "human",
"value": "from rest_framework.decorators import api_view\nfrom rest_framework.response import Response\nfrom .models import FormBuilderPreference\nfrom django.http import HttpResponseRe... | python | chosen |
[
{
"from": "system",
"value": "Update code in dipy/reconst (PEP8)\n\nUsing `pycodestyle` output, the file `dipy/reconst/base.py` was\nupdated to pass `pycodestyle` check\n\nSigned-off-by: Antonio Ossa <1ecf3d2f96b6e61cf9b68f0fc294cab57dc5d597@uc.cl>\n"
},
{
"from": "human",
"value": "\"\"\"\n\nBa... | python | chosen |
[
{
"from": "system",
"value": "Update the view for the voting\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, get_object_or_404\nfrom django.http import HttpResponse, Http404\nfrom polls.models import Question\n\n# Create your views here.\n\ndef index(request):\n latest... | python | chosen |
[
{
"from": "system",
"value": "Add default base data dir for experiments\n\n"
},
{
"from": "human",
"value": "from appconf import AppConf\nfrom django.conf import settings\n\n\nclass DjExperimentAppConf(AppConf):\n DATA_DIR = \"./\"\n SEPARATOR = \".\"\n OUTPUT_PREFIX = \"\"\n OUTPUT_... | python | chosen |
[
{
"from": "system",
"value": "Add unauthenticated message if sign-in incorrect\n"
},
{
"from": "human",
"value": "import requests\nfrom mitmproxy import ctx\n\n# TODO authenticate user\ndef getUser(flow):\n if 'proxyauth' in flow.metadata: # TODO and user != None\n return flow.... | python | chosen |
[
{
"from": "system",
"value": "Use yaml.safe_dump rather than yaml.dump. No more \"!!python/unicode\".\n"
},
{
"from": "human",
"value": "# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under... | python | chosen |
[
{
"from": "system",
"value": "Add parsing to enable vectors\n"
},
{
"from": "human",
"value": "import sklearn.cross_validation as cv\nfrom sklearn import tree\nimport pandas as py\nimport numpy as np\n\n"
},
{
"from": "gpt",
"value": "import sklearn.cross_validation as cv\nfrom sklea... | python | chosen |
[
{
"from": "system",
"value": "Update partner authorize URL to match changes by Xero"
},
{
"from": "human",
"value": "# Public/Private\nXERO_BASE_URL = \"https://api.xero.com\"\nREQUEST_TOKEN_URL = \"%s/oauth/RequestToken\" % XERO_BASE_URL\nAUTHORIZE_URL = \"%s/oauth/Authorize\" % XERO_BASE_URL\n... | python | chosen |
[
{
"from": "system",
"value": "Fix document format of as_strided\n"
},
{
"from": "human",
"value": "import cupy\n\n\ndef as_strided(x, shape=None, strides=None):\n \"\"\"\n Create a view into the array with the given shape and strides.\n .. warning:: This function has to be used with ext... | python | chosen |
[
{
"from": "system",
"value": "Update dsub version to 0.3.2\n\nPiperOrigin-RevId: 252927917\n"
},
{
"from": "human",
"value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | python | chosen |
[
{
"from": "system",
"value": "Add some basic transactional methdos to properties\n"
},
{
"from": "human",
"value": "\"\"\"\nProperty class\n\"\"\"\n\nclass Property(object):\n \"\"\"\n a monopoly property that items on the\n board can inherit from\n \"\"\"\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Move paginator settings to base list view\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.shortcuts import render_to_response, get_object_or_404\n\nfrom django.views.generic.detail import DetailView\nfrom django.views.generic.edit import Cr... | python | chosen |
[
{
"from": "system",
"value": "Create an example firewall rule push with the antivirus enablement.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\nfrom fortiosapi import FortiOSAPI\nimport sys\nimport os\nimport pprint\nimport json\nimport pexpect\nimport yaml\nimport logging\nfrom packagin... | python | chosen |
[
{
"from": "system",
"value": "Make udiff print reasonable errors while not on a branch.\n\nR=agable@chromium.org\nBUG=\n\nReview URL: https://codereview.chromium.org/212493002\n\ngit-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@259647 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",... | python | chosen |
[
{
"from": "system",
"value": "Update development status on master.\n"
},
{
"from": "human",
"value": "\"Utilities for building responsive websites in Django.\"\nfrom __future__ import unicode_literals\n\n\n__version__ = '0.2.0'\n"
},
{
"from": "gpt",
"value": "\"Utilities for buildin... | python | chosen |
[
{
"from": "system",
"value": "Update statistics epoch for easier testing\n"
},
{
"from": "human",
"value": "import socket\nimport datetime\nhostname = socket.gethostname().split('.')[0]\n\n\nconfig = {\n # Consumer stuff\n \"statscache.consumer.enabled\": True,\n \"statscache.sqlalchemy... | python | chosen |
[
{
"from": "system",
"value": "Generalize adding a data source\n\nInstead of using data source specific methods for DataManager, use\njust one: add_datasource(). The type of data source is defined by\nthe keyword argument 'type'.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom collectio... | python | chosen |
[
{
"from": "system",
"value": "XDC: Refactor test output comparison script\n\nSigned-off-by: Tomasz Michalak <a2fdaa543b4cc5e3d6cd8672ec412c0eb393b86e@antmicro.com>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\"\"\"\n\nThis script extracts the top module cells and their correspondi... | python | chosen |
[
{
"from": "system",
"value": "Add all languages to fallback languages\n\nBB-12799 #resolve\n"
},
{
"from": "human",
"value": "import parler.appsettings\nfrom parler.utils.conf import add_default_language_settings\n\nfrom bluebottle.clients import properties\n\nappsettings = parler.appsettings\n\... | python | chosen |
[
{
"from": "system",
"value": "Reorganize imports (and bump version)\n"
},
{
"from": "human",
"value": "version_info = (0, 20, 0)\n__version__ = '.'.join(map(str, version_info))\n\ntry:\n from . import greenthread\n from . import greenpool\n from . import queue\n from . import timeout... | python | chosen |
[
{
"from": "system",
"value": "Add code for automatically assigning message_refs\n"
},
{
"from": "human",
"value": "import sms_generator\nimport sms_twilio\nimport db\nimport config\n\n\ndef broadcast_procedure(procedure, location, duration, doctor):\n message = sms_generator.new_procedure_mes... | python | chosen |
[
{
"from": "system",
"value": "ENH: Print warnings on one line & no code\n"
},
{
"from": "human",
"value": "from textwrap import dedent\nimport warnings\n\n# Statsmodels is slow to fix upstream future warnings\n# This module is imported before the stats module so\n# so any FutureWarnings with the... | python | chosen |
[
{
"from": "system",
"value": "Allow slug to be passed directly into the view"
},
{
"from": "human",
"value": "from django.views.generic import ListView, DetailView\n\nfrom .models import Post\n\n\nclass PostListView(ListView):\n context_object_name = 'posts'\n model = Post\n template_na... | python | chosen |
[
{
"from": "system",
"value": "Rename exception to squash test warning\n"
},
{
"from": "human",
"value": "import pytest\n\nfrom .common import TestCase\nfrom h5py import File\n\n\nclass TestException(Exception):\n pass\n\ndef throwing(name, obj):\n print(name, obj)\n raise TestException(... | python | chosen |
[
{
"from": "system",
"value": "Make JsonField actually do it's work\n\nThis code will be used when objects are registered.\n\nChange-Id: I2f1b3e2dd5584335e318b936984c227050bbe699\nPartial-Bug: 1491258\n"
},
{
"from": "human",
"value": "# Copyright 2014 Intel Corp.\n#\n# Licensed under the Apache ... | python | chosen |
[
{
"from": "system",
"value": "authenticate: Add placeholder for feide oauth callback.\n"
},
{
"from": "human",
"value": "from devilry.devilry_authenticate.views import CustomLoginView\nfrom django.conf.urls import url\n\nfrom django_cradmin.apps.cradmin_authenticate.views import logout\n\nurlpat... | python | chosen |
[
{
"from": "system",
"value": "Use newer twilio API to fix 160 character limit\n\nSee http://stackoverflow.com/questions/22028278/send-sms-of-more-than-160-characters-in-python-using-twilio"
},
{
"from": "human",
"value": "#-*- coding: utf-8 -*-\n\"\"\"\nthis backend requires the twilio python li... | python | chosen |
[
{
"from": "system",
"value": "Change font style to <strong>\n"
},
{
"from": "human",
"value": "from flask import Flask\nfrom redis import Redis\nimport os\n\nhitcounter = Flask(__name__)\nredis = Redis(host='redis', port=6379)\nwho = os.getenv('WHO', 'World')\n\n@hitcounter.route('/')\ndef hello... | python | chosen |
[
{
"from": "system",
"value": "Add search fields for newsletter subscriptions\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import NewsletterSubscription\n\n\nadmin.site.register(NewsletterSubscription,\n list_display=('email', 'is_active', 'confirmed_on',... | python | chosen |
[
{
"from": "system",
"value": "Fix route for main page\n"
},
{
"from": "human",
"value": "from django.urls import path\n\nfrom core import views\n\n\napp_name = \"core\"\n\nurlpatterns = [\n path(\"home/\", views.home, name=\"home\"),\n path(\"about/\", views.about, name=\"about\"),\n]\n"
... | python | chosen |
[
{
"from": "system",
"value": "Set environment to development if Django is in DEBUG mode.\n"
},
{
"from": "human",
"value": "from honeybadger import honeybadger\n\nclass DjangoHoneybadgerMiddleware(object):\n def __init__(self):\n from django.conf import settings\n config_kwargs ... | python | chosen |
[
{
"from": "system",
"value": "Add list_filter to example ArticleAdmin\n\nWhen using a list filter and then adding or editing an object the\nlanguage GET parameter goes missing causing the wrong translation to be\nedited.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom d... | python | chosen |
[
{
"from": "system",
"value": "Add absolutely stupid test for only-drop gen_sql\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom io import StringIO\n\nfrom pg_bawler import gen_sql\n\n\ndef test_simple_main(monkeypatch):\n stdout = StringIO()\n monkeypatch.setattr(... | python | chosen |
[
{
"from": "system",
"value": "Test to get different pv names for an element\n"
},
{
"from": "human",
"value": "import rml.machines\n\n\ndef test_machine_load_elements():\n lattice = rml.machines.get_elements(machine='SRI21', elemType='BPM')\n assert len(lattice) == 173\n"
},
{
"fro... | python | chosen |
[
{
"from": "system",
"value": "Fix error on new user registration.\n"
},
{
"from": "human",
"value": "from django import forms\n\nfrom registration.models import RegistrationProfile\nfrom registration.forms import RegistrationForm\n\nfrom pykeg.core.models import UserProfile\n\nclass KegbotRegist... | python | chosen |
[
{
"from": "system",
"value": "Remove check for versions < 1.7\n"
},
{
"from": "human",
"value": "import os\n\nimport django\nfrom django.conf import settings\n\n\nif not settings.configured:\n settings_dict = dict(\n INSTALLED_APPS=[\n 'django.contrib.contenttypes',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix application name in admin\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass AirtimeApplication(models.Model):\n name = models.CharField(max_length=50)\n ratio = models.IntegerField(null=True, blank=True)\n max_per_day = models... | python | chosen |
[
{
"from": "system",
"value": "Add a related bill tester.\n"
},
{
"from": "human",
"value": "from ..bill import Bill\nfrom validictory import ValidationError\n\n\ndef toy_bill():\n b = Bill(bill_id=\"HB 2017\",\n session=\"2012A\",\n title=\"A bill for an act to raise t... | python | chosen |
[
{
"from": "system",
"value": "Add doxygen comment for version_string\n\nAdd a doxygen comment for version_string describing its nature.\n"
},
{
"from": "human",
"value": "import sys\n\nminver = (3,3,0)\n\nif sys.version_info[0:3] < minver:\n raise ImportError(\"transmute requires Python versio... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in management command for updating ratings\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django.core.management.base import BaseCommand\nfrom django.db.models import get_model\n\nProduct = get_model('catalogue', 'Product')\nProductReview... | python | chosen |
[
{
"from": "system",
"value": "Remove FK's from CSV export for massive speed boost\n"
},
{
"from": "human",
"value": "import csv\nfrom django.http import HttpResponse\nfrom servicerating.models import Response\n\ndef report_responses(request):\n\n qs = Response.objects.raw(\"SELECT servicerati... | python | chosen |
[
{
"from": "system",
"value": "Add stub for mod manager GUI\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport os.path\nimport platform\n\nimport wx\n\n\ndef create_menu_item(menu, label, func=None):\n menu_item = wx.MenuItem(menu, -1, label)\n if callable(func):\n menu.Bind(... | python | chosen |
[
{
"from": "system",
"value": "Return specific user-defined control, not proxy\n"
},
{
"from": "human",
"value": "from sf.lib.orderedattrdict import OrderedAttrDict\n\n\nclass Controller(object):\n\n def __init__(self, module, name):\n self.module = module\n self.name = name\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add url leading to student council archive\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\n\nurlpatterns = patterns('members.views',\n url(r'^login/$', 'login', name='login'),\n url(r'^search/(?P<name>.*)/$', 'search', name='se... | python | chosen |
[
{
"from": "system",
"value": "Make argv arguments optional, fixes pip installed script\n"
},
{
"from": "human",
"value": "import yaml\nfrom zonetruck.WorkManager import WorkManager\nfrom zonetruck.ZoneUpdater import ZoneUpdater\nfrom zonetruck.ZoneFilter import ZoneFilter\nfrom zonetruck.zone_xf... | python | chosen |
[
{
"from": "system",
"value": "Exclude platform specific doctests on appveyor.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport unittest\nimport doctest\nimport os\n\nimport lupa\n\n\ndef suite():\n test_dir = os.path.abspath(os.path.dirname(__file__))\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Put signature at the end to permit pub-sub to happen\n"
},
{
"from": "human",
"value": "import hmac\nimport hashlib\n\nfrom .error import AuthenticatorInvalidSignature\n\n\nclass Authenticator(object):\n \"\"\" This object is used to authenticate messages \"\"\"\... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.