conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Include natsort as a dependency for tests.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\n# Utility function to read the README file.\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n... | python | chosen |
[
{
"from": "system",
"value": "Make the first word of the package description capital\n"
},
{
"from": "human",
"value": "from setuptools import setup, find_packages\n\nsetup(\n name = \"sanitize\",\n version = \"0.33\",\n description = \"bringing sanitiy to world of messed-up data\",\n au... | python | chosen |
[
{
"from": "system",
"value": "Mark as zip_safe = False\n"
},
{
"from": "human",
"value": "from setuptools import setup\ntry:\n import ez_setup\n ez_setup.use_setuptools()\nexcept ImportError:\n pass\n\n\nsetup(\n name = \"django-tsearch2\",\n version = \"0.2\",\n packages = ['t... | python | chosen |
[
{
"from": "system",
"value": "Declare mock as a requiement.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport sys\n\nfrom setuptools import setup, find_packages\n\nfrom exam import __version__\n\ntry:\n import multiprocessing\nexcept ImportError:\n pass\n\ninstall_requires =... | python | chosen |
[
{
"from": "system",
"value": "Change koala-serializer version to 0.6.3\n"
},
{
"from": "human",
"value": "import sys\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name='chillin-server',\n version='1.4.0',\n description='Chillin AI Game Framework (Python Server)',\n long_... | python | chosen |
[
{
"from": "system",
"value": "Update email in pip package\n"
},
{
"from": "human",
"value": "from setuptools import setup\nsetup(\nname = 'taskcat',\npackages = ['taskcat'],\ndescription = 'An OpenSource Cloudformation Deployment Framework',\nauthor = 'Tony Vattathil',\nauthor_email = 'avattathi... | python | chosen |
[
{
"from": "system",
"value": "Use absolute path on find packages\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n from setuptools import setup... | python | chosen |
[
{
"from": "system",
"value": "Use standard 3-part version number.\n"
},
{
"from": "human",
"value": "\nimport os\nfrom setuptools import setup, find_packages\n\nsetup(\n name = 'temps',\n version = '0.1',\n license = 'MIT',\n description = 'Context managers for creating and cleaning ... | python | chosen |
[
{
"from": "system",
"value": "Use find_packages helper to get everything except for tests. Add sphinx as an installation requirement.\n"
},
{
"from": "human",
"value": "import os\nfrom setuptools import setup\n\nversion_file = open(os.path.join(os.path.dirname(__file__), 'VERSION'))\nversion = ... | python | chosen |
[
{
"from": "system",
"value": "Install static files, templates and docs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup\nfrom glob import glob\nfrom dh_syncserver import version\n\netcpath = \"/etc\"\n\nsetup(name='dh_syncserver',\n version=version,\n... | python | chosen |
[
{
"from": "system",
"value": "ADD function to return box gcode\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding=UTF-8\n\"\"\"Module containing Gcode parsing functions\"\"\"\n\n__author__ = \"Dylan Armitage\"\n__email__ = \"d.armitage89@gmail.com\"\n\n\n####---- Imports ----####... | python | chosen |
[
{
"from": "system",
"value": "Add extra space below ending of import\n"
},
{
"from": "human",
"value": "from django.contrib import admin\n\nfrom . import models\n\nadmin.site.register(models.Weekday)\nadmin.site.register(models.Meal)\nadmin.site.register(models.MealOption)\nadmin.site.register(m... | python | chosen |
[
{
"from": "system",
"value": "Enable appstats by default in dev too.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"WSGI app setup.\"\"\"\nimport os\nimport sys\n\nif 'lib' not in sys.path:\n # Add lib as primary libraries directory, with fallback to lib/dist\n # and opt... | python | chosen |
[
{
"from": "system",
"value": "Add media server to dev server\n"
},
{
"from": "human",
"value": "# Django\nfrom django.conf.urls import (\n include,\n url,\n)\nfrom django.contrib import admin\nfrom django.http import HttpResponse\n\nurlpatterns = [\n url(r'^admin/', admin.site.urls),\n ... | python | chosen |
[
{
"from": "system",
"value": "Raise custom ImportError if importing janome fails"
},
{
"from": "human",
"value": "# encoding: utf8\nfrom __future__ import unicode_literals, print_function\n\nfrom os import path\n\nfrom ..language import Language\nfrom ..attrs import LANG\nfrom ..tokens import Do... | python | chosen |
[
{
"from": "system",
"value": "Fix an url and use a callable instead of a string\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf.urls import url\nimport documents.views\n\nurlpatterns = [\n url(r\"^upload/(?P<slug>[^/]*)$\... | python | chosen |
[
{
"from": "system",
"value": "Add keyword arg for backend for log\n\nCan be used to switch out math module with other modules, ex. sympy for\nsymbolic answers\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import (absolute_import, division, print_function)\nimport ma... | python | chosen |
[
{
"from": "system",
"value": "Check is EASY_MAPS_GOOGLE_MAPS_API_KEY is not None before raising warning.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport warnings\n\nfrom django.conf import settings # pylint: disable=W0611\n\nfrom appconf import AppConf\n\n\nclass EasyMapsSe... | python | chosen |
[
{
"from": "system",
"value": "Fix macos shim for gtk 4\n"
},
{
"from": "human",
"value": "try:\n import gi\n\n gi.require_version(\"GtkosxApplication\", \"1.0\")\nexcept ValueError:\n macos_init = None\nelse:\n from gi.repository import GtkosxApplication\n\n macos_app = GtkosxAppl... | python | chosen |
[
{
"from": "system",
"value": "Change Skia ports again, again.\n\nBUG=skia:761\n\nReview URL: https://codereview.chromium.org/413273002\n\ngit-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@285363 0039d316-1c4b-4281-b951-d872f2087c98\n"
},
{
"from": "human",
"value": "# Copyright 2013 The Chrom... | python | chosen |
[
{
"from": "system",
"value": "Build fake frames for later testing.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom stacklogger import srcfile\n\nclass TestUtils(unittest.TestCase):\n \n def test_srcfile(self):\n self.assertTrue(srcfile(\"foo.py\").endswith(\"foo.py\"))\n ... | python | chosen |
[
{
"from": "system",
"value": "fix: Change to multiple verbose option\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"Script for updating a directory of repositories.\"\"\"\nimport logging\nimport os\n\nimport click\n\nfrom .actions import update_repo\n\n\n@click.command()\n@click... | python | chosen |
[
{
"from": "system",
"value": "Configure MIDDLEWARE_CLASSES in test settings\n\nDjango 1.7 complained:\n\n(1_7.W001) MIDDLEWARE_CLASSES is not set.\n HINT: Django 1.7 changed the global defaults for the\n MIDDLEWARE_CLASSES.\n django.contrib.sessions.middleware.SessionMiddleware,\n django.contrib... | python | chosen |
[
{
"from": "system",
"value": "Include version detail in doc\n"
},
{
"from": "human",
"value": "\nprint \"\"\"\nVersion Info\n============\n\nTo obtain version info::\n\n\n from scan.version import __version__, version_history\n print __version__\n print version_history\n\"\"\"\n\nfrom scan... | python | chosen |
[
{
"from": "system",
"value": "Add MIDDLEWARE_CLASSES to test settings\n\nSquelches a warning when using Django 1.7.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nimport django\nfrom django.conf import settings\nfrom django.core.management import call_command\n\n\nsettings.configure(\... | python | chosen |
[
{
"from": "system",
"value": "Fix test fixture to match earlier test change\n"
},
{
"from": "human",
"value": "from spec import eq_\n\nfrom invoke import ctask, Collection\n\n\n@ctask\ndef collection(c):\n c.run('false') # Ensures a kaboom if mocking fails\n\n\nns = Collection(collection)\nns... | python | chosen |
[
{
"from": "system",
"value": "Change the ITK example to use a simpler ITK filter\n"
},
{
"from": "human",
"value": "def transform_scalars(dataset):\n \"\"\"Define this method for Python operators that\n transform the input array.\"\"\"\n from tomviz import utils\n import numpy as np\... | python | chosen |
[
{
"from": "system",
"value": "Add route for preview request\n"
},
{
"from": "human",
"value": "import os\nfrom pyramid.config import Configurator\nfrom sqlalchemy import engine_from_config\n\nfrom .models import DBSession, Base\n\n\ndef main(global_config, **settings):\n '''This function retu... | python | chosen |
[
{
"from": "system",
"value": "Fix pep8 problem, extra new line after header\n\nChange-Id: I6503a000202d321300c5f3cea708d18cf228e77d\n"
},
{
"from": "human",
"value": "#! /usr/bin/env python\n\n# Copyright Lajos Katona\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#... | python | chosen |
[
{
"from": "system",
"value": "Mark dojango as 0.5.7 alpha\n"
},
{
"from": "human",
"value": "VERSION = (0, 5, 6, 'final', 0)\n\ndef get_version():\n version = '%s.%s' % (VERSION[0], VERSION[1])\n if VERSION[2]:\n version = '%s.%s' % (version, VERSION[2])\n if VERSION[3:] == ('alp... | python | chosen |
[
{
"from": "system",
"value": "Remove logger name from logs\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n#\n# Copyright (c) 2016, Neil Booth\n#\n# All rights reserved.\n#\n# See the file \"LICENCE\" for information about the copyright\n# and warranty status of this software.\n\n'''S... | python | chosen |
[
{
"from": "system",
"value": "Save request in new m2m filed\n"
},
{
"from": "human",
"value": "from .models import Campaign, InformationObject\n\n\ndef connect_info_object(sender, **kwargs):\n reference = kwargs.get('reference')\n if not reference:\n return\n if not reference.sta... | python | chosen |
[
{
"from": "system",
"value": "Make NagiosPluginHTTP available from monitoring.nagios.plugin package.\n"
},
{
"from": "human",
"value": "from monitoring.nagios.plugin.base import NagiosPlugin\nfrom monitoring.nagios.plugin.snmp import NagiosPluginSNMP\nfrom monitoring.nagios.plugin.secureshell im... | python | chosen |
[
{
"from": "system",
"value": "Set everything on the report read only.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom mapping.models import Location, Report\n\nclass LocationAdmin(admin.ModelAdmin):\n \n fieldsets = ((None,\n {'fields': (\n ('nam... | python | chosen |
[
{
"from": "system",
"value": "Fix charset default to UTF-8"
},
{
"from": "human",
"value": "# coding: utf-8\r\n\r\n\r\nclass Config(object):\r\n BASE_URL = \"https://ws.pagseguro.uol.com.br\"\r\n VERSION = \"/v2/\"\r\n CHECKOUT_SUFFIX = VERSION + \"checkout\"\r\n NOTIFICATION_SUFFIX ... | python | chosen |
[
{
"from": "system",
"value": "Fix config loader (bug in commit:5bdf6e47 / commit:eefe7561)\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2014 The Pycroft Authors. See the AUTHORS file.\n# This file is part of the Pycroft project and licensed under the terms of\n# th... | python | chosen |
[
{
"from": "system",
"value": "Add .gitcd-personal to .gitignore automaticly\n"
},
{
"from": "human",
"value": "import os\nimport yaml\nfrom gitcd.Config.Parser import Parser\nfrom gitcd.Config.DefaultsPersonal import DefaultsPersonal\n\n\nclass FilePersonal:\n\n loaded = False\n filename = \".... | python | chosen |
[
{
"from": "system",
"value": "Add mandatory methods to HistoryIndexView (refactor when working)\n"
},
{
"from": "human",
"value": "from .view import View\n\n\nclass HistoryIndexView(View):\n pass\n"
},
{
"from": "gpt",
"value": "from .view import View\n\nfrom errno import ENOENT\n... | python | chosen |
[
{
"from": "human",
"value": "Add an example of phase vocoder based time stretch and pitch shift capabilities\n"
},
{
"from": "gpt",
"value": "import zounds\nfrom zounds.spectral import time_stretch, pitch_shift\nfrom zounds.ui import AppSettings\nimport argparse\n\nsr = zounds.SR11025()\nBaseMod... | python | chosen |
[
{
"from": "system",
"value": "Fix autodoc support with Django 1.5\n"
},
{
"from": "human",
"value": "# Settings file to allow parsing API documentation of Django modules,\n# and provide defaults to use in the documentation.\n#\n# This file is placed in a subdirectory,\n# so the docs root won't b... | python | chosen |
[
{
"from": "system",
"value": "Move docstring arg bits into per-arg help\n"
},
{
"from": "human",
"value": "from invoke import ctask as task\n\n\n@task\ndef test(ctx, module=None, runner='spec'):\n \"\"\"\n Run a Spec or Nose-powered internal test suite.\n\n Say ``--module=foo``/``-m foo... | python | chosen |
[
{
"from": "system",
"value": "Add pytest markers for cassandra tests\n"
},
{
"from": "human",
"value": "import mock\nimport pytest\n\nfrom scrapi import settings\nsettings.DEBUG = True\nsettings.CELERY_ALWAYS_EAGER = True\nsettings.CELERY_EAGER_PROPAGATES_EXCEPTIONS = True\n\n\n@pytest.fixture(a... | python | chosen |
[
{
"from": "system",
"value": "Use `delete_all` instead of running cypher query\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Shared fixtures for :mod:`pytest`.\"\"\"\n\nfrom __future__ import print_function, absolute_import\n\nimport os\n\nimport pyte... | python | chosen |
[
{
"from": "system",
"value": "Add required SECRET_KEY setting for Django 1.5+\n"
},
{
"from": "human",
"value": "DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': 'test.db',\n }\n}\n\nINSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.c... | python | chosen |
[
{
"from": "system",
"value": "Add a test for formatting with cli\n"
},
{
"from": "human",
"value": "from mdformat._cli import run\n\n\ndef test_no_files_passed():\n assert run(()) == 0\n"
},
{
"from": "gpt",
"value": "from mdformat._cli import run\n\n\ndef test_no_files_passed():\... | python | chosen |
[
{
"from": "system",
"value": "Increase the version number due this bugfix\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport setuptools\n\nversion = '3.3.0'\n\nsetuptools.setup(\n name=\"alerta-mailer\",\n version=version,\n description='Send emails from Alerta',\n ur... | python | chosen |
[
{
"from": "system",
"value": "Reduce sample count for xorshift_rand tests\n"
},
{
"from": "human",
"value": "# Copyright 2014 Anonymous7 from Reddit, Julian Andrews\n#\n# This software may be modified and distributed under the terms\n# of the MIT license. See the LICENSE file for details.\n\nfr... | python | chosen |
[
{
"from": "system",
"value": "Fix the HDF5 type of mesh_uuid for imported meshes.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom abc import ABCMeta, abstractmethod\nimport uuid\n\n\nclass BaseReader(object, metaclass=ABCMeta):\n @abstractmethod\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix args to list. Args is a tuple, list takes a tuple"
},
{
"from": "human",
"value": "from genes.process.commands import get_env_run\nfrom .traits import only_posix\n\nrun = get_env_run()\n\n\n@only_posix()\ndef chmod(*args):\n # FIXME: this is ugly, name the ar... | python | chosen |
[
{
"from": "system",
"value": "Sort lists prior to computing len of candidates\n"
},
{
"from": "human",
"value": "\n\n# A special triplet is defined as: a <= b <= c for\n# a in list_a, b in list_b, and c in list_c\ndef get_num_special_triplets(list_a, list_b, list_c):\n num_special_triplets = ... | python | chosen |
[
{
"from": "system",
"value": "Use helper function for testing equality.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom mtglib.constants import base_url, card_flags\n\nclass DescribeConstants(unittest.TestCase):\n\n def should_have_base_url(self):\n url = ('http://gatherer.w... | python | chosen |
[
{
"from": "system",
"value": "Add test for force_pathable_endpoint pathfind param\n\nThis parameter is intended to allow pathing to adjacent squares\nof an unpassable square. This is necessary because if you want to\npathfind to a monster which blocks a square, you don't want to\nactually go *onto* the squa... | python | chosen |
[
{
"from": "system",
"value": "Make raw text tests consistent with mammoth.js\n"
},
{
"from": "human",
"value": "from nose.tools import istest, assert_equal\n\nfrom mammoth.raw_text import extract_raw_text_from_element\nfrom mammoth import documents\n\n\n@istest\ndef raw_text_of_text_element_is_v... | python | chosen |
[
{
"from": "system",
"value": "Mark test as xfail so that releases can be cut\n"
},
{
"from": "human",
"value": "import pytest\nimport pika\n\nfrom mettle.settings import get_settings\nfrom mettle.publisher import publish_event\n\n\ndef test_long_routing_key():\n settings = get_settings()\n ... | python | chosen |
[
{
"from": "system",
"value": "Make sure we give an example for two servers.\n"
},
{
"from": "human",
"value": "# put this into ~/.alphahub/config.py and make sure it's\n# not readable by anyone else (it contains passwords!)\n\n# the host we run on and want to receive packets on; note\n# that \"l... | python | chosen |
[
{
"from": "system",
"value": "Add mock X-Forwarded-For header in trackable tests\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n test_trackable\n ~~~~~~~~~~~~~~\n\n Trackable tests\n\"\"\"\n\nimport pytest\n\nfrom utils import authenticate, logout\n\npytestmark = py... | python | chosen |
[
{
"from": "system",
"value": "Clean up an import in simple backend URLs.\n"
},
{
"from": "human",
"value": "\"\"\"\nURLconf for registration and activation, using django-registration's\none-step backend.\n\nIf the default behavior of these views is acceptable to you, simply\nuse a line like this... | python | chosen |
[
{
"from": "system",
"value": "Make compatible with py-redis 3.x\n\nFixes https://github.com/thumbor/remotecv/issues/25\n"
},
{
"from": "human",
"value": "from redis import Redis\n\nfrom remotecv.result_store import BaseStore\nfrom remotecv.utils import logger\n\n\nclass ResultStore(BaseStore):\n... | python | chosen |
[
{
"from": "system",
"value": "Increment version number to 0.4.1dev\n"
},
{
"from": "human",
"value": "__version__ = '0.4.0'\n\n# This list defines all the modules that will be loaded if a user invokes\n# from climLab import *\n\n# totally out of date!\n\n#__all__ = [\"constants\", \"thermo\",... | python | chosen |
[
{
"from": "system",
"value": "Resolve the 500 error when google send a no results info\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom django.utils.encoding import smart_str\nfrom geopy import geocoders\nfrom geopy.exc import GeocoderServi... | python | chosen |
[
{
"from": "human",
"value": "Update : bind client Elevator class to package root\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__title__ = \"Elevator\"\n__author__ = \"Oleiade\"\n__license__ = \"BSD\"\n\n\nfrom client import Elevator\n"
}
] | python | chosen |
[
{
"from": "system",
"value": "Update sniffer tests with new argument passing\n"
},
{
"from": "human",
"value": "from mock import patch\n\nfrom django.test import TestCase\nfrom breach.sniffer import Sniffer\n\n\nclass SnifferTest(TestCase):\n def setUp(self):\n self.endpoint = 'http://... | python | chosen |
[
{
"from": "system",
"value": "Replace my own helper functions with webhelper ones\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"WebHelpers used in SAUCE.\n\n@author: moschlar\n\"\"\"\n\nfrom tg import url as tgurl\nfrom webhelpers import date, feedgenerator, html, number, mis... | python | chosen |
[
{
"from": "system",
"value": "Allow configuration of extensions for types.\n"
},
{
"from": "human",
"value": "import xlrd\nimport os\n\n\nbase_loader_error = 'The Loader class can only be used by extending it.'\n\n\nexcel_extensions = [\n '.xls',\n '.xlsx',\n]\n\n\nclass Loader(object):\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove Keras from network splitter\n\nKeras isn't as stable as h5py and json. This commit removes the keras dependency from the network splitting function.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\"\"\"\nConvert a keras model, saved with model.sav... | python | chosen |
[
{
"from": "system",
"value": "Update the supported file types list exposed to QML to use the new dict correctly\n"
},
{
"from": "human",
"value": "from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal\n\nfrom UM.Application import Application\nfrom UM.Logger import Logger\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Update module init file; begin version stamping here.\n"
},
{
"from": "human",
"value": "\"\"\"\nInstana sensor and tracer. It consists of two modules that can be used as entry points:\n\n- sensor: activates the meter to collect and transmit all kind of built-in met... | python | chosen |
[
{
"from": "system",
"value": "Add KarmTestError we can distinguish and print full tracebacks for unexpected errors. Delete exception trapping--let the test scripts do that.\n\nsvn path=/trunk/kdepim/; revision=367066\n"
},
{
"from": "human",
"value": "import sys\nimport os\n\ndef dcopid():\n '... | python | chosen |
[
{
"from": "system",
"value": "Fix spelling of Restaurant in web backend\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom django.db import models\nfrom model_utils import Choices\n\nclass Report(models.Model):\n \"\"\"Store report information\"\"\"\n REPORT... | python | chosen |
[
{
"from": "system",
"value": "Add some key in config\n"
},
{
"from": "human",
"value": "\r\nAMBIENTE = u'linux'\r\nPROD = False\r\nDEBUG = False\r\nLOG = False\r\nLOGPATH = './Application.log'\r\n\r\nEMAIL_HOST = 'smtp.gmail.com'\r\nEMAIL_LOGIN = 'xxxxxxxx@cnddh.org.br'\r\nEMAIL_PASSWORD = 'senh... | python | chosen |
[
{
"from": "system",
"value": "Fix empty color mode write\n"
},
{
"from": "human",
"value": "\"\"\"\nColor mode data structure.\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\nimport attr\nimport logging\nfrom psd_tools2.psd.base import ValueElement\nfrom psd_tools2.utils impor... | python | chosen |
[
{
"from": "system",
"value": "Use unigrams from warehouse module.\n"
},
{
"from": "human",
"value": "import re\n\nfrom data import warehouse\n\n_WORD_REGEX = re.compile(r'^\\w+$', re.IGNORECASE)\n\n\ndef score_word(word):\n if not _valid(word):\n return False\n if word in warehouse.get('/wo... | python | chosen |
[
{
"from": "system",
"value": "Set application/json mimetype for response.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom flask import Flask, url_for, render_template\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n\treturn render_template('index.html')\n\n@app.route('/r... | python | chosen |
[
{
"from": "system",
"value": "Switch Django version from 1.0 to 1.1\n"
},
{
"from": "human",
"value": "\"\"\"Configuration.\"\"\"\n\nimport logging\nimport os\nimport re\n\nfrom google.appengine.ext.appstats import recording\n\nlogging.info('Loading %s from %s', __name__, __file__)\n\n# Custom w... | python | chosen |
[
{
"from": "system",
"value": "Allow a story to have many authors\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass Author(models.Model):\n name = models.CharField(max_length=255)\n\n def __str__(self):\n return self.name\n\n\nclass Story(models.Model):\n ... | python | chosen |
[
{
"from": "system",
"value": "Change a bit the short description to make it more explicit\n"
},
{
"from": "human",
"value": "name = \"WSME\"\nversion = \"0.3\"\n\ndescription = \"Web Services Made Easy\"\n\nauthor = \"Christophe de Vienne\"\nemail = \"python-wsme@googlegroups.com\"\n\nurl = \"ht... | python | chosen |
[
{
"from": "system",
"value": "Test default values for Riemann\n"
},
{
"from": "human",
"value": "from pytest import fixture\n\nfrom oshino.config import Config, RiemannConfig\n\n\n@fixture\ndef base_config():\n return Config({\"riemann\": {\"host\": \"localhost\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix race condition during `mimetypes` initialization.\n\nInitial patch from Steven R. Loomis.\nCloses #8629.\n\n\ngit-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@9740 af82e41b-90c4-0310-8c96-b1721e28e2e2\n"
},
{
"from": "human",
"value": "# With mod_python we'l... | python | chosen |
[
{
"from": "system",
"value": "Fix conditions in JSON encoder\n"
},
{
"from": "human",
"value": "import json\nimport threading\nimport Queue\n\nfrom datetime import datetime,date,timedelta\nimport time\n\nfrom tornado import gen\nfrom tornado.ioloop import IOLoop\n\n@gen.coroutine\ndef async_slee... | python | chosen |
[
{
"from": "system",
"value": "Use the reset adder from the banks properly\n"
},
{
"from": "human",
"value": "import importlib\nimport os\nimport sys\nimport unittest\nimport code\nimport struct\n\ncode_path = os.path.dirname(__file__)\ncode_path = os.path.join(code_path, os.pardir)\nsys.path.app... | python | chosen |
[
{
"from": "system",
"value": "Fix test after metadata changes\n"
},
{
"from": "human",
"value": "# Copyright (C) 2010 rPath, Inc.\n\nimport testsuite\ntestsuite.setup()\n\nfrom testrunner import testcase\n\nfrom rpath_repeater import models\n\nclass TestBase(testcase.TestCaseWithWorkDir):\n p... | python | chosen |
[
{
"from": "system",
"value": "Update number of fonts in Docker image\n"
},
{
"from": "human",
"value": "\"\"\"\n tests.test_fonts\n ~~~~~~~~~~~~~~~~~~~~~\n Test fonts API.\n\n :copyright: (c) 2018 Yoan Tournade.\n :license: AGPL, see LICENSE for more details.\n\"\"\"\nimport reque... | python | chosen |
[
{
"from": "system",
"value": "Add a test for saving an empty recurrence object\n\nI wasn't sure whether this would fail on models which don't\naccept null values. Turns out it's allowed, so we should\nmake sure it stays allowed.\n"
},
{
"from": "human",
"value": "from tests.models import EventWi... | python | chosen |
[
{
"from": "system",
"value": "Decrease noise from code-style test\n"
},
{
"from": "human",
"value": "import pkg_resources\nimport unittest\n\n\nclass CodeStyleTestCase(unittest.TestCase):\n def test_code_style(self):\n flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts'... | python | chosen |
[
{
"from": "system",
"value": "Add metadata for tracker and docs\n"
},
{
"from": "human",
"value": "__title__ = 'libvcs'\n__package_name__ = 'libvcs'\n__description__ = 'vcs abstraction layer'\n__version__ = '0.3.0'\n__author__ = 'Tony Narlock'\n__github__ = 'https://github.com/vcs-python/libvcs'... | python | chosen |
[
{
"from": "system",
"value": "Fix incorrect libxau library name\n"
},
{
"from": "human",
"value": "from conans import ConanFile, AutoToolsBuildEnvironment, tools\nimport os\n\n\nclass LibxauConan(ConanFile):\n name = \"libxau\"\n version = \"1.0.8\"\n license = \"Custom https://cgit.fre... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in sms router.\n"
},
{
"from": "human",
"value": "\nclass SMSRouter(object):\n\n app_label = 'sms'\n db_name = 'sms'\n\n def db_for_read(self, model, **hints):\n\n if model._meta.app_label == self.app_label:\n return self.db_name\n... | python | chosen |
[
{
"from": "system",
"value": "Use the notice ID as priary key\n\nGentlemen, drop your DBs!\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport xml.etree.ElementTree as ET\nimport sys\nimport pymongo\nfrom pathlib import Path\n\nimport argh\n\nfrom xml2json import etree_to_dict\nf... | python | chosen |
[
{
"from": "system",
"value": "Clean up some LiveFlotWidget params\n"
},
{
"from": "human",
"value": "# This file is part of Moksha.\n#\n# Moksha is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Fo... | python | chosen |
[
{
"from": "system",
"value": "Correct ignored module name for South.\n"
},
{
"from": "human",
"value": "try:\n from south.modelsinspector import add_ignored_fields\n add_ignored_fields([\"^taggit_autosuggest\\.managers\"])\nexcept ImportError:\n pass # without south this can fail silen... | python | chosen |
[
{
"from": "system",
"value": "Add decorator for using websocket subhandlers\n"
},
{
"from": "human",
"value": "def require_request_model(cls, *args, validate=True, **kwargs):\n \"\"\"\n Makes a handler require that a request body that map towards the given model\n is provided. Unless th... | python | chosen |
[
{
"from": "system",
"value": "Fix of tests with unicode strings\n"
},
{
"from": "human",
"value": "\"\"\"Sample unittests.\"\"\"\n\nimport unittest2 as unittest\n\nfrom domain_models import model\nfrom domain_models import fields\n\n\nclass User(model.DomainModel):\n \"\"\"Example user domain... | python | chosen |
[
{
"from": "system",
"value": "Use relative imports for consistency; pep8\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import division\n\nimport numpy as np\n\nfrom astropy.tests.helper import pytest\nfrom photutils.psf import... | python | chosen |
[
{
"from": "system",
"value": "Fix Copyright Headers - Rename LLC to Foundation\n\nOne code change, rest are in headers\n\nChange-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1\n"
},
{
"from": "human",
"value": "# Copyright 2012 Intel Inc, OpenStack LLC.\n# All Rights Reserved.\n#\n# Licensed u... | python | chosen |
[
{
"from": "system",
"value": "Hide Python 2.6 Exception.message deprecation warnings\n"
},
{
"from": "human",
"value": "\"\"\"\nModule containing package exception classes.\n\"\"\"\n\n\nclass Invalid(Exception):\n\n def __init__(self, message, exceptions=None, validator=None):\n Except... | python | chosen |
[
{
"from": "system",
"value": "Add 12/2 part 1 solution\n"
},
{
"from": "human",
"value": "# Advent of Code\n# Dec 2, Part 1\n# @geekygirlsarah\n\n"
},
{
"from": "gpt",
"value": "# Advent of Code\n# Dec 2, Part 1\n# @geekygirlsarah\n\ninputFile = \"input.txt\"\n\n# Tracking vars\nfina... | python | chosen |
[
{
"from": "system",
"value": "Return verifier function, not None. Also reset the temporary file to the beginning before verifying it.\n"
},
{
"from": "human",
"value": "import zipfile\nimport tarfile\nimport shutil\nimport tempfile\nfrom osgeo import gdal\n\n\ndef is_zip(tmp):\n \"\"\"\n R... | python | chosen |
[
{
"from": "system",
"value": "Add option to count components\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\nimport sys, os\nimport argparse\nfrom deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo\n\ndef main(argv=None):\n\n parser = argparse.ArgumentPa... | python | chosen |
[
{
"from": "system",
"value": "Add form for accepting contract variation\n"
},
{
"from": "human",
"value": "from flask.ext.wtf import Form\nfrom wtforms import BooleanField\nfrom wtforms.validators import DataRequired, Length\nfrom dmutils.forms import StripWhitespaceStringField\n\n\nclass Signer... | python | chosen |
[
{
"from": "system",
"value": "Update version to 0.7.0 for release\n"
},
{
"from": "human",
"value": "\"\"\"EVELink - Python bindings for the EVE API.\"\"\"\n\nimport logging\n\nfrom evelink import account\nfrom evelink import api\nfrom evelink import char\nfrom evelink import constants\nfrom eve... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.