conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Comment out some boilerplate code, to prevent failures\n"
},
{
"from": "human",
"value": "\"\"\"\"\nBoilerplate Adventure\n\nAuthor: Ignacio Avas (iavas@sophilabs.com)\n\"\"\"\nimport codecs\nimport io\nimport sys\nimport unittest\nfrom story.adventures import Adven... | python | chosen |
[
{
"from": "system",
"value": "Increase tool priority, to keep space between cherrypy builtin tools like `json_out`.\n"
},
{
"from": "human",
"value": "import cherrypy\nfrom mako.lookup import TemplateLookup\n\n\nclass Tool(cherrypy.Tool):\n _lookups = {}\n\n def __init__(self):\n ch... | python | chosen |
[
{
"from": "system",
"value": "Use command-line argument to bind server address\n"
},
{
"from": "human",
"value": "import zmq\n\nfrom .databases import Databases\nfrom .worker import Worker\n\ncontext = zmq.Context()\n\nback_uri = 'inproc://workers'\n\nproxy = zmq.devices.ThreadDevice(\n devic... | python | chosen |
[
{
"from": "system",
"value": "Add moments op to CNTK backend, and associated tests\n"
},
{
"from": "human",
"value": "from keras.backend import cntk_backend as KCN\nfrom keras.backend.cntk_backend import logsumexp\nimport cntk as C\nimport numpy as np\n\n\ndef clip(x, min_value, max_value):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove runtime dep on python pbr\n"
},
{
"from": "human",
"value": "# Copyright 2012 OpenStack Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obt... | python | chosen |
[
{
"from": "system",
"value": "Add static route serving files\n\nCustom static file handler resolves `/` to `/index.html`.\n"
},
{
"from": "human",
"value": "import aiohttp\nimport aiohttp.web\n\nfrom mnemosyne.app import by_time, by_uuid\n\napplication = aiohttp.web.Application()\n\n# by_uuid AP... | python | chosen |
[
{
"from": "system",
"value": "Add url field to HackernewsScrapyItem and remove \"crawled_at\"\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport scrapy\n\n\nclass HackernewsScrapyItem(scrapy.Item):\n title = scrapy.Field()\n crawled_at = scrapy.Field()\n"
},
{
"from... | python | chosen |
[
{
"from": "system",
"value": "Use more consistent example for map\n\nThere is a `map` function in pythin, but for simple single expression\ncalculations, list comprehensions are much better suited.\n\nWhile map works well if there is a function, you can pass.\n"
},
{
"from": "human",
"value": "a... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in profile doc description build\n"
},
{
"from": "human",
"value": "#! /bin/env python\nimport os\nfrom typing import Any, Dict, Generator, Iterable, Type\n\nfrom isort.profiles import profiles\n\nOUTPUT_FILE = os.path.abspath(\n os.path.join(os.path.dir... | python | chosen |
[
{
"from": "system",
"value": "Fix the import order lint error\n"
},
{
"from": "human",
"value": "from testtools.assertions import assert_that\nfrom testtools.matchers import Equals\n\nfrom seaworthy.utils import resource_name\n\n\ndef test_resource_name():\n # Dummy test so that pytest passes... | python | chosen |
[
{
"from": "system",
"value": "Revert \"some random settings changes\"\n\nThis reverts commit 640eb2be2e32413718e93c1b8c77279ab5152170.\n"
},
{
"from": "human",
"value": "from local import *\n"
},
{
"from": "gpt",
"value": "from .base import *\ntry:\n from .local import *\nexcept I... | python | chosen |
[
{
"from": "system",
"value": "Return HTTP Status Code 404 for not found errors\n"
},
{
"from": "human",
"value": "from google.appengine.ext.webapp import template\nimport webapp2\nimport os\n\nclass NotFound(webapp2.RequestHandler):\n def get(self):\n path = os.path.join(os.path.dirnam... | python | chosen |
[
{
"from": "system",
"value": "Fix bad encoding in boilerplate\n"
},
{
"from": "human",
"value": "# Copyright 2015 IBM Corp. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the “License”);\n# you may not use this file except in compliance with the License.\n# You may ob... | python | chosen |
[
{
"from": "system",
"value": "Replace \\t by spaces for indention\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom node_registration import views\n\nurlpatterns = patterns('',\n\turl(r'^add/$', views.PositionCreate.as_view(), name='position-add'),\n\turl(r'^lis... | python | chosen |
[
{
"from": "system",
"value": "Make ricker funciton available in the top level.\n"
},
{
"from": "human",
"value": "\"\"\"\nRicker wavelet generator for seismic simulation\n===============================================\n\n\"\"\"\n\nfrom __future__ import division, print_function, absolute_import... | python | chosen |
[
{
"from": "system",
"value": "Clear old method of calling plugins\n"
},
{
"from": "human",
"value": "from tornado import gen, ioloop\nfrom tornado.ioloop import IOLoop\nimport sys\nfrom pkg_resources import iter_entry_points\nimport json\n\n@gen.coroutine\ndef main(plugin):\n #print(\"plugin:... | python | chosen |
[
{
"from": "system",
"value": "Fix auth tests and add login test\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport json\nfrom unittest import TestCase\nimport httpretty\nfrom faker import Faker\n\nfrom polyaxon_s... | python | chosen |
[
{
"from": "system",
"value": "Update auth tests to be compatible with Python 3\n\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nimport random\nimport unittest\n\nfrom .config import *\nfrom tweepy import API, OAuthHandler\n\n\nclass TweepyAuthTests(unittest.TestCase... | python | chosen |
[
{
"from": "system",
"value": "Add test to make sure SSL certs are installed.\n"
},
{
"from": "human",
"value": "def test_java_exists(Command):\n version_result = Command(\"java -version\")\n\n assert version_result.rc == 0\n"
},
{
"from": "gpt",
"value": "def test_java_exists(C... | python | chosen |
[
{
"from": "system",
"value": "Manage default editor group on a single page\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns\nfrom metashare.settings import DJANGO_BASE\n\nurlpatterns = patterns('metashare.accounts.views',\n (r'create/$',\n 'create'),\n (r'co... | python | chosen |
[
{
"from": "system",
"value": "Fix misspelled UglifyJS filter class name\n"
},
{
"from": "human",
"value": "\"\"\"Minify Javascript using `UglifyJS <https://github.com/mishoo/UglifyJS/>`_.\n\nUglifyJS is an external tool written for NodeJS; this filter assumes that\nthe ``uglifyjs`` executable is... | python | chosen |
[
{
"from": "system",
"value": "Make reddit url a constant\n"
},
{
"from": "human",
"value": "import json\nimport pprint\nimport requests\n\ndef sample_valid_reddit_response():\n\tr = requests.get('http://www.reddit.com/r/cscareerquestions/top.json')\n\tresponse_json = r.json()\n\n\tif 'data' not ... | python | chosen |
[
{
"from": "system",
"value": "Use request.data to access file uploads\n"
},
{
"from": "human",
"value": "from rest_framework.exceptions import ValidationError\n\n\nclass ModelSerializerMixin(object):\n \"\"\"Provides generic model serializer classes to views.\"\"\"\n model_serializer_class... | python | chosen |
[
{
"from": "system",
"value": "Create init of Storage class\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nInterface to Redis-storage.\n\n@author: Seva Zhidkov\n@contact: zhidkovseva@gmail.com\n@license: The MIT license\n\nCopyright (C) 2015\n\"\"\"\n\n\nclass Storage:\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove save method for auto_now_add=True\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils.translation import ugettext as _\nfrom django.utils.timezone import now\n\n\ntry:\n from django.contrib.auth import get_user_model\n Use... | python | chosen |
[
{
"from": "system",
"value": "Add RFS to `sendgrid` test\n"
},
{
"from": "human",
"value": "# This tests that the developer doesn't pass tainted user data into the mail.send.post() method in the SendGrid library.\nimport sendgrid\nimport os\n\n\nsg = sendgrid.SendGridAPIClient(os.environ.get('SE... | python | chosen |
[
{
"from": "system",
"value": "Update `curio` pin to 0.6.0.\n\nSigned-off-by: Laura <07c342be6e560e7f43842e2e21b774e61d85f047@veriny.tf>\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='discord-curious',\n version='0.2.0.post1',\n packages=['curious', 'cu... | python | chosen |
[
{
"from": "system",
"value": "Add missing dependency on pyparsing and six\n\nSigned-off-by: Christophe Vu-Brugier <1930e27f67e1e10d51770b88cb06d386f1aa46ae@fastmail.fm>\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n'''\nThis file is part of ConfigShell.\nCopyright (c) 2011-2013 by D... | python | chosen |
[
{
"from": "system",
"value": "Include 'models' subdirectory in package\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom distutils.core import setup\nfrom distutils.core import setup\n\nsetup(\n name='django-banking',\n version='0.1-dev',\n descri... | python | chosen |
[
{
"from": "system",
"value": "Add importlib to install_requires if necessary\n"
},
{
"from": "human",
"value": "\"\"\"\nnubo\n----\nAn easy way to deploy Linux VMs on different cloud providers.\n\nLinks\n`````\n* `GitHub Repository <https://github.com/ema/nubo>`_\n* `Development Version\n <http... | python | chosen |
[
{
"from": "system",
"value": "Add compile arg for building on MacOS Catalina / Xcode 11.2\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom setuptools import setup, Extension\n\nimport os\nfrom Cython.Build import cythonize\n\nif (os.name ==... | python | chosen |
[
{
"from": "system",
"value": "Remove reference to email from short description\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'\n\nsetup(\n name=\"django-nopassword\",\n version='1.1.0',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add croniter dependency. Sort deps.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\nfrom __future__ import print_function\nfrom distutils.core import setup\nimport os\n\nversion = '1.0.0b'\n\n# Append TeamCity build number if it gives us one.\nif 'TC_BU... | python | chosen |
[
{
"from": "system",
"value": "Set maximum bounds for both plots to provide a common scale for comparison between the different scenarios.\n"
},
{
"from": "human",
"value": "import os\nimport sys\nfrom setuptools import setup, find_packages\nfrom tethys_apps.app_installation import custom_develop... | python | chosen |
[
{
"from": "system",
"value": "Add test suit and requirements.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\nimport os.path\n\nimport versioneer\nversioneer.versionfile_source = \"circuit/_version.py\"\nversioneer.versionfile_build = \"circuit/_vers... | python | chosen |
[
{
"from": "system",
"value": "Increment version number 0.8.0 Set field support\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"marshmallow-pynamodb\",\n version=\"0.7.1\",\n packages=find_packages(exclude=('*test*',)),\n package_dir={... | python | chosen |
[
{
"from": "system",
"value": "Add schemas folder to package\n"
},
{
"from": "human",
"value": "import re\nfrom setuptools import setup\n\n__version__,= re.findall('__version__ = \"(.*)\"', open('mappyfile/__init__.py').read())\n\ndef readme():\n with open('README.rst') as f:\n return f... | python | chosen |
[
{
"from": "system",
"value": "Add explicit Python 3.6 support\n"
},
{
"from": "human",
"value": "from setuptools import setup\nfrom os import path\n\nwith open(path.join(path.abspath(path.dirname(__file__)), 'README.rst')) as f:\n readme = f.read()\n\nsetup(\n name='ghstats',\n version=... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages() to ensure the whole regparser gets installed\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom distutils.core import setup\n\nsetup(\n name='regulations-parser',\n url='https://github.com/c... | python | chosen |
[
{
"from": "system",
"value": "Change version number to 0.2.0\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright © 2013 Spyder Project Contributors\n# Licensed under the terms of the MIT License\n# (see LICENSE.txt for details)\n\n__version__ = '0.2.dev0'\n\n# ============... | python | chosen |
[
{
"from": "system",
"value": "Add license and Source Code url\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(name=\"zutil\",\n version='0.1.5',\n description=\"Utilities used for generating zCFD control dictionaries\",\n author=\"Zenotech\",\n au... | python | chosen |
[
{
"from": "system",
"value": "Update classifiers to show ISC license\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\nwith open('README.rst') as readme_f:\n README = readme_f.read()\n\nwith open('tests/requirements.txt') as test_requirements_f:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix compatible bug: file() -> open().\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\nfrom catplot import __version__ as version\n\nmaintainer = 'Shao-Zheng-Jiang'\nmaintainer_email = 'shaozhengjiang@gmail.com'\nauthor =... | python | chosen |
[
{
"from": "system",
"value": "Upgrade to a newer gevent for OSX Yosemity compat\n\nSee https://github.com/gevent/gevent/issues/656\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom setuptools import setup\n\nsetup(name=\"catsnap\",\n version=\"6.0.0\",\n description=\"catalo... | python | chosen |
[
{
"from": "system",
"value": "Add package name for github usage report"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(use_scm_version=True)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\n\nsetup(nam... | python | chosen |
[
{
"from": "system",
"value": "Add missed packages tot he build script\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\ndescription = \"\"\"\nA python module for calculating riichi mahjong hands: yaku, han and fu.\n\nYou can find usage examples here https://github.com/Mahjon... | python | chosen |
[
{
"from": "system",
"value": "Add required packages for lib to work and update version\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='sheetsu',\n version='0.0.4',\n description='Sheetsu Python client',\n url='http://github.com/andreff... | python | chosen |
[
{
"from": "system",
"value": "Add the Google API client as a requirement\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup, find_packages\n\nhere = os.path.abspath(os.path.dirname(__file__))\nREADME = open(os.path.join(here, 'README')).read()\nCHANGES = open(os.path.jo... | python | chosen |
[
{
"from": "system",
"value": "Use move version for sutup.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\n#\n# Copyright (c) 2011-2015 Genestack Limited\n# All Rights Reserved\n# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF GENESTACK LIMITED\n# The cop... | python | chosen |
[
{
"from": "system",
"value": "Allow MONGO_HOST env var override.\n"
},
{
"from": "human",
"value": "# This file specifies the Eve configuration.\nimport os\n\n# The run environment default is production.\n# Modify this by setting the NODE_ENV environment variable.\nenv = os.getenv('NODE_ENV') or... | python | chosen |
[
{
"from": "system",
"value": "Add coveragerc to package data\n"
},
{
"from": "human",
"value": "\ndef get_package_data():\n return {\n _ASTROPY_PACKAGE_NAME_ + '.tests': ['data/*.fits', 'data/*.npz']\n }\n"
},
{
"from": "gpt",
"value": "\ndef get_package_data():\n ret... | python | chosen |
[
{
"from": "human",
"value": "Implement a very basic plugin to add an option\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\n\ndef pytest_addoption(parser):\n group = parser.getgroup('{{cookiecutter.plugin_name}}')\n group.addoption(\n '--foo',\n a... | python | chosen |
[
{
"from": "system",
"value": "Add an additional layer for the for loop\n"
},
{
"from": "human",
"value": "import json\nimport itertools\n\nwith open('products.json') as data_file:\n data = json.load(data_file)\n products = data['products']\n\n\nproducts_temp = []\n\nfor index, item in enum... | python | chosen |
[
{
"from": "system",
"value": "Check variations little variations if the query fails.\n"
},
{
"from": "human",
"value": "from application import app\nfrom flask.ext.restful import Api, Resource\nimport os\nfrom subprocess import Popen as run, PIPE\n\n\napi = Api(app)\n\n\nclass QueryAPI(Resource)... | python | chosen |
[
{
"from": "system",
"value": "Handle non-ascii characters when generating fuzzing dictionary\n\nThis caused a failure when generating the dictionary for `tree-sitter-agda`.\n"
},
{
"from": "human",
"value": "import json\nimport sys\n\ndef find_literals(literals, node):\n '''Recursively find STR... | python | chosen |
[
{
"from": "system",
"value": "Remove use of \"unsure\" from TrainingData type\n\nThe \"unsure\" key isn't used anywhere else\n"
},
{
"from": "human",
"value": "import numpy\nimport sys\n\nfrom typing import (Iterator,\n Tuple,\n Mapping,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix field set on post admin, opps core\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom django import forms\n\nfrom opps.core.models import Post, PostImage\nfrom opps.core.models import Image\n\nfrom redactor.widgets... | python | chosen |
[
{
"from": "system",
"value": "Add data dict as Pixel member.\n"
},
{
"from": "human",
"value": "\"\"\"Pixel\n\nA pixel data structure with it's own uid that makes a Pixelmap.\nLast updated: March 7, 2017\n\"\"\"\n\nfrom itertools import count\n\n\nclass Pixel:\n new_id = count(1)\n\n def _... | python | chosen |
[
{
"from": "system",
"value": "Fix loading 'provider_config_dir' opt error\n\nWhen run unit test using 'ostestr --pdb' command. it may get\nan error that can not find the config opt 'provider_config_dir'.\n\nChange-Id: Ibc1c693a1531c791ad434ff56ee349ba3afb3d63\nCloses-Bug: #1649443\n"
},
{
"from": "h... | python | chosen |
[
{
"from": "system",
"value": "Create tiles in create contour command\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport sys\nimport os\n\nsys.path.append('../nsmaps')\n\nimport nsmaps\n\n\nDATA_DIR = './website/nsmaps-data'\n\n\ndef test():\n stations = nsmaps.station.Station... | python | chosen |
[
{
"from": "system",
"value": "Add line to easily uncomment and switch back and forth to production settings locally\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nos.environ['APP_SETTINGS'] = 'config.DevelopmentConfig'\n\nfrom pskb_website import app\n\n# Uncomment to s... | python | chosen |
[
{
"from": "system",
"value": "Return the top most group name of an object"
},
{
"from": "human",
"value": "#**********************************************************************************************#\n#********* Return the top most group name of an object ************************************... | python | chosen |
[
{
"from": "system",
"value": "Update the sample proxy list\n"
},
{
"from": "human",
"value": "\"\"\"\nProxy Server \"Phone Book\".\n\nSimplify running browser tests through a proxy server\nby adding your frequently-used proxies here.\n\nNow you can do something like this on the command line:\n\"... | python | chosen |
[
{
"from": "system",
"value": "Add crack test to test runner.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n# ======================================================================\n# matscipy - Python materials science tools\n# https://github.com/libAtoms/matscipy\n#\n# Copyright ... | python | chosen |
[
{
"from": "system",
"value": "fix: Remove assert_called for Python 3.5 compatibility\n"
},
{
"from": "human",
"value": "import unittest\nimport tabula\n\ntry:\n FileNotFoundError\n from unittest.mock import patch, MagicMock\n from urllib.request import Request\nexcept NameError:\n Fi... | python | chosen |
[
{
"from": "system",
"value": "Fix tests when there is an image with int tag\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom __future__ import absolute_import\nfrom fig.packages.docker import Client\nfrom fig.service import Service\nfrom fig.cli.utils import docke... | python | chosen |
[
{
"from": "system",
"value": "Add ability to drop discs on slots\n"
},
{
"from": "human",
"value": "# Runtime for managing the interactive component of the game. Allows user to play the game\n# through a text based interface.\n\nfrom game import DiscState\n\nclass TextualRuntime:\n\n def __init... | python | chosen |
[
{
"from": "system",
"value": "Debug statement used the wrong variable.\n"
},
{
"from": "human",
"value": "'''\nReturn data to a Cassandra ColumFamily\n\nHere's an example Keyspace/ColumnFamily setup that works with this\nreturner::\n\n create keyspace salt;\n use salt;\n create column f... | python | chosen |
[
{
"from": "system",
"value": "Hide \"Request Individual Mapper Status\" button if approved\n\nThere's no point to showing this button once you have been approved as\nan individual mapper for this group.\n"
},
{
"from": "human",
"value": "\ndef user_is_census_admin(user):\n return user.is_auth... | python | chosen |
[
{
"from": "system",
"value": "Use a fixed thumbnail size rather then a relative scale.\n"
},
{
"from": "human",
"value": "\"\"\"An overview window showing thumbnails of the image set.\n\"\"\"\n\nfrom __future__ import division\nimport math\nfrom PySide import QtCore, QtGui\n\n\nclass ThumbnailWi... | python | chosen |
[
{
"from": "system",
"value": "Replace json for flask.json to manage the Response\n"
},
{
"from": "human",
"value": "import json\n\nfrom flask import Response as SimpleResponse\n\nfrom .status_codes import HTTP_200_OK\nfrom .serializers import BaseSerializer\n\n\nclass Response(SimpleResponse):\n... | python | chosen |
[
{
"from": "human",
"value": "Add helper method to plugin pkg to handle configs\n"
},
{
"from": "gpt",
"value": "# This file is part of victims-web.\n#\n# Copyright (C) 2013 The Victims Project\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the... | python | chosen |
[
{
"from": "system",
"value": "Add a sanity test for the data\n"
},
{
"from": "human",
"value": "import os\nfrom itertools import combinations\n\nimport numpy as np\n\nfrom ..tape9utils import origen_to_name\n\nDATA_DIR = os.path.abspath(os.path.join(__file__, os.path.pardir,\n os.path.pardir,... | python | chosen |
[
{
"from": "system",
"value": "Update profile for local data.\n"
},
{
"from": "human",
"value": "import audfprint\nimport cProfile\nimport pstats\n\nargv = [\"audfprint\", \"match\", \"-d\", \"tmp.fpdb\", \"--density\", \"200\", \"query.mp3\", \"query2.mp3\"]\n\ncProfile.run('audfprint.main(argv)... | python | chosen |
[
{
"from": "system",
"value": "Fix import issue in cobra.topology\n\nSigned-off-by: Vivek Rai <6965dcfed9719c822a5fc29f0dbf450e6c3f778e@gmail.com>\n"
},
{
"from": "human",
"value": "from os import name as __name\nfrom sys import modules as __modules\nfrom warnings import warn\nif __name == 'java'... | python | chosen |
[
{
"from": "system",
"value": "Allow setup function to update dynamic mapping\n"
},
{
"from": "human",
"value": "import json\nimport os\n\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch_dsl import Index\nfrom model import APIDoc\n\n\ndef exists():\n return Index(APIDoc.Index.name)... | python | chosen |
[
{
"from": "system",
"value": "Raise ValueError on get_body instead of random exception when initializing ModelInstanceMessage.\n"
},
{
"from": "human",
"value": "import base64\n\ntry:\n import json\nexcept ImportError:\n try:\n import simplejson as json\n except ImportError:\n ... | python | chosen |
[
{
"from": "system",
"value": "Switch to new version of grammpy (1.1.2) and use copy method\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 23.06.2017 16:39\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\nfrom grammpy import Grammar\n\n... | python | chosen |
[
{
"from": "system",
"value": "Split out running unit and functional tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport glob\nimport logging\nimport os\nimport sys\nimport unittest\n\nfrom trace import fullmodname\ntry:\n from tests.utils import cleanup\nexcept:\n def cl... | python | chosen |
[
{
"from": "system",
"value": "Add version information under trombi module\n"
},
{
"from": "human",
"value": "# Copyright (c) 2010 Inoi Oy\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), ... | python | chosen |
[
{
"from": "system",
"value": "Add missing properties to SNS::Subscription\n"
},
{
"from": "human",
"value": "# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty\ntry:\n from awacs.aws imp... | python | chosen |
[
{
"from": "system",
"value": "Remove deprecated test setup and teardown code\n"
},
{
"from": "human",
"value": "import asyncio\nimport io\nimport zipfile\nfrom unittest import mock\n\nfrom tornado import testing\n\nfrom waterbutler.core import streams\n\nfrom tests import utils\n\n\nclass TestZi... | python | chosen |
[
{
"from": "system",
"value": "Add note to remove file\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is here to ensure that upgrades of salt remove the external_ip\n# grain\n\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n# This file is here to ens... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect redirect in clear_all\n"
},
{
"from": "human",
"value": "\"\"\"\nDebug Blueprints.\n\"\"\"\nfrom flask import Blueprint, current_app, redirect, jsonify, url_for, request\n\ndebug_pages = Blueprint('debug', __name__)\n\n\n@debug_pages.route(\"/clear_all... | python | chosen |
[
{
"from": "system",
"value": "Use map to loop instead of mapping a list\n"
},
{
"from": "human",
"value": "from nltk.sentiment.util import mark_negation\nfrom nltk.util import trigrams\nimport re\nimport validators\nfrom .happy_tokenizer import Tokenizer\n\n\nclass SentimentTokenizer(object):\n ... | python | chosen |
[
{
"from": "system",
"value": "Create a RC sensor class object\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport rcsensor\n\nprint(rcsensor.get_count(200, 10, 22))\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nfrom common.rcsensor import rcsensor as rcsens... | python | chosen |
[
{
"from": "system",
"value": "Update version 0.9.4 -> 0.9.5\n\nNew Features\r\n------------\r\n* `BQM.normalize` now returns the value the BQM was scaled by\r\n* `SampleSet.relabel_variables` no longer blocks for unresolved sample sets\r\n* `FileView` has a new parameter, `ignore_variables` that treats the ... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings for sigproc benchmarks\n"
},
{
"from": "human",
"value": "from timeit import default_timer as timer\nimport bifrost as bf\nfrom bifrost import pipeline as bfp\nfrom bifrost import blocks as blocks\nfrom bifrost_benchmarks import PipelineBenchmarker\n\... | python | chosen |
[
{
"from": "system",
"value": "Put docstring inside Server class\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport threading, socket\n\n\n\n\"\"\"\nDummy server using for unit testing\n\"\"\"\n\nclass Server(threading.Thread):\n def __init__(self, handler, host='localhost', port=8... | python | chosen |
[
{
"from": "system",
"value": "Add limit_days query param to the get_job endpoint.\n"
},
{
"from": "human",
"value": "\nfrom notifications_python_client.base import BaseAPIClient\nfrom app.notify_client import _attach_current_user\n\n\nclass JobApiClient(BaseAPIClient):\n def __init__(self, ba... | python | chosen |
[
{
"from": "system",
"value": "Use new string formatting method"
},
{
"from": "human",
"value": "'''\n Check your Facebook notifications on command line.\n Author: Amit Chaudhary ( studenton.com@gmail.com )\n'''\nimport json\n\n# Configuration\nnotifications = 5 # Number of Notifications\n... | python | chosen |
[
{
"from": "system",
"value": "Add various unicode spec helper functions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Blocks of unicode ranges\"\"\"\nfrom pprint import pprint\n\nimport requests\nURL = \"https://www.unicode.org/Public/UCD/latest/ucd/Blocks.txt\"\n\n\ndef load... | python | chosen |
[
{
"from": "system",
"value": "Remove numpy dependency from glassbr python code\n"
},
{
"from": "human",
"value": "\"\"\"\nThis module implements a portion of the Input Format Module. In this\ncase the input is the tabular data necessary for the different interpolations.\n\"\"\"\n\nimport numpy ... | python | chosen |
[
{
"from": "system",
"value": "Allow us to create both virtual and physical jobs\n"
},
{
"from": "human",
"value": "#\n# Copyright 2012 Cisco Systems, Inc.\n#\n# Author: Soren Hansen <sorhanse@cisco.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may no... | python | chosen |
[
{
"from": "system",
"value": "Test migrations with continuous deployment.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nimport django_extensions.db.fields\n\n\nclass Migration(migrations.Migration):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Update to receiver version 0.2.6\n\nUpdate to receiver version 0.2.6\n\nBetter testing\n"
},
{
"from": "human",
"value": "import unittest\nimport unittest.mock as mock\n\nfrom ogn.client.client import TelnetClient\n\n\nclass TelnetClientTest(unittest.TestCase):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix the output now that we are using the default output (nested) instead of hard coding it to yaml\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n'''\nTests for the salt-run command\n'''\n\n# Import Salt Testing libs\nfrom salttesting.helpers import e... | python | chosen |
[
{
"from": "system",
"value": "Return User and download count\n"
},
{
"from": "human",
"value": "from waterbutler.core import metadata\n\nclass BaseOsfStorageMetadata:\n @property\n def provider(self):\n return 'osfstorage'\n\n\nclass OsfStorageFileMetadata(BaseOsfStorageMetadata, me... | python | chosen |
[
{
"from": "system",
"value": "Delete method added in FileObject\n"
},
{
"from": "human",
"value": "from irma.database.nosqlhandler import NoSQLDatabase\nfrom bson import ObjectId\n\n\nclass FileObject(object):\n _uri = None\n _dbname = None\n _collection = None\n\n def __init__(self,... | python | chosen |
[
{
"from": "system",
"value": "Fix Django system check error for a editable field that is not displayed\n\nThis error,\n\"CommandError: System check identified some issues:\nERRORS:\n<class 'fullcalendar.admin.EventAdmin'>: (admin.E122) The value of 'list_editable[0]' refers to 'status', which is not an attr... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.