conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update Core dependency to v27\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name = \"OpenFisca-Country-Template\",\n version = \"3.7.0\",\n author = \"OpenFisca Team\",\n author_emai... | python | chosen |
[
{
"from": "system",
"value": "Fix format of console_scripts and spelling of version\n"
},
{
"from": "human",
"value": "from setuptools import setup\nimport sys\n\n# The argparse module was introduced in python 2.7 or python 3.2\nREQUIRES = [\"argparse\"] if sys.version[:3] in ('2.6', '3.0', '3.1... | python | chosen |
[
{
"from": "system",
"value": "Add six for py2/3 compatibility.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\nimport crabpy\n\nfrom setuptools import setup, find_packages\n\npackages = [\n 'crabpy',\n]\n\nrequires = [\n 'suds-jurko>=0.6.0',\n 'dogpi... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next dev cycle\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding: utf-8\n\nfrom setuptools import setup, find_packages\nsetup(\n name=\"bentoo\",\n description=\"Benchmarking tools\",\n version=\"0.14\",\n packages=find_packa... | python | chosen |
[
{
"from": "system",
"value": "Use pypandoc to convert README from md to rst\n"
},
{
"from": "human",
"value": "from parsable import parsable\nfrom setuptools import setup\n\nwith open('README.md') as f:\n long_description = f.read()\n\nsetup(\n name='treecat',\n version='0.0.1',\n de... | python | chosen |
[
{
"from": "system",
"value": "Bump version (0.6 -> 0.7)\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nentry_points = {\n 'console_scripts': [\n 'whatportis=whatportis.cli:run',\n ]\n}\nreadme = open('README.rst').read()\n\nsetup(\n name=\"whatportis\",\n v... | python | chosen |
[
{
"from": "system",
"value": "Add required dependencies for performance test\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"lightmatchingengine\",\n url=\"https://github.com/gavincyi/LightMatchingEngine\",\n license='MIT',\n\n author... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Bumping the version to 1.2.3.\"\n\nThis reverts commit 1b60d37c79fd5da505fe9312756e4eebc1464ddb.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup, find_packages\n\nPYPI_RESTRUCTURED_TEXT_INFO = \\\n\"\"\"\nBasic Example\n----------... | python | chosen |
[
{
"from": "system",
"value": "Fix zip_safe for local installs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nsetup(name='check_ruckus_vsz',\n\tversion='0.13',\n\tdescription='Nagios Check for Ruckus SCG',\n\tauthor='Lukas Scha... | python | chosen |
[
{
"from": "system",
"value": "Use `find_packages()` instead of naming packages\n\nThe `templatetags/` files were missed because they were not named. Using\n`find_packages()` will ensure this does not happen again.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ntry:\n from setupto... | python | chosen |
[
{
"from": "system",
"value": "Stop using borked local pylintrc\n"
},
{
"from": "human",
"value": "\"\"\"Setup for PyPi\"\"\"\n\nfrom setuptools import setup\nsetup(\n name='nik',\n packages=['nik'],\n version='1.0',\n description='Nifty tools and containers',\n author='Nik Vanderhoof',\n a... | python | chosen |
[
{
"from": "system",
"value": "Fix splunk module name (splunk => splunklib)\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n#\n# Copyright 2011-2012 Splunk, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n# not use this file except in compliance wit... | python | chosen |
[
{
"from": "system",
"value": "Refactor some book model variables\n\nAdd an edition field, help texts to some of the fields.\nChange behaviour of the __str__ method to be more informative.\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom datetime import datetime\nfrom django.... | python | chosen |
[
{
"from": "system",
"value": "Send result as json instead of plaintext\n"
},
{
"from": "human",
"value": "import flask\nimport json\nfrom flask import jsonify\n\nfrom donut.modules.groups import blueprint, helpers\n\n\n@blueprint.route(\"/1/groups/\")\ndef get_groups_list():\n # Create a dict... | python | chosen |
[
{
"from": "system",
"value": "Bump version for PyPI release\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nwith open('README.rst') as f:\n long_desc = f.read()\n\nsetup(\n name='ttrss-python',\n version='0.1.4',\n description='A client library for the ... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.13.2\n"
},
{
"from": "human",
"value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.13.1\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"... | python | chosen |
[
{
"from": "system",
"value": "Add clint package to datacats requirements\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright 2014-2015 Boxkite Inc.\n\n# This file is part of the DataCats package and is released under\n# the terms of the GNU Affero General Public License versi... | python | chosen |
[
{
"from": "system",
"value": "Fix for pip 10.0 and later\n"
},
{
"from": "human",
"value": "from setuptools import setup\nfrom setuptools import find_packages\nfrom pip.req import parse_requirements\nimport pip\nimport xblog\n\nREQUIREMENTS_FILE = \"xblog/requirements.txt\"\n\nrequirements = [st... | python | chosen |
[
{
"from": "system",
"value": "Use Launchpad page as URL"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\nfrom setuptools.command.install import install as Install\nimport re\n\nversionPattern = re.compile(r\"\"\"^__version__ = ['\"](.*?)['\"]$\"\"\", re.M)\nwith open... | python | chosen |
[
{
"from": "system",
"value": "Change version to 2.6 as feature was added\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom setuptools import setup\nimport os\n\n\n# Utility function to read README file\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)... | python | chosen |
[
{
"from": "system",
"value": "Downgrade de version bump to a minor one\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nREPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'\n\n\nsetup(\n author='Serenata de Amor',\n author_email='op.serenatadeamor@gmail.com',\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove event start field from form\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom django import forms\n\nfrom apps.posters.models import Poster\n\n\nclass AddPosterForm(forms.ModelForm):\n when = forms.CharField(label=u\"Event start\", widget=... | python | chosen |
[
{
"from": "system",
"value": "Add fedwatch-cli as installed script\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nSetup script\n\"\"\"\nimport os\nimport sys\n\nfrom distutils.core import setup\nfrom fedwatch import __version__\n\nsetup(\n name = 'fedwatch',\n descriptio... | python | chosen |
[
{
"from": "system",
"value": "Add --limit and filtering options to task event-list\n"
},
{
"from": "human",
"value": "import click\n\nfrom globus_cli.parsing import common_options, task_id_arg\nfrom globus_cli.helpers import outformat_is_json, print_table\n\nfrom globus_cli.services.transfer imp... | python | chosen |
[
{
"from": "system",
"value": "Add better pytest test support\n"
},
{
"from": "human",
"value": "\"\"\"\nA utility to package subsets of large ASPECT PVD files to visualize elsewhere\nwithout access to the original filesystem.\n\"\"\"\n\nfrom setuptools import find_packages, setup\n\npackage = 's... | python | chosen |
[
{
"from": "system",
"value": "Declare to the PyPI that we support Python 3\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nfrom guano import __version__\n\n\nsetup(\n name='guano',\n version=__version__,\n description='GUANO, the \"Grand Unified\" bat acoustics metada... | python | chosen |
[
{
"from": "system",
"value": "Add mock as a test dependency\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport os\nimport sys\nfrom setuptools import setup, find_packages\nfrom moulinette import env\n\n\nLOCALES_DIR = env[\"LOCALES_DIR\"]\n\n# Extend installation\nlocale_files = ... | python | chosen |
[
{
"from": "system",
"value": "Update classifiers to represent currently supported python versions\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nversion = \"0.6.0\"\nurl = \"https://github.com/AndyDeany/pygame-template\"\n\nwith open(\"requirements.txt\", \"r\") as requirem... | python | chosen |
[
{
"from": "system",
"value": "Use Pillow instead of PIL.\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nsetup(\n name='Resizer',\n version='0.0.1',\n description='Resizer helps you generate thumbnails and '\n 'load images from various sources.',\n p... | python | chosen |
[
{
"from": "system",
"value": "Update upload script to include checksums\n"
},
{
"from": "human",
"value": "#!python\nimport os\nimport sys\nimport json\nimport requests\n\nif __name__ == '__main__':\n version = sys.argv[1]\n filepath = sys.argv[2]\n filename = filepath.split('/')[-1]\n githu... | python | chosen |
[
{
"from": "system",
"value": "Fix to showing generated docs on OSX\n"
},
{
"from": "human",
"value": "\"\"\"\nAutomation tasks, aided by the Invoke package.\n\"\"\"\nimport os\nimport webbrowser\n\nfrom invoke import task, run\n\n\nDOCS_DIR = 'docs'\nDOCS_OUTPUT_DIR = os.path.join(DOCS_DIR, '_bu... | python | chosen |
[
{
"from": "system",
"value": "Add base class for output pipeline processors\n"
},
{
"from": "human",
"value": "import functools\n\n\ndef coroutine(fn):\n def wrapper(*args, **kwargs):\n generator = fn(*args, **kwargs)\n next(generator)\n return generator\n\n return wra... | python | chosen |
[
{
"from": "system",
"value": "Make the command-line tool pass the right parameters.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom optparse import make_option\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.db import transaction... | python | chosen |
[
{
"from": "system",
"value": "Use version extraction code from pyethapp / pyethereum"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# ############# version ##################\nfrom pkg_resources import get_distribution, DistributionNotFound\nimport os.path\ntry:\n _dist = get_distr... | python | chosen |
[
{
"from": "system",
"value": "Allow `css_class` to have blank value.\n\nCurrently the default value for the `css_class` field (name `Normal`)\nhas the value of a blank string. To allow the value to be used\n`blank=True` must be set.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n__a... | python | chosen |
[
{
"from": "system",
"value": "Add percentage sign to difficulty\n"
},
{
"from": "human",
"value": "import click\nfrom tabulate import tabulate\n\nfrom EasyEuler import data\n\n\n@click.command()\n@click.option('--sort', '-s', type=click.Choice(['id', 'difficulty']),\n default='id', ... | python | chosen |
[
{
"from": "system",
"value": "Add basestring py2/py3 to compat\n"
},
{
"from": "human",
"value": "import os\nimport sys\ntry:\n from shutil import which as _which\nexcept ImportError:\n from distutils.spawn import find_executable as _which\n\n\ndef which(binary):\n path = _which(binary)... | python | chosen |
[
{
"from": "system",
"value": "Add test that validates method call\n"
},
{
"from": "human",
"value": "from money_conversion.money import Money\nimport unittest\n\n\nclass MoneyClassTest(unittest.TestCase):\n def setUp(self):\n self.twenty_euro = Money(20, 'EUR')\n\n def test_convert_... | python | chosen |
[
{
"from": "system",
"value": "Add docstrings to Parser class\n"
},
{
"from": "human",
"value": "import ast\nimport os\n\n\nclass Parser(object):\n\n def __init__(self, repo_path):\n if not os.path.isabs(repo_path):\n raise ValueError('Repository path is not absolute: %s' % r... | python | chosen |
[
{
"from": "system",
"value": "Add default headers, fix output\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport lxml.html\nfrom lxml.cssselect import CSSSelector\nimport requests\nimport json\n\nclass EndpointIdentifier:\n _page = 'https://www.reddit.com/dev/api/oauth'\n ... | python | chosen |
[
{
"from": "system",
"value": "Make Python example output identical to C++ and Java by removing redundant\nspaces.\n\n\n\ngit-svn-id: 6df6fa3ddd728f578ea1442598151d5900a6ed44@65 630680e5-0e50-0410-840e-4b1c322b438d\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\n\n# See README.txt for info... | python | chosen |
[
{
"from": "system",
"value": "Make Python example output identical to C++ and Java by removing redundant\nspaces.\n\n"
},
{
"from": "human",
"value": "#! /usr/bin/python\n\n# See README.txt for information and build instructions.\n\nimport addressbook_pb2\nimport sys\n\n# Iterates though all peo... | python | chosen |
[
{
"from": "system",
"value": "Add readyToLogin.py and clear-passphrases.py to setup.py script.\n"
},
{
"from": "human",
"value": "from distutils.core import setup\r\n\r\nimport py2exe\r\nimport sys\r\n\r\nsetup(console=['..\\src\\omni-configure.py'],\r\n name=\"omni-configure\",\r\n\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix string encoding when the argument is already a str().\n"
},
{
"from": "human",
"value": "import os\nimport sys\nimport hashlib\n\ndef e(s):\n if type(s) == str:\n return str\n return s.encode('utf-8')\n\ndef d(s):\n if type(s) == unicode:\n ... | python | chosen |
[
{
"from": "system",
"value": "Make TEMPLATE_DIRS a tuple to make newer version of django happy\n\nBUG=skia:3465\n\nReview URL: https://codereview.chromium.org/968223003\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright (c) 2013 The Chromium Authors. All rights reserved.\n# Us... | python | chosen |
[
{
"from": "system",
"value": "Make the code evaluation rule use a UnicodeString rather than a NormalizedString, as part of the migration away from NormalizedStrings.\n"
},
{
"from": "human",
"value": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed und... | python | chosen |
[
{
"from": "system",
"value": "Make the tests expect authentication\n"
},
{
"from": "human",
"value": "from .helpers import BaseApplicationTest\n\n\nclass TestApplication(BaseApplicationTest):\n def test_index(self):\n response = self.client.get('/')\n assert 200 == response.stat... | python | chosen |
[
{
"from": "system",
"value": "Update entry point for cloud function data fetch\n"
},
{
"from": "human",
"value": "# Copyright 2021 Google LLC\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 obt... | python | chosen |
[
{
"from": "system",
"value": "Add note after testing on all three 'valid' environment formats: (Clean, CyVerse, Jetstream)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.4 on 2016-09-28 19:30\nfrom __future__ import unicode_literals\n\nfrom django.db import... | python | chosen |
[
{
"from": "system",
"value": "Add some hotness to the parse_ttags function. Now allows you to pass a custom list of things to parse, much nicer."
},
{
"from": "human",
"value": "from django import template \n\nregister = template.Library()\n\ndef parse_ttag(token):\n bits = token.split_conten... | python | chosen |
[
{
"from": "system",
"value": "Make makemigrations verbose in ./runtests.py -v\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport os, sys, re, shutil\nos.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'\n\nimport django\nfrom django.core.management import call_command\n\nnames_p... | python | chosen |
[
{
"from": "system",
"value": "Increase the list to query 50 employees.\n"
},
{
"from": "human",
"value": "from .models import Employee, BioData, Payroll\nfrom django.http import HttpResponse\nfrom django.shortcuts import render, get_object_or_404\n\ndef list(request):\n employees = Employee.o... | python | chosen |
[
{
"from": "system",
"value": "Initialize logging very first thing\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nfrom pox.core import core\nimport pox.openflow.openflow\nimport pox.topology.topology\nimport pox.openflow.of_01\nimport pox.dumb_l3_switch.dumb_l3_switch\n\n# Set default lo... | python | chosen |
[
{
"from": "system",
"value": "Configure board ID as party setting for board tests\n"
},
{
"from": "human",
"value": "\"\"\"\n:Copyright: 2006-2018 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom byceps.services.board.models.topic import Topic\n\nfrom testfi... | python | chosen |
[
{
"from": "system",
"value": "Use project ROOT_URLCONF on default host, not hardcoded urls.\n"
},
{
"from": "human",
"value": "from django_hosts import patterns, host\n\n\nhost_patterns = patterns(\n '',\n host(r'www', 'icekit.project.urls', name='www'),\n host(r'api', 'icekit.api.urls'... | python | chosen |
[
{
"from": "system",
"value": "Add route to get random quote\n"
},
{
"from": "human",
"value": "from rest_framework import viewsets, permissions\n\nfrom rest_framework_word_filter import FullWordSearchFilter\n\nfrom quotedb.models import Quote\nfrom quotedb.permissions import IsOwnerOrReadOnly\nf... | python | chosen |
[
{
"from": "system",
"value": "Fix script to output new line at end of file\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nimport depio\n\nsentnum = int(sys.argv[2])\nfnames = [sys.argv[1]]\nfor fname in fnames:\n\tsents = list(depio.depread(fname))\n\ti=0\n\tout = open(\"%d.... | python | chosen |
[
{
"from": "system",
"value": "TST: Use pytest to run tests\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# This file is closely based on tests.py from matplotlib\n#\n# This allows running the matplotlib tests from the command line: e.g.\n#\n# $ python tests.py -v -d\n#\n# The argum... | python | chosen |
[
{
"from": "system",
"value": "Fix class name of test.\n"
},
{
"from": "human",
"value": "import unittest2\n\nfrom google.appengine.ext import testbed\n\nfrom models.account import Account\nfrom models.suggestion import Suggestion\n\nfrom helpers.suggestions.suggestion_fetcher import SuggestionFe... | python | chosen |
[
{
"from": "system",
"value": "Fix second/millisecond conversion issue in test case\n\nThe test for the `get_remaining_time_in_millis` method was\nevaluating the output against a count in seconds, not milliseconds.\nThis corrects the issue to allow the test suite to pass\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Switch BooleanChoiceField to use Select widget instead of the RadioSelect widget\n"
},
{
"from": "human",
"value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\n\ndef boolean_coerce(value):\n if value in {1, '1'}:\n ... | python | chosen |
[
{
"from": "system",
"value": "Add __eq__ method to Period object\n\nUltimately we probably want to reuse Python objects\nlike timestamps.\n"
},
{
"from": "human",
"value": "\"\"\"Representation of a period of time.\"\"\"\n\n\nclass Period(object):\n\n def __init__(self, start, end):\n ... | python | chosen |
[
{
"from": "system",
"value": "Delete unused webob conversion method\n"
},
{
"from": "human",
"value": "\"\"\"Helpers for WebOb requests and responses.\"\"\"\n\nimport webob\n\n\ndef webob_to_django_response(webob_response):\n \"\"\"Returns a django response to the `webob_response`\"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix session event variable import.\n"
},
{
"from": "human",
"value": "# -*- test-case-name: vumi.middleware.tests.test_session_length -*-\n\nimport time\n\nfrom twisted.internet.defer import inlineCallbacks, returnValue\n\nfrom vumi.message.TransportUserMessage impo... | python | chosen |
[
{
"from": "system",
"value": "Make sure to load *all* tests\n"
},
{
"from": "human",
"value": "from backend import SESBackendTest\nfrom commands import SESCommandTest\nfrom stats import StatParsingTest\nfrom configuration import SettingsImportTest\n\n"
},
{
"from": "gpt",
"value": "f... | python | chosen |
[
{
"from": "system",
"value": "Add examples for editing and saving file\n\n"
},
{
"from": "human",
"value": "\r\nfrom __future__ import print_function\r\n\r\nimport pynbs\r\n\r\n\r\nmy_file = pynbs.read('demo_song.nbs')\r\n\r\nprint(my_file.header.song_length)\r\nprint(my_file.header.description)... | python | chosen |
[
{
"from": "system",
"value": "Add test for fellow model\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom .models import Event\n\nclass EventTestCase(TestCase):\n def setUp(self):\n events = (\n {\n \"fellow\": 1,\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix encoding issue with legacy python (2.7)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This software is distributed under the two-clause BSD license.\n# Copyright (c) The django-ldapdb project\n\nfrom django.conf import settings\nimport ldap.filte... | python | chosen |
[
{
"from": "system",
"value": "Disable duplicate celery log messages\n"
},
{
"from": "human",
"value": "from scoring_engine.celery_app import celery_app\nfrom billiard.exceptions import SoftTimeLimitExceeded\nimport subprocess\n\nfrom scoring_engine.logger import logger\n\n\n@celery_app.task(name... | python | chosen |
[
{
"from": "system",
"value": "Add new line at end of file\n"
},
{
"from": "human",
"value": "from django.views.generic.list import ListView\nfrom django.views.generic.detail import DetailView\nfrom django.views.generic.edit import CreateView\nfrom django.shortcuts import redirect, render\nfrom d... | python | chosen |
[
{
"from": "system",
"value": "Improve getting the first valid value.\n"
},
{
"from": "human",
"value": "from __future__ import print_function\n\ndef findFirst(data, target):\n for idx, value in enumerate(data):\n if value >= target:\n return idx\n\n return None\n\ntarget ... | python | chosen |
[
{
"from": "system",
"value": "Add `handle_raw` method that does not catch all upstream exceptions"
},
{
"from": "human",
"value": "from argparse import ArgumentParser\n\n\ndef cached_property(func):\n cach_attr = '_{}'.format(func.__name__)\n\n @property\n def wrap(self):\n if no... | python | chosen |
[
{
"from": "human",
"value": "Move eventlent monkeypatch out of cmd/\n\nCompleting a #TODO that I left for myself months ago,\nnow that we are using PBR for our build system,\nmove the eventlent monkey patching out of ironic/cmd/__init__\nand into ironic/__init__\n\nChange-Id: I1fd352919de0a2afe7058ab84c2087... | python | chosen |
[
{
"from": "system",
"value": "Add __repr__ to ChoicesDict structure"
},
{
"from": "human",
"value": "try:\n from collections import OrderedDict\nexcept ImportError:\n from ordereddict import OrderedDict\n\n\nclass ChoicesDict(OrderedDict):\n \"OrdereDict that yields the key and value on... | python | chosen |
[
{
"from": "system",
"value": "Add ability to index specific project.\n"
},
{
"from": "human",
"value": "import logging\n\nfrom django.core.management.base import BaseCommand\nfrom django.conf import settings\n\n\nfrom projects import tasks\nfrom projects.models import ImportedFile\nfrom builds.m... | python | chosen |
[
{
"from": "system",
"value": "Add args and kwargs to delete method\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom grandchallenge.core.models import UUIDModel\nfrom grandchallenge.cases.models import Image\nfrom grandchallenge.patients.models import Patient\n\n\nclass Archi... | python | chosen |
[
{
"from": "system",
"value": "Improve detection of function start.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\nimport subprocess, sys, re\n\ntry:\n classfile = sys.argv[1]\n functionRE = re.compile(sys.argv[2])\n toSearch = re.compile(sys.argv[3])\nexcept (re.error, Ind... | python | chosen |
[
{
"from": "system",
"value": "ZON-3409: Improve naming and add docstrings.\n"
},
{
"from": "human",
"value": "import datetime\nimport zeit.cms.celery\nimport zeit.cms.testing\n\n\n@zeit.cms.celery.CELERY.task()\ndef task(context, datetime):\n pass\n\n\nclass CeleryTaskTest(zeit.cms.testing.Ze... | python | chosen |
[
{
"from": "system",
"value": "Fix reading of API key from yaml file.\n"
},
{
"from": "human",
"value": "import os\nimport yaml\n\nfrom dogapi import dog_stats_api, dog_http_api\n\n\ndef setup():\n \"\"\"\n Initialize connection to datadog during locust startup.\n\n Reads the datadog api... | python | chosen |
[
{
"from": "system",
"value": "Rename content field to field_value.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.utils.encoding import python_2_unicode_compatible\n\nfrom .. import se... | python | chosen |
[
{
"from": "system",
"value": "Implement input API as spec'd in oonib.md\n"
},
{
"from": "human",
"value": "import glob\nimport json\nimport os\n\nimport yaml\n\nfrom oonib.handlers import OONIBHandler\n\nfrom oonib import config\n\nclass InputDescHandler(OONIBHandler):\n def get(self, inputID... | python | chosen |
[
{
"from": "system",
"value": "Change class names to CamelCase\n"
},
{
"from": "human",
"value": "from lobster.core.command import Command\n\n\nclass Elk_Update(Command):\n @property\n def help(self):\n return 'update Kibana objects'\n\n def setup(self, argparser):\n pass\n... | python | chosen |
[
{
"from": "system",
"value": "Use our own get_object_or_404 for ModelPublisher.get_object\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom .. import http\nfrom .publisher import Publisher\n\nfrom django.db import transaction\nfrom django.shortcuts import get_obj... | python | chosen |
[
{
"from": "system",
"value": "Use xml.sax.saxutils.escape instead of deprecated cgi.escape\n\n```\n/usr/local/lib/python3.6/dist-packages/mammoth/writers/html.py:34: DeprecationWarning: cgi.escape is deprecated, use html.escape instead\n return cgi.escape(text, quote=True)\n```\n"
},
{
"from": "hum... | python | chosen |
[
{
"from": "system",
"value": "Change map download code to be case insensitive\n"
},
{
"from": "human",
"value": "\"\"\"Model for handling operations on map data\"\"\"\nimport json\n\ndef persist_map(map_data, metadata, cursor, player_id):\n \"\"\"Method for persisting map data\"\"\"\n seri... | python | chosen |
[
{
"from": "system",
"value": "test: Make the core dumper interactive\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom ookoobah import core\nfrom ookoobah import utils\n\ngame = core.Game()\n\nutils.populate_grid_from_string(game.grid, \"\"\"\n ######\n #>..\\#\n #.#..#\n... | python | chosen |
[
{
"from": "system",
"value": "Create initial test case for large tree\n"
},
{
"from": "human",
"value": "import unittest\nfrom yeast_harness import *\n\n\nclass TestYeast(unittest.TestCase):\n def test_single_c_source(self):\n\n mk = Makefile(\n spores=SporeFile(\n ... | python | chosen |
[
{
"from": "system",
"value": "Test to validate trimming scenario\n"
},
{
"from": "human",
"value": "from grazer.core import crawler\nfrom bs4 import BeautifulSoup\n\n\ndef test_extract_links():\n text = \"\"\"\n <html><head><title>The Dormouse's story</title></head>\n <body>\n <p cla... | python | chosen |
[
{
"from": "system",
"value": "Tag commit for v0.0.17-master generated by gitmake.py\n"
},
{
"from": "human",
"value": "major = 0\nminor=0\npatch=16\nbranch=\"master\"\ntimestamp=1376507917.4"
},
{
"from": "gpt",
"value": "major = 0\nminor=0\npatch=17\nbranch=\"master\"\ntimestamp=137... | python | chosen |
[
{
"from": "system",
"value": "Stop importing clearly duplicate operators (like the First Manchester operator without a name)\n"
},
{
"from": "human",
"value": "\"\"\"\nUsage:\n\n ./manage.py import_operators < NOC_db.csv\n\"\"\"\n\nfrom busstops.management.import_from_csv import ImportFromCSV... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Temporarily make talks visible only to committee\"\n\nThis reverts commit 57050b7025acb3de66024fe01255849a5ba5f1fc.\n"
},
{
"from": "human",
"value": "from django.shortcuts import render, get_object_or_404\n\nfrom config.utils import get_active_event\n\nfro... | python | chosen |
[
{
"from": "system",
"value": "Fix floatx encoding on Python3"
},
{
"from": "human",
"value": "import numpy as np\n\n# the type of float to use throughout the session.\n_FLOATX = 'float32'\n_EPSILON = 10e-8\n\n\ndef epsilon():\n return _EPSILON\n\n\ndef set_epsilon(e):\n global _EPSILON\n ... | python | chosen |
[
{
"from": "system",
"value": "Document kicad python unicode bug\n"
},
{
"from": "human",
"value": "import pcbnew\nimport sys\nimport os\n\npretties = []\nfor dirname, dirnames, filenames in os.walk(sys.argv[1]):\n # don't go into any .git directories.\n if '.git' in dirnames:\n dirn... | python | chosen |
[
{
"from": "system",
"value": "Allow list to be sorted by a key in the node's data\n"
},
{
"from": "human",
"value": "import os\nimport json\n\nfrom kitchen.settings import KITCHEN_LOCATION\n\ndef load_data(data_type):\n retval = []\n nodes_dir = os.path.join(KITCHEN_LOCATION, data_type)\n ... | python | chosen |
[
{
"from": "system",
"value": "Increase timeout for RunGYP step\nBUG=skia:1631\n(SkipBuildbotRuns)\n\n\n\ngit-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@11229 2bbb7eff-a529-9590-31e7-b0007b416f81\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# Copyright (c) 2013 The Chromium Aut... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Fix ci build by adjust static root and media root path\"\n\nThis reverts commit e502c906\n"
},
{
"from": "human",
"value": "from .base import * # noqa\n\n\nSECRET_KEY = \"test\"\n\nDATABASES = {\n \"default\": {\"ENGINE\": \"django.db.backends.sqlite3\"... | python | chosen |
[
{
"from": "system",
"value": "Increase default sync frequency for SP\n"
},
{
"from": "human",
"value": "from nodeconductor.core import NodeConductorExtension\n\n\nclass SharepointExtension(NodeConductorExtension):\n\n @staticmethod\n def django_app():\n return 'nodeconductor_saltsta... | python | chosen |
[
{
"from": "system",
"value": "Use logging module for debug messages, not stdout.\n"
},
{
"from": "human",
"value": "import time\nimport urllib2\nimport socket\n\nfrom google.appengine.api import datastore_errors\nfrom google.appengine.runtime import apiproxy_errors\n\nMAX_ATTEMPTS = 10\n\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "[nixio] Use Python2 compatible super() call\n"
},
{
"from": "human",
"value": "from neo.io.basefromrawio import BaseFromRaw\nfrom neo.rawio.nixrawio import NIXRawIO\n\n# This class subjects to limitations when there are multiple asymmetric blocks\n\n\nclass NixIO(NI... | python | chosen |
[
{
"from": "system",
"value": "Expand Mock Request to include path and built in URL parsing.\n"
},
{
"from": "human",
"value": "\"\"\"\nTesting Helpers\n~~~~~~~~~~~~~~~\n\nCollection of Mocks and Tools for testing APIs.\n\n\"\"\"\nfrom odin.codecs import json_codec\n\nfrom odinweb.constants impor... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.