conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "[telemetry] Add skipped and addSkip() to PageTestResults, for Python < 2.7.\n\nFixing bots after https://chromiumcodereview.appspot.com/15153003/\nAlso fix typo in addSuccess(). successes is only used by record_wpr, so that mistake had no effect on the bots.\n\nTBR=tonyg@chromi... | python | chosen |
[
{
"from": "system",
"value": "urls: Migrate legacy urls to use modern django pattern.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nimport zerver.views\nimport zerver.views.streams\nimport zerver.views.auth\nimport zerver.views.tutorial\nimport zerver.views.report\n\n# Fut... | python | chosen |
[
{
"from": "system",
"value": "Change functionality depending on where command is called from"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom dateutil.relativedelta import relativedelta\n\nfrom legalaid.models import Case\nfrom cla_butler.tasks import De... | python | chosen |
[
{
"from": "system",
"value": "Drop empty field keys in migration\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\nfrom corehq.apps.custom_data_fields.models import CustomDataFieldsDefinition, CustomDataField\nfrom corehq.apps.users.models import CommCareUse... | python | chosen |
[
{
"from": "system",
"value": "Comment all view return a json of all comments\n"
},
{
"from": "human",
"value": "from flask_classy import FlaskView\nfrom flask_user import current_user, login_required\nfrom ..models import CommentModel, PostModel\nfrom ..forms import CommentForm\n\n\nclass Commen... | python | chosen |
[
{
"from": "system",
"value": "Change S3 full name to Amazon S3\n"
},
{
"from": "human",
"value": "import os\n\nfrom . import model\nfrom . import routes\nfrom . import views\n\nMODELS = [model.AddonS3UserSettings, model.AddonS3NodeSettings, model.S3GuidFile]\nUSER_SETTINGS_MODEL = model.AddonS3U... | python | chosen |
[
{
"from": "system",
"value": "Verify EGit commits/pushes to Master"
},
{
"from": "human",
"value": "'''\nCreated on Sep 27, 2013\n\n@author: dgamez\n'''\n\ndef run():\n t = lee_passwd ()\n \n for l in t:\n # print l\n e = l.split(\":\")\n user = e[0]\n shell = ... | python | chosen |
[
{
"from": "human",
"value": "Fix import race condition on CI\n"
},
{
"from": "gpt",
"value": "# The main Flask application needs to imported before any of the database tests so that linkr.db\n# is defined before attempting to access any of the database modules database.*.\n# This is the result o... | python | chosen |
[
{
"from": "system",
"value": "posts: Order posts from newest to oldest\n"
},
{
"from": "human",
"value": "from django.views.generic.list import ListView\nfrom django.views.generic.detail import DetailView\n\nfrom .models import Post\n\n\nclass PostListView(ListView):\n\n model = Post\n con... | python | chosen |
[
{
"from": "system",
"value": "Support for static pages added\n"
},
{
"from": "human",
"value": "# View for semi-static templatized content. \n#\n# List of valid templates is explicitly managed for (short-term)\n# security reasons.\n\nfrom mitxmako.shortcuts import render_to_response, render_to_s... | python | chosen |
[
{
"from": "system",
"value": "Add argument to specify bag topics\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Print a rosbag file.\n\"\"\"\n\nimport sys\nimport logging\n\nimport numpy as np\n\n# suppress logging warnings due to rospy\nlogging.basicCon... | python | chosen |
[
{
"from": "system",
"value": "Make onoff function more versatile\n"
},
{
"from": "human",
"value": "import RPi.GPIO as GPIO\nfrom time import sleep\n\ndef onoff(period, pin):\n \"\"\"Symmetric square wave, equal time on/off\"\"\"\n half_cycle = period / 2.0\n GPIO.output(pin, GPIO.HIGH)... | python | chosen |
[
{
"from": "system",
"value": "Use the new location of study NexSON\n\nEach study now has a distinct directory. Currently we only plan to store\na single JSON file in each directory, until one becomes larger than 50MB.\n\nAdditionally, this allows various metadata/artifacts about a study to live\nnear the ac... | python | chosen |
[
{
"from": "system",
"value": "Fix na rota dos testes\n"
},
{
"from": "human",
"value": "# coding: utf-8\nfrom django.test import TestCase\nfrom django.contrib.auth.models import User\nfrom rest_framework.authtoken.models import Token\nfrom rest_framework.test import APIRequestFactory, APIClient\... | python | chosen |
[
{
"from": "system",
"value": "Fix test for loading multiple trajectories.\n"
},
{
"from": "human",
"value": "##############################################################################\n# MDTraj: A Python Library for Loading, Saving, and Manipulating\n# Molecular Dynamics Trajectories... | python | chosen |
[
{
"from": "system",
"value": "Change dimensions of output in python wrapper\n"
},
{
"from": "human",
"value": "import pycuda.autoinit\nimport pycuda.driver as drv\nimport numpy\nfrom scipy import misc\nfrom color_histogram_cuda_module import histogram_atomics, histogram_accum\n\ndef histogram(im... | python | chosen |
[
{
"from": "system",
"value": "Fix issue where non localhost headless clouds werent calling finish\n\nSigned-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>\n"
},
{
"from": "human",
"value": "from conjureup import controllers, events, juju, utils\nfrom conj... | python | chosen |
[
{
"from": "system",
"value": "Remove square brackets around log level in log ouput\n"
},
{
"from": "human",
"value": "import config\nimport logging\nimport logging.handlers\n\n\n# ######### Set up logging ##########\n# log.basicConfig(format=\"%(asctime)s - %(levelname)s: %(message)s\", level=lo... | python | chosen |
[
{
"from": "system",
"value": "Add the endpoint for the logout.\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import include, patterns, url\n\nfrom rest_framework_nested import routers\n\nfrom shopit_app.views import IndexView\nfrom authentication_app.... | python | chosen |
[
{
"from": "system",
"value": "Use 'latest' to generate feed for GeneralPost.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom models import GeneralPost\nfrom feeds import LatestPosts\n\npost_list = {\n 'queryset': GeneralPost.objects.all(),\n}\n\nfeeds = {\n ... | python | chosen |
[
{
"from": "system",
"value": "Correct mention to date hierachy\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom django_rocket.models import Subscriber\n\n\nclass SubscriberAdmin(admin.ModelAdmin):\n list_display = ('email', 'created')\n date_hierarchy = ('created... | python | chosen |
[
{
"from": "system",
"value": "Remove superseded config default for `ROOT_REDIRECT_STATUS_CODE`\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.config_defaults\n~~~~~~~~~~~~~~~~~~~~~~\n\nDefault configuration values\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICE... | python | chosen |
[
{
"from": "system",
"value": "Set server URL with command line argument\n"
},
{
"from": "human",
"value": "#!/usr/env/bin python\n\nimport RPi.GPIO as io\nimport requests\nimport sys\n\nclass Switch(object):\n def __init__(self, **kwargs):\n self.pin = kwargs[\"pin\"]\n io.setup... | python | chosen |
[
{
"from": "system",
"value": "Fix 1010 upgrade step (setBatchID -> setBatch)\n"
},
{
"from": "human",
"value": "import logging\n\nfrom Acquisition import aq_base\nfrom Acquisition import aq_inner\nfrom Acquisition import aq_parent\n\nfrom Products.CMFCore.utils import getToolByName\n\ndef addBat... | python | chosen |
[
{
"from": "system",
"value": "Make Remittance Letter config messages translatable\n"
},
{
"from": "human",
"value": "from openerp.osv import osv, fields\nfrom openerp.tools.translate import _\n\n\nclass res_company(osv.Model):\n _inherit = \"res.company\"\n\n _columns = {\n 'remitta... | python | chosen |
[
{
"from": "system",
"value": "Make lil&big merged configuration hostname-aware for SITE_DOMAIN, this fixes the bad hostname in JS bookmarklets."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Settings for 1flow.net (local development)\n\nMAIN_SERVER = '127.0.0.1'\n\nfrom sparks.djang... | python | chosen |
[
{
"from": "system",
"value": "Allow the targetting of specific roles with fabric\n"
},
{
"from": "human",
"value": "from fabric.api import cd, run, task\n\ntry:\n import fabfile_local\n _pyflakes = fabfile_local\nexcept ImportError:\n pass\n\n@task\ndef update():\n with cd(\"~/vagran... | python | chosen |
[
{
"from": "system",
"value": "Prepare for deploy in deploy script.\n"
},
{
"from": "human",
"value": "from fabric.api import *\nfrom fabric.colors import *\n\nenv.colorize_errors = True\nenv.hosts = ['sanaprotocolbuilder.me']\nenv.user = 'root'\nenv.project_root = '/opt/s... | python | chosen |
[
{
"from": "system",
"value": "Use checksum when pushing code with rsync\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom fabric.api import env, run, sudo, task\nfrom fabric.context_managers import cd, prefix\nfrom fabric.contrib.project import rsync_project\n\nenv.use_ssh_config ... | python | chosen |
[
{
"from": "system",
"value": "Add magic to save a Matplotlib figure to S3\n"
},
{
"from": "human",
"value": "from IPython.display import Image\n\nimport boto\n\ndef parse_s3_uri(uri):\n if uri.startswith('s3://'):\n uri = uri[5:]\n\n return uri.split('/', 1)\n\n\ndef get_s3_key(uri)... | python | chosen |
[
{
"from": "system",
"value": "Fix big fuckup from last commit\n"
},
{
"from": "human",
"value": "import logging\nfrom urllib.parse import urlsplit, urljoin\nfrom requests import get\n\nl = logging.getLogger(__name__)\n\n#TODO: move this somewhere sensible\n#TODO: useful error handling (CLI...)\n... | python | chosen |
[
{
"from": "system",
"value": "Add redis config path format\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport ConfigParser\nimport os\n\nDEBUG = True\nPROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))\n\nconfig = ConfigParser.RawConfigParser()\nif DEBUG:\n config.rea... | python | chosen |
[
{
"from": "system",
"value": "Fix up pinout tests so they work with new structure\n"
},
{
"from": "human",
"value": "from __future__ import (\n unicode_literals,\n absolute_import,\n print_function,\n division,\n )\nstr = type('')\n\n\nimport pytest\n\nfrom gpiozero.cli import pin... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary test of collection children\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom indigo.models import Collection\nfrom indigo.models.errors import UniqueException\n\nfrom nose.tools import raises\n\nclass NodeTest(unittest.TestCase):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix missing search-context list on Contact page.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n### required - do no delete\ndef user(): return dict(form=auth())\ndef download(): return response.download(request,db)\ndef call(): return service()\n### ... | python | chosen |
[
{
"from": "system",
"value": "Allow service to start without EM if Condor and Pegasus are missing\n"
},
{
"from": "human",
"value": "import os\nimport logging\nfrom optparse import OptionParser\n\nfrom pegasus.service import app, em\nfrom pegasus.service.command import Command\n\nclass ServerCom... | python | chosen |
[
{
"from": "system",
"value": "Resolve issues with exporting empty dataset for certificate list\n"
},
{
"from": "human",
"value": "\"\"\"\nClasses and functions for writing IndicatorRecord objects with a record type of \"CE\" (Censys Record)\n\"\"\"\n\nfrom pivoteer.writer.core import CsvWriter\n... | python | chosen |
[
{
"from": "system",
"value": "Call connect instead of reconnect.\n"
},
{
"from": "human",
"value": "try:\n from .. import api, shared as G\n from ... import editor\n from ..exc_fmt import str_e\n from ..protocols import floo_proto\nexcept (ImportError, ValueError):\n from floo imp... | python | chosen |
[
{
"from": "system",
"value": "Add some more simple nd.groupby tests\n"
},
{
"from": "human",
"value": "import sys\nimport unittest\nfrom dynd import nd, ndt\n\nclass TestGroupBy(unittest.TestCase):\n def test_immutable(self):\n a = nd.array([\n ('x', 0),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add missing argument to _increment_tag call\n"
},
{
"from": "human",
"value": "import subprocess\nfrom git_release import errors, git_helpers\n\ndef _parse_tag(tag):\n major, minor = tag.split('.')\n return int(major), int(minor)\n\ndef _increment_tag(tag, re... | python | chosen |
[
{
"from": "system",
"value": "Fix residual blocks to be on-par with paper.\n"
},
{
"from": "human",
"value": "from keras.layers import Convolution2D, Merge\nfrom keras.layers.advanced_activations import PReLU\nfrom keras.engine.topology import merge\n\nfrom eva.layers.masked_convolution2d import... | python | chosen |
[
{
"from": "system",
"value": "Make sure LOG is defined before using it.\n"
},
{
"from": "human",
"value": "\"\"\"A virtual serial port data source.\"\"\"\nfrom __future__ import absolute_import\n\nimport logging\n\ntry:\n import serial\nexcept ImportError:\n LOG.debug(\"serial library not ... | python | chosen |
[
{
"from": "system",
"value": "Add the settings to the authdemo."
},
{
"from": "human",
"value": "from mongrel2.config import *\n\n\nmain = Server(\n uuid=\"f400bf85-4538-4f7a-8908-67e313d515c2\",\n access_log=\"/logs/access.log\",\n error_log=\"/logs/error.log\",\n chroot=\"./\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Move check for week number out into function.\n"
},
{
"from": "human",
"value": "from datetime import date as vanilla_date, timedelta\n\nfrom overflow import OverflowDate\n\n\ndef iso_to_gregorian(year, week, weekday):\n if week < 1 or week > 54:\n raise V... | python | chosen |
[
{
"from": "system",
"value": "Add tests for sending messages to emails without account.\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.core import mail\n\nfrom oscar.core.compat import get_user_model\nfrom oscar.apps.customer.utils import Dispatcher\nfrom oscar.... | python | chosen |
[
{
"from": "system",
"value": ": Create documentation of DataSource Settings \n\nTask-Url: "
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.stoettner@stoeps.de\n# Documentation: http://scri... | python | chosen |
[
{
"from": "system",
"value": "Use SQLAlchemy object_mapper for testing Alchemy objects\n\nSigned-off-by: Michal Juranyi <29976087921aeab920eafb9b583221faa738f3f4@vnet.eu>\n"
},
{
"from": "human",
"value": "import json\nimport decimal\nimport sqlalchemy\n\n\nclass AlchemyJSONEncoder(json.JSONEnco... | python | chosen |
[
{
"from": "system",
"value": "Add in good practices for crawling\n"
},
{
"from": "human",
"value": "from PIL import Image\nimport json, StringIO, requests\nimport time\n\nservice = \"http://dlss-dev-azaroth.stanford.edu/services/iiif/f1rc/\"\nresp = requests.get(service + \"info.json\")\njs = js... | python | chosen |
[
{
"from": "system",
"value": "Adjust logging and fix module documentation\n"
},
{
"from": "human",
"value": "\"\"\"Create the profile.\n\nCopyright (c) 2015 Francesco Montesano\nMIT Licence\n\"\"\"\n\nimport shutil\n\nimport dodocs.logger as dlog\nimport dodocs.utils as dutils\n\n\ndef remove(ar... | python | chosen |
[
{
"from": "system",
"value": "Fix wrong paramter name in permit_groups decorator\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\n# Authentication and Authorisation\nfrom functools import wraps\nfrom . import http\n\ndef permit(test_func):\n '''Decorate a handler ... | python | chosen |
[
{
"from": "system",
"value": "Exclude import from style checking\n"
},
{
"from": "human",
"value": "\"\"\"Application configuration for the chapters application.\"\"\"\n\nfrom django.apps import AppConfig\n\n\nclass UsersAppConfig(AppConfig):\n \"\"\"Configuration object for the chapters appl... | python | chosen |
[
{
"from": "system",
"value": "Allow people to import ThriftConnection from elasticsearch package itself\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nVERSION = (0, 4, 3)\n__version__ = VERSION\n__versionstr__ = '.'.join(map(str, VERSION))\n\nfrom elasticsearch.clie... | python | chosen |
[
{
"from": "system",
"value": "Fix ui bug in switch\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Gitless - a version control system built on top of Git.\n# Licensed under GNU GPL v2.\n\n\"\"\"gl switch - Switch branches.\"\"\"\n\n\nfrom __future__ import unicode_literals\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.5.0.dev0\n"
},
{
"from": "human",
"value": "__version__ = '0.4.3.dev0'\n\n# this should ensure that we can still import constants.py as climlab.constants\nfrom climlab.utils import constants\nfrom climlab.utils import thermo, legendre\n... | python | chosen |
[
{
"from": "system",
"value": "Update REST API address in test\n"
},
{
"from": "human",
"value": "import requests\nfrom nose.plugins.attrib import attr\n\n@attr('webservice')\ndef test_rest_api_responsive():\n stmt_str = '{\"statements\": [{\"sbo\": \"http://identifiers.org/sbo/SBO:0000526\", ... | python | chosen |
[
{
"from": "system",
"value": "Fix json.loads when context is None\n\nCo-authored-by: Pierre Verkest <94ea506e1738fc492d3f7a19e812079abcde2af1@gmail.com>"
},
{
"from": "human",
"value": "# Copyright 2019 Creu Blanca\n# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).\nimport js... | python | chosen |
[
{
"from": "system",
"value": "Test tool to create temporary devpi index.\n"
},
{
"from": "human",
"value": "\"\"\"\nTest tools required by multiple suites.\n\"\"\"\n\n__author__ = 'mbach'\n\n\nimport contextlib\nimport shutil\nimport subprocess\nimport tempfile\n\n\n@contextlib.contextmanager\nd... | python | chosen |
[
{
"from": "system",
"value": "Disable django.contrib.sites tests in Jenkins.\n"
},
{
"from": "human",
"value": "# NOTE: local.py must be an empty file when using this configuration.\n\nfrom .defaults import *\n\n# Put jenkins environment specific overrides below.\n\nINSTALLED_APPS += ('django_je... | python | chosen |
[
{
"from": "system",
"value": "Remove the unused import and fix testing library\n"
},
{
"from": "human",
"value": "\"\"\"\n:mod:`zsl.interface.webservice.performers.method`\n-------------------------------------------------\n\n.. moduleauthor:: Martin Babka\n\"\"\"\nfrom __future__ import unicode... | python | chosen |
[
{
"from": "system",
"value": "Change date's limits format to datetime.date.\n"
},
{
"from": "human",
"value": "import datetime\n\nimport mongoengine\nfrom mongoengine.django import auth\n\nfrom piplmesh.account import fields\n\nclass User(auth.User):\n birthdate = fields.LimitedDateTimeField(... | python | chosen |
[
{
"from": "system",
"value": "Add header, needed for the upcoming changes in the update_cronos.sh\nscript\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"apps.settings\")\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix url for screenshot test\n"
},
{
"from": "human",
"value": "from marionette_driver import By\nfrom marionette_driver.errors import MarionetteException\n\nfrom marionette_harness import MarionetteTestCase\n\nimport testsuite\n\nclass Test(MarionetteTestCase):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix build wheels and upload 5.\n"
},
{
"from": "human",
"value": "from subprocess import call, check_output\nimport sys\nimport os\n\nisPython3 = sys.version_info.major == 3\n\n# https://stackoverflow.com/a/3357357\ncommand = 'git log --format=%B -n 1'.split()\nout ... | python | chosen |
[
{
"from": "system",
"value": "Return empty result rather than graphql error\n"
},
{
"from": "human",
"value": "import graphene\nfrom django.http import Http404\nfrom graphql import GraphQLError\nfrom wagtail.core.models import Page\n\nfrom . import types\n\n\nclass Query(graphene.ObjectType):\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"bump version\" -- Not ready to release yet\n\nThis reverts commit 60e383ce1e4432c360e615598813e3b1747befb8.\n\n"
},
{
"from": "human",
"value": "version_info = (0, 2, 0)\n__version__ = \".\".join(map(str, version_info))\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Fix filename error in HORIZONS telnet script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n\n#import argparse\nfrom telnetlib import Telnet\n\ndef main(in_path, out_path):\n with open(in_path) as f:\n lines = f.read().split('\\n')\n tn = ... | python | chosen |
[
{
"from": "system",
"value": "Rename package \"si_prefix\" to \"si-prefix\"\n"
},
{
"from": "human",
"value": "from paver.easy import task, needs, path, sh, cmdopts\nfrom paver.setuputils import setup, install_distutils_tasks, find_package_data\nfrom distutils.extension import Extension\nfrom op... | python | chosen |
[
{
"from": "system",
"value": "Use context manager to read README\n"
},
{
"from": "human",
"value": "import os\nimport re\n\nfrom paver.easy import *\nfrom paver.setuputils import setup\n\ndef get_version():\n \"\"\"\n Grab the version from irclib.py.\n \"\"\"\n here = os.path.dirname... | python | chosen |
[
{
"from": "system",
"value": "DanielWagnerHall: Fix test as well :)\n\nr17825\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\n# Copyright 2012 Software Freedom Conservancy.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n# you may not use this file except in compl... | python | chosen |
[
{
"from": "system",
"value": "Add a test for sysdig\n"
},
{
"from": "human",
"value": "import pytest\n\n@pytest.mark.parametrize(\"name\", [\n (\"apt-file\"),\n (\"apt-transport-https\"),\n (\"atom\"),\n (\"blktrace\"),\n (\"ca-certificates\"),\n (\"chromium-browser\"),\n (\"cron\"),\n (... | python | chosen |
[
{
"from": "system",
"value": "Add tearDown() - remove test dir, test files existing and not existing.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nfrom passwd_change import passwd_change, shadow_change, mails_delete\n\nfrom unittest import TestCase, TestLoader, TextTestRunner\nim... | python | chosen |
[
{
"from": "system",
"value": "Fix build wheels with Pandoc.\n"
},
{
"from": "human",
"value": "import os\nfrom subprocess import call, check_output\nimport sys\nfrom shutil import copy2\n\n\ndef checkAndInstall():\n try:\n check_output('pandoc -v'.split())\n except OSError:\n ... | python | chosen |
[
{
"from": "system",
"value": "Handle sliding window with size 0\n"
},
{
"from": "human",
"value": "\ndef fragment(sequence, size=5):\n \"\"\"\n Fragment a string sequence using a sliding window given by size\n\n :param sequence: String containing the sequence\n :param size: Size of t... | python | chosen |
[
{
"from": "system",
"value": "Update date from creation time\n"
},
{
"from": "human",
"value": "from rest_framework.fields import SerializerMethodField\nfrom rest_framework.serializers import ModelSerializer, CharField, UUIDField\n\nfrom alexa.settings import RADIO_LINK_BASE\nfrom yle.models imp... | python | chosen |
[
{
"from": "system",
"value": "Use syntax compatible with Python 2.4\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.conf import settings\nfrom socialregistration.utils import _https\n\nregister = template.Library()\n\n@register.inclusion_tag('socialregistration/facebo... | python | chosen |
[
{
"from": "system",
"value": "Use global pytestmark to skip tests; deprecate class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport pytest\nfrom os.path import basename\nfrom helpers import utils, fixture\n\n\n@pytest.mark.skipif(pytest.config.getoption(\"--application\") is no... | python | chosen |
[
{
"from": "system",
"value": "Add docs-live to perform demo-runs\n"
},
{
"from": "human",
"value": "\"\"\"Development automation.\"\"\"\n\nimport nox\n\n\ndef _install_this_editable(session, *, extras=None):\n if extras is None:\n extras = []\n\n session.install(\"flit\")\n sessi... | python | chosen |
[
{
"from": "system",
"value": "Update import of Event class\n\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom pathlib import Path\nfrom typing import Callable, Optional, List, Union\n\nfrom il2fb.parsers.events.events import Event\n\n\nEventOrNone = Optional[Event]\nEventHandler = Call... | python | chosen |
[
{
"from": "system",
"value": "Fix error if passing a list of args to tenancy_reverse\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Q\n\n\ndef multitenancy_enabled():\n return \"decisiontree.multi... | python | chosen |
[
{
"from": "system",
"value": "Use new OpenAM token validation endpoint\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nfrom flask import request, redirect\nimport requests\n\ncookiename = 'openAMUserCookieName'\namURL = 'https://openam.example.com/'\nvalidTokenAPI = amURL + 'openam/... | python | chosen |
[
{
"from": "system",
"value": "BUG: Fix typo in variable name.\n"
},
{
"from": "human",
"value": "\"\"\"Aligner for texts and their segmentations.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n__all__ = ['Alignme... | python | chosen |
[
{
"from": "system",
"value": "Change example style for python3\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- encoding:utf-8 -*-\n\nfrom xunleipy.remote import XunLeiRemote\n\n\ndef remote_download(username, password, rk_username, rk_password, download_links, proxy=None, path='C... | python | chosen |
[
{
"from": "system",
"value": "Handle unexpected errors properly in load_blueprint\n"
},
{
"from": "human",
"value": "import click\n\nfrom .loader import load_yaml\nfrom .blueprint import Blueprint\nfrom .exceptions import ValidationError, YAMLError\n\n\ndef get_blueprint(*files):\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Update the user agent test\n"
},
{
"from": "human",
"value": "import time\nfrom seleniumbase import BaseCase\n\n\nclass MyTestClass(BaseCase):\n\n def test_user_agent(self):\n self.open('http://www.whatsmyua.info/')\n user_agent = self.get_text(\"#c... | python | chosen |
[
{
"from": "system",
"value": "Return an empty dict if no data\n\nAvoids a HTTP500 on slow instances where the file\nmay be created before data is written, causing the\nYAML parser to return None.\n\nChange-Id: I13b92941f3e368839a9665fe3197c706babd9335\n"
},
{
"from": "human",
"value": "import os... | python | chosen |
[
{
"from": "system",
"value": "Make is_masquerading template tag more robust\n\nWhen masquerading is not enabled, immediately return False to avoid\nchecking for a request attribute that won't be present.\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom .. import perms\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Introduce scope_types in pause server policy\n\noslo.policy introduced the scope_type feature which can\ncontrol the access level at system-level and project-level.\n - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope\n - http://specs.openstack.org/op... | python | chosen |
[
{
"from": "system",
"value": "Fix to use react-router for all unmatched routes.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url, include\nfrom django.contrib import admin\nfrom rest_framework import routers\nfrom server import views\n\nrouter = routers.DefaultRouter()\nrouter... | python | chosen |
[
{
"from": "system",
"value": "Remove Code That Doesn't Have a Test\n"
},
{
"from": "human",
"value": "\"\"\"DigitalOcean DNS Records.\"\"\"\n\nfrom certbot_dns_auth.printer import printer\nfrom do_record import http\n\n\nclass Record(object):\n \"\"\"Handle DigitalOcean DNS records.\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add comment about module naming\n"
},
{
"from": "human",
"value": "#pipe2py modules package\n#Author: Greg Gaughan\n\n__all__ = ['pipefetch',\n 'pipefetchdata',\n 'pipedatebuilder',\n 'pipeurlbuilder',\n 'pipetextinput',\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow the 'dataType' field to be overriden\n\nThe 'dataType' field in records predates data groups and data types. As\nsuch they don't always match the new world order of data types. It's\nfine to change in all cases other than Licensing which is run on\nlimelight, that we don'... | python | chosen |
[
{
"from": "system",
"value": "Check correspondances in framesets now\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom syntacticframes.models import VerbNetClass\nfrom parsecorrespondance import parse\nfrom loadmapping import mapping\n\nclass Command(... | python | chosen |
[
{
"from": "system",
"value": "Update examples to match docs\n\nUse the interface defined in the docs in the examples scripts.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nimport os\nimport sys\n\nfrom pysuru import TsuruClient\n\n\nTSURU_TARGET = os.environ.get('TSURU_TARGET', None)\nTSUR... | python | chosen |
[
{
"from": "system",
"value": "Include both binaural mr-sEPSM and sEPSM\n"
},
{
"from": "human",
"value": "\"\"\"\nThe :mod:`pambox.speech` module gather speech intelligibility\nmodels.\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom .binauralsepsm import BinauralSepsm\nfrom .sepsm import... | python | chosen |
[
{
"from": "system",
"value": "Use Config and Result class in Tool\n"
},
{
"from": "human",
"value": "import os\nimport yaml\nfrom performance_testing.errors import ConfigFileError, ConfigKeyError\nfrom performance_testing import web\nfrom datetime import datetime as date\nfrom time import time\n... | python | chosen |
[
{
"from": "system",
"value": "Make this hack compatible with Django 1.9\n"
},
{
"from": "human",
"value": "from django.contrib.admin import StackedInline, TabularInline\nfrom django.template.defaultfilters import slugify\n\nclass OrderableInlineMixin(object):\n\n class Media:\n js = (\... | python | chosen |
[
{
"from": "system",
"value": "Add copyright header, let me know if corrections are needed.\n"
},
{
"from": "human",
"value": "import exceptions\n\nclass BaseCacheModule(object):\n\n def get(self, key):\n raise exceptions.NotImplementedError\n\n def set(self, key, value):\n ra... | python | chosen |
[
{
"from": "system",
"value": "Load user pref file if exists in the maya user script directory\n"
},
{
"from": "human",
"value": "import os\r\nimport json\r\n\r\n\r\nSCRIPT_PATH = os.path.dirname(__file__)\r\n\r\n\r\ndef getPreference():\r\n \"\"\" Load pref json data nad return as dict\"\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Add KeyError exception and ZBX_NOT_SUPPORTED message.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport urllib2\nimport json\nimport argparse\n\n\ndef get_metric(host, port, metric):\n response = urllib2.urlopen(\n ... | python | chosen |
[
{
"from": "system",
"value": "Test initialize with filename and file-like.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom numpy.testing import assert_almost_equal, assert_array_less\nimport numpy as np\n\nfrom poisson import BmiPoisson\n\n\ndef test_grid_initialize():\n model ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.