conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix flake8 issue and fix up documentation\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n# -*- mode: python; coding: utf-8 -*-\n# Copyright 2017 the HERA Collaboration\n# Licensed under the 2-clause BSD license.\n\nimport os\nimport numpy as np\nfrom ast... | python | chosen |
[
{
"from": "system",
"value": "Add option to get meat\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport codecs\nimport random\nimport os\ndirname = os.path.dirname(os.path.realpath(__file__))\n\nMIN_INGRED = 2\nMAX_INGRED = 8\n\nfilename = dirname + \"/vegetarian\"\nwith open(fil... | python | chosen |
[
{
"from": "system",
"value": "Add a missing isinstance check to pacify pyright\n\npyright (correctly) complains that we use `detail[\"DATA_TYPE\"]` in GCS\nerror parsing without knowing that `detail` is a type which supports\nstrings in `__getitem__`.\n\nCheck if `detail` is a dict before indexing into it.\... | python | chosen |
[
{
"from": "system",
"value": "Return a csrf token on the homepage.\n\nWe were not setting a CSRF token on the homepage. This meant that requests to\nAPI endpoints did not have a token available. This change sets the token\nimmediatley as part of the cookie. Ajax calls can then use this value.\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Add dependency on requets module."
},
{
"from": "human",
"value": "import os\n\nfrom setuptools import setup\n\ndef read(*paths):\n \"\"\"Build a file path from *paths* and return the contents.\"\"\"\n with open(os.path.join(*paths), 'r') as f:\n return... | python | chosen |
[
{
"from": "system",
"value": "Add missing entry points and classifiers.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom __future__ import with_statement\n\nfrom setuptools import setup, find_packages\nfrom buildkit import *\n\n\nMETA = get_metadata('neuemux/version.py')\n\n\nset... | python | chosen |
[
{
"from": "system",
"value": "Change PyPi name to giturlparse.py\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\ntry:\n from setuptools import setup, Extension\n has_setuptools = True\nexcept ImportError:\n from distutils.core import setup, Extension\n has_setuptools = False\... | python | chosen |
[
{
"from": "system",
"value": "Update Django requirement to latest LTS\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='django-directed-edge',\n version='2.0.1',\n packages=(\n 'django_directed_edge',\n ),\n url='https://chris-lamb.co.uk/proj... | python | chosen |
[
{
"from": "system",
"value": "Fix a https url issue\n\nChange-Id: I2d2794209620c823f0aef9549f8ee43aa4c91dff\n"
},
{
"from": "human",
"value": "# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use... | python | chosen |
[
{
"from": "system",
"value": "Make sure we install the csv file, still.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom setuptools import setup\n\nsetup(name='libhxl',\n version='2.7',\n description='Python support for the Humanitarian Exchange Language (HXL).',\n aut... | python | chosen |
[
{
"from": "system",
"value": "Install six for Python 2 & 3 compatibility\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\nfrom setuptools import setup\n\n\nsetup(name=\"sagbescheid\",\n author=\"Wieland Hoffmann\",\n author_email=\"themineo@gmail.com\",\n packages=[\"sag... | python | chosen |
[
{
"from": "system",
"value": "Add git short hash to unreleased version numbers\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(name='MaxwellBloch',\n version='0.3.0.dev',\n description='A Python package for solving the Maxwell-Bloch equations.',\n url='htt... | python | chosen |
[
{
"from": "system",
"value": "Upgrade Beaker 1.6.4 => 1.8.1\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='tangled.session',\n version='0.1a3.dev0',\n description='Tangled session integration',\n long_description=open('README.rst').read(),\n ur... | python | chosen |
[
{
"from": "system",
"value": "Add a content type description to keep twine happy.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport io\n\nfrom setuptools import setup, Extension\n\n\nwith io.open('README.rst', encoding='utf8') as readme:\n long_description = readme.read()\n\n\n... | python | chosen |
[
{
"from": "human",
"value": "Add organizational structure and import calls to clean_data.py and io.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nName: Paul Briant\nDate: 12/11/16\nClass: Introduction to Python\nAssignment: Final Project\n\nDescription:\nTests for Final Project\n\"\"\"\n\nimport clea... | python | chosen |
[
{
"from": "system",
"value": "Rename project since someone else created the pypi package\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python2\n\nfrom setuptools import setup\n\nimport bayesian_changepoint_detection\n\nsetup(\n name='bayesian_changepoint_detection',\n version=bayesian_... | python | chosen |
[
{
"from": "system",
"value": "Add Framework::Pytest to list of classifiers\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nwith open('README.rst') as f:\n long_description = f.read()\n\nsetup(\n name='pytest-faulthandler',\n version='1.3.0',\n py_modules=['pytest... | python | chosen |
[
{
"from": "system",
"value": "Debug travis to pypi deploy\n"
},
{
"from": "human",
"value": "import amazon\n\nfrom setuptools import setup, find_packages\n\n\nlong_description = pypandoc.convert('README.md', 'rst')\n\n\nsetup(name='python-amazon-simple-product-api',\n version=amazon.__versi... | python | chosen |
[
{
"from": "system",
"value": "Fix version and format and rereleas\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\nconf = dict(name='magiclog',\n version='1.0.0',\n author = 'Jason Dusek',\n author_email = 'jason.dusek... | python | chosen |
[
{
"from": "system",
"value": "Remove long desc for now.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n__version__ = '0.11.10'\n\npackages = [\n 'lassie',... | python | chosen |
[
{
"from": "system",
"value": "Add support for missing .yang suffix check\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\ndef read(fname):\n\treturn open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name = 'xym',\n version = '0.4',\n descript... | python | chosen |
[
{
"from": "system",
"value": "Use README.md instead of README.rst\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8-*-\nfrom setuptools import setup\n\nsetup(name='cmuclmtk',\n version='0.1.3',\n description='Wrapper library for accessing the language model ... | python | chosen |
[
{
"from": "system",
"value": "Fix readme to be able to build a wheel\n"
},
{
"from": "human",
"value": "\"\"\"\ndjango-gstorage\n\n\"\"\"\nimport re\n\nfrom setuptools import setup\n\nversion = ''\nwith open('gstorage/__init__.py', 'r') as fd:\n version = re.search(r'^__version__\\s*=\\s*[\\'... | python | chosen |
[
{
"from": "system",
"value": "Add dependency, so it gets auto installed when installing the plugin.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='lektor-root-relative-path',\n author=u'Atsushi Suga',\n author_email='a2csuga@users.noreply.github.com',\... | python | chosen |
[
{
"from": "system",
"value": "Change version and license for 0.2\n\ngit-svn-id: 8e0fbe17d71f9a07a4f24b82f5b9fb44b438f95e@617 b426a367-1105-0410-b9ff-cdf4ab011145\n"
},
{
"from": "human",
"value": "\nfrom setuptools import setup\n\nsetup(name = 'OWSLib',\n version = '0.1.0',\n... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages() to package all packages of module.\n\nCurrent setup.py includes only the django_jobvite package and excludes all\nthe packages within the django_jobvite directory, like migrations,\nmanagement, etc. Long story short, if you install django_jobvite using\npip ... | python | chosen |
[
{
"from": "system",
"value": "Make VERSION easier to access\n\nUntil now `algoliasearch.version.VERSION` was needed to obtain the\ncurrent version. Only `algoliasearch.VERSION` is now needed.\nThe change is backward compatible: it is still possible to do\n`algoliasearch.version.VERSION`.\n"
},
{
"fr... | python | chosen |
[
{
"from": "system",
"value": "Include README in PyPi release\n"
},
{
"from": "human",
"value": "\"\"\"Lusmu setup information\n\nCopyright 2013 Eniram Ltd. See the LICENSE file at the top-level directory of\nthis distribution and at https://github.com/akaihola/lusmu/blob/master/LICENSE\n\n\"\"\"... | python | chosen |
[
{
"from": "system",
"value": "Include custom templatetags in package build.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any ... | python | chosen |
[
{
"from": "system",
"value": "Move data structures out of main\n"
},
{
"from": "human",
"value": "def ok(n):\n s = n + 3\n print 's = %d' % (s,)\n return s\ndef ident(val):\n return val\ndef main():\n while False:\n inside = 1\n a = 1 + 2\n ok(a)\n if True:\n ... | python | chosen |
[
{
"from": "system",
"value": "Update mean_pointcloud to be faster\n\nThis is actually faster than using numpy. It is also MUCH\nfaster if it gets jitted by something like pypy or numba.\n"
},
{
"from": "human",
"value": "from .pointcloud import PointCloud\nimport numpy as np\n\n\ndef mean_pointc... | python | chosen |
[
{
"from": "system",
"value": "Fix the admin url configuration.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.\n#\n# This file is part of Postorius.\n#\n# Postorius is free software: you can redistribute it and/or modify... | python | chosen |
[
{
"from": "system",
"value": "Handle form submits without ad text\n"
},
{
"from": "human",
"value": "from django.views.decorators.csrf import csrf_exempt\nfrom django.shortcuts import render\n\nimport assess\n\ndef home(request):\n if request.method == 'GET':\n return render(request, '... | python | chosen |
[
{
"from": "system",
"value": "Remove superfluous import by using the exception from the namespace.\n"
},
{
"from": "human",
"value": "import contextlib\nimport functools\n\nimport pluggy\n\nimport keyring\nfrom keyring.errors import KeyringError\n\n\nhookimpl = pluggy.HookimplMarker(\"devpiclien... | python | chosen |
[
{
"from": "system",
"value": "Change migrations lack of apps, schema_editor\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\nimport django.apps\nfrom django.core.management import call_command\n\n\ndef add_pe... | python | chosen |
[
{
"from": "system",
"value": "ref: Add lock on identify_revision when revision is missing\n"
},
{
"from": "human",
"value": "from zeus.exceptions import UnknownRepositoryBackend\nfrom zeus.models import Repository, Revision\nfrom zeus.vcs.base import UnknownRevision\n\n\ndef identify_revision(re... | python | chosen |
[
{
"from": "system",
"value": "Fix mono-extensions checkout for PR branches ('origin/pull/N/merge')\n"
},
{
"from": "human",
"value": "from mono_master import MonoMasterPackage\nfrom bockbuild.util.util import *\n\nclass MonoMasterEncryptedPackage (MonoMasterPackage):\n \n def __init__(self... | python | chosen |
[
{
"from": "system",
"value": "Make datetime_to_sec_since_epoch return an int and fix epoch_sec_to_minutes_since_epoch\n"
},
{
"from": "human",
"value": "import datetime\nimport time\n\ndef datetime_to_sec_since_epoch(dt):\n '''Take a python datetime object and convert it to seconds since the un... | python | chosen |
[
{
"from": "system",
"value": "Use GITHUB_TOKEN instead of BOT_PASSWORD\n\nWhen using BOT_PASSWORD, the bot cannot have\ntwo factor authentication enabled as GitHub expects\nan additional header parameter that is the one time\n2FA password: https://developer.github.com/v3/auth/#working-with-two-factor-authen... | python | chosen |
[
{
"from": "system",
"value": "Add test for denying get requests\n"
},
{
"from": "human",
"value": "\"\"\"accounts app unittests for views\n\n\"\"\"\nfrom django.test import TestCase\nfrom django.urls import reverse\n\n\nclass WelcomePageTest(TestCase):\n \"\"\"Tests relating to the welcome_pa... | python | chosen |
[
{
"from": "system",
"value": "Add password field to User model\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.db import models\n\n\nclass User(models.Model):\n MALE = -1\n UNDEFINED = 0\n FEMALE = 1\n GENDER_CHOICES = ... | python | chosen |
[
{
"from": "system",
"value": "fix(settings): Add console as email backend\n"
},
{
"from": "human",
"value": "# Database\n# https://docs.djangoproject.com/en/1.8/ref/settings/#databases\n\nDEBUG = True\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',... | python | chosen |
[
{
"from": "system",
"value": "Refactor io doc building code\n"
},
{
"from": "human",
"value": "\"\"\"Utilities to read and write images in various formats.\n\nThe following plug-ins are available:\n\n\"\"\"\n\nfrom ._plugins import *\nfrom .sift import *\nfrom .collection import *\n\nfrom ._io i... | python | chosen |
[
{
"from": "system",
"value": "Fix problem with device icons\n"
},
{
"from": "human",
"value": "from django import template\nfrom django.utils.safestring import mark_safe\nfrom django.utils.translation import ugettext as _\n\nfrom mygpo.api.models import DEVICE_TYPES\n\nregister = template.Librar... | python | chosen |
[
{
"from": "system",
"value": "Add test for saving skeleton image\n"
},
{
"from": "human",
"value": "import os\nimport pytest\n\nimport pandas\nfrom skan import pipe\n\n@pytest.fixture\ndef image_filename():\n rundir = os.path.abspath(os.path.dirname(__file__))\n datadir = os.path.join(rund... | python | chosen |
[
{
"from": "system",
"value": "Remove a line of debug output\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals, absolute_import\n\nfrom boto.cloudfront.exception import CloudFrontServerError\nfrom catsnap.worker import worker\nfrom catsnap import Client\n\nclass Invalidat... | python | chosen |
[
{
"from": "system",
"value": "Add a note acknowledging the source of this class\n"
},
{
"from": "human",
"value": "\"\"\"\nRegistry class and global node registry.\n\"\"\"\n\nimport inspect\n\nclass NotRegistered(KeyError):\n pass\n\n\nclass NodeRegistry(dict):\n NotRegistered = NotRegiste... | python | chosen |
[
{
"from": "system",
"value": "Update version 0.7.0 -> 0.7.1"
},
{
"from": "human",
"value": "# Copyright 2018 D-Wave Systems Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain... | python | chosen |
[
{
"from": "system",
"value": "Fix UnicodeDecodeError: Return text string, not bytes\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nfrom django.db.models import Q\nfrom django.core.management.base import NoArgsCommand\nfrom django.template.loader import render_to_string\nfrom dja... | python | chosen |
[
{
"from": "system",
"value": "Change to use function for block generation\n\nUse a separate function for random block generation\nmove code from loop to the function\n"
},
{
"from": "human",
"value": "#import the needed modules fo communication with minecraft world\nfrom mcpi.minecraft import *\... | python | chosen |
[
{
"from": "system",
"value": "Update CDC scraper to handle new format\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport requests\nimport lxml.html\nimport pandas as pd\nimport sys\n\nURL = \"http://www.cdc.gov/zika/geo/united-states.html\"\n\nINT_COLS = [ \"travel_associated_cases... | python | chosen |
[
{
"from": "system",
"value": "Fix smart_u for Django 1.3"
},
{
"from": "human",
"value": "# coding=utf-8\n# flake8: noqa\nimport sys\n\nif sys.version_info[0] == 3:\n from django.utils.encoding import smart_bytes as smart_b, force_str as force_u, smart_text as smart_u\n # noinspection PyUn... | python | chosen |
[
{
"from": "system",
"value": "Add travis-ci to `powerd by` page.\n"
},
{
"from": "human",
"value": "from django.shortcuts import render\nfrom django.contrib import admin, auth\n\n# We don't need a user management\nadmin.site.unregister(auth.models.User)\nadmin.site.unregister(auth.models.Group)\... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Import order changed to break tools dependency\"\n\nThis reverts commit 3a75fd530b1ecb9e6466ac99532d06032ae3a049.\n"
},
{
"from": "human",
"value": "# Here we import all necessary staff from external files\n\n# tools\nfrom .tools import matvec, col, kron, d... | python | chosen |
[
{
"from": "system",
"value": "Remove the last reference to South - it can be pip uninstalled now\n"
},
{
"from": "human",
"value": "from django.db import models\n\nfrom pombola.core.models import Person\nfrom speeches.models import Speaker\n\nfrom south.modelsinspector import add_introspection_r... | python | chosen |
[
{
"from": "system",
"value": "Add missing py2py3 compatibility imports\n"
},
{
"from": "human",
"value": "import torch\nfrom . import Kernel\nfrom gpytorch.lazy import DiagLazyVariable, ZeroLazyVariable\n\n\nclass WhiteNoiseKernel(Kernel):\n def __init__(self, variances):\n super(White... | python | chosen |
[
{
"from": "system",
"value": "Replace the timestep_limit call with the new tags api.\n"
},
{
"from": "human",
"value": "from gym.envs.registration import registry, register, make, spec\nfrom gym_ple.ple_env import PLEEnv\n# Pygame\n# ----------------------------------------\nfor game in ['Catche... | python | chosen |
[
{
"from": "system",
"value": "Fix small bug in templatetags\n"
},
{
"from": "human",
"value": "from django import template\n\nfrom ..models import Post, Section\n\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef latest_blog_posts(scoper=None):\n qs = Post.objects.current()\... | python | chosen |
[
{
"from": "system",
"value": "Use relative import to fix Python 3.\n"
},
{
"from": "human",
"value": "__title__ = 'hexfile'\n__version__ = '0.1.1'\n__author__ = 'Ryan Sturmer'\n__license__ = 'MIT'\n__copyright__ = 'Copyright 2014 Ryan Sturmer'\n__docformat__ = 'restructuredtext'\n\nfrom core imp... | python | chosen |
[
{
"from": "system",
"value": "Configure django correctly when we setup our env\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport multiprocessing\nimport optparse\n\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.utils.importlib import import_module\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Remove Django 1.8 dependency in initial migration\n\nThe ('contenttypes', '0002_remove_content_type_name') migration was part of Django 1.8, replacing it with '__first__' allows the use of Django 1.7"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __f... | python | chosen |
[
{
"from": "system",
"value": "Reduce result broker message timeout\n"
},
{
"from": "human",
"value": "\n# Wait up to 15 minutes for each iteration.\nBROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 3600} # Seconds = 1 hour.\n# Do not pre-fetch work.\nCELERYD_PREFETCH_MULTIPLIER = 1 \n# Do not a... | python | chosen |
[
{
"from": "system",
"value": "Use right env variable to build redis url\n\nIt is for the events stream daemon.\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask_sse import sse\n\napp = Flask(__name__)\napp.config[\"REDIS_URL\"] = os.environ.get(\n \"REDIS_URL... | python | chosen |
[
{
"from": "system",
"value": "Remove empty line. Add bland commit message.\n"
},
{
"from": "human",
"value": "import os\nfrom soho.utils import register_plugin\n\n\nregistry = {}\n\n\ndef register_renderer(spec, *ext):\n \"\"\"Register a renderer.\n\n ``spec``\n\n a string that repr... | python | chosen |
[
{
"from": "system",
"value": "Correct 'ignore case' playalbumby test\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=utf-8\n\nfrom __future__ import print_function, unicode_literals\n\nimport nose.tools as nose\n\nfrom tests.utils import run_filter\n\n\ndef test_ignore_case():... | python | chosen |
[
{
"from": "system",
"value": "Use ast.If not ast.IfExp for if tag\n"
},
{
"from": "human",
"value": "\nimport ast\n\nfrom .library import Library\n\nregister = Library()\n\n\n@register.tag(name='block')\ndef block(parser, token):\n token = token.strip()\n parser.build_method(token, endnode... | python | chosen |
[
{
"from": "system",
"value": "Add featured field to ProductAdmin\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom .models import Image, Product, Review, Specification\n\n\nclass ImageInline(admin.StackedInline):\n model = Image\n\n\nclass SpecificationInline(admin.S... | python | chosen |
[
{
"from": "system",
"value": "Fix auth issue, catch up devel --skip-ci\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n#\n# Copyright 2011 Friday Film Club. All Rights Reserved.\n\n\"\"\"Main views of the Friday Film Club app.\"\"\"\n\n__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'\n... | python | chosen |
[
{
"from": "system",
"value": "Fix user creation with unique username\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django.db import models\nfrom django.utils import simplejson as json\n\nfrom .signals import post_associate\n\n\nclass IdentityManager(models.... | python | chosen |
[
{
"from": "system",
"value": "Make matrix exercise compatible with Python3\n"
},
{
"from": "human",
"value": "class Matrix(object):\n def __init__(self, s):\n self.rows = [[int(n) for n in row.split()]\n for row in s.split('\\n')]\n\n @property\n def columns(s... | python | chosen |
[
{
"from": "system",
"value": "redis_commands: Use a synopsis for usage examples\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport lxml.etree, lxml.html\nimport re\n\nurl = \"http://redis.io\"\noutput = \"output.txt\"\n\nf = open(output, \"w\");\n\ntree = lxm... | python | chosen |
[
{
"from": "system",
"value": "Rename to sum_list_iter() and revise main()'s num_ls\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef sum_list_for(num_ls):\n \"\"\"Sum number list by for lo... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect import reference to nw_similarity\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom similarity.nw_similarity import NWAlgorithm\n\n\nclass Test(unittest.TestCase):\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\... | python | chosen |
[
{
"from": "system",
"value": "Fix mistaken reference to image_callback.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# (C) 2015 Jean Nassar\n# Released under BSD version 4\n\"\"\"\nReduce /ardrone/image_raw framerate from 30 Hz to 2 Hz.\n\n\"\"\"\nimport ro... | python | chosen |
[
{
"from": "system",
"value": "Make trac related tasks available in fab\n"
},
{
"from": "human",
"value": "\"\"\"\nCollection of utilities to automate the administration of Twisted's\ninfrastructure. Use this utility to install, update and start/stop/restart\nservices running on twistedmatrix.com... | python | chosen |
[
{
"from": "human",
"value": "Raise error if taggit.migrations imported for Django <=1.6\n\nFixes gh-219.\n"
},
{
"from": "gpt",
"value": "\"\"\"\nDjango migrations for taggit app\n\nThis package does not contain South migrations. South migrations can be found\nin the ``south_migrations`` packag... | python | chosen |
[
{
"from": "system",
"value": "Use sorted dictionary in cleanse_dictionary.\n"
},
{
"from": "human",
"value": "from django.views.debug import cleanse_setting\n\n\ndef cleanse_dictionary(dictionary):\n \"\"\"\n Cleanse sensitive values in a dictionary.\n \"\"\"\n\n cleansed_dictionary ... | python | chosen |
[
{
"from": "system",
"value": "Add a delay between process launches.\n\nIt so happens that the client process was launched before the server causing\ndeadlocks in some cases. Fixed that by adding a small delay. In reality, we may\nneed to logic to vtkTestDriver to make it more featured and parse outputs from... | python | chosen |
[
{
"from": "system",
"value": "Support both remote URL styles in gh-deploy.\n"
},
{
"from": "human",
"value": "import subprocess\nimport os\n\n\ndef gh_deploy(config):\n if not os.path.exists('.git'):\n print 'Cannot deploy - this directory does not appear to be a git repository'\n ... | python | chosen |
[
{
"from": "system",
"value": "CI: Fix regex in ulp_adc example test\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom tiny_test_fw import Utility\nimport re\nimport ttfw_idf\n\n\n@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')\ndef test_examples_ulp_adc(env, ... | python | chosen |
[
{
"from": "system",
"value": "Implement command line option parse program.\n"
},
{
"from": "human",
"value": "from .BloArticle import BloArticle\n\n\nclass Blo:\n def __init__(self):\n pass\n\nif __name__ == '__main__':\n # TODO: implement main routine of Blo.\n # blo [-c config_... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in unit test class of the sphere manifold\n\nSigned-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>\n"
},
{
"from": "human",
"value": "import unittest\n\nimport numpy as np\nimport numpy.linalg as la\nimport numpy.random as rnd\nimp... | python | chosen |
[
{
"from": "system",
"value": "clang: Fix spurious '../llvm/configure: line 541: 0: Bad file descriptor' on clang roll try jobs.\n\nThe subprocess module used to dup() stdin, but apparently that's no longer true. So dup it manually.\nPatch from Jay Soffian <jaysoffian@gmail.com>!\n\nBUG=none\nTEST=Put a new ... | python | chosen |
[
{
"from": "system",
"value": "Replace pre-commit test patch decorators with setUp/tearDown patching.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom mock import Mock, patch\n\nfrom captainhook import pre_commit\n\n\nclass TestMain(unittest.TestCase):\n\n @patch('captainhook.pre_com... | python | chosen |
[
{
"from": "system",
"value": "Fix spacing. Update mfcc test to check columns\n"
},
{
"from": "human",
"value": "import numpy as np\nfrom unittest import TestCase\n\nfrom cartography.extractor import LibrosaFeatureExtractor\n\ndef gen_signal(dur, sr, freq):\n return np.pi * 2 * freq * np.arange(... | python | chosen |
[
{
"from": "system",
"value": "Add __copy__ method to grammar\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 01.08.2017 07:33\n:Licence GNUv3\nPart of grammpy\n\n\"\"\"\n\nfrom .MultipleRulesGrammar import MultipleRulesGrammar as Grammar\n\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Add a title to the print_method problem\n"
},
{
"from": "human",
"value": "import codecs\nimport io\nimport sys\n\nfrom workshopper.problems import BaseProblem\n\n\nclass Problem(BaseProblem):\n\n def test(self, file):\n old_stdout = sys.stdout\n sy... | python | chosen |
[
{
"from": "system",
"value": "Add button that links to website\n"
},
{
"from": "human",
"value": "from kivy.uix.screenmanager import Screen\nfrom kivy.lang import Builder\nfrom kivy.factory import Factory\nfrom functools import partial\n\nimport webbrowser\n\n\nclass ScreenAbout(Screen):\n Bu... | python | chosen |
[
{
"from": "system",
"value": "Hide variants select input when product has no variants\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import pgettext_lazy\n\nfrom ..cart.forms import AddToCartForm\nfrom ..product.models import GenericProduct\n\n\nclass ... | python | chosen |
[
{
"from": "system",
"value": "Prepare for config and command line arguments\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\n# Pianette\n\n# A command-line emulator of a PS2 Game Pad Controller \n# that asynchronously listens to GPIO EDGE_RISING\n# inputs from sensors and sends Seria... | python | chosen |
[
{
"from": "system",
"value": "Simplify python solution to 55\n"
},
{
"from": "human",
"value": "\"\"\"\nproblem55.py\n\nIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic. A number\nthat never forms a palindrome through the reverse and add process is called a\nLychrel number. Ho... | python | chosen |
[
{
"from": "system",
"value": "Fix Python module search path\n"
},
{
"from": "human",
"value": "from utils.helpers import error, find_mbed_dir, is_mbed_dir\nimport sys, os\nfrom utils import set_project_dir\n\nfrom commands.set import CmdSet\nfrom commands.get import CmdGet\nfrom commands.clone i... | python | chosen |
[
{
"from": "system",
"value": "Make our PollingDataStreamers start up right away\n"
},
{
"from": "human",
"value": "import logging\n\nfrom datetime import timedelta\nfrom twisted.internet.task import LoopingCall\n\nfrom moksha.hub.hub import MokshaHub\n\nlog = logging.getLogger('moksha.hub')\n\nc... | python | chosen |
[
{
"from": "system",
"value": "Make it clear that a few example tests fail on purpose\n"
},
{
"from": "human",
"value": "''' NOTE: This test suite contains 2 passing tests and 2 failing tests. '''\n\nfrom seleniumbase import BaseCase\n\n\nclass MyTestSuite(BaseCase):\n\n def test_1(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix python3 compatibility issues with doc fix\n"
},
{
"from": "human",
"value": "from ._library import *\nfrom ._library import __version__, __api_version__\n\ndef get_include():\n \"\"\"Returns the directory containing the C/C++ API include directives\"\"\"\n\n r... | python | chosen |
[
{
"from": "system",
"value": "Enable face culling in sponza example\n"
},
{
"from": "human",
"value": "import moderngl as mgl\nfrom demosys.effects import effect\n\n\nclass SceneEffect(effect.Effect):\n \"\"\"Generated default effect\"\"\"\n def __init__(self):\n self.scene = self.g... | python | chosen |
[
{
"from": "system",
"value": "Add url to user agent\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\n\n__all__ = ['build_session', 'delete', 'get', 'post', 'put']\n\nimport freight\nimport requests\n\nUSER_AGENT = 'freight/{}'.format(freight.VERSION),\n\n\ndef build_ses... | python | chosen |
[
{
"from": "system",
"value": "Implement basis for VOI analyzer.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding : utf-8\n\n\"\"\"\nMain module for VOI analyzer.\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport argparse\nimport os\n\n\n\n"
},
{
"from": "gpt",
... | python | chosen |
[
{
"from": "system",
"value": "Format error message better in a long SQL\n"
},
{
"from": "human",
"value": "import re\n\n\nRE_MESSAGE = re.compile(r'Message: (.+), Sqlstate:')\nRE_SQLSTATE = re.compile(r'Sqlstate: (\\d+)')\nRE_POSITION = re.compile(r'Position: (\\d+)')\n\n\ndef format_error(error... | python | chosen |
[
{
"from": "system",
"value": "Allow rule repos to provide version information\n\nAdded a new method to the root package `add_status`.\n\nRule repos should use it during initialization:\n\nimport falafel\nfalafel.add_status(name=\"my_rule_repo\", nvr=\"my-rules-1.0.0-1\", commit=\"abcdef\")\n"
},
{
"... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.