conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove version restriction from opt_einsum.\n\nSee https://github.com/dgasmith/opt_einsum/issues/98.\n" }, { "from": "human", "value": "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file e...
python
chosen
[ { "from": "system", "value": "Add classifiers for Python 3.2 and 3.3\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nfrom setuptools import setup, find_packages\n\nimport versions\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()...
python
chosen
[ { "from": "system", "value": "Add requirement 'six', required for configobj.\n" }, { "from": "human", "value": "import sys\nIS_PYTHON3 = sys.version_info[0] == 3\nif not IS_PYTHON3:\n print(\"Error: signac requires python version >= 3.x.\")\n sys.exit(1)\n\nfrom setuptools import setup, fi...
python
chosen
[ { "from": "system", "value": "Write long description as git flavoured markdown\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom distutils.core import setup\nimport sys\nimport os\n\nversion = '1.1.5'\n\ntry:\n import pypandoc\n long_description = pypandoc.convert('README.md',...
python
chosen
[ { "from": "system", "value": "Include README to data_files properly\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport websitepoller\nfrom setuptools import setup\n\ndescription = \"Polls specified websites and alerts using system notifications.\"\ntry:\n ...
python
chosen
[ { "from": "system", "value": "Remove template's text and fix url to github\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n README = readme.read()\n\n# allow set...
python
chosen
[ { "from": "system", "value": "Fix open call for LICENSE.txt\n\nCloses #76" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom pytube import __version__\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nwith o...
python
chosen
[ { "from": "system", "value": "Declare explicitly supported python versions\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nfrom setuptools import setup\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\ntest_requirements = []\nwith open('./requir...
python
chosen
[ { "from": "system", "value": "Change Planning to Pre Alpha\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\n\ndef install():\n\n setup(\n name='dogu',\n version='1.0',\n license='MIT',\n description='Dogu serv...
python
chosen
[ { "from": "system", "value": "Change name of module made by cython to rk4cython to test.\n" }, { "from": "human", "value": "from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\nimport numpy\nimport configuration\n\next_modules = [Ex...
python
chosen
[ { "from": "system", "value": "Bump to 2.0 to get past old django-compress\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n from setu...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.5.2 for new release.\n\n\n\ngit-svn-id: 81b94fb54a9ccc5de77f18f0566c533f73bbb9c4@41 b1010a0a-674b-0410-b734-77272b80c875\n" }, { "from": "human", "value": "#!/usr/bin/python2.4\nfrom distutils.core import setup\n\nsetup(name='mox',\n ...
python
chosen
[ { "from": "system", "value": "Add upper bound on PyMongo version for future compatibility\n" }, { "from": "human", "value": "import setuptools\n\nsetuptools.setup(\n name=\"Monufacture\",\n version=\"2.0.0\",\n author=\"Tom Leach\",\n author_email=\"tom@gc.io\",\n description=\"A ...
python
chosen
[ { "from": "system", "value": "Add official OSI name in the license metadata\n\nThis makes it easier for automatic license checkers to verify the license of this package." }, { "from": "human", "value": "import os\nfrom glob import glob\nfrom setuptools import setup, find_packages\n\n\ndef read(f...
python
chosen
[ { "from": "system", "value": "Add 'Systems Administration' to the list of project classifiers\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nfrom suponoff import __version__ as version\n\n\nif __name__ == '__main__':\n with open(\"README.rst\") as f:\n ...
python
chosen
[ { "from": "system", "value": "Increment version for deployment to PyPI\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nrequires = [\n 'configparser',\n 'python-dateutil',\n 'pytz',\n 'requests',\n 'simplejson'\n]\n\nsetup(\n name='amaascore',\n...
python
chosen
[ { "from": "system", "value": "Use pyscss instead of libsass, as it should be able to be successfully installed on our managed servers.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()\n\n# all...
python
chosen
[ { "from": "system", "value": "Switch URL to Crate page\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport twelve\nimport twelve.adapters\nimport twelve.services\n\ntry:\n from setuptools import setup\n # hush pyflakes\n setup\nexcept ImportError:\n from distutils.core i...
python
chosen
[ { "from": "system", "value": "Add `dev` extras to requirements.\n" }, { "from": "human", "value": "import setuptools\n\nfrom polymorphic_auth import __version__\n\nsetuptools.setup(\n name='django-polymorphic-auth',\n version=__version__,\n packages=setuptools.find_packages(),\n inst...
python
chosen
[ { "from": "system", "value": "Use pip instead of easy_install for installation.\n\nIf we're running the installation of dependencies for installation\nourselves anyway - just use pip and be done with it. This means\nthat our requirements will get installed consistently regardless of\nwhether we're using pip...
python
chosen
[ { "from": "system", "value": "Use the right field name?\n" }, { "from": "human", "value": "from django.http import HttpResponse\nfrom django.shortcuts import render_to_response\nfrom store.models import FandomHierarchy, Image\nfrom store.itemfilters import ApplyPredicates\n\ndef frontpage(reques...
python
chosen
[ { "from": "system", "value": "Correct the view of capturist dashboard\n" }, { "from": "human", "value": "from django.contrib.auth.decorators import user_passes_test, login_required\nfrom django.shortcuts import render\n\nfrom perfiles_usuario.utils import is_capturista\nfrom estudios_socioeconom...
python
chosen
[ { "from": "system", "value": "Fix value attribute name to _value\n" }, { "from": "human", "value": "\"\"\"Kraken - objects.Attributes.IntegerAttribute module.\n\nClasses:\nIntegerAttribute - Base Attribute.\n\n\"\"\"\n\nfrom number_attribute import NumberAttribute\nfrom kraken.core.kraken_system...
python
chosen
[ { "from": "system", "value": "Fix user documentation in Capturista.\n" }, { "from": "human", "value": "from django.db import models\nfrom django.conf import settings\nfrom django.contrib.auth.models import Group\n\nfrom .utils import CAPTURISTA_GROUP\n\n\nclass Capturista(models.Model):\n \"\...
python
chosen
[ { "from": "system", "value": "Add python shebang and change file mode to executable\n" }, { "from": "human", "value": "# run.py\n#\n# Copyright(c) Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph>\n# Licensed under MIT\n# Version 0.0.0\n\nfrom app import app\n\nif __name__ == \"__main__\":\n #...
python
chosen
[ { "from": "system", "value": "Refactor command to find cases by default" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom dateutil.relativedelta import relativedelta\n\nfrom legalaid.models import Case\nfrom cla_butler.tasks import DeleteOldData\n\n\nclas...
python
chosen
[ { "from": "system", "value": "Test if ressource is hookable before write/update\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2014-2015 Anthony Minotti <anthony@minotti.cool>.\n#\n#\n...
python
chosen
[ { "from": "system", "value": "Fix entity index aggregator argument error\n" }, { "from": "human", "value": "import logging\nfrom followthemoney import model\nfrom servicelayer.worker import Worker\n\nfrom ingestors.manager import Manager\n\nlog = logging.getLogger(__name__)\n\n\nclass IngestWork...
python
chosen
[ { "from": "system", "value": "Add error handling for corrupted trajectory frames\n\nWhen the analysis came across corrupted frames from a trajectory the\nanalysis stopped. Rather than stopping this should just continue past\nthe corrupted frames.\n" }, { "from": "human", "value": "#! /usr/bin/en...
python
chosen
[ { "from": "system", "value": "Change match all query syntax\n" }, { "from": "human", "value": "'''\r\n Biothings Query Component Common Tests\r\n'''\r\n\r\nimport os\r\n\r\nfrom nose.core import main\r\n\r\nfrom biothings.tests import BiothingsTestCase\r\n\r\n\r\nclass QueryTests(BiothingsTes...
python
chosen
[ { "from": "system", "value": "Add missing brace to comprehension" }, { "from": "human", "value": "import user\n\nVENUE = 257163\n\n\ndef GetUserCheckins(user_obj, limit=50, max_id=None):\n request = {'limit': limit}\n if max_id is not None:\n request['max_id'] = max_id\n return user_obj.Ge...
python
chosen
[ { "from": "system", "value": "Add a fuzz call for SBCommunication: obj.connect(None).\n\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@146912 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "\"\"\"\nFuzz tests an object after the default construction to make sure ...
python
chosen
[ { "from": "system", "value": "Fix custom redislite to account for the none errors\n" }, { "from": "human", "value": "import urlparse\nfrom limits.storage import Storage\nfrom redislite import Redis\nimport time\n\nclass LimitsRedisLite(Storage): # For Python Limits\n STORAGE_SCHEME = \"redisl...
python
chosen
[ { "from": "system", "value": "Make mwparserfromhell skip style tags\n\nSince we do not really care if '' and ''' tags are processed\nas plaintext or not, and not processing them as plaintext\ncauses #10\n" }, { "from": "human", "value": "import mwparserfromhell as mwp\nfrom . import IndentTree\n...
python
chosen
[ { "from": "system", "value": "Resolve a cyclical dependency issue\n" }, { "from": "human", "value": "\nfrom vumi.blinkenlights.heartbeat.publisher import (HeartBeatMessage,\n HeartBeatPublisher)\nfrom vumi.blinkenlights.heartbeat.monitor import ...
python
chosen
[ { "from": "system", "value": "Use Location namedtuple when calling printer\n" }, { "from": "human", "value": "from tailor.utils.sourcefile import num_lines_in_file, file_too_long\n\n\nclass FileListener:\n # pylint: disable=too-few-public-methods\n\n def __init__(self, printer, filepath):\...
python
chosen
[ { "from": "system", "value": "Set an explicit value because Default value of 'RedirectView.permanent' will change from True to False in Django 1.9." }, { "from": "human", "value": "from django.conf.urls import patterns, url\nfrom django.views.generic import RedirectView\n\nfrom django_messages.v...
python
chosen
[ { "from": "system", "value": "Update Python/Django: Admin queryset -> get_queryset\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom timepiece.contracts.models import ProjectContract, ContractHour,\\\n ContractAssignment, HourGroup\n\n\nclass ContractAssignmentIn...
python
chosen
[ { "from": "system", "value": "Add status code to error message\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport requests\nimport json\nimport errno\n\nfrom moulinette.core import MoulinetteError\n\ndef yunopaste(data):\n\n paste_server = \"https://paste.yunohost.org\"\n\n ...
python
chosen
[ { "from": "system", "value": "Support for extra parameters in extractors\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import (\n print_function, unicode_literals, division, absolute_import)\n\nfrom six.moves import range\n\nfrom monkeylearn.utils import SleepReq...
python
chosen
[ { "from": "system", "value": "Drop features removed in Django 2.0\n\nField.rel and Field.remote_field.to are removed\nhttps://docs.djangoproject.com/en/dev/releases/2.0/#features-removed-in-2-0\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.1 on 2016-01-29 ...
python
chosen
[ { "from": "system", "value": "Remove dependency check done by Mopidy\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nimport os\n\nfrom mopidy import config, exceptions, ext\n\n__version__ = '0.3.0'\n\nclass Extension(ext.Extension):\n\n dist_name = 'Mopidy-SomaFM...
python
chosen
[ { "from": "system", "value": "Update post -> article migration script, include all fields\n" }, { "from": "human", "value": "def migrate_posts_to_articles():\n from django.core.files import base\n from articles.models import Article, Image\n from blog.models import Post\n\n for p in ...
python
chosen
[ { "from": "system", "value": "Use cached version of get_aliases_for_room\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2015, 2016 OpenMarket Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wit...
python
chosen
[ { "from": "system", "value": "Put some high-level module docs together, including a simple example\n" }, { "from": "human", "value": "from .discovery import advertise, unadvertise, discover\nfrom .messenger import (\n send_command, wait_for_command, \n send_request, wait_for_request, send_...
python
chosen
[ { "from": "system", "value": "Enable DT for all hosts\n" }, { "from": "human", "value": "import os\n\n# Gunicorn\n# ========\nbind = '127.0.0.1:5000'\n\n# Muffin\n# ======\n\nPLUGINS = (\n\n # Contrib plugins\n 'muffin_jinja2',\n 'muffin_peewee',\n 'muffin_session',\n 'muffin_oaut...
python
chosen
[ { "from": "system", "value": "Revert \"Add tests to compare epsilon with another objects\"\n\nThis reverts commit ae4b4fe5fb5c5774720dd3a14549aa88bde91043.\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...
python
chosen
[ { "from": "system", "value": "Allow viewer package to import without Qt\n" }, { "from": "human", "value": "try:\n from .qt import QtGui as _QtGui\nexcept ImportError as e:\n raise ImportError('Viewer requires Qt')\n\nfrom .viewers import ImageViewer, CollectionViewer\n" }, { "from"...
python
chosen
[ { "from": "system", "value": "Add label in error message\n" }, { "from": "human", "value": "import pprint\r\nimport sublime\r\nimport json\r\nfrom .util import Util\r\n\r\n# for debug\r\npp = pprint.PrettyPrinter(indent=4)\r\n\r\nclass Base(object):\r\n\r\n def settings(self, attr):\r\n ...
python
chosen
[ { "from": "system", "value": "Bump version to 6.1.0 from 6.0.0\n" }, { "from": "human", "value": "\"\"\"\nedx-organizations app initialization module\n\"\"\"\n__version__ = '6.0.0' # pragma: no cover\n" }, { "from": "gpt", "value": "\"\"\"\nedx-organizations app initialization modul...
python
chosen
[ { "from": "system", "value": "Fix context given to mailutils\n" }, { "from": "human", "value": "from django.shortcuts import render, redirect\nfrom django.conf import settings\nfrom django.views import View\nfrom members.programmes import DEGREE_PROGRAMME_CHOICES\nfrom registration.forms import ...
python
chosen
[ { "from": "system", "value": "fix: Exclude current record while validating duplicate employee" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright (c) 2015, Frappe Technologies and contributors\n# For license information, please see license.txt\n\nfrom __future__ import unicode_...
python
chosen
[ { "from": "system", "value": "Add an example showing stream unpacking\n" }, { "from": "human", "value": "import unittest\n\nfrom msgpack import *\n\nclass MessagePackTestCase(unittest.TestCase):\n \"\"\"\n This is not really a comprehensive test suite for messagepack but instead a\n way...
python
chosen
[ { "from": "system", "value": "Append 'px' to end of image upload form resize field\n" }, { "from": "human", "value": "from django import forms\n\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.bootstrap import FormActions, Div\nfrom crispy_forms.layout import Layout, Field, HTML, ...
python
chosen
[ { "from": "system", "value": "Remove package namespace in the URLS since it was useless." }, { "from": "human", "value": "from django.conf.urls.defaults import *\nfrom piston.resource import Resource\nfrom pony_server.api.handlers import PackageHandler, RootHandler, BuildHandler, TagHandler\n\np...
python
chosen
[ { "from": "system", "value": "Move query stuff to model.py due to fight within team over it. It was brutally removed.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\napp.config.from_envvar('CREATE_CFG')\n\n\n@app.rout...
python
chosen
[ { "from": "system", "value": "Add collageitems to the view.\n" }, { "from": "human", "value": "# (c) Nelen & Schuurmans. MIT licensed, see LICENSE.rst.\nfrom __future__ import print_function, unicode_literals\nfrom __future__ import absolute_import, division\n\nfrom collections import OrderedDi...
python
chosen
[ { "from": "system", "value": "Modify a function call argument\n" }, { "from": "human", "value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport abc\n\nfrom ._common import ...
python
chosen
[ { "from": "system", "value": "Fix telegram plugin install requires\n" }, { "from": "human", "value": "\nfrom setuptools import setup, find_packages\n\nversion = '0.0.1'\n\nsetup(\n name=\"alerta-telegram\",\n version=version,\n description='Alerta plugin for Telegram',\n url='https:/...
python
chosen
[ { "from": "system", "value": "Add basic view to see category show page\n" }, { "from": "human", "value": "from flask import render_template, Blueprint, url_for, \\\n redirect, flash, request\n\nfrom project.models import Category, Webinar\n\ncategory_blueprint = Blueprint('category', __name__...
python
chosen
[ { "from": "system", "value": "Copy the csrf_exempt attribute in @asynchronous\n\nNeeded for @csrf_exempt to work.\n\n(imported from commit 563ab11b0d26262511e9a6d9cc2735b0b835a391)\n" }, { "from": "human", "value": "import types\n\nclass TornadoAsyncException(Exception): pass\n\nclass _DefGen_Re...
python
chosen
[ { "from": "system", "value": "Add tests for error cases that proves incompatibility with Python 2.5 and early versions.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom unittest import TestCase\n\nfrom semver import compare\nfrom semver import match\nfrom semver import parse\n\...
python
chosen
[ { "from": "system", "value": "Add test for start/end values\n" }, { "from": "human", "value": "import datetime as dt\n\nfrom .context import tohu\nfrom tohu.v6.primitive_generators import Date\n\n\ndef test_single_date():\n g = Date(start=\"2018-01-01\", end=\"2018-01-01\")\n dates = g.gen...
python
chosen
[ { "from": "system", "value": "Tools: Add --list to variable tool.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys\nsys.path.append('..')\n\nfrom cli import *\nfrom optparse import OptionParser\n\nparse = OptionParser()\nparse.add_option('-a', '--variable', dest='variables'...
python
chosen
[ { "from": "system", "value": "Test project allow multiple forums\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include, url\n\nfrom django.contrib import admin\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n # Examples:\n # url(r'^$', 'ForumSite.views.home...
python
chosen
[ { "from": "system", "value": "Move structure to a separate directory\n" }, { "from": "human", "value": "import countershape\nfrom countershape import Page, Directory, PythonModule\nimport countershape.grok\n\n\nthis.layout = countershape.Layout(\"_layout.html\")\nthis.markdown = \"rst\"\nns.docT...
python
chosen
[ { "from": "system", "value": "Change serialise field reference to update method name in datetimeutil\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport datetime\nfrom odin import datetimeutil\n\n\nclass DatetimeEcmaFormat(object):\n \"\"\"\n Serialize a datetime object into...
python
chosen
[ { "from": "system", "value": "Fix map resolving to empty list on Python 3.\n" }, { "from": "human", "value": "# The supported extensions, as defined by https://github.com/github/markup\nsupported_extensions = ['.md', '.markdown']\n\n\n# The default filenames when no file is provided\ndefault_fil...
python
chosen
[ { "from": "system", "value": "Convert squashed migration to regular migration\n\nThis confuses the hell out of me every time\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport django.contrib.gis....
python
chosen
[ { "from": "system", "value": "Remove unecessary code in cache backend _set\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\nclass BaseCacheBackend(object):\n\n def get(self, thumbnail_name):\n if isinstance(thumbnail_name, list):\n thumbnail_name = ''.join(thu...
python
chosen
[ { "from": "system", "value": "FIX TYPO: Uncovered by NaveenKVN\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\n\"\"\"\nRecipe for loading additional step definitions from sub-directories\nin the \"features/steps\" directory.\n\n.. code-block::\n\n # -- FILE: features/steps/use_sub...
python
chosen
[ { "from": "system", "value": "Add test to check sys.exit was called with the expected exit status\n" }, { "from": "human", "value": "from scripts.check_step_UDFs import CheckStepUDFs\nfrom tests.test_common import TestEPP\nfrom unittest.mock import Mock, patch, PropertyMock\n\n\nclass TestCheckS...
python
chosen
[ { "from": "system", "value": "Increase coverage of version command\n" }, { "from": "human", "value": "import sys\nfrom twisted.trial import unittest\nfrom twisted.internet import defer\n\nimport scrapy\nfrom scrapy.utils.testproc import ProcessTest\n\n\nclass VersionTest(ProcessTest, unittest.Te...
python
chosen
[ { "from": "system", "value": "Add mutex to the \"tweetannouncement\" management command.\n" }, { "from": "human", "value": "\"\"\"\nManagement command to cross-publish announcements on Twitter.\n\"\"\"\n\nfrom django.core.management.base import NoArgsCommand\n\nfrom ...models import Announcement...
python
chosen
[ { "from": "system", "value": "Add support for multiple trees imput\n" }, { "from": "human", "value": "from lcparser import *\nimport pdb\n\n\"\"\"\nUsage:\n1) Paste the code under Solution(object) line\n2) Paste the method called by LeetCode in the corresponding line you find the\n \"main\" m...
python
chosen
[ { "from": "system", "value": "Allow to set umask in DropPrivileges\n" }, { "from": "human", "value": "from pwd import getpwnam\nfrom grp import getgrnam\nfrom traceback import format_exc\nfrom os import getuid, setgroups, setgid, setuid, umask\n\n\nfrom circuits.core import handler, BaseComponen...
python
chosen
[ { "from": "system", "value": "Replace type() comparison with isinstance.\n\ntype() comparison won't work due to weakproxy.\n\nReviewer: Luciano Wolf <c353ae890f0e6de8473e43011f009ccd38a3c452@openbossa.org>\nReviewer: Hugo Lima <e250cbdf6b5a11059e9d944a6e5e9282be80d14c@openbossa.org>\nReviewer: Renato Filho ...
python
chosen
[ { "from": "system", "value": "Allow feed, rss, and atom prefixes in URL validator.\n" }, { "from": "human", "value": "import re\n\nfrom django.core import validators\n\n\nclass URLValidator(validators.URLValidator):\n \"\"\"Custom url validator to include git urls and urls with http+ like pre...
python
chosen
[ { "from": "system", "value": "Make attended_meetings return lists of meetings\n" }, { "from": "human", "value": "from django.db import models\nfrom django.contrib.auth.models import AbstractUser\n\n\nclass Member(AbstractUser):\n faculty_number = models.CharField(max_length=8)\n\n\n def __...
python
chosen
[ { "from": "system", "value": "Revert 85807 - Enabled nacl_integration tests on the Linux bots.\n\nBUG= none\nTEST= none\n\nReview URL: http://codereview.chromium.org/7038025\n\nTBR=ncbray@google.com\nReview URL: http://codereview.chromium.org/7042025\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@8...
python
chosen
[ { "from": "system", "value": "Update person addition test to create address book inside test func + import needed classes from the package\n" }, { "from": "human", "value": "from unittest import TestCase\n\n\nclass AddressBookTestCase(TestCase):\n\n def test_add_person(self):\n person ...
python
chosen
[ { "from": "system", "value": "Add two other implement of insertion sort\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ndef insertion_sort(a):\n for i in range(1, len(a)):\n current_val = a[i]\n j = i\n while j > 0 and a[j-1] > current...
python
chosen
[ { "from": "system", "value": "Use random.choice instead of random.choices\n\n- Allows compatibility with python3.5\n" }, { "from": "human", "value": "# Generate a SECRET_KEY file\n\nimport random\nimport string\nimport os\n\nfn = 'secret_key.txt'\n\ndef generate_key():\n\treturn ''.join(random.c...
python
chosen
[ { "from": "system", "value": "Add support for Django debug sidebar.\n" }, { "from": "human", "value": "\"\"\"elmo URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFunction ...
python
chosen
[ { "from": "system", "value": "Set Netconsole default listen port to 6666\n\naccording to linux/Documentation/networking/netconsole.txt\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport socket, sys\nfrom datetime import datetime\nfrom threading import Thr...
python
chosen
[ { "from": "system", "value": "Make sure that tray items is a list\nThis fixes an exception when tray['items'] is None. The same conditional check is added for response['tray'].\n" }, { "from": "human", "value": "from InstagramAPI.src.http.Response.Objects.Item import Item\nfrom InstagramAPI.src....
python
chosen
[ { "from": "system", "value": "Make \"is_saveable\" a staticmethod of SaveSession\n" }, { "from": "human", "value": "import sublime\r\nimport sublime_plugin\r\n\r\nfrom datetime import datetime\r\n\r\nfrom .modules import messages\r\nfrom .modules import serialize\r\nfrom .modules import settings...
python
chosen
[ { "from": "system", "value": "Replace assertEquals with assertEquals for Py3." }, { "from": "human", "value": "import unittest\nfrom distarray import utils\n\n\nclass TestMultPartitions(unittest.TestCase):\n \"\"\"\n Test the multiplicative parition code.\n \"\"\"\n\n def test_both_m...
python
chosen
[ { "from": "system", "value": "Set default priority level to None\n" }, { "from": "human", "value": "from __future__ import unicode_literals\nfrom functools import total_ordering\n\nfrom binary_heap import BinaryHeap\n\n\n@total_ordering # Will build out the remaining comparison methods\nclass Q...
python
chosen
[ { "from": "system", "value": "Fix pylint errors that snuck into 2015.2\n" }, { "from": "human", "value": "# utf-8\n'''\nA Runner module interface on top of the salt-ssh Python API\n\nThis allows for programmatic use from salt-api, the Reactor, Orchestrate, etc.\n'''\nimport salt.client.ssh.clien...
python
chosen
[ { "from": "system", "value": "Add cache support for ASN1_Packet()\n\n--HG--\nbranch : fix-padding-after-pull-request-18\n" }, { "from": "human", "value": "## This file is part of Scapy\n## See http://www.secdev.org/projects/scapy for more informations\n## Copyright (C) Philippe Biondi <phil@secd...
python
chosen
[ { "from": "system", "value": "Add missing import in incantation" }, { "from": "human", "value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n# Packages may add whatever they like to this file, but\n# should keep this content at the top.\n# ---------------------------------...
python
chosen
[ { "from": "system", "value": "Fix version comparison of Werkzeug.\n" }, { "from": "human", "value": "\"\"\"\nerrors and exceptions\n\"\"\"\n\nfrom werkzeug.exceptions import HTTPException\n\ndef _patch_werkzeug():\n import pkg_resources\n if pkg_resources.get_distribution(\"werkzeug\").ver...
python
chosen
[ { "from": "system", "value": "PyInstaller: Make sure dosagelib.data is importable\n" }, { "from": "human", "value": "# SPDX-License-Identifier: MIT\n# Copyright (C) 2016-2022 Tobias Gruetzmacher\nfrom PyInstaller.utils.hooks import collect_data_files, collect_submodules, copy_metadata\n\nhiddeni...
python
chosen
[ { "from": "system", "value": "Make User model compatible with Django 2.x\n" }, { "from": "human", "value": "# -*- coding: UTF-8 -*-\nfrom django import VERSION\nfrom django.conf import settings\nfrom django.contrib.contenttypes.fields import GenericForeignKey\nfrom django.contrib.contenttypes.mo...
python
chosen
[ { "from": "system", "value": "[marv] Make fetching application root from env less error-prone\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2016 - 2018 Ternaris.\n# SPDX-License-Identifier: AGPL-3.0-only\n\nimport os\nfrom marv_cli import setup_logging\nsetup_loggin...
python
chosen
[ { "from": "system", "value": "Add test for unsupplied email for user model\n" }, { "from": "human", "value": "\"\"\"accounts app unittests for models\n\n\"\"\"\nfrom django.test import TestCase\nfrom django.contrib.auth import get_user_model\n\n\nUSER = get_user_model()\nTEST_EMAIL = 'newvisitor...
python
chosen
[ { "from": "system", "value": "Make constructor of DefaultFilterSet compatible\n\n - arguments had different names than FilterSet before\n" }, { "from": "human", "value": "import django_filters\n\n\nclass PagedFilterSet(django_filters.FilterSet):\n \"\"\"Removes page parameters from the query ...
python
chosen
[ { "from": "system", "value": "Expand single-trial plot to include multiple subjects.\n" }, { "from": "human", "value": "import climate\nimport lmj.plot\n\nimport source\n\n\ndef main(subject):\n subj = source.Subject(subject)\n trial = subj.blocks[0].trials[0]\n trial.load()\n\n ax =...
python
chosen
[ { "from": "system", "value": "Mark mark_safe as safe :)\n" }, { "from": "human", "value": "from django import template\nfrom django.utils.safestring import mark_safe\n\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef url_format(link_format, url, text, title):\n if link_format =...
python
chosen