conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add a test that these calls dont fail.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom flask import Flask\nfrom flask_selfdoc import Autodoc\n\n\nclass TestErrorHandling(unittest.TestCase):\n def test_app_not_initialized(self):\n app = Flask(__n... | python | chosen |
[
{
"from": "system",
"value": "Move the security fix into Eucalyptus\n"
},
{
"from": "human",
"value": "from oscar import app\n\n\nclass EdxShop(app.Shop):\n # URLs are only visible to users with staff permissions\n default_permissions = 'is_staff'\n\n\napplication = EdxShop()\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Tag new version with bug fixes.\n"
},
{
"from": "human",
"value": "# flake8: noqa\n\n__version__ = '0.28.5k'\n\nfrom .explainers.kernel import KernelExplainer, kmeans\nfrom .explainers.sampling import SamplingExplainer\nfrom .explainers.tree import TreeExplainer, Tr... | python | chosen |
[
{
"from": "system",
"value": "Change to avoid \"DeprecationWarning: invalid escape sequence\"\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import, unicode_literals\n\nimp... | python | chosen |
[
{
"from": "system",
"value": "Revert \"[mh-14] \"This import is ultimately just from django.contrib.auth.models import User - using that directly would probably address whatever circular import required that this import get put here, and make it clearer which model User is.\"-Dane\"\n\nThis reverts commit 7... | python | chosen |
[
{
"from": "system",
"value": "Kill \"Ja existeix una factura amb el mateix..\" too\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom ooop import OOOP\nimport configdb\n\nO = OOOP(**configdb.ooop)\n\nimp_obj = O.GiscedataFacturacioImportacioLinia\n\nimp_del_i... | python | chosen |
[
{
"from": "system",
"value": "Add some explanation of logging options.\n"
},
{
"from": "human",
"value": "\"\"\"Configuration file for harness.py\n\nAuthor: Ian Huston\nFor license and copyright information see LICENSE.txt which was distributed with this file.\n\n\n\"\"\"\nimport logging\n\n####... | python | chosen |
[
{
"from": "system",
"value": "Remove manual emit on status\n"
},
{
"from": "human",
"value": "from gevent import monkey\nmonkey.patch_all()\n\nimport time\nfrom threading import Thread\nimport settings\nimport requests\nfrom flask import Flask\nfrom flask.ext.socketio import SocketIO, emit\n\nap... | python | chosen |
[
{
"from": "system",
"value": "Use argparse for main python entrypoint args.\n\nWill make it easier to add proto_langdir as a flag argument in a future commit.\n"
},
{
"from": "human",
"value": "import metasentence\nimport language_model\nimport standard_kaldi\n\nimport diff_align\n\nimport json\... | python | chosen |
[
{
"from": "system",
"value": "Add game loop to prototype\n"
},
{
"from": "human",
"value": "from board import Board, BoardCanvas\n\n\nb = Board(19, 19)\nc = BoardCanvas(b)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n\nimport platform\nimport subprocess\nimport sys\nfrom c... | python | chosen |
[
{
"from": "system",
"value": "Add short comment to docs\n"
},
{
"from": "human",
"value": "\"\"\"\nThe `safeopt` package provides...\n\nMain classes\n============\n.. autosummary::\n SafeOpt\n SafeOptSwarm\n\nUtilities\n=========\n.. autosummary::\n sample_gp_function\n linearly_spaced_c... | python | chosen |
[
{
"from": "system",
"value": "Add __str__ method for Chord class.\n\nSigned-off-by: Charlotte Pierce <351429ca27f6e4bff2dbb77adb5046c88cd12fae@malformed-bits.com>\n"
},
{
"from": "human",
"value": "class Chord(object):\n # TODO: doctring\n def __init__(self, root_note):\n # TODO: do... | python | chosen |
[
{
"from": "system",
"value": "Update script to print all field types to a file\n"
},
{
"from": "human",
"value": "import glob\nimport os\nimport SCIRunPythonAPI; from SCIRunPythonAPI import *\n\ndef allFields(path):\n\tnames = []\n\tfor dirname, dirnames, filenames in os.walk(path):\n\t\tfor fil... | python | chosen |
[
{
"from": "system",
"value": "Add --include-aashe-in-website flag to org upsert\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Upserts Organization records with data from Salesforce Accounts.\n\"\"\"\nimport logging\nimport os\n\nfrom django.core.management.base import BaseComma... | python | chosen |
[
{
"from": "system",
"value": "FIX mae sale require fe uninstallable\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': 'Sale Order Require Contract on Confirmation',\n 'version': '1.0',\n 'category': 'Projects & Services',\n 'sequence': 14,\n 'summary': '',\n ... | python | chosen |
[
{
"from": "system",
"value": "Correct chat plugin example in docsctring\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf8 -*-\n\n\"\"\"\n This module add the class needed for creating custom chat command\n\n :Example:\n\n Here's a simple ChatPlugin which will... | python | chosen |
[
{
"from": "system",
"value": "Fix \"AppRegistryNotReady: Models aren't loaded yet\"\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom os.path import dirname, abspath\n\nimport django\nfrom django.conf import settings\n\n\nif len(sys.argv) > 1 and 'postgres' in sys.argv:\... | python | chosen |
[
{
"from": "system",
"value": "Fix typo. dest_key => dest_keys.\n\n\tmodified: s3s3/api.py\n"
},
{
"from": "human",
"value": "\"\"\"\nThe API for s3s3.\n\"\"\"\nimport tempfile\n\nfrom boto.s3.connection import S3Connection\n\n\ndef create_connection(connection_args):\n connection_args = con... | python | chosen |
[
{
"from": "system",
"value": "[LP-1965] Change authentication classes to cater inactive users\n"
},
{
"from": "human",
"value": "from django.http import JsonResponse\nfrom django.shortcuts import get_object_or_404\nfrom rest_framework import status\nfrom rest_framework.authentication import Sess... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Skip RenderPdfs until the crash is fixed\"\n\nThis reverts commit fd03af0fbcb5f1b3656bcc78d934c560816d6810.\n\nhttps://codereview.chromium.org/15002002/ fixes the crash.\n\nR=borenet@google.com\n\nReview URL: https://codereview.chromium.org/14577010\n\ngit-svn-id: 32fc... | python | chosen |
[
{
"from": "system",
"value": "Change the status string in riemann\n"
},
{
"from": "human",
"value": "\"\"\"\nCloudify plugin for running a simple bash script.\n\nOperations:\n start: Run a script\n\"\"\"\n\nfrom celery import task\nfrom cosmo.events import send_event as send_riemann_event\nfr... | python | chosen |
[
{
"from": "system",
"value": "Improve config argument splitting to allow quoted spaces\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\ndef convert_arg_line_to_args(arg_line):\n \"\"\"argparse helper for splitting input from config\n\n Allows comment lines ... | python | chosen |
[
{
"from": "system",
"value": "Switch to using dbSession in db.py instead of baseInterface.py\n\nThis is another file that should have been included in PR #272,\nwhere we transitioned all existing non-Flask db access to a\ndb connection using the new contextmanager. Originally missed\nthis one because it *is... | python | chosen |
[
{
"from": "system",
"value": "Add m3.medium to EC2 instance types\n\nThis is the lowest `m3` family instance type with ephemeral storage."
},
{
"from": "human",
"value": "EC2_INSTANCE_TYPES = [\n 't2.micro',\n 't2.small',\n 't2.medium',\n 't2.large'\n]\n\nRDS_INSTANCE_TYPES = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Add 'manage.py org list' command\n\n'org list' simply prints out the organizations.\n"
},
{
"from": "human",
"value": "from flask_script import Manager\nfrom redash import models\n\nmanager = Manager(help=\"Organization management commands.\")\n\n\n@manager.option('... | python | chosen |
[
{
"from": "system",
"value": "Add a constructor method for Backend\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\n\nclass Backend(object):\n \n def log(self, level, message):\n self.router.log(level, message)\n\n def start(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix user profile test to include same environment variables\n"
},
{
"from": "human",
"value": "import json\n\nfrom pymessenger.user_profile import UserProfileApi\nfrom test_env import *\n\nupa = UserProfileApi(PAGE_ACCESS_TOKEN, app_secret=APP_SECRET)\n\ndef test_fi... | python | chosen |
[
{
"from": "system",
"value": "Update to reflect new example data\n"
},
{
"from": "human",
"value": "from __future__ import division\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\n\n__all__ = [\"palplot\", \"dogplot\"]\n\n\ndef palplot(pal, size=1):\n \"\"\"P... | python | chosen |
[
{
"from": "system",
"value": "Fix format syntax with python 2.6 - upgrade version\n"
},
{
"from": "human",
"value": "VERSION = (0, 7)\n__version__ = '.'.join(map(str, VERSION))\nDATE = \"2014-06-17\""
},
{
"from": "gpt",
"value": "VERSION = (0, 8)\n__version__ = '.'.join(map(str, VER... | python | chosen |
[
{
"from": "system",
"value": "Fix streamwriter action so it doesn't include \"u\" type prefix in the\nobject result.\n\nThis way it works consistently and correctly under Python 2 and Python\n3.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport argparse\nimport sys\nimport ast\n... | python | chosen |
[
{
"from": "system",
"value": "Add a silly assert to avoid a pyflakes warning"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport unittest\n\nfrom kiwi.ui.widgets.checkbutton import ProxyCheckButton\n\n\nclass CheckButtonTest(unittest.TestCase):\n def testForBool(self):\n myC... | python | chosen |
[
{
"from": "system",
"value": "Update expected value on test\n"
},
{
"from": "human",
"value": "import markdown\nfrom mdx_embedly import EmbedlyExtension\n\n\ndef test_embedly():\n s = \"[https://github.com/yymm:embed]\"\n expected = \"\"\"\n<p>\n<a class=\"embedly-card\" href=\"https://git... | python | chosen |
[
{
"from": "system",
"value": "voctocore: Rename NetTimeProvider6 to NetTimeProvider, to match exports\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\nimport logging\nfrom gi.repository import Gst, GstNet\n\n__all__ = ['Clock', 'NetTimeProvider']\nport = 9998\n\nlog = logging.getLogger('Cl... | python | chosen |
[
{
"from": "system",
"value": "Fix for \"No module named decorator\" on fresh environment installs.\n\nFixes regression from 4b26b5837ced0c2f76495b05b87e63e05f81c2af.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(\n name ... | python | chosen |
[
{
"from": "system",
"value": "Fix data availability when installed via pip\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n\"\"\"TODO: Maybe add a docstring containing a long description\n\n This would double as something we could put int the `long_description`\n parameter for `se... | python | chosen |
[
{
"from": "system",
"value": "Add change to ship both pyparsing and pyparsing_py3 modules.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"Setup script for the pyparsing module distribution.\"\"\"\r\nfrom distutils.core import setup\n\nfrom pyparsing import __version__\r\n\r\ns... | python | chosen |
[
{
"from": "system",
"value": "Make draftjs-exporter dep strict version check\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n from distutils.core import setup\n\nsetup(\n name='wagtail-draftail',\n v... | python | chosen |
[
{
"from": "system",
"value": "Remove GitHub to download library\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='pyhunter',\n packages=['pyhunter'],\n version='0.2',\n description='An (unofficial) Python wrapper for the Hunter.io API',\n author='... | python | chosen |
[
{
"from": "system",
"value": "Add pyparsing module to dependencies\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n\tname=\"DependencyWatcher-Parser\",\n\tversion=\"1.0\",\n\turl=\"http://github.com/DependencyWatcher/parser/\",\n... | python | chosen |
[
{
"from": "system",
"value": "Fix import errors realted to missing 'mutual_debt' module\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='mutual-debt-simplifier',\n version='1.0',\n description='Tool to perform mutual debt simplification',\... | python | chosen |
[
{
"from": "system",
"value": "Fix the download URL to match the version number.\n"
},
{
"from": "human",
"value": "#coding:utf-8\nimport sys\nfrom distutils.core import setup\n\nfrom setuptools.command.test import test as TestCommand\n\n\nclass PyTest(TestCommand):\n user_options = [('pytest-... | python | chosen |
[
{
"from": "system",
"value": "Use current date and time as version number\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n\"\"\"\nPlotting and analysis tools for the ARTIS 3D supernova radiative transfer code.\n\"\"\"\n\nimport os\n\nfrom setuptools import find_packages, setup\n\nsetup(nam... | python | chosen |
[
{
"from": "system",
"value": "Use PyPI for host sdist; updated classifiers\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"django-c5filemanager setup file.\n\nTHIS SOFTWARE IS UNDER BSD LICENSE.\nCopyright (c) 2010 Daniele Tricoli <eriol@mornie.org>\n\nRead LICENSE for more inf... | python | chosen |
[
{
"from": "system",
"value": "Allow use as vendor library\n\nWith this little change this tool can be used as a dependency"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\nsetup(\n name='LinkFinder',\n packages=find_packages(),\n ver... | python | chosen |
[
{
"from": "system",
"value": "Undo workaround for broken json-table-schema release (via messytables)"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='myria-python',\n version='1.2.4',\n author='Daniel Halperin',\n author_email='dhalperi@c... | python | chosen |
[
{
"from": "system",
"value": "Make data_files paths absolute again\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport sys\nimport os.path\nfrom setuptools import Command, find_packages, setup\n\nHERE = os.path.abspath(os.path.dirname(__file__))\n\nREADME_PATH = os.path.join(HERE,... | python | chosen |
[
{
"from": "system",
"value": "Include kv files in package.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport cplcom\n\n\nsetup(\n name='CPLCom',\n version=cplcom.__version__,\n packages=find_packages(),\n package_data={'cplcom': ['../media/*']},\n... | python | chosen |
[
{
"from": "system",
"value": "Bump version for trove classifiers\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"cobertura-clover-transform\",\n version='1.1.4',\n packages=find_packages(),\n include_package_data=True,\n descriptio... | python | chosen |
[
{
"from": "system",
"value": "Update six version to match"
},
{
"from": "human",
"value": "\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"cdispyutils\",\n version=\"0.1.0\",\n description=\"General utilities\",\n license=\"Apache\",\n install_requires=[\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove version requirement, add pathlib\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nwith open('git_externals/__init__.py')... | python | chosen |
[
{
"from": "system",
"value": "Add rst long description for pypi\n"
},
{
"from": "human",
"value": "\"\"\"\nCopyright (c) 2010-2013, Anthony Garcia <anthony@lagg.me>\nDistributed under the ISC License (see LICENSE)\n\"\"\"\n\nfrom distutils.core import setup, Command\nfrom distutils.errors import... | python | chosen |
[
{
"from": "system",
"value": "Fix summary - pypi doesn't allow multiple lines\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='django-markwhat',\n version=\".\".join(map(str, __import__('django_markwhat').__version__)),\n packages=['django_markwhat', 'dj... | python | chosen |
[
{
"from": "system",
"value": "Set debug mode off as default\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#Main Settings\nblog_name = \"Pomash\"\nblog_author = \"JmPotato\"\nblog_url = \"http://xxx.oo/\"\n\ntwitter_card = False\ntwitter_username = \"@Jm_Pot... | python | chosen |
[
{
"from": "system",
"value": "Replace iteritems with six helper\n"
},
{
"from": "human",
"value": "unset = object()\n\n\ndef of(d):\n return {k: v for k, v in d.iteritems() if v != unset}\n\n"
},
{
"from": "gpt",
"value": "from six import iteritems\nunset = object()\n\n\ndef of(d)... | python | chosen |
[
{
"from": "system",
"value": "Set data cache home directory to ~/.cache/paddle/dataset\n"
},
{
"from": "human",
"value": "import hashlib\nimport os\nimport shutil\nimport urllib2\n\n__all__ = ['DATA_HOME', 'download']\n\nDATA_HOME = os.path.expanduser('~/.cache/paddle_data_set')\n\nif not os.pat... | python | chosen |
[
{
"from": "system",
"value": "Update string arg to url() to callable\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.views.generic import RedirectView\nfrom analyticsdataserver import vi... | python | chosen |
[
{
"from": "system",
"value": "Allow passing format option to helper function\n"
},
{
"from": "human",
"value": "from collections import namedtuple\n\n__all__ = ['identity', 'print_generated_sequence']\n\n\ndef identity(x):\n \"\"\"\n Helper function which returns its argument unchanged.\n ... | python | chosen |
[
{
"from": "system",
"value": "Update test for volcano plot\n"
},
{
"from": "human",
"value": "from sequana.viz import Volcano\n\ndef test1():\n import numpy as np\n fc = np.random.randn(1000)\n pvalue = np.random.randn(1000)\n v = Volcano(fc, -np.log10(pvalue**2), pvalue_threshold=3)... | python | chosen |
[
{
"from": "system",
"value": "[FIX] l10n_br_coa_simple: Use admin user to create COA\n"
},
{
"from": "human",
"value": "# Copyright (C) 2020 - Gabriel Cardoso de Faria <gabriel.cardoso@kmee.com.br>\n# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n\nfrom odoo import api, tools, ... | python | chosen |
[
{
"from": "system",
"value": "Hide modules from variables traced by %%snoop\n"
},
{
"from": "human",
"value": "import ast\n\nfrom snoop import snoop\nfrom IPython.core.magic import Magics, cell_magic, magics_class\n\n\n@magics_class\nclass SnoopMagics(Magics):\n @cell_magic\n def snoop(sel... | python | chosen |
[
{
"from": "system",
"value": "Use config.json as a go-gobject-gen dependency as well.\n"
},
{
"from": "human",
"value": "from waflib.Task import Task\nfrom waflib.TaskGen import extension\n\nclass gogobject(Task):\n\trun_str = '${GGG} ${GGGFLAGS} -o ${TGT[0].parent.abspath()} ${SRC}'\n\n@extensi... | python | chosen |
[
{
"from": "system",
"value": "Fix test so it is testing something\n"
},
{
"from": "human",
"value": "from .base import FloppyFormsTestCase\n\nimport floppyforms as forms\n\n\nclass IntegerFieldTests(FloppyFormsTestCase):\n def test_parse_int(self):\n int_field = forms.IntegerField()\n ... | python | chosen |
[
{
"from": "system",
"value": "Update Sanction exception error message and docstrings\n"
},
{
"from": "human",
"value": "class OSFError(Exception):\n \"\"\"Base class for exceptions raised by the Osf application\"\"\"\n pass\n\n\nclass NodeError(OSFError):\n \"\"\"Raised when an action c... | python | chosen |
[
{
"from": "system",
"value": "Remove extra `%` from the `cli` tools.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n salt.utils.parser\n ~~~~~~~~~~~~~~~~~\n\n :copyright: © 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`\n :license: Apache 2.0, see ... | python | chosen |
[
{
"from": "system",
"value": "globals: Replace deprecated 'map' builtin with list comprehension\n\nSigned-off-by: Euan Harris <c3b6e83069c8e9e3af49a38fec6026be89559638@citrix.com>\n"
},
{
"from": "human",
"value": "import os.path\n\nBUILD_ROOT_DIR = \"planex-build-root\"\n\n[SPECS_DIR, SOURCES_D... | python | chosen |
[
{
"from": "system",
"value": "Add CDN origin domain to allowed hosts.\n"
},
{
"from": "human",
"value": "import os\nimport socket\n\nfrom .base import * # noqa\n\n\nSERVER_ENV = os.getenv('DJANGO_SERVER_ENV')\nSECRET_KEY = os.getenv('SECRET_KEY')\nSTATIC_URL = os.getenv('STATIC_URL', STATIC_URL... | python | chosen |
[
{
"from": "system",
"value": "Change path following import of build folder"
},
{
"from": "human",
"value": "import os,sys\r\n\r\n#General vars\r\nCURDIR=os.path.dirname(os.path.abspath(__file__))\r\nTOPDIR=os.path.dirname(CURDIR)\r\nDOWNLOAD_DIR=TOPDIR+'\\\\downloads'\r\n\r\n#Default vars\r\nPY_... | python | chosen |
[
{
"from": "system",
"value": "Integrate content server with new settings module\n"
},
{
"from": "human",
"value": "import os\nimport pytest\nimport tempfile\nimport shutil\nfrom falafel.content.manager import ContentManager\n\n\n@pytest.fixture\ndef cm():\n tmp_dir = tempfile.mkdtemp()\n y... | python | chosen |
[
{
"from": "system",
"value": "Raise the import batch size to 100\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (C) 2011 Lukas Lalinsky\n# Distributed under the MIT license, see the LICENSE file for details.\n\nfrom acoustid.script import run_script\nfrom acoustid.data.s... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add a modified lut-data-generating script to use pickle, rather than npz\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nScript used to create lut lists used by mayavi from matplotlib colormaps.\nThis requires matlplotlib to be installed and s... | python | chosen |
[
{
"from": "system",
"value": "Add examples of ways to use FileDropInput\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nfrom base.form_utils import RequiredFieldForm\n\nfrom .models import Document\nfrom base.form_utils import FileDropInput\n\n\nclass DocumentForm(RequiredFieldForm... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Quit Backend If Running\"\n\nThis reverts commit a00432191e2575aba0f20ffb1a96a323699ae4fc.\n"
},
{
"from": "human",
"value": "from multiprocessing import Queue, Process\nimport time\nimport backend\ncommand_queue = Queue()\nresponse_queue = Queue()\n\n\ndef... | python | chosen |
[
{
"from": "system",
"value": "Create profile if user is created\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass Profile(models.Model):\n user = models.OneToOneField(User)\n\n def __str__(self):\n return self.use... | python | chosen |
[
{
"from": "system",
"value": "Add limit_choices_to to CustomLink.content_type field\n"
},
{
"from": "human",
"value": "# Generated by Django 2.2 on 2019-04-15 19:28\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Call FLAGS.get_help if it's available.\n"
},
{
"from": "human",
"value": "# Copyright 2016 PerfKitBenchmarker Authors. 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... | python | chosen |
[
{
"from": "system",
"value": "Disable test for py27 (mock not available)\n"
},
{
"from": "human",
"value": "\"\"\"Unit test some basic response rendering functionality.\n\nThese tests use the unittest.mock mechanism to provide a simple Assistant\ninstance for the _Response initialization.\n\"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix build wheels with Pandoc 2.\n"
},
{
"from": "human",
"value": "import os\nfrom subprocess import call, check_output\nimport sys\nfrom shutil import copy2\n\nplatform = sys.platform\n\n\ndef checkAndInstall():\n try:\n check_output('pandoc -v'.split())\... | python | chosen |
[
{
"from": "system",
"value": "Make reaction api display user id instead of username.\n"
},
{
"from": "human",
"value": "from apps.bluebottle_utils.serializers import SorlImageField, SlugHyperlinkedIdentityField\nfrom django.contrib.auth.models import User\nfrom rest_framework import serializers\... | python | chosen |
[
{
"from": "system",
"value": "Send timestamp to the outside world\n"
},
{
"from": "human",
"value": "import time\nimport socket\nimport datetime\nfrom ipaddress import ip_address\n\nimport zmq\nimport yaml\nimport quick2wire.i2c as i2c\n\nfrom database import Writer\nfrom database import Tempera... | python | chosen |
[
{
"from": "system",
"value": "Save the created html in a HTML file.\n"
},
{
"from": "human",
"value": "import sublime, sublime_plugin\nfrom .mistune import markdown\n\nclass CreateMinuteCommand(sublime_plugin.TextCommand):\n\tdef run(self, edit):\n\t\tregion = sublime.Region(0, self.view.size())... | python | chosen |
[
{
"from": "system",
"value": "Prepare to update Master branch to v 0.9.4\n"
},
{
"from": "human",
"value": "# This is the only location where the version will be written and changed.\n# Based on https://packaging.python.org/single_source_version/\n__version__ = '0.9.4b'\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Fix passed args (no more program name)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nEntrypoint module, in case you use `python -mdependenpy`.\n\nWhy does this file exist, and why __main__? For more info, read:\n\n- https://www.python.org/dev... | python | chosen |
[
{
"from": "system",
"value": "Move eye down a bit\n"
},
{
"from": "human",
"value": "from django import template\nfrom metabotnik.models import project_status_choices\n\nregister = template.Library()\n\n@register.filter\ndef nicestatus(dbval):\n 'Converts a db status choice into a more user-f... | python | chosen |
[
{
"from": "human",
"value": "Add variables for top and metadata directories\n"
},
{
"from": "gpt",
"value": "\"\"\"Metadata and tools for WMT components.\"\"\"\n\nimport os\n\n\ntop_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))\nmetadata_dir = os.path.join(top_dir, 'metadata... | python | chosen |
[
{
"from": "system",
"value": "Create recorder file if not exist\n"
},
{
"from": "human",
"value": "from Measurement import Measurement\n\nclass Recorder(object):\n def __init__(self, recorderType):\n self.recorderType = recorderType\n\n def record(self, measure: Measurement):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect checksum verification when checksum is 32 (0x20, space)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nclass TeleinfoParser:\n\n\tintegerKeys = [\n\t\t'ISOUSC', 'BASE', 'HCHC', 'HCHP', 'EJPHN', 'EJPHPM',\n\t\t'BBRHCJB', 'BBRHPJB', 'BBRHCJW... | python | chosen |
[
{
"from": "system",
"value": "Fix usage comment to refer to the correct filename\n"
},
{
"from": "human",
"value": "\"\"\"\nUsage:\n\n$ python test_group_name.py group_1\ntest_foo.py test_bar.py::TestClass\n$\n\nThis is used by CI to run only a certain set of tests on a particular builder.\n\nSe... | python | chosen |
[
{
"from": "system",
"value": "Raise PluginErrors instead of ValueErrors in versions.\n"
},
{
"from": "human",
"value": "import re\n\n\n# regular expression for finding assignments\n_quotes = \"['|\\\"|\\\"\\\"\\\"]\"\nBASE_ASSIGN_PATTERN = r'({}\\s*=\\s*[ubr]?' + _quotes + r')(.*?)(' +\\\n ... | python | chosen |
[
{
"from": "system",
"value": "Sort listed ambassadors by date_joined\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django_countries import countries\n\ndef get_user(user_id):\n user = User.objects.get(id=user_id)\n return user\n\ndef get_user_profile(... | python | chosen |
[
{
"from": "system",
"value": "Remove duplicate tags during init\n"
},
{
"from": "human",
"value": "import uuid\n\n\nclass Note(object):\n \"\"\"\n A note.\n Currently has a title, tags, texr and a priority.\"\"\"\n\n def __init__(self, title, tags, text, priority=1, unique_id=None):\... | python | chosen |
[
{
"from": "system",
"value": "Update \"HijiNKS Ensue\" after feed change\n"
},
{
"from": "human",
"value": "from comics.aggregator.crawler import CrawlerBase, CrawlerImage\nfrom comics.core.comic_data import ComicDataBase\n\n\nclass ComicData(ComicDataBase):\n name = \"HijiNKS Ensue\"\n la... | python | chosen |
[
{
"from": "system",
"value": "Update tests for new environment.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2011 Alexander Shorin\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as part... | python | chosen |
[
{
"from": "system",
"value": "Remove 'is_live' from draft visibility check.\n"
},
{
"from": "human",
"value": "OWNER_PERMISSIONS = ['challenges.%s_submission' % v for v in ['edit', 'delete']]\n\nclass SubmissionBackend(object):\n \"\"\"Provide custom permission logic for submissions.\"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Change import to indicate function of imported classes\n"
},
{
"from": "human",
"value": "from flask_wtf import Form\nfrom wtforms.validators import DataRequired, Email\nfrom dmutils.forms import StripWhitespaceStringField\n\n\nclass EmailAddressForm(Form):\n ema... | python | chosen |
[
{
"from": "system",
"value": "Handle cases where there are multiple values for a field.\n"
},
{
"from": "human",
"value": "\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException\n\n\ndef json_api_exception_handler(exc, context):\n \"\"\" Custom exception handl... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in reference \":class:`ArrowFactory <...>\""
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nProvides the default implementation of :class:`ArrowFactory <arrow.factory.ArrowFactory>`\nmethods for use as a module API.\n\n'''\n\nfrom __future__ ... | python | chosen |
[
{
"from": "system",
"value": "Add a test for on_message\n"
},
{
"from": "human",
"value": "import re\nimport unittest\nfrom gather.bot import ListenerBot\n\n\nclass TestGatherBot(unittest.TestCase):\n def test_register(self):\n bot = ListenerBot()\n self.assertEqual({}, bot.acti... | python | chosen |
[
{
"from": "system",
"value": "Add current value for price_includes_tax to context\n"
},
{
"from": "human",
"value": "import plata\n\n\ndef plata_context(request):\n \"\"\"\n Adds a few variables from Plata to the context if they are available:\n\n * ``plata.shop``: The current :class:`p... | python | chosen |
[
{
"from": "system",
"value": "Add perelement figures write figures into subdirectory\n"
},
{
"from": "human",
"value": "import pandas as pd\nimport matplotlib\nmatplotlib.use(\"pdf\")\nimport matplotlib.pyplot as plt\nimport sys\nimport os.path\n\nfigdir = \"figures\"\n\ndf = pd.read_csv(sys.std... | python | chosen |
[
{
"from": "system",
"value": "Fix spelling error and remove Windows line endings.\n"
},
{
"from": "human",
"value": "# Rediculously simple test of the winsound module for Windows.\n\nimport winsound\nfor i in range(100, 2000, 100):\n winsound.Beep(i, 75)\nprint \"Hopefully you heard some soun... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.