conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Drop obsoleted support for offset.\n" }, { "from": "human", "value": "from .base import Base\n\n\nclass List(Base):\n current = None\n\n def __init__(self, result, object_type):\n Base.__init__(self, result)\n self.object_type = object_type\n\n ...
python
chosen
[ { "from": "system", "value": "Print data when citybikes throws error.\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand, CommandError\nfrom optparse import make_option\nimport os\nimport sys\n\nclass Command(BaseCommand):\n\thelp = 'Fetch bicikelj XMLs and st...
python
chosen
[ { "from": "system", "value": "Fix name of Aritlce Parent Chooser view as used by the URLs\n" }, { "from": "human", "value": "from django.conf.urls import url\n\nfrom molo.core.content_import.api import admin_views\n\n\nurlpatterns = [\n url(r\"^import-articles/$\", admin_views.ArticleImportVi...
python
chosen
[ { "from": "system", "value": "Read custom variables (Required to support CentOS Stream)\n" }, { "from": "human", "value": "dnf_failure = False\nbase = dnf.Base()\n\ntry:\n base.read_all_repos()\n base.fill_sack()\n upgrades = base.sack.query().upgrades().run()\n\nexcept:\n dnf_failur...
python
chosen
[ { "from": "system", "value": "Fix standards tests for log levels\n" }, { "from": "human", "value": "import sys\n\ndef test_level_standards(logging, log):\n \"\"\"\n Ensure that the standard log levels work \n \"\"\"\n import logging_levels.standards \n del sys.modules['logging_...
python
chosen
[ { "from": "system", "value": "Remove a database access from the template tag.\n\n--HG--\nbranch : schema-invitations\n" }, { "from": "human", "value": "from django import template\n\nfrom ..schema import is_shared_model as _is_shared_model\nfrom ..schema import get_schema_model\n\nSchema = get_s...
python
chosen
[ { "from": "system", "value": "Add `**kwargs` support to transformers\n" }, { "from": "human", "value": "import logging\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom ..utils import Timer\n\n__all__ = ['PureTransformer', 'identity']\n\n\nlogger = logging...
python
chosen
[ { "from": "system", "value": "Add test cases for unexpected page_limit\n" }, { "from": "human", "value": "from hn import HN\n\nhn = HN()\n\ndef test_pagination_top():\n \"\"\"\n This test checks if the pagination works for the front page by comparing\n number of stories in 2 pages.\n ...
python
chosen
[ { "from": "system", "value": "workbench: Mark env setter line as noqa\n" }, { "from": "human", "value": "# This file is part of Shuup.\n#\n# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.\n#\n# This source code is licensed under the OSL-3.0 license found in the\n# LICENSE file...
python
chosen
[ { "from": "system", "value": "Fix module import problem, make code more pep compliant, add utf8 encoding\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nimport sys\nfrom bottle import route,run,template,static_file\n#from lib import mydb\n\nbase=os.path.dirname(os.path.realp...
python
chosen
[ { "from": "system", "value": "Update UI preferences model (list)\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nResource information of host\n\"\"\"\n\n\ndef get_name():\n \"\"\"\n Get name of this resource\n\n :return: name of this resource\n...
python
chosen
[ { "from": "system", "value": "Add missing init_context to sample divison\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom flask.ext.babel import gettext\nfrom ..division import Division\nimport user\n\ndivision = Division(\n name='sample',\n display_name=gettext(\"Beispie...
python
chosen
[ { "from": "system", "value": "Replace incorrect JS_MIMETYPES with CSS_MIMETYPES\n" }, { "from": "human", "value": "from django.conf import settings\nfrom mediasync import JS_MIMETYPES\nimport os\nfrom subprocess import Popen, PIPE\n\ndef _yui_path(settings):\n if not hasattr(settings, 'MEDIAS...
python
chosen
[ { "from": "system", "value": "Add function to generate artifact rules.\n\nAdds a function to before_after_filesystem_snapshot.py called\ngenerate_artifact_rules.\n" }, { "from": "human", "value": "def snapshot(before_dict, after_dict):\n '''before_after_snapshot is a simple function that return...
python
chosen
[ { "from": "system", "value": "Fix empty file names messin stuff up.\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.views.static import serve\nfrom django.http import HttpResponse\nfrom django.views.decorators.csrf import csrf_view_exempt\n\nimport json\nimport o...
python
chosen
[ { "from": "system", "value": "Split the XFR output into an array of values.\n\nHad to split on \\n. Need to go through the code more and figure out why it doesn't actually present itself\nupon printing\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport dns.query\nimport dns.zone\...
python
chosen
[ { "from": "system", "value": "Use the proper entry point name.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\nimport uuid\n\nfrom jirafs_list_table import __version__ as version_string\n\n\nrequirements_path = os.path.join(\n os.path.dirname(__file_...
python
chosen
[ { "from": "system", "value": "Update the classification to production/stable.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport os\n\nfrom distutils.core import setup\n\n\nhere = os.path.dirname(__file__)\n\ndef get_long_desc():\n return open(os.path.join(here, 'README.rst'...
python
chosen
[ { "from": "system", "value": "Add tuple containing all supported archive formats and their human-readable description.\n" }, { "from": "human", "value": "from .tarball import TarballArchiver\nfrom .zipfile import ZipArchiver\n\n\nTARBALL = TarballArchiver.UNCOMPRESSED\nTARBALL_GZ = TarballArchiv...
python
chosen
[ { "from": "system", "value": "Add username to context in iceberg_settings context processor\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom django_iceberg.auth_utils import init_iceberg, get_conf_class\n\ndef iceberg_sett...
python
chosen
[ { "from": "system", "value": "Set pypi development status to Pre-Alpha\n" }, { "from": "human", "value": "from setuptools import find_packages\nfrom setuptools import setup\n\n\nsetup(\n name='caravan',\n version='0.0.3.dev0',\n description='Light python framework for AWS SWF',\n lon...
python
chosen
[ { "from": "system", "value": "Include package data in release\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nexecfile('police_api/version.py')\n\nsetup(\n name='police-api-client',\n version=__version__, # NOQA\n description='...
python
chosen
[ { "from": "system", "value": "Add sphinx to dev requirements\n" }, { "from": "human", "value": "from setuptools import setup\n\nname = 'turbasen'\nVERSION = '2.5.0'\n\nsetup(\n name=name,\n packages=[name],\n version=VERSION,\n description='Client for Nasjonal Turbase REST API',\n ...
python
chosen
[ { "from": "system", "value": "Include Twisted plugin in install.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\n\ndef listify(filename):\n return filter(None, open(filename, 'r').read().split('\\n'))\n\n\nsetup(\n name=\"vumi\",\n version=\"0.4.0a\",\n...
python
chosen
[ { "from": "system", "value": "Change trove classifier to show project is now stable\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nwith open('README.rst') as readme_f:\n README ...
python
chosen
[ { "from": "system", "value": "Add a correct dir to sys.path, remove unused imports.\n" }, { "from": "human", "value": "import os\nimport sys\n\nfrom os.path import join as pjoin\n\nfrom setuptools import setup\nfrom setuptools import Command\nfrom subprocess import call\n\n\ndef read_version_str...
python
chosen
[ { "from": "system", "value": "Include the requirements.txt contents in install_requires.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nversion = \"0.10\"\n\nsetup(\n name=\"pycoinnet\",\n version=version,\n packages=[\n \"pycoinnet\",...
python
chosen
[ { "from": "system", "value": "Upgrade requirements to be Django 1.2.5\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nversion = '1.2.0'\n\nsetup(name=\"Miro Community\",\n version=version,\n packages=find_packages(),\n author='Participatory Cultur...
python
chosen
[ { "from": "system", "value": "Install wagtail only if needed.\n\nIn my case, I'm using not yet released to pypi wagtail, from master branch, and this setup script tries to install old wagtail and old django." }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\nInstall wagtailsettings ...
python
chosen
[ { "from": "system", "value": "Add pandas as optional dependency.\n" }, { "from": "human", "value": "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nwith open('README.rst') as fp:\n readme = fp.read()\n\nwith open('HISTORY.rst') as fp:\n history...
python
chosen
[ { "from": "system", "value": "Split out the dependencies of client and server.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name=\"rotterdam\",\n version=\"0.3.2\",\n description=(\n \"Simple distributed job queue via redis.\"\n ),\n author=\"...
python
chosen
[ { "from": "system", "value": "Add links to github project page\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\n__VERSION__ = '0.2.4'\n\nlong_description = \"See https://furtive.readthedocs.org\"\n\nsetup(name='Furtive',\n version=__VERSION__,\...
python
chosen
[ { "from": "system", "value": "Add license information, and update project url.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(name='sms_auth_service',\n version='0.0.1',\n description='An SMS backed authorization micro-service',\n packages=['sms_auth_serv...
python
chosen
[ { "from": "system", "value": "Upgrade requests library to version 2.1.1\n\nUpgrade the `requests` library to match the version provided by Ubuntu\nTrusty, version 2.1.1.\n\nThis is to prevent a conflict on Ubuntu Trusty between system Python\nlibraries and Pip libraries.\n\nSpecifically, Pip relies on the `...
python
chosen
[ { "from": "system", "value": "Fix entry point for pretty printing script.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\n# Prevent \"TypeError: 'NoneType' object is not callable\" error\n# when running python setup.py test \n# (see http://www.eby-sarna.com/pipe...
python
chosen
[ { "from": "system", "value": "Add warning if large_description is not generated\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nimport os\nfrom osuapi import __version__ as version, __title__ as name, __author__ as author, __license__ as license\n\n\ndef read(fnam...
python
chosen
[ { "from": "system", "value": "Bump version number for the next release.\n" }, { "from": "human", "value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nconfig = {\n 'description': 'regetron is a simple shell for playing with regular express...
python
chosen
[ { "from": "system", "value": "Add pyyaml and use lower case lib names\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"adbons\",\n version=\"0.0.1\",\n author=\"Daniel Bälz\",\n author_email=\"me@dbaelz.de\",\n description=\"\"\"A w...
python
chosen
[ { "from": "system", "value": "Make sure hook can actually be instantiated (generic DbApiHook cannot)\n" }, { "from": "human", "value": "from airflow.hooks.dbapi_hook import DbApiHook\nimport great_expectations as ge\n\n\nclass ExpectationMySQLHook(DbApiHook):\n\n def __init__(self, *args, **k...
python
chosen
[ { "from": "system", "value": "Refresh package data to assure better pyghmi and confetty\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='confluent_client',\n version='0.1.1',\n author='Jarrod Johnson',\n author_email='jbjohnso@us.ibm.com',\n url='h...
python
chosen
[ { "from": "system", "value": "Use mocking to fix the result of hashing files\n" }, { "from": "human", "value": "\"\"\"\nTests of overall functionality\n\"\"\"\n\nimport pytest\nimport toolaudit\nimport yaml\n\n\ndef test_simple_audit(capsys):\n \"\"\"\n Check simple audit gives the expecte...
python
chosen
[ { "from": "system", "value": "Remove overide of default scriptpath\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n__version__ = '$Id$'\n\nfrom pywikibot import family\n\n# The Wikitech family\n\nclass Family(family.Family):\n\n def __init__(self):\n super(Family, self)....
python
chosen
[ { "from": "system", "value": "Fix failing test and make lint\n" }, { "from": "human", "value": "import flask\nfrom donut.modules.groups import helpers as groups\n\n\ndef has_permission(user_id, permission_id):\n ''' \n Returns True if [user_id] holds a position that directly \n or indir...
python
chosen
[ { "from": "system", "value": "Remove customer server error view temporarily.\n" }, { "from": "human", "value": "from django.conf.urls import include, url\nfrom django.contrib import admin\n\nfrom lists.views import home_page\nfrom core.views import custom_server_error\n\n# error pages\n# handler...
python
chosen
[ { "from": "system", "value": "TEST: Add a smoke test for cross_val_score\n" }, { "from": "human", "value": "\"\"\" Test the cross_val module\n\"\"\"\n\nimport numpy as np\n\nimport nose\n\nfrom .. import cross_val\n\ndef test_kfold():\n # Check that errors are raise if there is not enough sam...
python
chosen
[ { "from": "system", "value": "Support new and old Django urlconf imports\n" }, { "from": "human", "value": "from django.conf.urls.defaults import *\n\nurlpatterns = patterns(\n 'premis_event_service.views',\n # begin CODA Family url structure >\n (r'^APP/$', 'app'),\n # node urls\n ...
python
chosen
[ { "from": "system", "value": "Update license attribute to return binary and raw result\n" }, { "from": "human", "value": "from utilities import url_to_json\n\n\ndef run(project_id, repo_path, cursor, **options):\n query = 'SELECT url FROM projects WHERE id = ' + str(project_id)\n cursor.ex...
python
chosen
[ { "from": "system", "value": "Add 'Machine Identifier' for easy support lookups in Troposphere\n" }, { "from": "human", "value": "from core.models import Application as Image\n\nfrom api import permissions\nfrom api.v2.serializers.details import ImageSerializer\nfrom api.v2.views.base import Aut...
python
chosen
[ { "from": "system", "value": "Add return value: tcc path.\n" }, { "from": "human", "value": "#! /usr/bin/env python\n# coding=utf-8\n\nimport os.path\nimport subprocess\n\n\nclass SubTask():\n def __init__(self, output_dir, log):\n self.__output_dir = output_dir\n self.__log = l...
python
chosen
[ { "from": "system", "value": "Update a SeleniumBase tour example\n" }, { "from": "human", "value": "from seleniumbase import BaseCase\n\n\nclass MyTestClass(BaseCase):\n\n def test_basic(self):\n self.open('https://xkcd.com/1117/')\n self.assert_element('img[alt=\"My Sky\"]')\n ...
python
chosen
[ { "from": "system", "value": "Add test cases and comments\n" }, { "from": "human", "value": "# You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise\n# solve with O(1) additional memory\n\ndef rotate_image(a):\n\tn = len(a)\n\n\tif a is None or n < 1...
python
chosen
[ { "from": "system", "value": "Return N for ref allele in pos uncovered by ref\n\nThis arose during processing of a CGI var file originating from LFR\ndata (not sure, but LFR is an advanced technique, so it's possible CGI\nis calling some positions that aren't called in reference).\n" }, { "from": "h...
python
chosen
[ { "from": "system", "value": "Add created and modified date mixins\n" }, { "from": "human", "value": "from radar.models.users import User\nfrom radar.serializers.fields import StringField, IntegerField\nfrom radar.serializers.models import ModelSerializer\n\n\nclass TinyUserSerializer(ModelSeria...
python
chosen
[ { "from": "system", "value": "Fix bug in countdonw hours calculation\n" }, { "from": "human", "value": "from django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.http import HttpResponse\nfrom django.utils.http import urlencode\n\nimport json\nimpor...
python
chosen
[ { "from": "system", "value": "Add __all__ variable to enforce ordering in docs\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# Artifacts - Artifactory Search Client\n#\n# Copyright 2015 Smarter Travel\n#\n# Available under the MIT license. See LICENSE for details.\n#\n\n\"\"\"\n...
python
chosen
[ { "from": "system", "value": "Add 'cd -' feature to change to the previous working directory.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@141846 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "\"\"\"Utility for changing directories and execution of commands ...
python
chosen
[ { "from": "system", "value": "Make thread pool scheduler behave as a pooled new thread scheduler\n" }, { "from": "human", "value": "import logging\nfrom concurrent.futures import ThreadPoolExecutor\n\nfrom rx.core import Scheduler, Disposable\nfrom rx.disposables import SingleAssignmentDisposabl...
python
chosen
[ { "from": "system", "value": "Handle capital \"V\" in URL\n" }, { "from": "human", "value": "import re\n\nARXIV_ID_PATTERN = r\"([a-z\\-]+(?:\\.[A-Z]{2})?/\\d{7}|\\d+\\.\\d+)(v\\d+)?\"\nARXIV_ID_RE = re.compile(ARXIV_ID_PATTERN)\nARXIV_URL_RE = re.compile(fr\"arxiv.org/[^\\/]+/({ARXIV_ID_PATTERN...
python
chosen
[ { "from": "system", "value": "Update Pymunk recipe to 6.0.0\n" }, { "from": "human", "value": "from os.path import join\nfrom pythonforandroid.recipe import CompiledComponentsPythonRecipe\n\n\nclass PymunkRecipe(CompiledComponentsPythonRecipe):\n name = \"pymunk\"\n version = '5.5.0'\n ...
python
chosen
[ { "from": "system", "value": "Add custom error class 'InvalidType'\n" }, { "from": "human", "value": "\"\"\"\nscrapple.utils.exceptions\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFunctions related to handling exceptions in the input arguments\n\"\"\"\n\nimport re\n\n\ndef check_arguments(args):\n\t\"\"\"\n\t...
python
chosen
[ { "from": "system", "value": "Allow multiple lines of traceback.\n" }, { "from": "human", "value": "#!/usr/bin/python3\n\nfrom pprint import pprint\nimport json\nimport sys\n\ndef get(obj, path):\n try:\n for part in path:\n obj = obj[part]\n return obj\n except Ke...
python
chosen
[ { "from": "system", "value": "Add Apache 2.0 license to source file\n\nSource code should be licensed under the Apache 2.0 license.\nAll source files should have the licensing header.\n\nChange-Id: I67df47560d87182265ec4fa973bddaf356829fc1\n" }, { "from": "human", "value": "from __future__ impor...
python
chosen
[ { "from": "system", "value": "Change self.accounts to self.info for getting the cached password hash\n" }, { "from": "human", "value": "from module.plugins.Account import Account\n\nfrom module.common.json_layer import json_loads\n\nclass ReloadCc(Account):\n __name__ = \"ReloadCc\"\n __...
python
chosen
[ { "from": "system", "value": "Add test with standard lib\n\nmath.cos( should return <Param: x @0,0>\n" }, { "from": "human", "value": "\"\"\"\nTest compiled module\n\"\"\"\nimport os\nimport platform\nimport sys\nimport jedi\n\nfrom .helpers import cwd_at\n\n\n@cwd_at('test/extensions')\ndef tes...
python
chosen
[ { "from": "system", "value": "Fix tests for Python 3\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport pytest\nimport types\nfrom rakuten_ws.webservice import RakutenWebService\nfrom rakuten_ws.base import RakutenAPIResponse \n\n\n@pytest...
python
chosen
[ { "from": "system", "value": "Use “helpers” as independent module for “tests.runtests” environment\n" }, { "from": "human", "value": "# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:\n\n# python-quilt - A Python implementation of the quilt patch system\n#\n# See LICENSE comming with the source of p...
python
chosen
[ { "from": "system", "value": "Fix recursive logging error wheni GrayFilter is in use and \"django\" logger is at DEBUG leve\n" }, { "from": "human", "value": "from .request import GLOBALS\nfrom django.conf import settings\nimport logging\n\n\nclass GrayFilter(logging.Filter): # pragma: no cover...
python
chosen
[ { "from": "system", "value": "DOC: Add warning if IPython isn't installed.\n" }, { "from": "human", "value": "from .checkpoints import PostgresCheckpoints\nfrom .pgmanager import PostgresContentsManager\n\n__all__ = [\n 'PostgresCheckpoints',\n 'PostgresContentsManager',\n]\n" }, { ...
python
chosen
[ { "from": "system", "value": "Put api.__version__ back in after version shuffle\n" }, { "from": "human", "value": "# Copyright 2017 Planet Labs, 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...
python
chosen
[ { "from": "system", "value": "Create config paths if needed, find files and (for now) report remotes.\n" }, { "from": "human", "value": "#!/usr/bin/env python2.7\n#coding: utf8\n\n\"\"\"\nKSP Add-on Version Checker.\n\"\"\"\n# Copyright 2014 Dimitri \"Tyrope\" Molenaars\n\n# Licensed under the A...
python
chosen
[ { "from": "system", "value": "Add tests to compute from rules property\n" }, { "from": "human", "value": "#!/usr/bin/env python\r\n\"\"\"\r\n:Author Patrik Valkovic\r\n:Created 23.06.2017 16:39\r\n:Licence GNUv3\r\nPart of grammpy\r\n\r\n\"\"\"\r\n\r\nfrom unittest import main, TestCase\r\nfrom ...
python
chosen
[ { "from": "system", "value": "Fix error in enclosed mass calculation and fix unit handling.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -----------------------------------------------------------------------------\n# GENHERNQUIST.ENCMASS\n# Laura L Watkins [lauralwatkins@gmail.co...
python
chosen
[ { "from": "system", "value": "Set the `default_filename` for `GrafanaHandler`.\n" }, { "from": "human", "value": "import os\nimport tornado.web\nfrom loadsbroker.webapp.api import RootHandler, RunHandler\nfrom loadsbroker.webapp.views import GrafanaHandler\n\n\n_GRAFANA = os.path.join(os.path.di...
python
chosen
[ { "from": "system", "value": "Remove dependency on the future lib.\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nimport django_rq\n\nfrom ievv_opensource.ievv_batchframework.models import BatchOperation\nfrom ievv_opensource.ievv_batchframework import batchregistry...
python
chosen
[ { "from": "system", "value": "Change Linac pulse duration interval to 150 ns\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nimport math as _math\nimport numpy as _np\nimport pyaccel as _pyaccel\nimport mathphys as _mp\nfrom . import optics_mode_M0 as _optics_mode_M0\n\n_default_opt...
python
chosen
[ { "from": "system", "value": "Update history capability for \"F Minus\"\n" }, { "from": "human", "value": "from comics.aggregator.crawler import GoComicsComCrawlerBase\nfrom comics.core.comic_data import ComicDataBase\n\n\nclass ComicData(ComicDataBase):\n name = \"F Minus\"\n language = \...
python
chosen
[ { "from": "system", "value": "Use boost 1.71.0 for conan\n\nhttps://github.com/conan-io/conan-center-index/issues/214#issuecomment-564074114\n" }, { "from": "human", "value": "from conans import ConanFile, CMake\nfrom conans.tools import load\nimport re\n\n\ndef get_version():\n try:\n ...
python
chosen
[ { "from": "system", "value": "Add unique constraint to rid" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\n app.models\n ~~~~~~~~~~\n\n Provides the SQLAlchemy models\n\"\"\"\nfrom __future__ import (\n absolute_import, division, print_function, with_statement,\n ...
python
chosen
[ { "from": "system", "value": "Migrate command line interface to hug\n" }, { "from": "human", "value": "#!notify/bin/python3\n\nimport os\nimport sys\nfrom pushbullet import Pushbullet\n\n\ndef create_note(title, content):\n api_key = os.environ[\"PB_API_KEY\"]\n pb = Pushbullet(api_key)\n ...
python
chosen
[ { "from": "system", "value": "Handle unset default currency better\n" }, { "from": "human", "value": "from PySide import QtGui\r\n\r\nimport cbpos\r\n\r\nfrom cbpos.mod.currency.models.currency import Currency\r\n\r\nclass CurrencyConfigPage(QtGui.QWidget):\r\n label = 'Currency'\r\n \r\n ...
python
chosen
[ { "from": "system", "value": "Set notification.backends.EmailBackend.sensitivity = 3, so that it has a different sensitivity from the WebBackend\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.mail import EmailMessage\n\nfrom notification.backends.base impor...
python
chosen
[ { "from": "system", "value": "Add setproctitle wrapper so it's optional.\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>\n" }, { "from": "human", "value": "from django.db import models\nfrom django.conf import settings\nfrom django.utils.importlib import import...
python
chosen
[ { "from": "system", "value": "Apply recursion to quick sort\n" }, { "from": "human", "value": "# Sort list using recursion\n\ndef quick_sort(lst):\n\tif len(lst) == 0:\n\t\tprint []\n\n\tleft = []\n\tright = []\n\tpivot = lst[0]\n\n\t# compare first element in list to the rest\n\tfor i in range(...
python
chosen
[ { "from": "system", "value": "Add utility to import all submodules of all apps.\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>\n" }, { "from": "human", "value": "from django.utils.importlib import import_module\nfrom django.core.exceptions import MiddlewareNot...
python
chosen
[ { "from": "system", "value": "Implement some URL parameter options\n" }, { "from": "human", "value": "import io\n\nimport dont_tread_on_memes\n\nimport flask\n\napp = flask.Flask(__name__)\n\n\n@app.route(\"/\", defaults={\"caption\": \"tread on\"})\n@app.route(\"/<caption>/\")\ndef main(caption...
python
chosen
[ { "from": "system", "value": "Use raspistill and provide some additional error info\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport tempfile\nimport subprocess\n\nimport web\n\nurls = (\"/camera\", \"Camera\")\napp = web.application(urls, globals())\n\n\nclass Camera(object):\...
python
chosen
[ { "from": "system", "value": "Correct button text in functional test\n" }, { "from": "human", "value": "from django_webtest import WebTest\nfrom bs4 import BeautifulSoup\n\nfrom django.contrib.admin.models import User\n\n\nclass NomnomTest(WebTest):\n\n fixtures = ['users.json',]\n\n def t...
python
chosen
[ { "from": "system", "value": "Use loop.create_future if it exists\n" }, { "from": "human", "value": "import asyncio\n\nfrom .protocol import Protocol\n\n\n__all__ = ('connect',)\n\n\nclass Connection:\n def __init__(self, protocol, transport, loop):\n self._protocol = protocol\n ...
python
chosen
[ { "from": "system", "value": "Fix repetitive adding of cmake macro recommendation\n" }, { "from": "human", "value": "# vim: set ts=4 sw=4 et: coding=UTF-8\n\n# We basically extend rpmcheck\nfrom .rpmcheck import RpmCheck\n\n\nclass RpmBuild(RpmCheck):\n \"\"\"\n Replace various trouble...
python
chosen
[ { "from": "system", "value": "Add organization projects to docs\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nfrom rest_framework.response import Response\n\nfrom sentry.api.bases.organization import OrganizationEndpoint\nfrom sentry.api.permissions import assert_p...
python
chosen
[ { "from": "system", "value": ": Create documentation of DataSource Settings \n\nTask-Url: " }, { "from": "human", "value": "######\n# Check ExId (GUID) by Email through JDBC\n#\n# Author: Christoph Stoettner\n# Mail: christoph.stoettner@stoeps.de\n# Documentation: http://scri...
python
chosen
[ { "from": "system", "value": "Add sphinx autosection label plugin.\n" }, { "from": "human", "value": "from datetime import date\n\nimport guzzle_sphinx_theme\n\nfrom pyinfra import __version__\n\n\ncopyright = 'Nick Barrett {0} — pyinfra v{1}'.format(\n date.today().year,\n __version__,\n)...
python
chosen
[ { "from": "system", "value": "Add column support for sql server\n" }, { "from": "human", "value": "from django.db import connection\nfrom django.db.models.fields import *\nfrom south.db import generic\n\nclass DatabaseOperations(generic.DatabaseOperations):\n \"\"\"\n django-pyodbc (sql_se...
python
chosen
[ { "from": "system", "value": "Include test files when packaging osg-configure\n\ngit-svn-id: 8e6470fdf0410dbd375d7ca1c7e7b1f4e5857e13@14556 4e558342-562e-0410-864c-e07659590f8c\n" }, { "from": "human", "value": "from distutils.core import setup\nimport glob,re\n\nconfig_files = glob.glob('config...
python
chosen
[ { "from": "system", "value": "Include Cython output in sdist\n" }, { "from": "human", "value": "# -*- encoding: utf-8 *-*\n#!/usr/bin/env python\nimport sys\nfrom setuptools import setup, Extension\nfrom Cython.Distutils import build_ext\n\ndependencies = ['pycrypto', 'msgpack-python', 'pbkdf2.p...
python
chosen
[ { "from": "system", "value": "Update iprestrict models in initial data\n" }, { "from": "human", "value": "\"\"\"Disable iprestriction completely.\"\"\"\n\nfrom iprestrict.models import IPGroup, IPRange, Rule\n\n\ndef load_data(**kwargs):\n allow_all()\n\n\ndef allow_all():\n all_group = ge...
python
chosen
[ { "from": "system", "value": "Fix bug, InvalidInputError not defined." }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom schematics.exceptions import ConversionError, ValidationError\n\n\ndef validate(schema, data):\n try:\n schema.import_data(data)\n schema.valida...
python
chosen
[ { "from": "system", "value": "Test case for Question method added\n\nA test case to avoid future published questions read as recently added\n" }, { "from": "human", "value": "from django.test import TestCase\n\n# Create your tests here.\n" }, { "from": "gpt", "value": "import datetim...
python
chosen
[ { "from": "system", "value": "Remove print(\"failing back on pretty_print\") when using dolo-recs\n" }, { "from": "human", "value": "#from __future__ import print_function\n\n# This module is supposed to be imported first\n# it contains global variables used for configuration\n\n\n# try to regis...
python
chosen
[ { "from": "system", "value": "Handle register flag; use CONN_MGR_PARAM_FLAG_REQUIRED not 1L\n\n\n20070911135601-4210b-dec39420c4af7a81bd9b6060cb81d787ebb707fc.gz\n" }, { "from": "human", "value": "#!/usr/bin/python\nimport sys\nimport telepathy\nfrom telepathy.interfaces import CONN_MGR_INTERFAC...
python
chosen