conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add None check while applying modifiers\n" }, { "from": "human", "value": "from .Resource import names_registered, resource_by_name\n\ndef build():\n for name in names_registered():\n resource = resource_by_name(name)()\n for explanation in resourc...
python
chosen
[ { "from": "system", "value": "Set some fields as tranlate\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in root directory\n################...
python
chosen
[ { "from": "system", "value": "Add data fixers to reindex for search by re-saving everything\n" }, { "from": "human", "value": "from datetime import datetime, timedelta\nfrom functools import wraps\n\nimport makerbase\nfrom makerbase.models import *\n\n\ndef for_class(*classes):\n def do_that(...
python
chosen
[ { "from": "system", "value": "Remove unused file type check\n" }, { "from": "human", "value": "\"\"\"Load and parse configuration file.\"\"\"\nimport yaml\nfrom io import open\n\nCONFIG = {}\n\ndef load_config(config_file):\n \"\"\"Loads a configuration file.\"\"\"\n config = {}\n if ty...
python
chosen
[ { "from": "system", "value": "Add debugging statement to retrieve_passages function\n" }, { "from": "human", "value": "# LING 573 Question Answering System\n# Code last updated 4/17/14 by Clara Gordon\n# This code implements an InfoRetriever for the question answering system.\n\n\nfrom pymur imp...
python
chosen
[ { "from": "system", "value": "Fix a KeyError that is raised when there are no reuslts\n" }, { "from": "human", "value": "\"\"\"This module provides a SearchResults class.\"\"\"\n\nfrom types import GeneratorType\nfrom ..resources import Record, StatsResult\nfrom ..swimlane_dict import SwimlaneDi...
python
chosen
[ { "from": "system", "value": "Fix waymo open dataset proto import.\n\nPiperOrigin-RevId: 355350302\n" }, { "from": "human", "value": "# coding=utf-8\n# Copyright 2021 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ...
python
chosen
[ { "from": "system", "value": "[Units] Add type hint to calculate function\n\n" }, { "from": "human", "value": "\nimport operator\n\nfrom pyparsing import Forward, Group, Literal, nums, Suppress, Word\n\nexpression_stack = []\n\ndef push_first(tokens):\n\texpression_stack.append(tokens[0])\n\n\"\...
python
chosen
[ { "from": "system", "value": "Revert \"adding 2013 to search query\"\n" }, { "from": "human", "value": "from haystack import indexes\n\nfrom respondants.models import Institution\n\n\nclass InstitutionIndex(indexes.SearchIndex, indexes.Indexable):\n \"\"\"Search Index associated with an insti...
python
chosen
[ { "from": "system", "value": "Set GUI title\nand size\n" }, { "from": "human", "value": "import gi\ngi.require_version('Gtk', '3.0')\nfrom gi.repository import Gtk\n\n\nclass MainWindow(Gtk.Window):\n\n def __init__(self):\n Gtk.Window.__init__(self, title=\"\")\n\n\nwin = MainWindow()...
python
chosen
[ { "from": "system", "value": "Add parameter to specificy ADC read repeats\n" }, { "from": "human", "value": "\"\"\" Access ADCs vias SysFS interface \"\"\"\n\nimport glob\n\nclass adc(object):\n\n def __init__(self, num):\n self.num = num\n # need to read a glob here, since numbering is n...
python
chosen
[ { "from": "system", "value": "test: Add Python 2.7 to nox test environment\n\nIt is needed for sanity checking the code against the current\ndeployment environment.\n\nSigned-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com>\n" }, { "from": "human", "value": "\"\"\"Automat...
python
chosen
[ { "from": "system", "value": "Add rational root test stub\n" }, { "from": "human", "value": "# tests to determine whether a polynomial is irreducible over a finite field\n\nimport numpy\n\n\ndef eisenstein(poly, p):\n \"\"\"\n returns true if poly is irreducible by Eisenstein's sufficient ...
python
chosen
[ { "from": "system", "value": "Put configurable product in Picking list\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom odoo import models, fields\n\n\nclass StockMove(models.Model):\n _inherit = 'stock.move'\n\n product_id = fields.Many2one(domain=[('config_ok', '=', Fal...
python
chosen
[ { "from": "system", "value": "Make logging to file optional, PEP8-fixes.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals, division\nimport logging\n\n\ndef init_logging(level=logging.DEBUG,logsize=1024,logcount=5):\n format...
python
chosen
[ { "from": "system", "value": "Revert \"Remove some trailing whitespace\"\n\nThis reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.\n" }, { "from": "human", "value": "from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField\nfrom yunity.models.utils im...
python
chosen
[ { "from": "system", "value": "Add module docstring and reorder imports\n" }, { "from": "human", "value": "#!/usr/bin/env python3.5\n\nimport npc\nimport sys\n\nif __name__ == '__main__':\n npc.cli(sys.argv[1:])\n" }, { "from": "gpt", "value": "#!/usr/bin/env python3.5\n\n\"\"\"\nE...
python
chosen
[ { "from": "system", "value": "Validate repo exists in `AnalyzeForm`\n" }, { "from": "human", "value": "from django import forms\n\nfrom wtl.wtgithub.worker import GithubWorker\n\n\nclass AnalyzeForm(forms.Form):\n git_url = forms.CharField()\n\n def analyze(self):\n worker = GithubW...
python
chosen
[ { "from": "system", "value": "Add Updated docker image with iproute2 package\n" }, { "from": "human", "value": "\"\"\"\nRole tests\n\"\"\"\nimport pytest\n\n# To run all the tests on given docker images:\npytestmark = pytest.mark.docker_images(\n 'infopen/ubuntu-trusty-ssh:0.1.0',\n 'infop...
python
chosen
[ { "from": "system", "value": "[INDY-1175] Add new dict format into node validator-info\n\nSigned-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com>\n" }, { "from": "human", "value": "import importlib\n\nfrom indy_node.__metadata__ import __version__ as node_pgk...
python
chosen
[ { "from": "system", "value": "Modify KuryrException extend Exception appropriately\n\nThis patch modifies KuryrException call the initializer of the super\nclass. This fixes Kuryr not to return the empty error response.\n\nChange-Id: I728a24df6f20a81090c98aac46be22f3d27cd884\nSigned-off-by: Taku Fukushima <...
python
chosen
[ { "from": "system", "value": "Add exception to to return extended height of the show\n" }, { "from": "human", "value": "from django import template\n\nfrom datetime import datetime, time, timedelta\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef height(start, end):\n if start....
python
chosen
[ { "from": "system", "value": "Make numbers the default comments style\n" }, { "from": "human", "value": "from flask_wtf import Form\nfrom flask_wtf.csrf import CsrfProtect\nfrom wtforms import StringField, IntegerField, SelectField, BooleanField\n\ncsrf = CsrfProtect()\n\n\nclass Submission(Form...
python
chosen
[ { "from": "system", "value": "Add column to title model\n" }, { "from": "human", "value": "from dataviva import db\n\n\nclass GraphTitle(db.Model):\n __tablename__ = 'graph_title'\n id = db.Column(db.Integer, primary_key=True)\n title_en = db.Column(db.String(255))\n subtitle_en = db...
python
chosen
[ { "from": "system", "value": "Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.\n" }, { "from": "human", "value": "# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-\n# ex: set softtabstop=4 ta...
python
chosen
[ { "from": "system", "value": "Add get_property, set_property and delete_property functions\n" }, { "from": "human", "value": "from devicehive.handler import Handler\nfrom devicehive.device_hive import DeviceHive\n\n\nclass ApiCallHandler(Handler):\n \"\"\"Api call handler class.\"\"\"\n\n ...
python
chosen
[ { "from": "system", "value": "Implement a search test for when there is no matching template\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport pathlib\nimport json\n\nimport pytest\n\n\n@pytest.fixture\ndef templates_file():\n return 'tests/templates.json'\n\n\ndef scenario...
python
chosen
[ { "from": "system", "value": "Test a non-square Viewport child.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nimport pyglet\nimport glooey\n\nwindow = pyglet.window.Window()\nbatch = pyglet.graphics.Batch()\n\ncursor = pyglet.image.load('cursor-image.png')\nhotspot = 4, 24\n\nroot...
python
chosen
[ { "from": "system", "value": "Use more recent version of libffi. 3.1 has a known bug that is fixed in current version\n" }, { "from": "human", "value": "from spack import *\n\nclass Libffi(Package):\n \"\"\"The libffi library provides a portable, high level programming\n interface to vario...
python
chosen
[ { "from": "system", "value": "Add more expected star str\n" }, { "from": "human", "value": "from metafunctions.util import node, star\nfrom metafunctions.tests.util import BaseTestCase\n\n\nclass TestUnit(BaseTestCase):\n def test_simple_star(self):\n @node\n def f(*args):\n ...
python
chosen
[ { "from": "system", "value": "Add doctest to the sample project\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\n\n__all__ = ('is_snake',)\n\n\ndef is_snake(word):\n if not word.isalpha():\n raise ValueError(\"String '{}' is not a...
python
chosen
[ { "from": "system", "value": "Move create method as example implementation\n\nCopy method/function from exusting tool integration for reference\nconcerning the layout of the json object\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"Module providing an image asset asignment fa...
python
chosen
[ { "from": "system", "value": "Work on ferry routes display\n\nWill either need to pull data from google, or aggregate if we want to do\nall those in australia\n" }, { "from": "human", "value": "# from . import has_required_data_maker, obtain_data_maker\n\nPATH = 'ferry_paths.json'\n\n\ndef has_r...
python
chosen
[ { "from": "system", "value": "Update local settings for compatibility with docker\n" }, { "from": "human", "value": "DEBUG = True\nALLOWED_HOSTS = []\nSECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31'\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postg...
python
chosen
[ { "from": "system", "value": "Return translation instead of tuple\n\nFixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field." }, { "from": "human", "value": "from rest_framework.fields import ChoiceField\n\n\nclass EnumField(ChoiceField):\n ...
python
chosen
[ { "from": "system", "value": "Fix examples by adding package to path\n" }, { "from": "human", "value": "import json\nimport os\nimport shutil\nfrom scipy_data_fitting import Plot\n\ndef save_example_fit(fit):\n \"\"\"\n Save fit result to a json file and a plot to an svg file.\n \"\"\"\...
python
chosen
[ { "from": "system", "value": "Remove version number from Python shebang.\n\nOn special request from someone trying to purge python2.2 from code indexed\ninternally at Google.\n\n\ngit-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n" }, { "from": "human", ...
python
chosen
[ { "from": "system", "value": "Make check_root use proper logging and exit cleanly\n" }, { "from": "human", "value": "'''\nA few checks to make sure the environment is sane\n'''\n# Original Author: Jeff Schroeder <jeffschroeder@computer.org>\n\nimport logging\nlog = logging.getLogger(__name__)\n\...
python
chosen
[ { "from": "system", "value": "Read model parameters and output at the beginning\n" }, { "from": "human", "value": "import sys, json\n\nfrom cloudtracker import main as tracker_main\n \ndef run_tracker(input):\n print( \" Running the cloud-tracking algorithm... \" )\n print( \" Input dir...
python
chosen
[ { "from": "system", "value": "Add dependencies on hr_contract as it should have been done\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n{\n 'name': 'Human Employee Streamline',\n 'version': '1.2',\n 'author': 'XCG Consulting',\n 'category': 'Human Resources',\n 'desc...
python
chosen
[ { "from": "system", "value": "Refactor system tests to mock out requests library vs mocking out request handler.\n" }, { "from": "human", "value": "import datetime\nfrom decimal import Decimal\n\nfrom mock import Mock\n\nimport ubersmith.order\n\n# TODO: setup/teardown module with default reques...
python
chosen
[ { "from": "system", "value": "[merge] Merge manually, because vim exec is retarded\n" }, { "from": "human", "value": "# the lolbot core\n# (c) 2017 S Stewart under MIT License\n\n# -*- coding: utf-8 -*-\n# obviously, logging\n\nimport json\nimport logging\nimport time\nimport subprocess\n\nimpor...
python
chosen
[ { "from": "system", "value": "Fix 'Number too big' weirdness\n" }, { "from": "human", "value": "#\n# Sivakumar Kailasam and lowliet\n#\n\nimport sublime, sublime_plugin\n\nclass RepeatMacroCommand(sublime_plugin.TextCommand):\n def run(self, edit):\n self.view.window().show_input_pan...
python
chosen
[ { "from": "system", "value": "refactor(app-tests): Merge fixture tests to reduce live servers and time\n" }, { "from": "human", "value": "\"\"\"\nTest fixtures.\n\n:copyright: (c) 2017 Derek M. Frank\n:license: MPL-2.0\n\n\"\"\"\nfrom flask import Flask # type: ignore\n\n\ndef test_simple_app(a...
python
chosen
[ { "from": "system", "value": "Add all the J* colormaps\n" }, { "from": "human", "value": "import numpy as np\nimport Image\n\ndef makeImage(cmap, fname):\n cmarr = (cmap*255).astype(np.uint8)\n im = Image.fromarray(cmarr[np.newaxis])\n im.save(fname)\n\ndef cmList(additional):\n cmap...
python
chosen
[ { "from": "system", "value": "Tidy up Python class example\n" }, { "from": "human", "value": "import math\n\nclass Circle:\n def __init__(self, radius):\n self.radius = radius\n def area(self):\n return math.pi * self.radius * self.radius\n\nc = Circle(10)\n\nassert(type(c) =...
python
chosen
[ { "from": "system", "value": "Implement the QUIT command and disconnect\n" }, { "from": "human", "value": "from twisted.words.protocols import irc\n\n\nclass HeufyBotConnection(irc.IRC):\n def __init__(self, protocol):\n self.protocol = protocol\n self.nick = \"PyHeufyBot\" # T...
python
chosen
[ { "from": "system", "value": "Resolve 58; no tests for besancon\n" }, { "from": "human", "value": "from astroquery import besancon\nimport asciitable\nfrom astropy.io.ascii.tests.common import assert_equal\n\n# SKIP - don't run tests because Besancon folks don't want them (based on the fact that...
python
chosen
[ { "from": "system", "value": "Remove TLD check, allow for www\n" }, { "from": "human", "value": "import socket\nimport tld\n\n\ndef valid_hostname(hostname: str) -> bool:\n \"\"\"\n :param hostname: The hostname requested in the scan\n :return: True if it's a valid hostname (fqdn in DNS...
python
chosen
[ { "from": "system", "value": "Revert \"Added the output for hostname\"\n\nThis reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.\n" }, { "from": "human", "value": "from flask import Flask\nimport socket\n\n\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef index():\n return \"Hello fr...
python
chosen
[ { "from": "system", "value": "Update testSetCustomChromeFlags to only append to chrome flags, not override\n\nThis is in keeping with the spirit of the ExtraChromeFlags() method. Whenever\nit's overridden, it should only ever append to the list of chrome flags,\nnever completely override it.\n\nBUG=None\nTE...
python
chosen
[ { "from": "system", "value": "Update the HeartbeatCollector to send in Metricly checks\n" }, { "from": "human", "value": "# coding=utf-8\n\n\"\"\"\nSend a value of 1 as a heartbeat every time this collector is invoked.\n\n#### Dependencies\nNone\n\n#### Usage\nAdd the collector config as :\n\nen...
python
chosen
[ { "from": "system", "value": "Add a line to end of file\n" }, { "from": "human", "value": "from functools import partial\n\nfrom mamba.example_group import ExampleGroup, PendingExampleGroup\nfrom mamba.example import Example, PendingExample\n\nIRRELEVANT_SUBJECT='irrelevant subject'\n\n\ndef an_...
python
chosen
[ { "from": "system", "value": "pyroTorrent: Fix encoding on error page.\n" }, { "from": "human", "value": "import traceback\nimport sys\n\nclass SessionHackException(Exception):\n \"\"\"\n Raised when something goes wrong.\n \"\"\"\n\nclass SessionHack(object):\n \"\"\"\n The S...
python
chosen
[ { "from": "system", "value": "Add TODO comment for char limits\n" }, { "from": "human", "value": "from django import forms\n\nfrom registration import constants\n\n\nclass CompanyForm(forms.Form):\n company_number = forms.CharField(\n label='Company number',\n help_text=('This i...
python
chosen
[ { "from": "system", "value": "Implement API endpoints with flask\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nimport os\nimport flask\n\nclass BlogAPI:\n def __init__(self):\n self.app = flask.Flask(__name__)\n self.log = self.app.logger\n\n self.app.confi...
python
chosen
[ { "from": "system", "value": "flask: Load asset bundles into webassets environment\n" }, { "from": "human", "value": "from flask import Flask\nfrom flask.ext.babel import Babel\nfrom flask.ext.assets import Environment\n\n\ndef create_app():\n app = Flask(__name__, static_folder='public')\n ...
python
chosen
[ { "from": "system", "value": "Add TODO comment for removing TestGame class (doesn't do anything now)\n" }, { "from": "human", "value": "from pygametemplate import Game\nfrom example_view import ExampleView\n\n\nclass TestGame(Game):\n \"\"\"An altered Game class for testing purposes.\"\"\"\n ...
python
chosen
[ { "from": "system", "value": "Make output data cleaner on the eyes :)\n" }, { "from": "human", "value": "'''\nExecute overstate functions\n'''\n\n# Import salt libs\nimport salt.overstate\nimport salt.output\n\n\ndef over(env='base', os_fn=None):\n '''\n Execute an overstate sequence to or...
python
chosen
[ { "from": "system", "value": "Make namespaces more clear in input_helpers.py\n" }, { "from": "human", "value": "import importlib\nimport warnings\nfrom distutils.version import LooseVersion\n\n\ndef check_versions(minimum_versions):\n \"\"\"Raises an ImportError if a dependent package is not ...
python
chosen
[ { "from": "system", "value": "Move fixture import to only be in DEV\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nfrom flask import current_app, request, session\n\nfrom freight.models import User\n\nfrom freight.testutils.fixtures import Fixtures\n\nNOT_SET = obje...
python
chosen
[ { "from": "system", "value": "Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.\n\n" }, { "from": "human", "value": "from django.shortcuts import render\n\n# Create your views here.\n" }, { "from": "gpt", "value": "from django.forms import ...
python
chosen
[ { "from": "system", "value": "Make release version final for 6.0.0\n" }, { "from": "human", "value": "from __future__ import absolute_import\nfrom arches.setup import get_version\n\ntry:\n from .celery import app as celery_app\nexcept ModuleNotFoundError as e:\n print(e)\n\nVERSION = (6, 0...
python
chosen
[ { "from": "system", "value": "Use hidden classes by default\n" }, { "from": "human", "value": "\nfrom pycket import config\n\nif not config.hidden_classes:\n from pycket.impersonators.hidden_classes import *\nelse:\n from pycket.impersonators.baseline import *\n" }, { "from": "gpt"...
python
chosen
[ { "from": "system", "value": "Update model to fit data properly.\n\nThere are some huge titles...\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass Person(models.Model):\n name = models.CharField(max_length=80)\n\n def __unicode__(self):\n return self.name\n...
python
chosen
[ { "from": "system", "value": "Update secret key generator to exclude pantuations\n" }, { "from": "human", "value": "import os\nimport random\nimport string\nfrom datetime import date, datetime\n\n\ndef random_name():\n return ''.join([random.choice(string.ascii_lowercase + string.digits) for ...
python
chosen
[ { "from": "system", "value": "Update secret file from to\n" }, { "from": "human", "value": "import os\nimport random\nimport string\nfrom datetime import date, datetime\n\n\ndef random_name():\n return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)])\n\n\nd...
python
chosen
[ { "from": "system", "value": "Save form data to DB on each step\n" }, { "from": "human", "value": "from django.shortcuts import get_object_or_404, render\nfrom django.http import HttpResponseRedirect, HttpResponse\nfrom formtools.wizard.views import SessionWizardView\nfrom ansible.models import ...
python
chosen
[ { "from": "system", "value": "Disable more tests on memcache.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# coding=utf8\n\nfrom simplekv.memory.memcachestore import MemcacheStore\n\nfrom basic_store import BasicStore, TTLStore\n\nimport pytest\n\nmemcache = pytest.importorskip('mem...
python
chosen
[ { "from": "system", "value": "Add test for registry registration form\n\nThis adds a test to ensure that the registry registration page\nhas a registration form with the expected method and number of\ninputs.\n" }, { "from": "human", "value": "import pytest\nfrom web_test_base import *\n\nclass ...
python
chosen
[ { "from": "system", "value": "Add subreddit query param to adzerk frame.\n\nFor tracking / targeting.\n" }, { "from": "human", "value": "from pylons import c, g\n\nfrom r2.lib.pages import Ads as BaseAds\n\n\nclass Ads(BaseAds):\n def __init__(self):\n BaseAds.__init__(self)\n a...
python
chosen
[ { "from": "system", "value": "Store references to albums, add new methods.\n" }, { "from": "human", "value": "from BaseIndexEntry import BaseIndexEntry\n\n\nclass PerformerIndexEntry(BaseIndexEntry):\n\n def __init__(self, name, titles, number):\n super(PerformerIndexEntry, self).__ini...
python
chosen
[ { "from": "system", "value": "Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware\n" }, { "from": "human", "value": "from django.utils.functional import SimpleLazyObject\nfrom tinycart.models import Cart\n\n\nclass CartMiddleware(object):\n\n def process_request(s...
python
chosen
[ { "from": "system", "value": "Check for existing config before writing default\n" }, { "from": "human", "value": "from paver.easy import sh, task\n\n\nconfig = \"\"\"# replace pass with values you would like to overwrite from DefaultConfig in\n# default_config.py. Values you do not explicitly ov...
python
chosen
[ { "from": "system", "value": "Implement __unicode__ for entry objects\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"Base class for all types of entries.\"\"\"\n\n\nclass BaseEntry(object):\n \"\"\"Base class for all types of entries.\"\"\"\n\n def format(self, **optio...
python
chosen
[ { "from": "system", "value": "flake8: Fix all warnings in top-level urlconf\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nfrom django.conf import settings\nfrom django.conf.urls import include, patterns\nfrom django.contrib import admin\nfrom django.contrib.staticf...
python
chosen
[ { "from": "system", "value": "Set up linked list class\n" }, { "from": "human", "value": "# LINKED LIST\n\n# define constructor\nclass Node(object):\n\tdef __init__(self, data):\n\t\tself.data = data\n\t\tself.next = None\n" }, { "from": "gpt", "value": "# LINKED LIST\n\n# define con...
python
chosen
[ { "from": "system", "value": "Add \"Programming Language :: Python :: 2.7\" PyPi trove classifier\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport octo\nfrom distutils.core import setup\n\nif __name__ == \"__main__\":\n\twith open('README.rst') as file:\n\t\tlong_description = ...
python
chosen
[ { "from": "system", "value": "Revert \"install_requires is a list now, not iterator\"\n\nThis reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.\n" }, { "from": "human", "value": "from distutils.core import setup\n\nwith open('README.md') as description:\n long_description = description...
python
chosen
[ { "from": "system", "value": "Fix long description content type\n" }, { "from": "human", "value": "import codecs\nfrom os import path\nfrom textwrap import dedent\n\nfrom setuptools import setup\n\nhere = path.abspath(path.dirname(__file__))\n\nwith codecs.open(path.join(here, \"README.rst\"), e...
python
chosen
[ { "from": "system", "value": "Make argparse an optional dependency (and avoid pinning in a library).\n" }, { "from": "human", "value": "\"\"\"\npip-tools keeps your pinned dependencies fresh.\n\"\"\"\nimport sys\nfrom setuptools import setup\n\n\nsetup(\n name='pip-tools',\n version='0.2',...
python
chosen
[ { "from": "system", "value": "Remove requests dependency upper version constraint\n\nRemoves the undocumented and outdated upper version constraint\nfor the requests dependency.\n" }, { "from": "human", "value": "# coding=utf-8\nimport sys\n\ncmdclass = {}\n\ntry:\n from setuptools import set...
python
chosen
[ { "from": "system", "value": "Change version to master branch\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nfrom distutils.core import setup\nfrom glob import glob\n\n# Scripts whose names end in a-z or 1-9 (avoids emacs backup files)\nscripts = glob('scripts/*[a-z,1-9]')\n\nsetup(name...
python
chosen
[ { "from": "system", "value": "Reduce version requirements, bump to v0.1.3.\n" }, { "from": "human", "value": "# coding=utf-8\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name=\"django-celery-transactions\",\n version=\"0.1.2\",\n description=\"Django transaction support fo...
python
chosen
[ { "from": "system", "value": "Add Python 3.6 as a supported version.\n" }, { "from": "human", "value": "import re\n\nfrom setuptools import setup\n\nwith open('nexmo/__init__.py', 'r') as fd:\n version = re.search(r'^__version__\\s*=\\s*[\\'\"]([^\\'\"]*)[\\'\"]', fd.read(), re.MULTILINE).gro...
python
chosen
[ { "from": "system", "value": "Install templates with the egg.\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom os import path\nfrom setuptools import setup, find_packages\n\n\ndef read(name):\n return open(path.join(path.dirname(__file__), name)).read()\n\nsetup(\n name='djan...
python
chosen
[ { "from": "system", "value": "Bump version number to 0.5\n" }, { "from": "human", "value": "from setuptools import setup\n\nwith open('README.rst') as f:\n long_desc = f.read()\n\nsetup(\n name='ttrss-python',\n version='0.4',\n description='A client library for the Tiny ...
python
chosen
[ { "from": "system", "value": "Update the author name and bump version\n\nThis new version should fix the problem of installing `typing`.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport os\n\nfrom setuptools import setup\n\n\ndef read(fname):\n try:\n return open(os.p...
python
chosen
[ { "from": "system", "value": "Include wrapper script in dist\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='docker-pipeline',\n version='1.0.0',\n packages=[''],\n url='https://github.com/Duke-GCB/docker-pipeline',\n license='MIT',\n autho...
python
chosen
[ { "from": "system", "value": "Add PyPI classifiers and python_requires\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom distutils.core import Extension\n\nVERSION = '1.0.5'\nLONG_DESCRIPTION = \"\"\"\nA numerical geometric algebra module...
python
chosen
[ { "from": "system", "value": "Upgrade to v0.4.6 of membersuire_api_client\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup\nimport os\n\n\n# Utility function to read README file\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname...
python
chosen
[ { "from": "system", "value": "Switch version to semantic versioning.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# coding=utf8\n\nimport os\n\nfrom setuptools import setup, find_packages\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n...
python
chosen
[ { "from": "system", "value": "Add warning about unmaintained python2\n" }, { "from": "human", "value": "# coding: utf-8\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License...
python
chosen
[ { "from": "system", "value": "Update the PyPI version to 0.2.23.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport os\nfrom setuptools import setup\n\ndef read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except:\n ret...
python
chosen
[ { "from": "system", "value": "Add Python 3.6 to classifiers\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom setuptools import setup\n\nsetup(\n name='Redis-Sentinel-Url',\n py_modules=['redis_sentinel_url'],\n version='1.0.0',\n install_require...
python
chosen
[ { "from": "system", "value": "Change requirement from 'adb>1.3.0' to 'adb-homeassistant'" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='firetv',\n version='1.0.6',\n description='Communicate with an Amazon Fire TV device via ADB over a network.',\n ur...
python
chosen
[ { "from": "system", "value": "DOC: Add descriptions/links for meta fields\n" }, { "from": "human", "value": "name = 'package-name'\npath = name.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\nversion = '0.0.0'\nauthor = 'Author Name'\nauthor_email = ''\ndescription = ''\nurl = '' # project...
python
chosen
[ { "from": "system", "value": "Remove warning: file legato.py (for module legato) not found during installation" }, { "from": "human", "value": "from setuptools import setup, find_packages\nimport sys\n\nif sys.hexversion < 0x02070000:\n sys.exit(\"Python 2.7 or newer is required to use this p...
python
chosen
[ { "from": "system", "value": "Remove support for end-of-life Python 3.6 in next release\n\nChecked again just now and we are still waiting on Python 3.10 stability" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom setuptools import find_packages, setup\n\nwith...
python
chosen
[ { "from": "system", "value": "Install mock package when not in stdlib\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom distutils.core import setup\nfrom clusterjob import __version__\n\n\nsetup(name='clusterjob',\n version=__version__,\n description='Manage traditional HP...
python
chosen