conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Comment out 'static' and 'deform' methods; disagreements on long-term API.\n"
},
{
"from": "human",
"value": "\"\"\"\nContributed by Michael Mericikel.\n\"\"\"\n\nfrom pyramid.decorator import reify\nimport pyramid.url as url\n\nclass URLGenerator(object):\n def ... | python | chosen |
[
{
"from": "system",
"value": "Fix broken NSG create command (duplicate --name parameter)\n"
},
{
"from": "human",
"value": "# pylint: disable=no-self-use,too-many-arguments\nfrom azure.mgmt.network.models import Subnet, SecurityRule\nfrom ._factory import _network_client_factory\n\ndef create_up... | python | chosen |
[
{
"from": "system",
"value": "Use unpacking for simpler code\n"
},
{
"from": "human",
"value": "CHILDREN = [\"Alice\", \"Bob\", \"Charlie\", \"David\", \"Eve\", \"Fred\",\n \"Ginny\", \"Harriet\", \"Ileana\", \"Joseph\", \"Kincaid\", \"Larry\"]\nPLANTS = {\"C\": \"Clover\", \"G\": \"G... | python | chosen |
[
{
"from": "system",
"value": "Fix timezone difference with travis.\n"
},
{
"from": "human",
"value": "import datetime\nfrom decimal import Decimal\n\nfrom mock import Mock\n\nimport ubersmith.order\n\n# TODO: setup/teardown module with default request handler\n# TODO: mock out requests library v... | python | chosen |
[
{
"from": "system",
"value": "Add \"capitalize first letter\" function to examples\n"
},
{
"from": "human",
"value": "import xkcdpass.xkcd_password as xp\nimport random\n\n\ndef random_capitalisation(s, chance):\n new_str = []\n for i, c in enumerate(s):\n new_str.append(c.upper() i... | python | chosen |
[
{
"from": "system",
"value": "Bring now uses --myUIDandGIDCheckout if root is not the invoker\n"
},
{
"from": "human",
"value": "from solvent import config\nfrom solvent import run\nfrom solvent import requirementlabel\nimport logging\nimport os\n\n\nclass Bring:\n def __init__(self, reposito... | python | chosen |
[
{
"from": "system",
"value": "Disable application views from oauth2-toolkit\n"
},
{
"from": "human",
"value": "from django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\nfrom django.http import HttpResponse\nfrom django.conf.urls.stat... | python | chosen |
[
{
"from": "system",
"value": "Update the sample with covariant markings\n"
},
{
"from": "human",
"value": "from typing import TypeVar, List\n\nclass Mammal:\n pass\n\nclass Cat(Mammal):\n pass\n\nT = TypeVar('T')\n\ndef count_mammals(seq : List[Mammal]) -> int:\n return len(seq)\n\nlst ... | python | chosen |
[
{
"from": "system",
"value": "Add unique parameter to idea name\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\n\nclass Idea(models.Model):\n name = models.CharField(max_length=200)\n description = models.TextField()\n votes = ... | python | chosen |
[
{
"from": "system",
"value": "Add newline between func defs.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Config-like for paver tool.\"\"\"\nfrom paver.easy import task, sh, path # noqa\n\n# pylint: disable=invalid-name\ncli_command_name = 'serverauditor'\n\n\n@task\ndef li... | python | chosen |
[
{
"from": "system",
"value": "Fix params handling in {{s}}.\n\n\nFormer-commit-id: 15eae70c91cd08f9028944f8b6a3990d3170aa28"
},
{
"from": "human",
"value": "#-*- encoding: utf-8 -*-\n\nimport base\n\ndef handle_date(template):\n year = None\n if len(template.params) >= 3:\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add Endashcatredirect as a new item in list of category redirect templates\n\nBug: T183987\nChange-Id: I72b6ded1ccab48d5d905f4edd4ce6b9485703563\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Family module for Wikimedia Commons.\"\"\"\n#\n# (C) Py... | python | chosen |
[
{
"from": "system",
"value": "Fix up imports after module has moved\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport ed25519\nimport hmac\nfrom sqrl.utils import baseconv\n\n\nclass Crypt:\n \"\"\"\n Crypt\n - Creating site specific key pair\n - Signing SRQL respons... | python | chosen |
[
{
"from": "system",
"value": "Add test for required registration."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom flask import Flask\nfrom flask.ext.knot import Knot, get_container\n\n\ndef create_app():\n app = Flask(__name__)\n app.config['TESTING'] = Tr... | python | chosen |
[
{
"from": "system",
"value": "Add some more tests for isympy -a\n"
},
{
"from": "human",
"value": "\"\"\"Tests of tools for setting up interactive IPython sessions. \"\"\"\n\nfrom sympy.interactive.session import init_ipython_session, enable_automatic_symbols\n\nfrom sympy.core import Symbol\nfr... | python | chosen |
[
{
"from": "system",
"value": "Add ansible app site title\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Playbook, Registry, Repository\n\nadmin.site.register(Playbook)\nadmin.site.register(Registry)\nadmin.site.register(Repository)\nadmin.site.site_hea... | python | chosen |
[
{
"from": "system",
"value": "Determine what to encode based in skip options.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Copyright (c) Ubuntu Podcast\n# http://www.ubuntupodcast.org\n# See the file \"LICENSE\" for the full license governing this code.\n... | python | chosen |
[
{
"from": "system",
"value": "Make static http error code generator directory agnostic\n"
},
{
"from": "human",
"value": "import os, errno\n# Create build folder if it doesn't exist\ntry:\n os.makedirs('build')\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\ntemplate ... | python | chosen |
[
{
"from": "system",
"value": "Return http 200 for webhooks\n"
},
{
"from": "human",
"value": "from django import http\nfrom mailgun import utils\n\nimport models as unsubscribe_model\n\ndef unsubscribe_webhook(request):\n verified = utils.verify_webhook(\n request.POST.get('token'), \n... | python | chosen |
[
{
"from": "system",
"value": "Add root URL (to serve public wishlist)\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns('',\n url(r'^djadmin/', include(admin.site.urls)),\n)\n"
},
{
"from"... | python | chosen |
[
{
"from": "system",
"value": "Add URLs for previous views.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom core import views\n\nurlpatterns = [\n\turl(r'^sensors/$', views.SensorList.as_view()),\n\turl(r'^sensors/(?P<pk>[0-9]+)/$', views.SensorDetail.as_view()),\n\n\tur... | python | chosen |
[
{
"from": "system",
"value": "Add a note for the utility script.\n"
},
{
"from": "human",
"value": "import inspect\n\nfrom cinspect import getsource, getfile\n\nimport IPython.core.oinspect as OI\nfrom IPython.utils.py3compat import cast_unicode\n\nold_find_file = OI.find_file\nold_getsource = i... | python | chosen |
[
{
"from": "system",
"value": "Add checks for a reasonable week number.\n"
},
{
"from": "human",
"value": "from datetime import date, timedelta\n\ndef iso_to_gregorian(year, week, weekday):\n jan_8 = date(year, 1, 8).isocalendar()\n offset = (week - jan_8[1]) * 7 + (weekday - jan_8[2])\n ... | python | chosen |
[
{
"from": "system",
"value": "Implement Powermace, Crackle, Vitality Totem and Siltfin Spiritwalker\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Spells\n\n# Ancestor's Call\nclass GVG_029:\n\taction = [\n\t\tForcePlay(CONTROLLER, RANDOM(CONTROLLER_HAND + MINION)),\n\t\tFor... | python | chosen |
[
{
"from": "system",
"value": "Update LUA test to perform interpolation\n"
},
{
"from": "human",
"value": "from kat.harness import Query\nfrom abstract_tests import AmbassadorTest, ServiceType, HTTP\n\n\nclass LuaTest(AmbassadorTest):\n target: ServiceType\n\n def init(self):\n self.... | python | chosen |
[
{
"from": "system",
"value": "Read in the database and data options from a config file\n\nI hope this works.\n"
},
{
"from": "human",
"value": "import os\nfrom flask import Flask, abort, request\nfrom flask.ext import restful\nfrom vaux.storage import LibreDB\nfrom datetime import datetime\nfrom... | python | chosen |
[
{
"from": "system",
"value": "Add input rule for adding employee\n"
},
{
"from": "human",
"value": "from flask import flash\nfrom flask_wtf import FlaskForm\nfrom wtforms import StringField, PasswordField\nfrom wtforms.validators import DataRequired, Email, Length\n\n\ndef flash_errors(form):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix args.file and remove stat from argparse\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\nimport sys\nimport re\nimport argparse\nimport fileinput\n\nfrom argparse import RawDescriptionHelpFormatter\n\nfrom patterns import pre_patterns... | python | chosen |
[
{
"from": "human",
"value": "Add missing redirection in empty file.\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\n\n# OpenFisca -- A versatile microsimulation software\n# By: OpenFisca Team <contact@openfisca.fr>\n#\n# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team\n# https://... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for Django 1.7\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom os.path import abspath, dirname\n\nfrom django.conf import settings\n\n\nsys.path.insert(0, abspath(dirname(__file__)))\n\n\nif not settings.configured:\n settings... | python | chosen |
[
{
"from": "system",
"value": "Fix deprecated modules for content types\n"
},
{
"from": "human",
"value": "from attachments.models import Attachment\nfrom django.contrib.contenttypes import generic\n\n\nclass AttachmentInlines(generic.GenericStackedInline):\n model = Attachment\n extra = 1"... | python | chosen |
[
{
"from": "system",
"value": "Update deploy script to support Travis.\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.virtualenv = 'sou... | python | chosen |
[
{
"from": "system",
"value": "Add PERMISSIONS setting to test settings\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport django\nfrom django.conf import settings\nfrom django.core.management import call_command\n\n\nsettings.configure(\n DATABASES={\n 'default': {\n ... | python | chosen |
[
{
"from": "system",
"value": "Add root path to sys.path\n"
},
{
"from": "human",
"value": "\n\nsource_suffix = '.rst'\nmaster_doc = 'index'\n\nhtml_theme = 'alabaster'\n\nextensions = [\n 'sphinx.ext.autodoc',\n 'sphinx.ext.autosummary',\n]\n"
},
{
"from": "gpt",
"value": "impo... | python | chosen |
[
{
"from": "system",
"value": "Fix \"Edit on GitHub\" links\n\nUsing \"master\" seems to mess it up, see\nhttps://github.com/readthedocs/readthedocs.org/issues/5518\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n### General settings\n\nextensions = []\ntemplates_path = ['_templates... | python | chosen |
[
{
"from": "system",
"value": "Add child_count taken from new Subject property\n"
},
{
"from": "human",
"value": "from rest_framework import serializers as ser\n\nfrom api.base.serializers import JSONAPISerializer, LinksField, JSONAPIListField\n\nclass TaxonomyField(ser.Field):\n def to_repres... | python | chosen |
[
{
"from": "system",
"value": "Upgrade to test using django 1.7 and 1.8\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'\ntest_dir = os.path.dirname(__file__)\nsys.path.insert(0, test_dir)\n\nfrom django.test.utils import get_run... | python | chosen |
[
{
"from": "system",
"value": "Allow iframes to be synched\n"
},
{
"from": "human",
"value": "import feedparser\nimport datetime\n\nfrom .models import RssEntry\n\n\nclass RssSyncHelper(object):\n\n def __init__(self, feed):\n self.feed = feed\n\n def save_entry(self, result):\n ... | python | chosen |
[
{
"from": "system",
"value": "Include AllValuesQuantizer in external APIs\n\nPiperOrigin-RevId: 320104499\n"
},
{
"from": "human",
"value": "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use th... | python | chosen |
[
{
"from": "system",
"value": "Add function for generating random id\n"
},
{
"from": "human",
"value": "from ckan.tests import factories\n\n\ndef create_mock_data(**kwargs):\n mock_data = {}\n\n mock_data['organization'] = factories.Organization()\n mock_data['organization_name'] = mock_... | python | chosen |
[
{
"from": "system",
"value": "Make twine check happy [ci skip]\n"
},
{
"from": "human",
"value": "\"\"\"colorise module setup script for distribution.\"\"\"\n\nfrom setuptools import setup\nimport os\n\n\ndef get_version(filename):\n with open(filename) as fh:\n for line in fh:\n ... | python | chosen |
[
{
"from": "system",
"value": "Update for compatibility with pesto==14\n\nIgnore-this: 7a596766eb3deedefb2c9ba36ce5ecfc\n\ndarcs-hash:20100419210717-8e352-6286dc43ea83998229ccdcd619ff1f4990ff82ee.gz\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nimport sys, os\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 and open file description\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport os\n\nPROJECT_ROOT, _ = os.path.split(__file__) \nDESCRIPTION = open( os.path.join(PROJECT_ROOT, \"README\") ).read()\nVERSION = REVISION = '0.1.4'\nPROJECT_NA... | python | chosen |
[
{
"from": "system",
"value": "chore(pins): Update to dictionary release tag\n\n- Update to dictionary release tag\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='gdcdatamodel',\n packages=find_packages(),\n install_requires=[\n 'py... | python | chosen |
[
{
"from": "system",
"value": "Add classifier for Python 3-only compatibility.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name='pyaavso',\n ... | python | chosen |
[
{
"from": "system",
"value": "Change author and email to the same as atomic-reactor has\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\"\"\"\nCopyright (c) 2015 Red Hat, Inc\nAll rights reserved.\n\nThis software may be modified and distributed under the terms\nof the BSD license. See th... | python | chosen |
[
{
"from": "system",
"value": "Allow newer versions of sklearn - this will now allow software to be compiled again on OSX. Also tested on Linux.\n"
},
{
"from": "human",
"value": "import setuptools\n\nwith open(\"README.md\", \"r\") as fh:\n long_description = fh.read()\n\nsetuptools.setup(\n ... | python | chosen |
[
{
"from": "system",
"value": "Move test dependencies to tests_require.\n\nMove nose, nose-cov, and mock to tests_require, since they are only\nrequired for tests and not needed for general package setup.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n... | python | chosen |
[
{
"from": "system",
"value": "Use alternate GitHub download URL\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom setuptools import find_packages, setup\n\nVERSION = \"1.0.0\"\n\n\nwith open(\"requirements.txt\", \"rt\") as f:\n requirements= f.read().sp... | python | chosen |
[
{
"from": "system",
"value": "Add 'and Contributors' to Author\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import find_packages, setup\n\n\nsetup(\n name=\"pylast\",\n version=\"2.2.0.dev0\",\n author=\"Amr Hassan <amr.hassan@gmail.com>\",\n install_requ... | python | chosen |
[
{
"from": "system",
"value": "Set initial version for series 0.2.x\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\ndef listify(filename):\n return filter(None, open(filename,'r').read().split('\\n'))\n\ndef remove_externals(requirements):\n return filter(l... | python | chosen |
[
{
"from": "system",
"value": "Add python_requires to help pip\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='osmviz',\n version='1.1.0',\n description='OSMViz is a small set of Python tools for retrieving '\n 'and using Ma... | python | chosen |
[
{
"from": "system",
"value": "Fix find_packages excludes to contain a list rather than a bare string\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom ez_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup, find_packages\nsetup(\n name = \"cmdparse\",\... | python | chosen |
[
{
"from": "system",
"value": "Update package URL to use GitHub\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='Zuice',\n version='0.2-dev',\n description='A dependency injection framework for Python',\n author='Michael Williamson',\n author_em... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Bump version to 0.2.0\"\n\nThis reverts commit 189e4bc4bcd7a6764740d9974a633996f6ba1fc7.\n"
},
{
"from": "human",
"value": "import os.path\nimport sys\n\nfrom setuptools import setup, find_packages\nfrom build_manpage import build_manpage\n\nHOME=os.path.ex... | python | chosen |
[
{
"from": "system",
"value": "Make 0.9.10_pre4 to match webapp\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nfrom glob import glob\n\nif os.environ.get('USE_SETUPTOOLS'):\n from setuptools import setup\n setup_kwargs = dict(zip_safe=0)\n\nelse:\n from distutils.core i... | python | chosen |
[
{
"from": "system",
"value": "Make flake8 test only dependency\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='hadmin',\n version='0.1',\n packages=find_packages(),\n author='Alec Ten Harmsel',\n author_email='alec@alectenharmsel.co... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Bumping the version reflecting the bugfix\"\n\nThis reverts commit 7f3daf4755aff19d04acf865df39f7d188655b15.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom __future__ import unicode_literals\nfrom setuptools import setup, find_packages\n\nin... | python | chosen |
[
{
"from": "system",
"value": "Set minimum version for dependencies.\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport os\n\nversion = 0.4\n\nsetup(\n version=version,\n description=\"A script allowing to setup Amazon EC2 instances through configuration files.\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add alternative package list url\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom manager import views\n\nurlpatterns = [\n url(r'^$', views.package_list, name='package_list'),\n url(r'^packages/(?P<package_name>[a-zA-Z0-9_+-]+)/$', vi... | python | chosen |
[
{
"from": "system",
"value": "Fix importing force_text tests for 1.4 compatibility\n\nuse 1.4 compat code\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom django.test import TestCase\nfrom django.utils.text import force_text... | python | chosen |
[
{
"from": "system",
"value": "Add scipy as a dependency of jaxlib.\n\nJaxlib depends on LAPACK kernels provided by Scipy."
},
{
"from": "human",
"value": "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in co... | python | chosen |
[
{
"from": "system",
"value": "Add \"Pointer's Gamut\" coverage computation example.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nShowcases RGB colourspace volume computations.\n\"\"\"\n\nfrom __future__ import division, unicode_literals\n\nimport c... | python | chosen |
[
{
"from": "system",
"value": "[FIX] medical_prescription_sale: Add dependency\n* Add dependency on stock to manifest file. This is needed by some of the demo\ndata in the module, which was not installing due to its absence.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2016 Las... | python | chosen |
[
{
"from": "system",
"value": "Convert import try/except to use test_support.import_module().\n"
},
{
"from": "human",
"value": "\"\"\"This test checks for correct fork() behavior.\n\"\"\"\n\nimport os\nimport time\nimport unittest\nfrom test.fork_wait import ForkWait\nfrom test.test_support impo... | python | chosen |
[
{
"from": "system",
"value": "tools: Make Utility.console_log accept Unicode and byte strings as well\n"
},
{
"from": "human",
"value": "from __future__ import print_function\nimport sys\n\n\n_COLOR_CODES = {\n \"white\": '\\033[0m',\n \"red\": '\\033[31m',\n \"green\": '\\033[32m',\n ... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Simplify this code and make sure AdminSite doesn't act like a singleton\"\n\nUnfortunately, it's not that simple. Without the runtime merging from\ninside hatband.AdminSite, this doesn't seem to pick up everything else.\n\nThis reverts commit 122b4e6982fe7a74ee668c1b1... | python | chosen |
[
{
"from": "system",
"value": "Fix FileNotFoundError on missing local_settings.py\n\nThis has been broken for a long time... When running LBB without a\nlocal_settings.py and without an LBB_ENV environment variable, importing\nlocal_settings.py was resulting in a FileNotFoundError.\n"
},
{
"from": "h... | python | chosen |
[
{
"from": "system",
"value": "Add docstring for class Movie\n"
},
{
"from": "human",
"value": "# media.py\n\n\nclass Movie(object):\n def __init__(self,\n title,\n storyline,\n poster_image_url,\n trailer_youtube_url,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix some print statments for Python3 compatibility.\n"
},
{
"from": "human",
"value": "import csv\n\ndef read_axf(axf_string):\n blocks = {}\n state = 'new_block'\n\n for line in axf_string.split('\\n'):\n if line == '[$]' or line == '':\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a test exercising TFA custom op.\n\nTo prevent future regression.\n\nBUG=145555176\n"
},
{
"from": "human",
"value": "import unittest\n\nimport tensorflow as tf\nimport tensorflow_addons as tfa\n\n\nclass TestTensorflowAddons(unittest.TestCase):\n def test_tf... | python | chosen |
[
{
"from": "system",
"value": "Add HoverTool to show off properties availability\n"
},
{
"from": "human",
"value": "from bokeh.io import output_file, show\nfrom bokeh.models import GeoJSONDataSource\nfrom bokeh.plotting import figure\nfrom bokeh.sampledata.sample_geojson import geojson\n\noutput_... | python | chosen |
[
{
"from": "system",
"value": "Add more options to the `docs` task\n"
},
{
"from": "human",
"value": "\"\"\"\nAutomation tasks, aided by the Invoke package.\n\"\"\"\nimport os\nimport webbrowser\n\nfrom invoke import task, run\n\n\nDOCS_DIR = 'docs'\nDOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_bui... | python | chosen |
[
{
"from": "system",
"value": "Implement more TGT Neutral Legendaries\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n##\n# Minions\n\n# Confessor Paletress\nclass AT_018:\n\tinspire = Summon(CONTROLLER, RandomMinion(rarity=Rarity.LEGENDARY))\n\n\n# Skycap'n Kragg\nclass AT_070:\n\t... | python | chosen |
[
{
"from": "system",
"value": "Fix a test class name\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom tests import with_settings\nfrom tests.web.splinter import TestCase\nfrom catsnap import Client\nfrom catsnap.table.image import Image\nfrom catsnap.table.album ... | python | chosen |
[
{
"from": "system",
"value": "Add draft of DeVos solar cell power function\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom astropy import constants\nfrom astropy import units\nfrom sympy.mpmath import polylog\n\n\ndef uibei(order, energy_lo, temp, chem_pote... | python | chosen |
[
{
"from": "system",
"value": "Fix for empty lines in data sets"
},
{
"from": "human",
"value": "from typing import List\n\nimport csv\nimport os\nimport random\n\nDICT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"dicts\")\n\n\ndef dictionary_sample(name: str, sample: int = 1)... | python | chosen |
[
{
"from": "system",
"value": "Make shows and episodes only appear if published is true.\n"
},
{
"from": "human",
"value": "from flask import render_template, jsonify\n\nfrom app import app\nfrom models import Show, Episode\n\n@app.route('/')\n@app.route('/index')\ndef index():\n return render... | python | chosen |
[
{
"from": "system",
"value": "Fix travis, make sure skipif condition resolves to a bool\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nskipif_markers\n--------------\n\nContains pytest skipif markers to be used in the suite.\n\"\"\"\n\nimport pytest\... | python | chosen |
[
{
"from": "system",
"value": "Update indentation to 4 spaces\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport re\nimport time\nimport sys\nfrom threading import Thread\n\nclass testit(Thread):\n def __init__ (self,ip):\n Thread.__init__(self)\n self.ip = ... | python | chosen |
[
{
"from": "system",
"value": "Update random number generator test\n"
},
{
"from": "human",
"value": "import os\nimport mxnet as mx\nimport numpy as np\n\ndef same(a, b):\n return np.sum(a != b) == 0\n\ndef check_with_device(device):\n with mx.Context(device):\n a, b = -10, 10\n ... | python | chosen |
[
{
"from": "system",
"value": "Add set_position method to Rover\n"
},
{
"from": "human",
"value": "class Rover:\n\n compass = ['N', 'E', 'S', 'W']\n\n def __init__(self, x=0, y=0, direction='N'):\n self.x = x\n self.y = y\n self.direction = direction\n\n @property\n ... | python | chosen |
[
{
"from": "system",
"value": "Expand test on URL endpoints in API client\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom soccermetrics.rest import SoccermetricsRestClient\n\nclass ClientEndpointTest(unittest.TestCase):\n \"\"\"\n Test endpoints of API resources in client.\n \... | python | chosen |
[
{
"from": "system",
"value": "Solve deprecation warning from Traitlets\n"
},
{
"from": "human",
"value": "from unittest.mock import Mock\n\nfrom jupyterhub import orm\nfrom remoteappmanager.services.reverse_proxy import ReverseProxy\nfrom tornado import gen, testing\n\n\nclass TestReverseProxy(t... | python | chosen |
[
{
"from": "system",
"value": "Add tests for slow requests reporting configuration\n"
},
{
"from": "human",
"value": "from tg.error import ErrorReporter\n\n\ndef simple_app(environ, start_response):\n status = '200 OK'\n headers = [('Content-type', 'text/plain')]\n start_response(status,... | python | chosen |
[
{
"from": "system",
"value": "Remove vestigial hard coded production settings. These should be defined in a dotenv file, now.\n"
},
{
"from": "human",
"value": "from ._base import *\n\nSITE_PUBLIC_PORT = None # Default: SITE_PORT\n\n# DJANGO #####################################################... | python | chosen |
[
{
"from": "system",
"value": "Update JSMA test tutorial constant\n"
},
{
"from": "human",
"value": "import unittest\n\n\nclass TestMNISTTutorialJSMA(unittest.TestCase):\n def test_mnist_tutorial_jsma(self):\n from tutorials import mnist_tutorial_jsma\n\n # Run the MNIST tutorial... | python | chosen |
[
{
"from": "system",
"value": "Delete the jobs in tearDown() in tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport unittest\nfrom subprocess import Popen, PIPE\n\n\nROOT_DIR = os.path.join(os.path.dirname(__file__), \"..\")\nsys.path.append(ROOT_DIR)\n... | python | chosen |
[
{
"from": "system",
"value": "Update Django requirement to latest LTS\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-append-url-to-sql',\n description=\"Appends the request URL to SQL statements in Django.\",... | python | chosen |
[
{
"from": "system",
"value": "Add NO_PY_EXT environment variable to disable compilation of\nthe C module, which is not working very well in cross-compile\nmode.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom distutils.core import setup, Extension\n\nelp_srcs = ['src/periodic.c'... | python | chosen |
[
{
"from": "system",
"value": "Add the \"scipy\" and \"numpy\" packages as dependencies.\n\nBy specifying the dependencies of a package we allow the user to install\n\"sobol_seq\" with a single `pip install` command, even in a clean environment.\n"
},
{
"from": "human",
"value": "from setuptools ... | python | chosen |
[
{
"from": "system",
"value": "Test trigger for Travis CI\n"
},
{
"from": "human",
"value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nsettings = dict()\n\nsettings.update(\n name=\"pykwalify\",\n version=\"0.1.2\",\n description... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with path variable\n"
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\nPACKAGE_VERSION = '0.3'\n\n\ndef version():\n def version_file(mode='r'):\n return open(os.path.join(os.path.dirname(os.path.abspath(__file__), 've... | python | chosen |
[
{
"from": "system",
"value": "Add icons on package install\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nfrom distutils.core import setup\nfrom youtube_dl_gui import version\n\nsetup(name='Youtube-DLG',\n version=version.__version__,\n description='Youtube-dl GUI',\n ... | python | chosen |
[
{
"from": "system",
"value": "Switch to the \"Stable\" development status classifier\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\r\n\r\n\r\nwith open('README.md') as readme:\r\n long_description = readme.read()\r\n\r\n\r\nwith open('requirements.txt') as req... | python | chosen |
[
{
"from": "system",
"value": "Add test for one subdirectory\n"
},
{
"from": "human",
"value": "'''\nGotoNewest tests\n'''\n\nimport unittest\nimport sys\nsys.path.append('../src/')\nimport gn\n\nTEST_DIR = '/tmp/test'\n\nclass TestGotoNewest(unittest.TestCase):\n ''' Test class for GotoNewest... | python | chosen |
[
{
"from": "system",
"value": "Update requests requirement from <2.24,>=2.4.2 to >=2.4.2,<2.25\n\nUpdates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.\n- [Release notes](https://github.com/psf/requests/releases)\n- [Changelog](https://github.com/psf/requests/b... | python | chosen |
[
{
"from": "system",
"value": "Use new README.rst as package long_description\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\nfrom setuptools import setup\n\n\nif sys.argv[-1] == 'publish':\n os.system('python setup.py register sdist bdist_wheel upload')\n ... | python | chosen |
[
{
"from": "system",
"value": "Add better error support for answers file\n"
},
{
"from": "human",
"value": "import tweepy, time, random\n\ndef main():\n CONSUMER_KEY = 'your_consumer_key'\n CONSUMER_SECRET = 'your_consumer_secret'\n ACCESS_KEY = 'your_access_key'\n ACCESS_SECRET = 'yo... | python | chosen |
[
{
"from": "system",
"value": "Increment version after making parser properties non-private"
},
{
"from": "human",
"value": "import subprocess\nimport sys\n\nfrom setuptools import Command, setup\n\n\nclass RunTests(Command):\n user_options = []\n\n def initialize_options(self):\n pa... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.