conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Make test fixtures more modular\n"
},
{
"from": "human",
"value": "import logging\nimport os\n\nimport pytest\nfrom redis import Redis\n\nfrom minique.utils import get_random_pronounceable_string\n\n\ndef pytest_configure() -> None:\n logging.basicConfig(datefmt=... | python | chosen |
[
{
"from": "system",
"value": "Add option to invert `OptionalIf` validator\n\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.\n# This file is part of the Pycroft project and licensed under the terms of\n# the Apache License, Version 2.0. See the L... | python | chosen |
[
{
"from": "system",
"value": "Add approved sets for Texas Tech\n"
},
{
"from": "human",
"value": "from share.provider import OAIProviderAppConfig\n\n\nclass AppConfig(OAIProviderAppConfig):\n name = 'providers.org.ttu'\n version = '0.0.1'\n title = 'ttu'\n long_title = 'Texas Tech Un... | python | chosen |
[
{
"from": "system",
"value": "Call setup() before testing on Django 1.7+\n\nSigned-off-by: Don Naegely <e690a32c1e2176a2bfface09e204830e1b5491e3@gmail.com>\n"
},
{
"from": "human",
"value": "import os\nimport sys\n\nos.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'\n\nfrom django.core impo... | python | chosen |
[
{
"from": "system",
"value": "Allow creating AST nodes using call syntax, through signatures.\n\nBy using Python 3's signatures, we can create AST nodes using\ncall syntax, as in Name(value=...). This also improves the\nintrospection.\n"
},
{
"from": "human",
"value": "\"\"\"\n wispy.tree\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove admin site from test project.\n"
},
{
"from": "human",
"value": "from django.conf.urls import include, url\nfrom django.contrib import admin\n\nurlpatterns = [\n url(r'^admin/', admin.site.urls),\n url(r'^edtf/', include('edtf.urls', namespace='edtf'))\... | python | chosen |
[
{
"from": "system",
"value": "Test with the default test runner for all Django versions.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom django.conf import settings\n\n\nif not settings.configured:\n settings.configure(\n DATABASES={\n ... | python | chosen |
[
{
"from": "system",
"value": "Update test config for django 1.11\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Adapted from https://raw.githubusercontent.com/hzy/django-polarize/master/runtests.py\n\nimport sys\n\nfrom django.conf import settings\nfrom django.core.management impo... | python | chosen |
[
{
"from": "system",
"value": "Read log file from ENV and add full path for default\n"
},
{
"from": "human",
"value": "import os\n\nINTERVAL = int(os.environ.get('INTERVAL', 60))\nAWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']\nAWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']\nAWS... | python | chosen |
[
{
"from": "system",
"value": "Fix link being empty string in py2 if it's unicode\n\nShould fix any remaining Unicode errors.\n"
},
{
"from": "human",
"value": "from app import app\nfrom flask import render_template, request\nfrom .looper import getNextLink\n\n@app.route('/')\ndef index_page():\n... | python | chosen |
[
{
"from": "system",
"value": "Remove more commented out example code\n\n(imported from commit 83f7c8763d96af5341fe630d1d8be11eef1f33aa)\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for humbug project.\n\nThis module contains the WSGI application used by Django's development server\nand... | python | chosen |
[
{
"from": "system",
"value": "Fix for graphene ui on debug mode\n"
},
{
"from": "human",
"value": "from django.http import JsonResponse\nfrom django.utils.decorators import method_decorator\nfrom django.utils.translation import ugettext_lazy as _\nfrom graphene_django.views import GraphQLView\nf... | python | chosen |
[
{
"from": "system",
"value": "Add a function to list absolute path to demo files\n"
},
{
"from": "human",
"value": "\"\"\"\nDemonstration files --- :mod:`pbxplore.demo`\n============================================\n\nPBxplore bundles a set of demonstration files. This module ease the access to\... | python | chosen |
[
{
"from": "system",
"value": "[FIX] medical_patient_species: Remove tests for is_person (default is False, human set to True in xml).\nRe-add test ensuring warning raised if trying to unlink Human.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# © 2016 LasLabs Inc.\n# License AGPL-... | python | chosen |
[
{
"from": "system",
"value": "Use preinstalled mingw on appveyor"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Build the project on AppVeyor.\n\nimport os\nfrom download import Downloader\nfrom subprocess import check_call\n\nbuild = os.environ['BUILD']\ncmake_command = ['cmake', '-D... | python | chosen |
[
{
"from": "system",
"value": "Add str as a type for mod setter\n"
},
{
"from": "human",
"value": "\"\"\"Provide the ModAction class.\"\"\"\nfrom typing import TYPE_CHECKING\n\nfrom .base import PRAWBase\n\nif TYPE_CHECKING: # pragma: no cover\n from ... import praw\n\n\nclass ModAction(PRAWB... | python | chosen |
[
{
"from": "system",
"value": "Make directory if it doesnt exist\n"
},
{
"from": "human",
"value": "import collections\n\nLearningObject = collections.namedtuple(\n 'LearningObject',\n ['text', 'image'])\n\nclass Model(object):\n def __init__(self, name):\n self._name = name\n self._objs... | python | chosen |
[
{
"from": "system",
"value": "8: Create documentation of DataSource Settings \n\nTask-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8"
},
{
"from": "human",
"value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.... | python | chosen |
[
{
"from": "system",
"value": "Clean PostgreSQL - commit after each change not to keep state in memory\n"
},
{
"from": "human",
"value": "from selinon import StoragePool\nfrom cucoslib.models import WorkerResult, Analysis\n\nfrom .base import BaseHandler\n\n\nclass CleanPostgres(BaseHandler):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix path to test file.\n"
},
{
"from": "human",
"value": "\"\"\" Run this file to check your python installation.\n\"\"\"\nfrom os.path import dirname, join\n\nHERE = dirname(__file__)\n\ndef test_import_pandas():\n import pandas\n\n\ndef test_pandas_version():\n... | python | chosen |
[
{
"from": "system",
"value": "Add Algolia API website in docstring.\n"
},
{
"from": "human",
"value": "import requests\n\n\nclass AlgoliaEndpoint(object):\n \"\"\"Class used to call the Algolia API and parse the response.\"\"\"\n\n URL = \"http://hn.algolia.com/api/v1/search_by_date\"\n\n @st... | python | chosen |
[
{
"from": "system",
"value": "Revert \"PEP8: delete unused import\"\n\nThis reverts commit ef48c713ec8686d1be3a66d8f41c498ae1361708.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# encoding: utf-8\n\nimport sys\nimport os\n\n\n# Taken from legacy python unittest\nclass WritelnDecorat... | python | chosen |
[
{
"from": "system",
"value": "Use add_handler instead of set handlers as a list.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport unittest\n\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\nimport flask_featureflags as feature_flags\nfrom flask_featureflags.contrib.sqlalchemy im... | python | chosen |
[
{
"from": "system",
"value": "Add tests to ensure DataPackage uses base schema by default\n"
},
{
"from": "human",
"value": "import pytest\nimport datapackage\n\n\nclass TestDataPackage(object):\n def test_schema(self):\n descriptor = {}\n schema = {'foo': 'bar'}\n dp = d... | python | chosen |
[
{
"from": "system",
"value": "Add fix for time.clock removal in 3.8 for pycrypto backend\n"
},
{
"from": "human",
"value": "\ntry:\n from jose.backends.cryptography_backend import CryptographyRSAKey as RSAKey # noqa: F401\nexcept ImportError:\n try:\n from jose.backends.pycrypto_ba... | python | chosen |
[
{
"from": "system",
"value": "Set the get_odbc_engine function to check etc, then user home for odbc file by default\n"
},
{
"from": "human",
"value": "from six.moves import configparser as CP\nfrom sqlalchemy.engine.url import URL\nfrom sqlalchemy.engine import create_engine\nimport os\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Change variable names to remove conflict with standard functions\n"
},
{
"from": "human",
"value": "from random import seed as srand, randint\nfrom time import time\n\nsrand(time())\n\nclass Card:\n types = (\"def\", \"atk\")\n limits = {\"def\": (1, 25), \"at... | python | chosen |
[
{
"from": "system",
"value": "Remove select related. Django 1.8 requires existing fields instead of ignoring missing ones.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.core.cache import cache\nfrom django.conf import settings\n\nfrom .utils import bitgroup_cache_k... | python | chosen |
[
{
"from": "system",
"value": "Allow three-deep paths in Pinata\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom models import Page\n\nurlpatterns = patterns('kcdc3.apps.pinata.views',\n\n\turl(r'^$', 'page_view'),\n\turl(r'^[0-9a-zA-Z_-]+/$', 'page_vie... | python | chosen |
[
{
"from": "system",
"value": "Use persistent test DB (--keepdb can skip migrations)\n\nBy default test database is in-memory (':memory:'), i.e. not saved on\ndisk, making it impossible to skip migrations to quickly re-run tests\nwith '--keepdb' argument.\n"
},
{
"from": "human",
"value": "#\n# C... | python | chosen |
[
{
"from": "system",
"value": "Allow 0-dimensional arrays for tensor meshgrids\n"
},
{
"from": "human",
"value": "\"\"\"The WaveBlocks Project\n\nVarious small utility functions.\n\n@author: R. Bourquin\n@copyright: Copyright (C) 2012 R. Bourquin\n@license: Modified BSD License\n\"\"\"\n\nfrom nu... | python | chosen |
[
{
"from": "system",
"value": "Add renderer global 'r' as alias for 'request'.\n"
},
{
"from": "human",
"value": "from akhet.urlgenerator import URLGenerator\nimport pyramid.threadlocal as threadlocal\nfrom pyramid.exceptions import ConfigurationError\n\nfrom .lib import helpers\n\ndef includeme(... | python | chosen |
[
{
"from": "system",
"value": "Set MidgardConnection in setUp method\n"
},
{
"from": "human",
"value": "# coding=utf-8\n\nimport sys\nimport struct\nimport unittest\nfrom test_000_config import TestConfig\nfrom test_001_connection import TestConnection\n\nfrom gi.repository import Midgard\nfrom g... | python | chosen |
[
{
"from": "system",
"value": "Include sender address in completion log.\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101358 91177308-0d34-0410-b5e6-96231b3b80d8\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\nfrom socket import *\nfrom time import localtime, strf... | python | chosen |
[
{
"from": "system",
"value": "Add a version field into the header.\n"
},
{
"from": "human",
"value": "# The Header class contains the data structure of the Header class, and methods includes encapsulate, and decapsulate.\n\nimport struct\nimport random\nfrom MessageType import MessageType\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Use MongoTestCase when we have it...\n"
},
{
"from": "human",
"value": "from unittest import TestCase\n\nfrom datetime import datetime\n\nfrom citools.mongo import get_database_connection\nfrom citools.git import get_last_revision\n\nclass TestLastStoreRetrieval(Tes... | python | chosen |
[
{
"from": "system",
"value": "Make all the tokenizer unit tests assertEquals() on arrays\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom cobe.tokenizer import MegaHALTokenizer\n\nclass testMegaHALTokenizer(unittest.TestCase):\n def setUp(self):\n self.tokenizer = MegaHALToke... | python | chosen |
[
{
"from": "system",
"value": "Use Polish lables in login form.\n\nSigned-off-by: Mariusz Fik <e22610367d206dca7aa58af34ebf008b556228c5@fidano.pl>\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.contrib.admin import widgets\nfrom .models import Event\n\n\nclass LoginForm(... | python | chosen |
[
{
"from": "system",
"value": "Add note to render_plugin[s] that render_region should be preferred\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils.html import mark_safe\n\nregister = template.Library()\n\n\n@register.simple_tag(takes_context=True)\ndef render_plu... | python | chosen |
[
{
"from": "system",
"value": "Include application version info metric\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nfrom django.apps import AppConfig\n\n\nclass CommonAppConfig(AppConfig):\n name = \"common\"\n\n def ready(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Increment patch version to match submission to PyPI for pip install.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='ohmysportsfeedspy',\n packages=['ohmysportsfeedspy'],\n version='0.1.2',\n author = ['Brad Barkhous... | python | chosen |
[
{
"from": "system",
"value": "Enable latest version of basictracer"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='lightstep',\n version='4.1.0',\n description='LightStep Python OpenTracing Implementation',\n long_description='',\n au... | python | chosen |
[
{
"from": "system",
"value": "Remove mocked dependencies for readthedocs\n"
},
{
"from": "human",
"value": "from setuptools import find_packages, setup\n\nfrom dichalcogenides import __version__\n\nwith open('README.rst', 'r') as f:\n long_description = f.read()\n\nsetup(\n name='dichalcog... | python | chosen |
[
{
"from": "system",
"value": "Set Development Status to \"Stable\"\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom setuptools import find_packages\n\nsetup(name=\"django-image-cropping\",\n version=\"0.6.4\",\n description=\"A reusable app for cropping images easi... | python | chosen |
[
{
"from": "system",
"value": "Fix versioning and add scripts directory\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\ndef read(filename):\n full_path = os.path.join(os.path.dirname(__file__), filename)\n with open(full_path) as fd:\n ret... | python | chosen |
[
{
"from": "system",
"value": "Change my email to avoid Yahoo, which decided to brake my scraper script recently."
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: iso-8859-1 -*-\n\nfrom setuptools import setup\n\nsetup(\n name = 'TracMasterTickets',\n version = '2.1.1',... | python | chosen |
[
{
"from": "system",
"value": "Add a protocol to the url\n"
},
{
"from": "human",
"value": "from setuptools import setup\nsetup(\n name=\"sbq\",\n packages=[\"sbq\"],\n version=\"0.2.0\",\n description=\"Low-dependency package for automating bigquery queries.\",\n author=\"Colin Fu... | python | chosen |
[
{
"from": "system",
"value": "Add argparse as install requirement for 2.5/2.6 systems\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages ... | python | chosen |
[
{
"from": "system",
"value": "Add author, author_email & url to make pypi happy\n"
},
{
"from": "human",
"value": "# Haze\n#\n# Author: Joe Block <jpb@unixorn.net>\n# License: Apache 2.0\n\nfrom setuptools import setup, find_packages\n\nname = \"haze\"\nrequirements = map(str.strip, open(\"requi... | python | chosen |
[
{
"from": "system",
"value": "Add tests. For exclude packages\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as readme_file:\n readme = readme_file.read()\n\nwith open('HISTORY.rst') a... | python | chosen |
[
{
"from": "system",
"value": "Make the leap to v1\n"
},
{
"from": "human",
"value": "import setuptools\n\n\nREQUIREMENTS = [\n \"nose==1.3.0\",\n \"python-dateutil==1.5\",\n]\n\n\nif __name__ == \"__main__\":\n setuptools.setup(\n name=\"jsond\",\n version=\"0.0.1\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add missing package declaration to distutils\n\nThrough easy_install and pip, the r53 package is not included (just missing).\nDeclare it here so it will be included and prevent this:\n\n[jed@js route53]$ r53\nTraceback (most recent call last):\n File /usr/local/bin/r53, line ... | python | chosen |
[
{
"from": "system",
"value": "Add long description / url\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2.6\n\nimport setuptools\n\n\nsetuptools.setup(\n name='clicast',\n version='0.4.5',\n\n author='Max Zheng',\n author_email='maxzheng.os @t gmail.com',\n\n description=open('READ... | python | chosen |
[
{
"from": "system",
"value": "Include package data specified in MANIFEST\n\nNot really needed, but adding it incase we do bundle other things in future\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os\n\nfrom setuptools import find_packages, setup\n\n\ndef read(filename):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change version 0.1.5 to 0.1.6\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nfrom sys import version\nif version < '2.6.0':\n raise Exception(\"This module doesn't support any version less than 2.6\")\n\nimport sys\nsys.path.append(\"./test\")... | python | chosen |
[
{
"from": "system",
"value": "Add the test name and change testUrl to just url\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n#\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can ob... | python | chosen |
[
{
"from": "system",
"value": "Switch slumber out for forklift\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\nimport conveyor\n\n\ninstall_requires = [\n \"APScheduler\",\n \"PyYAML\",\n \"redis\",\n \"slumber\",\n \"xmlrpc2... | python | chosen |
[
{
"from": "system",
"value": "Bump version number for release.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\n\nfrom setuptools import setup\n\n\ndef readreq(filename):\n result = []\n with open(filename) as f:\n for req in f:\n req = req.partition... | python | chosen |
[
{
"from": "system",
"value": "Test getting playlist videos, too\n"
},
{
"from": "human",
"value": "import data\nfrom client import authentication_request_url, GoogleAPIClient\n\n\nc = GoogleAPIClient()\n\nif c.access_token is None:\n print 'Open the following URL in your Web browser and grant... | python | chosen |
[
{
"from": "system",
"value": "Remove cython Extension builder and build_ext from Setup\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\n\nimport numpy\n\nALGPATH = \"clusterpy/core/toolboxes/cl... | python | chosen |
[
{
"from": "system",
"value": "Remove pybitcointools in favor of bitcoin\n"
},
{
"from": "human",
"value": "\"\"\"\npybitcoin\n==============\n\n\"\"\"\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='pybitcoin',\n version='0.9.8',\n url='https://github.com/blockstack/pyb... | python | chosen |
[
{
"from": "system",
"value": "Add devel.twitter.com to PROD suffixes\n\n\n\n\n"
},
{
"from": "human",
"value": "import re\nimport socket\n\nclass Location(object):\n \"\"\"Determine which cluster the code is running in, or CORP if we are not in prod.\"\"\"\n\n PROD_SUFFIXES = [\n '.corpdc.t... | python | chosen |
[
{
"from": "system",
"value": "Update Location determination to current hostname standards.\n\n\n"
},
{
"from": "human",
"value": "import re\nimport socket\n\nclass Location(object):\n \" Determine which cluster the code is running in, or CORP if we are not in prod. \"\n\n CORP = \"corp\"\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add classes to run ./configure\n"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2004 Specifix, Inc.\n# All rights reserved\n#\nimport os\nimport shutil\nimport util\n\nclass Make:\n\n def doBuild(self, dir):\n\tos.system(\"cd %s; make\" % dir)\n\nclass MakeI... | python | chosen |
[
{
"from": "system",
"value": "Upgrade Prometheus client to fix memory leak with Python 3.7\n\nhttps://github.com/prometheus/client_python/issues/340\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name='prometheus-kafka-consumer-group-exporter',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add long description content type\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\n\ndef read(fname):\n with open(os.path.join(os.path.dirname(__file__), fname)) as f:\n return f.read()\n\n\nsetup(name='timy',\n version='0... | python | chosen |
[
{
"from": "system",
"value": "Change README content type to markdown for pypi\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\nimport setuptools\n\nwith open(\"README.md\", 'r') as f:\n long_description = f.read()\n\nsetup(\n name='chess_py',\n v... | python | chosen |
[
{
"from": "system",
"value": "Revert \"move temporally URL to juandebravo\"\n\nThis reverts commit 9325f6884c5110cf57ab8becb26eb876c7deb59c.\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\ntry:\n # HACK: Avoid \"TypeError: 'NoneType' object is not callable\"\... | python | chosen |
[
{
"from": "system",
"value": "Reset version number to 0.2.1 in preparation for making release 0.2.2 (release script bumps version number)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(name='relengapi-mapper',\n version='0.2.... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fix Python 2.7 build\" and un-pin pg8000 version on Python 2\n\nThe underlying issue has been resolved in pg8000:\n https://github.com/tlocke/pg8000/issues/7\n\nThis reverts commit f27e5a3f.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Create a complete filtered output agency.txt\n\nFilter based on arguments passed from shell.\n"
},
{
"from": "human",
"value": "import csv\nimport sys\n\n# agency.txt done\n# feed_info.txt nothing to change\n\n# calendar_dates.txt depends on service_id.\n# routes.tx... | python | chosen |
[
{
"from": "system",
"value": "Update to use new bmi model.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport sys\nimport numpy as np\n\nfrom bmi import MyBMI\n\ndef print_var_values (bmi, var_name):\n s = ', '.join ([str (x) for x in b... | python | chosen |
[
{
"from": "system",
"value": "Allow glfw.init() to fail on CI as well"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.fixture\ndef pyglui_ui_instance():\n import glfw\n\n from pyglui import cygl, ui\n\n glfw.ERROR_REPORTING = \"raise\"\n glfw_init_successful = glfw.init()... | python | chosen |
[
{
"from": "system",
"value": "Fix test edit magic test\n"
},
{
"from": "human",
"value": "\nfrom metakernel.tests.utils import (get_kernel, get_log_text, \n clear_log_text, EvalKernel)\n\ndef test_edit_magic():\n kernel = get_kernel(EvalKernel)\n results ... | python | chosen |
[
{
"from": "system",
"value": "Add a helper to Country; should go upstream prolly\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom postgres.orm import Model\n\n\nclass Country(Model):\n \"\"\"Represent country records... | python | chosen |
[
{
"from": "system",
"value": "Improve error message for CISD\n"
},
{
"from": "human",
"value": "from cisd import CISD\n"
},
{
"from": "gpt",
"value": "from pyscf.ci import cisd\n\ndef CISD(mf, frozen=[], mo_coeff=None, mo_occ=None):\n from pyscf import scf\n if isinstance(mf, (... | python | chosen |
[
{
"from": "system",
"value": "Mark initial migration so django knows to skip it.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix getting snapshotsoftware on old snapshots\n"
},
{
"from": "human",
"value": "from pydash import find\n\nfrom ereuse_devicehub.resources.device.domain import DeviceDomain\nfrom ereuse_devicehub.resources.event.device import DeviceEventDomain\nfrom ereuse_devicehu... | python | chosen |
[
{
"from": "system",
"value": "Fix python library problem due to ABI tagged .so files\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n\"\"\"\nsetup.py file for compiling Infomap module\n\"\"\"\n\nfrom distutils.core import setup, Extension\nimport fnmatch\nimport os\nimport re\n\ncppS... | python | chosen |
[
{
"from": "system",
"value": "Fix unintended late finalization of memoized functions\n"
},
{
"from": "human",
"value": "import atexit\nimport functools\n\nfrom cupy import cuda\n\n\n_memoized_funcs = []\n\n\ndef memoize(for_each_device=False):\n \"\"\"Makes a function memoizing the result for... | python | chosen |
[
{
"from": "system",
"value": "Add more patterns to be handled in the slug\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\n\nimport core.views\n\nurlpatterns = [\n url(r'^u/(?P<slug>[\\w-\\.]+)/?$', core.views.run_fn, name=\"run_fn\"),\n]\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Update version and copyright year.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\nfrom sphinx_celery import conf\n\nglobals().update(conf.build_config(\n 'kombu', __file__,\n project='Kom... | python | chosen |
[
{
"from": "system",
"value": "Convert reply from bytes to string\n\nThe GET message reply is a byte string and it needs to be converted to\na string before being passed to the JSON parser.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Unit tests for the Master Controller REST... | python | chosen |
[
{
"from": "system",
"value": "Add number in string format\nFor python 2.6 compatibility"
},
{
"from": "human",
"value": "import unittest\nfrom robber import expect\nfrom robber.matchers.contain import Contain\n\nclass TestAbove(unittest.TestCase):\n def test_matches(self):\n expect(Con... | python | chosen |
[
{
"from": "system",
"value": "Return empty list for non-logged in users. "
},
{
"from": "human",
"value": "from flask import request\nfrom flask.ext.login import current_user\nfrom werkzeug.exceptions import Forbidden\n\n\ndef request_collections(action):\n try:\n return request.collec... | python | chosen |
[
{
"from": "system",
"value": "Remove import random now that it's not being used\n"
},
{
"from": "human",
"value": "import random\nimport re\nfrom twitterbot import TwitterBot\nimport wikipedia\n\n\nclass Genderbot(TwitterBot):\n boring_article_regex = (r\"municipality|village|town|football|genu... | python | chosen |
[
{
"from": "system",
"value": "Use test.touch() instead of os.utime() in a test.\n\nNo intended functionality change.\n\nTBR=evan\nReview URL: https://chromiumcodereview.appspot.com/9234034"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (c) 2012 Google Inc. All rights reser... | python | chosen |
[
{
"from": "system",
"value": "Convert to py3, fix style issues (flake8, pylint).\n"
},
{
"from": "human",
"value": "import argparse\nimport os\nimport re\nimport sys\n\ndef main(cmdline):\n\n parser = argparse.ArgumentParser(\n description='Ensure zero padding in numbering of files.')\... | python | chosen |
[
{
"from": "system",
"value": "Make channel an optional parameter\n\nRPi.GPIO supports calling cleanup() without parameters to cleanup\nall gpios used in the session. By adding \"=None\" warnings about\nmissing parameters are ignored.\n"
},
{
"from": "human",
"value": "def cleanup(channel_or_chan... | python | chosen |
[
{
"from": "system",
"value": "Fix the network service provider test\n\nThis test was pretty lame before since it just verified that\nthe result was a string. Now it verifies that at least one\nservice provider exists and I think I picked one that should\nbe aroudn for a while. The test failure message als... | python | chosen |
[
{
"from": "system",
"value": "Add url mapping for github callback\n"
},
{
"from": "human",
"value": "\"\"\"ssoproject URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.9/topics/http/urls/\nExamples:\nFuncti... | python | chosen |
[
{
"from": "system",
"value": "Fix not being able to delete contacts\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\r\n\r\nfrom lily.contacts.views import (JsonContactListView, AddContactView, EditContactView, DetailContactView,\r\n D... | python | chosen |
[
{
"from": "system",
"value": "Make basestring work in Python 3\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# encoding: utf-8\n\nfrom __future__ import absolute_import\n\nimport urllib\nfrom .base import AuthenticationMixinBase\nfrom . import GrantFailed\n\nclass AuthorizationCodeM... | python | chosen |
[
{
"from": "system",
"value": "Remove \"versions\" panel from django-debug-toolbar.\n\nThe \"Versions\" panel of django-debug-toolbar is not compatible with\nwagtailmenus (see\nhttps://github.com/jazzband/django-debug-toolbar/issues/922 and\nhttps://github.com/rkhleics/wagtailmenus/issues/115).\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Fix library name in Latex.\n"
},
{
"from": "human",
"value": "import sys\nimport os\nimport shlex\nimport subprocess\n\nread_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'\n\nif read_the_docs_build:\n subprocess.call('doxygen', shell=True)\n\nexte... | python | chosen |
[
{
"from": "system",
"value": "Terminate viz process at end of experiment.\n"
},
{
"from": "human",
"value": "'''Main file for running experiments.\n\n'''\n\n\nimport logging\n\nfrom cortex._lib import (config, data, exp, optimizer, setup_cortex,\n setup_experiment, train)... | python | chosen |
[
{
"from": "system",
"value": "Use explicit kwarg over kwargs dictionary access\n"
},
{
"from": "human",
"value": "from django.views.generic import RedirectView\n\n\nclass RouteRedirectView(RedirectView):\n \"\"\"Redirect to the target Route.\"\"\"\n permanent = False # Set to django 1.9's... | python | chosen |
[
{
"from": "system",
"value": "Make default saving option relative\n\nSaving workflows with wd=True only works when you use a working dir.\nSince this is optional, it makes more sense to use relative paths\n(and assume the user uses the nlppln CWL_PATH to save their workflows).\n"
},
{
"from": "human... | python | chosen |
[
{
"from": "system",
"value": "Fix sensor to be active high\n"
},
{
"from": "human",
"value": "\"\"\"\nClass for communicating with the GrovePi ultrasonic ranger.\n\nHere we treat it as a binary sensor.\n\"\"\"\n\nimport logging\nlogging.basicConfig()\nLOGGER = logging.getLogger(__name__)\nLOGGER... | python | chosen |
[
{
"from": "system",
"value": "Allow the Mapreduce status UI to function when a CSP is enforced with django-csp.\n"
},
{
"from": "human",
"value": "from django.conf.urls import url\nfrom djangae.utils import djangae_webapp\n\nfrom django.views.decorators.csrf import csrf_exempt\n\ntry:\n from ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.