conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Document the xyplot function and support data dict\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python2.7\n\"\"\"Avoid some boilerplate rpy2 usage code with helpers.\n\nMostly I wrote this so that I can use xyplot without having\nto remember a lot of details.\... | python | chosen |
[
{
"from": "system",
"value": "Prepend '/' to urls gotten from asset_url() to make them absolute. This fixes /projects/* documentation not displaying correctly.\n"
},
{
"from": "human",
"value": "class Integration:\n def __init__(self, env):\n \"\"\"\n :type env: webassets.Enviro... | python | chosen |
[
{
"from": "system",
"value": "Add new validators to SPA"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib.auth.models import User\n\nfrom kitabu.models.subjects import VariableSizeSubject, BaseSubject\nfrom kitabu.models.reservations import ReservationMaybeExclus... | python | chosen |
[
{
"from": "system",
"value": "Add web function for add new directory\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Eduardo Klosowski\n# License: MIT (see LICENSE for details)\n#\n\nfrom flask import Flask, render_template\nimport jinja2\n\nfrom .. import Dir... | python | chosen |
[
{
"from": "system",
"value": "Remove unused LOG in websocket\n\nChange-Id: Ic45e5e4353dd816fd5416b880aa47df8542b2e02\n"
},
{
"from": "human",
"value": "# Copyright 2017 Linaro Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file ex... | python | chosen |
[
{
"from": "system",
"value": "Fix for usernames with capital letters"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\nfrom .views import block_view, unblock_ip_view, unblock_username_view\n\nurlpatterns = patterns(\n '',\n url(r'^blocks/$', block_view,\n ... | python | chosen |
[
{
"from": "system",
"value": "Indent return in identify class.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# A class for auto identifying bioinformatics file formats.\n# By Lee & Matt\n\nimport re\nimport json\nimport mmap\n\n\nclass BioID:\n defs = None\n\n def __init__(s... | python | chosen |
[
{
"from": "system",
"value": "Modify the Page parameter with url supplied\n"
},
{
"from": "human",
"value": "'''\nfrom pycrawl import crawler\n\n# Execute variants\npage = crawler.grab('http://www.pasarpanda.com')\npage = crawler.from_file('file.html')\npage = crawler.from_text(\"<html></html>\"... | python | chosen |
[
{
"from": "system",
"value": "Allow Cuneiform to do full page conversions. Downsides: 1) it crashes on quite a lot of pages 2) there's no progress output\n"
},
{
"from": "human",
"value": "\"\"\"\nWrapper for Cuneiform.\n\"\"\"\n\n\n\nfrom generic_wrapper import *\n\ndef main_class():\n retu... | python | chosen |
[
{
"from": "system",
"value": "Read secret from correct location\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango settings for pc_datamanger project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/topics/settings/\n\nFor the full list of settings and their value... | python | chosen |
[
{
"from": "system",
"value": "Bump version to 1.3.0-dev after releasing 1.2\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n__version_info__ = (1, 2, 0, 'dev')\n\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join([str(i) for i in... | python | chosen |
[
{
"from": "system",
"value": "Add status column to Log model\n"
},
{
"from": "human",
"value": "from datetime import datetime\nfrom har import db\n\n\nclass Log(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n subject_id = db.Column(db.Integer, db.ForeignKey('subject.device'))\n... | python | chosen |
[
{
"from": "system",
"value": "Bump version number to 3.0.1\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(name='mailosaur',\n version='3.0',\n description='Python client library for Mailosaur',\n url='https://mailosaur.com',\n author='Clickity Ltd',\... | python | chosen |
[
{
"from": "system",
"value": "Include the serializer adapters in the PyPI package\n"
},
{
"from": "human",
"value": "from distutils.core import setup\n\nsetup(\n name='hy-py',\n version='0.0.2',\n packages=['hy'],\n license='MIT',\n author='Joakim Ekberg',\n author_email='jocke... | python | chosen |
[
{
"from": "system",
"value": "Fix version to conform to semver standard\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n__version__ = '0.10'\n\nsetup(name='GuessThatSong',\n version=__version__,\n install_requires=['Flask==0.12.1',\n\t\t\t\t\... | python | chosen |
[
{
"from": "system",
"value": "Add requirement of h5py and phonopy\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom distutils.core import setup\n\npackages = [\n 'upho',\n 'upho.phonon',\n 'upho.harmonic',\n 'upho.analysis',\n 'upho.structure',\n 'upho.irreps',\n ... | python | chosen |
[
{
"from": "system",
"value": "Update splash view to use visible() method.\n"
},
{
"from": "human",
"value": "from django.shortcuts import get_object_or_404\nimport jingo\n\nfrom challenges.models import Submission, Category\nfrom projects.models import Project\n\n\ndef splash(request, project, s... | python | chosen |
[
{
"from": "system",
"value": "Add unit test to get opts from the environment\n"
},
{
"from": "human",
"value": "# coding=utf-8\n'''\nTest case for utils/__init__.py\n'''\nfrom __future__ import unicode_literals, print_function, absolute_import\nfrom tests.support.unit import TestCase, skipIf\nfr... | python | chosen |
[
{
"from": "system",
"value": "Add license, long description and fix classifiers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf-8\n__author__ = 'kulakov.ilya@gmail.com'\n\nfrom setuptools import setup\nfrom sys import platform\n\n\nREQUIREMENTS = []\n\n\nif platform.start... | python | chosen |
[
{
"from": "system",
"value": "Add pyscopg2 to list of dependencies\n\n\nFormer-commit-id: afed58eea17319b11e3fafc1ef45c7cdf590fac0\nFormer-commit-id: 257ed272462ca52cc15bae9040296ace91e15843 [formerly 19b9a870795fb176a9fb49b427a00b70fc6e2b35] [formerly 5b2ece2b396282c63c2902d6128e3a1f2c982708 [formerly 1a66... | python | chosen |
[
{
"from": "system",
"value": "Add gcsfs, tensorflow-datasets, zarr as dependencies.\n\nPiperOrigin-RevId: 414517642\n"
},
{
"from": "human",
"value": "# coding=utf-8\n# Copyright 2021 The Balloon Learning Environment Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")... | python | chosen |
[
{
"from": "system",
"value": "Set up release to mesh-tensorflow 0.0.4.\n\nPiperOrigin-RevId: 221204704\n"
},
{
"from": "human",
"value": "\"\"\"Install Mesh TensorFlow.\"\"\"\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\nsetup(\n name='mesh-tensorflow',\n version... | python | chosen |
[
{
"from": "system",
"value": "Add scipy in requirements list\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(name='pygraphc',\n version='0.0.1',\n description='Event log clustering in Python',\n long_description='This package contains event log clustering ... | python | chosen |
[
{
"from": "system",
"value": "Update requests to address security concern\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(name='citrination-client',\n version='4.6.0',\n url='http://github.com/CitrineInformatics/python-citrination-client',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add pysqlite to the dependencies\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python \n# -*- coding: utf-8 -*- \n#\n#\n# Copyright 2012 ShopWiki\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compl... | python | chosen |
[
{
"from": "system",
"value": "Add a \"signature requirement\" to the sdist upload command.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nfrom setuptools import setup\n\n\nPACKAGENAME = 'preconditions'\n\n\nsetup(\n name=PACKAGENAME,\n description='Flexible, concise precondit... | python | chosen |
[
{
"from": "system",
"value": "Remove changelog from release description\n"
},
{
"from": "human",
"value": "\"\"\"\nsetup.py for Flask-Limiter\n\n\n\"\"\"\n__author__ = \"Ali-Akber Saifee\"\n__email__ = \"ali@indydevs.org\"\n__copyright__ = \"Copyright 2014, Ali-Akber Saifee\"\n\nfrom setuptools ... | python | chosen |
[
{
"from": "system",
"value": "Tag version v1.0.0 -- first extracted version\n"
},
{
"from": "human",
"value": "from distutils.core import setup\nimport os\n\npackage_data = []\nBASE_DIR = os.path.dirname(__file__)\nwalk_generator = os.walk(os.path.join(BASE_DIR, \"project_template\"))\npaths_and... | python | chosen |
[
{
"from": "system",
"value": "Prepare for 0.9.5 on pypi\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='livescrape',\n version='0.9.4',\n url='https://github.com/ondergetekende/python-livescrape',\n description='A toolkit to build pythonic web scrape... | python | chosen |
[
{
"from": "system",
"value": "Change version with better package documentation\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport multiprocessing\n\nversion = '0.2.0'\n\ninstall_requires = [\"scipy >= 0.13.3\",\n \"numpy >=1.8.1\"]\ntests_require = [\"nose... | python | chosen |
[
{
"from": "system",
"value": "Add install-time error message for Python 3.1 and earlier.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(name='jump_consistent_hash',\n version='1.0.0',\n description='Implementation of the Jump Consistent Hash algorithm',\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix a hard-coded version number\n"
},
{
"from": "human",
"value": "from distutils.core import setup # setuptools breaks\n\n# Dynamically calculate the version based on knowledge.VERSION\nversion_tuple = __import__('rest_hooks').VERSION\nversion = '1.0.4' #'.'.join([... | python | chosen |
[
{
"from": "system",
"value": "Adjust version in download url\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='Que... | python | chosen |
[
{
"from": "system",
"value": "Include pcbmode_config.json file in package\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nsetup(\n name = \"pcbmode\",\n packages = find_packages(),\n use_scm_version=True,\n setup_requires=['setuptools_scm'],\n\n ins... | python | chosen |
[
{
"from": "system",
"value": "Handle both forms of next links\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom urllib.parse import urljoin\nfrom urllib.request import urlopen, Request\nimport json\nimport codecs\n\nreader = codecs.getreader(\"utf-8\")\n\ndef crawl(collection_url):... | python | chosen |
[
{
"from": "system",
"value": "Add back mirror for image tests"
},
{
"from": "human",
"value": "import matplotlib\nfrom matplotlib import pyplot as plt\n\nfrom ..utils.decorators import wraps\n\nMPL_VERSION = matplotlib.__version__\n\nROOT = \"http://{server}/testing/astropy/2018-02-01T23:31:45.0... | python | chosen |
[
{
"from": "system",
"value": "Undo revision changes to previous migration\n"
},
{
"from": "human",
"value": "\"\"\"add last_modified column for events\n\nRevision ID: 54dcea22a268\nRevises: 41f957b595fc\nCreate Date: 2015-03-16 23:15:55.908307\n\n\"\"\"\n\n# revision identifiers, used by Alembic... | python | chosen |
[
{
"from": "system",
"value": "Update dots lineplot example to use relplot\n"
},
{
"from": "human",
"value": "\"\"\"\nLine plots on multiple facets\n=============================\n\n_thumb: .45, .42\n\n\"\"\"\nimport seaborn as sns\nsns.set(style=\"ticks\")\n\ndots = sns.load_dataset(\"dots\")\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix to allow invocation by `python unnaturalcode/http`\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright (C) 2014 Eddie Antonio Santos\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU ... | python | chosen |
[
{
"from": "system",
"value": "DOC: Fix unicode in citation (again)\n"
},
{
"from": "human",
"value": "\"\"\"\nDefine citations for ESPEI\n\"\"\"\n\nESPEI_CITATION = \"B. Bocklund, R. Otis, A. Egorov, A. Obaied, I. Roslyakova, Z.-K. Liu, ESPEI for efficient thermodynamic database development, mod... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Clean results task Health Check\"\n\nThis reverts commit 4d4148ea831d425327a3047ebb9be8c3129eaff6.\n\nClose #269\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\nfrom health_check.backends import BaseHealthCheckBackend\nfrom health_che... | python | chosen |
[
{
"from": "system",
"value": "Add tags and filters into the context\n"
},
{
"from": "human",
"value": "\nimport ast\n\nfrom . import parse\n\n\nclass Template:\n def __init__(self, raw):\n self.raw = raw\n self.parser = parse.Parser(raw)\n self.nodelist = self.parser()\n\... | python | chosen |
[
{
"from": "system",
"value": "Update params decorator with basic error checking.\n"
},
{
"from": "human",
"value": "\"\"\"\nSimple utilities for creating Bayesian optimization components.\n\"\"\"\n\n# future imports\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom _... | python | chosen |
[
{
"from": "system",
"value": "Throw 500 error on multiple accounts in account context processor\n\ngit-svn-id: 51ba99f60490c2ee9ba726ccda75a38950f5105d@1121 45601e1e-1555-4799-bd40-45c8c71eef50\n"
},
{
"from": "human",
"value": "\nfrom account.models import Account, AnonymousAccount\n\ndef openi... | python | chosen |
[
{
"from": "system",
"value": "Test that the registry's root has a null parent\n"
},
{
"from": "human",
"value": "# Pytest will pick up this module automatically when running just \"pytest\".\n#\n# Each test_*() function gets passed test fixtures, which are defined\n# in conftest.py. So, a funct... | python | chosen |
[
{
"from": "system",
"value": "Disable the \"draw properties\" benchmark\n\nWe'd still like to be able to run this benchmark manually, but we don't\nneed it to be run automatically.\n\nBUG=None\nCQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_perf_bisect;tryserver.chrom... | python | chosen |
[
{
"from": "system",
"value": "Add builds to project api\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom .models import Build, BuildResult, Project\n\n\nclass ProjectSerializer(serializers.ModelSerializer):\n\n class Meta:\n model = Project\n fie... | python | chosen |
[
{
"from": "system",
"value": "Add unit test for successful completion.\n"
},
{
"from": "human",
"value": "import json\nfrom base64 import b64encode\n\nimport pytest\nfrom flask import Flask\n\nfrom flask_authorization_panda import basic_auth\n\n\n@pytest.fixture\ndef flask_app():\n app = Flas... | python | chosen |
[
{
"from": "system",
"value": "Change assignment to boolean equals"
},
{
"from": "human",
"value": "from genes import apt\nimport platform\n\nclass Config:\n OS = platform.system()\n (DIST, _, CODE) = platform.linux_distribution()\n REPO = DIST.lower() + '-' + CODE\n\ndef main():\n if... | python | chosen |
[
{
"from": "system",
"value": "[CIKit] Add \"-h\" and \"-v\" to mutually exclusive group\n"
},
{
"from": "human",
"value": "from os import path\nfrom actions import VersionAction\nfrom argparse import ArgumentParser\nfrom functions import parse_extra_vars\n\nparser = ArgumentParser(\n prog='ci... | python | chosen |
[
{
"from": "system",
"value": "Add description and test build stage\n\n"
},
{
"from": "human",
"value": "from conans import ConanFile, CMake\n\nclass Core8(ConanFile):\n name = \"core8\"\n version = \"0.1\"\n url = \"https://github.com/benvenutti/core8.git\"\n settings = \"os\", \"com... | python | chosen |
[
{
"from": "system",
"value": "Handle no config.yaml in migrations\n"
},
{
"from": "human",
"value": "\"\"\"\nMigrate config to docker hosts list\n\"\"\"\nimport os\nimport yaml\n\n\nfilename = os.path.join('data', 'configs.yaml')\nwith open(filename) as handle:\n data = yaml.load(handle)\n\nh... | python | chosen |
[
{
"from": "system",
"value": "Configure WhiteNoise to serve static files\n"
},
{
"from": "human",
"value": "\"\"\"\nWSGI config for project project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangopro... | python | chosen |
[
{
"from": "system",
"value": "Reset the num threads to the env variable, not the default\n"
},
{
"from": "human",
"value": "from numba.np.ufunc.parallel import get_thread_count\nfrom os import environ as env\nfrom numba.core import config\nimport unittest\n\n\nclass TestParallelEnvVariable(unitt... | python | chosen |
[
{
"from": "system",
"value": "feat: Add function to remove reacted to urls\n"
},
{
"from": "human",
"value": "from . import parser\nfrom . import printer\nfrom . import firebase as fb\nfrom . import reaction as react\n\n\ndef is_empty(events):\n return ((events is None) or (len(events) == 0))... | python | chosen |
[
{
"from": "system",
"value": "Change the test for pureelk in elasticsearch\n\nIt makes more sense to test for a specific index pattern rather than\npureelk-global-arrays index. The reason is if someone never adds an\narray startup code will try to re-add .kibana data\n"
},
{
"from": "human",
"va... | python | chosen |
[
{
"from": "system",
"value": "Add super call to db Base class\n\nWithout this call, multiple inheritance involving the db Base\nclass does not work correctly.\n\nChange-Id: Iac6b99d34f00babb8b66fede4977bf75f0ed61d4\n"
},
{
"from": "human",
"value": "# Copyright 2010 United States Government as r... | python | chosen |
[
{
"from": "system",
"value": "[r] Make must_fail fully compatible with nose\n\nOriginally, whenever you run a must_fail test alone and directly\nwith nose, you would get this error message:\n'ValueError: no such test method in <test reference>: test_decorated'\n"
},
{
"from": "human",
"value": "... | python | chosen |
[
{
"from": "system",
"value": "Fix mypy error by asserting\n\nSince we just asked `is_panel_active`, the following `find_output_panel`\n*must* succeed. So we `assert panel` to tell it mypy.\n"
},
{
"from": "human",
"value": "import sublime\nimport sublime_plugin\n\nPANEL_NAME = \"SublimeLinter M... | python | chosen |
[
{
"from": "system",
"value": "Return empty list if nothing found\n"
},
{
"from": "human",
"value": "'''\r\nCreated on 17-sep.-2012\r\n\r\n@author: ldevocht\r\n'''\r\nimport urllib.request\r\nimport urllib.parse\r\nimport lxml.objectify\r\nimport logging\r\n\r\nlogger = logging.getLogger('pathFin... | python | chosen |
[
{
"from": "system",
"value": "Use `django.templatetags.static`to load the file\n\nDebugging this issue: https://github.com/timmyomahony/django-pagedown/issues/25"
},
{
"from": "human",
"value": "from django.conf import settings\n\n\ndef compatible_staticpath(path):\n '''\n Try to return a ... | python | chosen |
[
{
"from": "system",
"value": "Add import for marked to tests\n"
},
{
"from": "human",
"value": "import unittest\n\n\nclass MarkedTests(unittest.TestCase):\n pass\n\n\nif __name__ == '__main__':\n unittest.main()\n"
},
{
"from": "gpt",
"value": "import unittest\n\nimport marked\... | python | chosen |
[
{
"from": "system",
"value": "Fix nbt._get_version()\nFunction did not work (it tried to join integers as a string)\nAlso re-order __all__ for documentation purposes\n"
},
{
"from": "human",
"value": "__all__ = [\"chunk\", \"region\", \"world\", \"nbt\"]\nfrom . import *\n\nVERSION = (1, 3)\n\nd... | python | chosen |
[
{
"from": "system",
"value": "Add role removal and logic cleanup\n"
},
{
"from": "human",
"value": "import discord\nimport shlex\n\nrolesTriggerString = '!role' # String to listen for as trigger\n\nasync def parse_roles_command(message, client):\n server_roles = message.server.roles # Grab a ... | python | chosen |
[
{
"from": "system",
"value": "Use isinstance to check type\n\nThis should also allow to use subtypes like a SortedDict\nto pass in headers.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\nfrom .base import BaseDataset\n\nclass SimpleDataset(BaseDataset):\n def __i... | python | chosen |
[
{
"from": "system",
"value": "Add extra missing items to the entity"
},
{
"from": "human",
"value": "from mangopaysdk.entities.entitybase import EntityBase\n\n\nclass Card(EntityBase):\n \"\"\"Card entity\"\"\"\n \n def __init__(self, id = None):\n # MMYY\n self.Expiration... | python | chosen |
[
{
"from": "system",
"value": "Fix test for no connection\n- In the case of no connectivity, test will skip rather than fail\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.test import override_settings\n\nfrom asana.error... | python | chosen |
[
{
"from": "system",
"value": "TEST allink_apps subtree - pulling\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.contrib import admin\nfrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom parler.admin import TranslatableTabularInline\n... | python | chosen |
[
{
"from": "system",
"value": "Store task in the criterion base class\n\nSummary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/737\n\nDifferential Revision: D16377805\n\nPulled By: myleott\n\nfbshipit-source-id: 1e090a02ff4fbba8695173f57d3cc5b88ae98bbf\n"
},
{
"from": "human... | python | chosen |
[
{
"from": "system",
"value": "Implement scheduled task handling in Slack\n"
},
{
"from": "human",
"value": "import time\nimport importlib\n\nimport pmxbot\n\n\nclass Bot(pmxbot.core.Bot):\n\tdef __init__(self, server, port, nickname, channels, password=None):\n\t\ttoken = pmxbot.config['slack to... | python | chosen |
[
{
"from": "system",
"value": "Fix styling issue in URLConf.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns\nfrom django.conf.urls.defaults import url\n\n\nurlpatterns = patterns('pytask.profile.views',\n url(r'^view/$', 'view_profile', name='view_profile'),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a simple test to make sure cookiecutter comes with jinja2_time\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom cookiecutter.environment import StrictEnvironment\nfrom cookiecutter.exceptions import UnknownExtension\n\n\ndef te... | python | chosen |
[
{
"from": "system",
"value": "Fix error handing to be python 3 compatible\n"
},
{
"from": "human",
"value": "from django.utils import timezone\nfrom rest_framework import serializers\nfrom reports.utils import midnight, midnight_validator, one_month_after\n\n\nclass ReportGenerationSerializer(se... | python | chosen |
[
{
"from": "system",
"value": "Make _get_property to return none when name does not exist\n"
},
{
"from": "human",
"value": "class Base(dict):\n\n def _get_property(self, name):\n \"\"\"Return the named property from dictionary values.\"\"\"\n if not self[name]:\n retu... | python | chosen |
[
{
"from": "system",
"value": "Handle unicode and string creation correctly\n"
},
{
"from": "human",
"value": "\"\"\"PyWXSB -- Python W3C XML Schema Bindings.\n\nbinding - Module used to generate the bindings and at runtime to\nsupport the generated bindings\n\nutils - Common utilities used in pa... | python | chosen |
[
{
"from": "system",
"value": "Fix issue with Python bindings caused by introduction of CI20 platform\n\nthis adds ci20.c to the compile path for Python bindings, otherwise you\nget the following:\n\nImportError:\n/usr/lib/python3.4/site-packages/wiringX/gpio.cpython-34m.so: undefined\nsymbol: ci20Init\n"
... | python | chosen |
[
{
"from": "system",
"value": "Fix url pattern for category's slug\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, url\n\nfrom . import views\n\n\nurlpatterns = [\n url(r'^(?P<slug>[a-z0-9-]+?)-(?P<product_id>[0-9]+)/$',\n views.product_details, name='details')... | python | chosen |
[
{
"from": "system",
"value": "Fix Python 2.5 support in tests\n"
},
{
"from": "human",
"value": "from gears.asset_handler import AssetHandlerError, ExecMixin\nfrom mock import patch, Mock\nfrom unittest2 import TestCase\n\n\nclass Exec(ExecMixin):\n executable = 'program'\n\n\nclass ExecMixin... | python | chosen |
[
{
"from": "system",
"value": "Add wait for pagination test\n"
},
{
"from": "human",
"value": "import unittest\nimport sys\nimport os\n\ntry:\n from instagram_private_api_extensions import pagination\nexcept ImportError:\n sys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n ... | python | chosen |
[
{
"from": "system",
"value": "Update the modified ABCMeta to copy docstrings to abstractmethods.\n"
},
{
"from": "human",
"value": "\"\"\"\nModifications to ABC to allow for additional metaclass actions.\n\"\"\"\n\n# future imports\nfrom __future__ import division\nfrom __future__ import absolut... | python | chosen |
[
{
"from": "system",
"value": "Allow disabling password and token auth on jupyter notebooks"
},
{
"from": "human",
"value": "# Copyright 2015 The TensorFlow 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... | python | chosen |
[
{
"from": "system",
"value": "Fix mismatch opening and closing quotes on a string.\n"
},
{
"from": "human",
"value": "\nimport sys\n\nif sys.platform != 'darwin':\n raise ValueError, \"This test only leaks on Mac OS X'\n\ndef leak():\n # taken from platform._mac_ver_lookup()\n from gest... | python | chosen |
[
{
"from": "system",
"value": "Add coffee status to API\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.views.generic import View\n\n\nfrom .utils import apimethod\n\n# Create your views here.\n\nclass StatusView(View):\n @apimethod\n def get(self, reques... | python | chosen |
[
{
"from": "system",
"value": "Add magic for RE(...) calls\n"
},
{
"from": "human",
"value": "from ophyd.commands import setup_ophyd\nsetup_ophyd()\n\nfrom ophyd.commands import *\nfrom bluesky.callbacks import *\nfrom bluesky.plans import *\n# from bluesky.spec_api import *\nfrom bluesky.utils i... | python | chosen |
[
{
"from": "system",
"value": "Add some flags to nbgrader assign\n"
},
{
"from": "human",
"value": "from IPython.config.loader import Config\nfrom IPython.config.application import catch_config_error\nfrom IPython.utils.traitlets import Unicode\nfrom nbgrader.apps.customnbconvertapp import Custom... | python | chosen |
[
{
"from": "system",
"value": "Make the run system task more error friendly\n"
},
{
"from": "human",
"value": "import sys\nimport bson.objectid\nimport config.global_configuration as global_conf\nimport database.client\nimport batch_analysis.trial_runner as trial_runner\n\n\ndef main(*args):\n ... | python | chosen |
[
{
"from": "system",
"value": "[IMPR] Add hiwikivoyage to the list of global bot wikis\n\nhttps://meta.wikimedia.org/wiki/Bot_policy/Implementation\n\nChange-Id: I25246991c177ce499bb63e4dfff46cb03d8e9f59\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Family module for Wikivoyag... | python | chosen |
[
{
"from": "system",
"value": "Add dummy class to test generate_ordinates\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport datac\nimport numpy as np\nimport os\n\nparams = {\"temp_sun\": 6000.}\nbandgaps = np.linspace(0, 3.25, 100)\n\nabscissae = datac.generate_abscissae(bandgap... | python | chosen |
[
{
"from": "system",
"value": "Fix expected failure decorator in test.\n"
},
{
"from": "human",
"value": "import pytest\n\nimport chatexchange\nfrom chatexchange.events import MessageEdited\n\nimport live_testing\n\n\nif live_testing:\n @pytest.mark.xfail(\"not implemented yet\")\n def test... | python | chosen |
[
{
"from": "system",
"value": "Restructure the valid_paths list into a dict.\n"
},
{
"from": "human",
"value": "\"\"\" fedmsg-notifications internal API \"\"\"\n\nimport fmn.lib.models\n\nimport logging\nlog = logging.getLogger(__name__)\n\n\ndef recipients(session, config, message):\n \"\"\" ... | python | chosen |
[
{
"from": "system",
"value": "Return 404 NOT FOUND if no match could be found\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom flask import Flask, abort, make_response, request\nfrom pigeon import PigeonStore\nfrom socket import inet_aton, error as socket_error\n\napp = Flask(__n... | python | chosen |
[
{
"from": "system",
"value": "Add is_label_name field to Feature model\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.utils import timezone\n\nclass Dataset(models.Model):\n name = models.CharField(max_length=100, default='')\n description = models.CharField(m... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for Preprocess constructors\n"
},
{
"from": "human",
"value": "import unittest\nfrom mock import Mock, MagicMock, patch\n\nimport Orange\n\n\nclass TestPreprocess(unittest.TestCase):\n def test_read_data_calls_reader(self):\n class MockPreprocess... | python | chosen |
[
{
"from": "system",
"value": "Make auto-incrementing event names work with a mixture of numeric and non-numeric event names\n"
},
{
"from": "human",
"value": "import ckan.logic as logic\nimport ckan.plugins.toolkit as toolkit\n\n\ndef event_create(context, data_dict):\n \"\"\" Creates a 'even... | python | chosen |
[
{
"from": "system",
"value": "Add a naive implementation of the predict command\n"
},
{
"from": "human",
"value": "import click\n\n\n@click.group()\n@click.version_option()\ndef cli():\n pass\n"
},
{
"from": "gpt",
"value": "import click\n\nfrom .loader import load_yaml\nfrom .blu... | python | chosen |
[
{
"from": "system",
"value": "Move clowder_test directory setup to post arg parse hook\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"Clowder test command line app\n\n.. codeauthor:: Joe Decapo <joe@polka.cat>\n\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix problem related to the teacheradmin form, exclude owner\n"
},
{
"from": "human",
"value": "# Copyright 2012 Rooter Analysis S.L.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Li... | python | chosen |
[
{
"from": "system",
"value": "FIX disable mrp auto prod demo data\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n{\n 'name': 'MRP auto production',\n 'version': '0.1',\n 'author': 'ADHOC',\n 'category': 'Localization/Argentina',\n 'website': 'www.adhoc.com.ar'... | python | chosen |
[
{
"from": "system",
"value": "Add toctree_only to latex_documents to fix sphinx build\n"
},
{
"from": "human",
"value": "import sys\n\nfrom os.path import dirname, abspath\n\nsys.path.insert(0, dirname(dirname(abspath(__file__))))\n\nfrom django.conf import settings\n\nsettings.configure()\n\npr... | python | chosen |
[
{
"from": "system",
"value": "Fix for Partner's email not being accessible to administrator\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom openerp import models, fields, api\n\n\nclass User(models.Model):\n _inherit = 'res.users'\n\n def __init__(self, pool, cr):\n ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.