conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "[AC-7071] Add finalists to v1 user group\n" }, { "from": "human", "value": "from accelerator_abstract.models.base_user_utils import is_employee\nfrom impact.permissions import (\n settings,\n BasePermission)\n\n\nclass V1APIPermissions(BasePermission):\n au...
python
chosen
[ { "from": "system", "value": "ENH: Put file reader class into top-level namespace\n" }, { "from": "human", "value": "\"\"\"Package tools for reading TRMM data.\n\n\"\"\"\n\ntry:\n from __dev_version import version as __version__\n from __dev_version import git_revision as __git_revision__\...
python
chosen
[ { "from": "system", "value": "Remove the admin from the url resolver\n" }, { "from": "human", "value": "# Copyright (C) 2010 Francois Marier <francois@libravatar.org>\n#\n# This file is part of Libravatar\n# \n# Libravatar is free software: you can redistribute it and/or modify\n# it under the ...
python
chosen
[ { "from": "system", "value": "Convert top-level-comment to a docstring.\n" }, { "from": "human", "value": "#!/usr/bin/python\n#\n# Copyright 2014 Google 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...
python
chosen
[ { "from": "system", "value": "Add app_name url to td_biblio\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.conf.urls import url\n\nfrom . import views\n\n\nurlpatterns = [\n # Entry List\n url(\n '^$',\n views.EntryListView.as_view(),\n name='e...
python
chosen
[ { "from": "system", "value": "Implement UpperCamelCase name check for protocols\n" }, { "from": "human", "value": "from tailor.swift.swiftlistener import SwiftListener\nfrom tailor.utils.charformat import is_upper_camel_case\n\n\nclass MainListener(SwiftListener):\n\n def enterClassName(self,...
python
chosen
[ { "from": "system", "value": "Add version to package documentation.\n" }, { "from": "human", "value": "\"\"\" Pyflation - Cosmological simulations in Python\nAuthor: Ian Huston\n\nPyflation is a python package to simulate cosmological perturbations in the early universe.\nUsing the Klein-Gordon ...
python
chosen
[ { "from": "system", "value": "Add statsd data for (in)secure requests\n" }, { "from": "human", "value": "from django.conf import settings\n\nfrom django_statsd.clients import statsd\nfrom django_statsd.middleware import GraphiteRequestTimingMiddleware\n\n\nclass GraphiteViewHitCountMiddleware(Gr...
python
chosen
[ { "from": "system", "value": "Add support for Python 2.6 and 2.7\n\nRemove the following error when using Python 2.6 and 2.7.\nTypeError: 'encoding' is an invalid keyword argument for this function\n\nPython 3 operation is unchanged\n" }, { "from": "human", "value": "from __future__ import print...
python
chosen
[ { "from": "system", "value": "Fix bug 'auto field does not accept 0 value'\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\n\nclass PublishableAdmin(admin.ModelAdmin):\n \"\"\"\n Overrides standard admin.ModelAdmin save_...
python
chosen
[ { "from": "system", "value": "Remove hack for sqpyte again\n\nRelated: https://github.com/HPI-SWA-Lab/SQPyte/commit/1afdff01b989352e3d72ca7f2cc9c837471642c7\n" }, { "from": "human", "value": "#! /usr/bin/env python\n\nimport sys, os\n\n\n\"\"\"\nRSqueak Build Options (separated with `--` from RP...
python
chosen
[ { "from": "system", "value": "Add the proper tests for the base app\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom splinter import Browser\n\n\nclass TestBaseViews(TestCase):\n\n def setUp(self):\n self.browser = Browser('chrome')\n\n def tearDown(self):\n...
python
chosen
[ { "from": "system", "value": "Increase a bit verbosity of tests so people know which test failed\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport glob\nimport os\nimport sys\nimport unittest\n\nimport common\n\nprogram = None\nif len(sys.argv) < 2:\n raise ValueError('Need at ...
python
chosen
[ { "from": "system", "value": "Generalize randomize script to work recursively and on more than just music\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport subprocess\nimport sys\nimport uuid\n\nif __name__ == '__main__':\n dir_name = sys.argv[1]\n\n for file_na...
python
chosen
[ { "from": "system", "value": "Load files given in arguments\n" }, { "from": "human", "value": "#!/usr/bin/python3\n# coding=utf-8\n\nimport sys\nimport os\nimport imp\nimport traceback\n\nservers = dict()\n\nprint (\"Nemubot ready, my PID is %i!\" % (os.getpid()))\nprompt = __import__ (\"prompt\...
python
chosen
[ { "from": "system", "value": "Increase switching interval to lure out race conditions a bit ...\n" }, { "from": "human", "value": "import unittest\n\nfrom bndl.compute.run import create_ctx\nfrom bndl.util.conf import Config\n\n\nclass ComputeTest(unittest.TestCase):\n worker_count = 3\n\n ...
python
chosen
[ { "from": "system", "value": "Revert database password policy while problems with keyring investigated\n" }, { "from": "human", "value": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work ...
python
chosen
[ { "from": "system", "value": "scripts/examples: Fix VSYNC GPIO LED pin name.\n" }, { "from": "human", "value": "# VSYNC GPIO output example.\n#\n# This example shows how to toggle a pin on VSYNC interrupt.\n\nimport sensor, image, time\nfrom pyb import Pin\n\nsensor.reset() ...
python
chosen
[ { "from": "system", "value": "Change multi line string to be regular comment.\n" }, { "from": "human", "value": "from ed2d.physics import rectangle\nfrom ed2d.physics import quadtree\n\nclass PhysEngine(object):\n\n def __init__(self):\n # I would love to have width and height as globa...
python
chosen
[ { "from": "system", "value": "Set the default bouncetime value to -666\n\nSet the default bouncetime to -666 (the default value -666 is in Rpi.GPIO source code).\r\n\r\nAs-Is: if the bouncetime is not set, your setting for event detecting is silently down. And there is no notification that bouncetime is req...
python
chosen
[ { "from": "system", "value": "Use isdigit() instead of int()\n" }, { "from": "human", "value": "\ndef is_siret(siret):\n # A valid SIRET is composed by 14 digits\n try:\n int(siret)\n except ValueError:\n return False\n\n return len(siret) == 14\n" }, { "from": ...
python
chosen
[ { "from": "system", "value": "Make sure versioneer is imported from here\n" }, { "from": "human", "value": "\"\"\"\nGet the version string from versioneer and print it to stdout\n\"\"\"\nimport versioneer\n\nversioneer.VCS = 'git'\nversioneer.tag_prefix = 'v'\nversioneer.versionfile_source = 've...
python
chosen
[ { "from": "system", "value": "Fix stupid oops in Format interface\n" }, { "from": "human", "value": "from straight.plugin import load as plugin_load\n\n\nclass Format(object):\n @classmethod\n def name(cls):\n \"\"\"Get the format's name.\n\n An format's canonical name is the...
python
chosen
[ { "from": "system", "value": "Fix typo in method name" }, { "from": "human", "value": "import unittest\n\n\nclass ExampleTest(unittest.TestCase):\n def test_xample(self):\n self.assertEqual(1, 1)\n\nif __name__ == '__main__':\n unittest.main()\n" }, { "from": "gpt", "val...
python
chosen
[ { "from": "system", "value": "Break after receiving no bytes to prevent hanging\n" }, { "from": "human", "value": "from pymogilefs.response import Response\nfrom pymogilefs.request import Request\nimport socket\n\n\nBUFSIZE = 4096\nTIMEOUT = 10\n\n\nclass Connection:\n def __init__(self, host...
python
chosen
[ { "from": "system", "value": "Change choice_id field to choice\n" }, { "from": "human", "value": "from django.db import models\nfrom rest_framework import serializers\n\nclass Choice(models.Model):\n text = models.CharField(max_length=255)\n version = models.CharField(max_length=4)\n cr...
python
chosen
[ { "from": "system", "value": "Add guard for parallel kwarg on 32-bit Windows\n" }, { "from": "human", "value": "\nfrom hypothesis import given\nfrom hypothesis.strategies import integers\n\nfrom numba import jit\nimport numpy as np\n\n\n@jit(nopython=True, parallel=True)\ndef get(n):\n return...
python
chosen
[ { "from": "system", "value": "Rewrite Disqus to use the new scope selection system\n" }, { "from": "human", "value": "from oauthlib.oauth2.draft25 import utils\nimport foauth.providers\n\n\ndef token_uri(service, token, r):\n params = [((u'access_token', token)), ((u'api_key', service.client_...
python
chosen
[ { "from": "system", "value": "Use >= minimumDurationInMonths instead of >\n" }, { "from": "human", "value": "import sys\n\nfrom dateutil import relativedelta\n\n\ndef run(project_id, repo_path, cursor, **options):\n cursor.execute(\n '''\n SELECT COUNT(c.id), MIN(c.created_a...
python
chosen
[ { "from": "system", "value": "Include file extension in returned filename\n" }, { "from": "human", "value": "from flask import Flask, render_template, request, jsonify\nimport os\n\napp = Flask(__name__)\napp.config.from_object('config.Debug')\n\n@app.route('/upload', methods=['GET', 'POST'])\nd...
python
chosen
[ { "from": "system", "value": "Add template for parse_reflog function\n" }, { "from": "human", "value": "from flask import Flask\napp = Flask(__name__)\n\n@app.route(\"/\")\ndef main():\n return \"Welcome!\"\n\nif __name__ == \"__main__\":\n app.run()\n" }, { "from": "gpt", "val...
python
chosen
[ { "from": "system", "value": "Fix category dependency for employee creation flow in testing\n" }, { "from": "human", "value": "from .models import Employee\nfrom rest_framework.test import APITestCase\n\n\nclass EmployeeTestCase(APITestCase):\n def setUp(self):\n Employee.objects.creat...
python
chosen
[ { "from": "system", "value": "Fix some bugs in tests\n" }, { "from": "human", "value": "from twisted.trial import unittest\n\nimport x256 \n\n\nclass Testx256(unittest.TestCase):\n \"\"\"\n Test class for x256 module.\n \"\"\"\n\n def setUp(self):\n self.rgb = [220, 40, 150]\n...
python
chosen
[ { "from": "system", "value": "Add simple regression test for logging patches\n" }, { "from": "human", "value": "import logging\n\nimport pytest\n\n\nsetup_py = \"\"\"\\\nfrom setuptools import setup\n\nsetup(\n name=\"test_logging\",\n version=\"0.0\"\n)\n\"\"\"\n\n\n@pytest.mark.parametri...
python
chosen
[ { "from": "system", "value": "Add username, email and phone on Apply serializer\n" }, { "from": "human", "value": "from ovp_projects import models\nfrom ovp_projects.models.apply import apply_status_choices\n\nfrom ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSeria...
python
chosen
[ { "from": "system", "value": "Change temp directory and update tweet message.\n" }, { "from": "human", "value": "import exifread\nimport os\n\n\nclass TweetS3Images(object):\n def __init__(self, twitter, s3_client):\n self._twitter = twitter\n self._s3_client = s3_client\n ...
python
chosen
[ { "from": "system", "value": "Remove the deprecated 'currency' context\n" }, { "from": "human", "value": "from currencies.models import Currency\n\n\ndef currencies(request):\n currencies = Currency.objects.all()\n\n if not request.session.get('currency'):\n request.session['currenc...
python
chosen
[ { "from": "system", "value": "Use BleCommunicationWin on CI tests\n" }, { "from": "human", "value": "import logging\nimport re\nimport sys\n\nfrom ruuvitag_sensor.url_decoder import UrlDecoder\n\n_LOGGER = logging.getLogger(__name__)\n\nmacRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\\\1[0-9a-f]{2}){...
python
chosen
[ { "from": "system", "value": "Validate Model function to allow permission\n" }, { "from": "human", "value": "from collections import defaultdict\nfrom .utils import get_value_from_accessor\n\nclass RoleBehaviour(object):\n ids = []\n object_accessors = {}\n\n def __init__(self, user, re...
python
chosen
[ { "from": "system", "value": "Add helper methods:\n 1. for converting from native string to bytes\n 2. for converting from native string to unicode\n" }, { "from": "human", "value": "# Copyright Least Authority Enterprises.\n# See LICENSE for details.\n\n\"\"\"\nHelpers for Python 2/3 compatib...
python
chosen
[ { "from": "system", "value": "Store temporary test directories in test path.\n" }, { "from": "human", "value": "import os\nimport shutil\nimport subprocess\nimport unittest\n\nfrom stash import Stash\n\nclass StashTestCase(unittest.TestCase):\n \"\"\"Base class for test cases that test stash ...
python
chosen
[ { "from": "system", "value": "Add get method to settings\n" }, { "from": "human", "value": "from flask import Flask\nfrom roomcontrol.music import music_service\nfrom roomcontrol.light import light_service\nfrom roomcontrol.alarm import alarm_service\n\napp = Flask(__name__)\napp.register_bluepr...
python
chosen
[ { "from": "system", "value": "Complete benchmarking: for vs. recur\n" }, { "from": "human", "value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef sum_list(num_ls):\n \"\"\"Sum number list by recursion.\"\"\"\n if l...
python
chosen
[ { "from": "system", "value": "Add a read filter for boolean fields\n" }, { "from": "human", "value": "\"\"\"Jinja environment filters for Pynuts.\"\"\"\n\nfrom flask import escape\nfrom flask.ext.wtf import QuerySelectField, QuerySelectMultipleField\n\n\ndef data(field):\n \"\"\"Return data a...
python
chosen
[ { "from": "system", "value": "Change pass to password to avoid shadowing\n" }, { "from": "human", "value": "from os import getenv\nimport sqlite3\nimport win32crypt\n\nappdata = getenv(\"APPDATA\") \nconnection = sqlite3.connect(appdata + \"\\..\\Local\\Google\\Chrome\\User Data\\Default\\Login ...
python
chosen
[ { "from": "system", "value": "Add AuctionBase fail and rollback properties.\n" }, { "from": "human", "value": "\"\"\"\n.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>\n\"\"\"\nimport pydarkstar.darkobject\nimport pydarkstar.database\n\nclass AuctionBase(pydarkstar.darkobject.DarkObject):...
python
chosen
[ { "from": "system", "value": "Set project name when parsing configuration\n\nChange-Id: Ib66df49855be1577688bc66cf7c0ada4486ff198\n" }, { "from": "human", "value": "# Copyright (c) 2013 Mirantis Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ...
python
chosen
[ { "from": "system", "value": "Convert a few more `url`s to `path`s\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.conf.urls import include, url\nfrom rest_framework import routers\n\nfrom api.views import CompanyViewSet\n\nrouter = routers.DefaultRouter()\nroute...
python
chosen
[ { "from": "system", "value": "Fix latex output for splitted up/down values\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nimport json\n\ndef storeJSON(dict, file_string):\n with open(file_string, 'w') as fp:\n json.dump(dict, fp, indent=4)\n\ndef storeTEX(dict, file_string):\n...
python
chosen
[ { "from": "system", "value": "Determine rating dispositions noted by the data changes and store them in a dictionary with the sample identification as the key.\n" }, { "from": "human", "value": "\"\"\"\n Watch Votes stream and update Sample ups and downs\n \"\"\"\n\nimport json\nimport bot...
python
chosen
[ { "from": "system", "value": "Fix to make site packages more generic in tests\n" }, { "from": "human", "value": "from datetime import datetime\n\nfrom django.test import TestCase\n\nfrom package.tests import data, initial_data\nfrom searchv2.utils import remove_prefix, clean_title\n\nclass UtilF...
python
chosen
[ { "from": "system", "value": "Improve names to reduce line size\n" }, { "from": "human", "value": "from .reviewsapi import ReviewsAPI\n\n\nclass Assigner:\n\n def __init__(self):\n self.reviewsapi = ReviewsAPI()\n\n def certifications(self):\n response = self.reviewsapi.certi...
python
chosen
[ { "from": "system", "value": "Switch to using Pushover's example tokens and such\n" }, { "from": "human", "value": "TEST_TOKEN = 'abcdef'\nTEST_USER = 'ubcdef'\nTEST_DEVICE = 'my-phone'\n" }, { "from": "gpt", "value": "TEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'\nTEST_USER = 'uQiRz...
python
chosen
[ { "from": "system", "value": "Remove a print statement that was dumb and breaking python3\n" }, { "from": "human", "value": "from sqlshare_rest.util.db import get_backend\nfrom sqlshare_rest.models import Query\nfrom django.utils import timezone\n\n\ndef process_queue():\n filtered = Query.ob...
python
chosen
[ { "from": "system", "value": "Add test_generic_list on tests views\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom opps.views.tests.test_generic_detail import *\n" }, { "from": "gpt", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfr...
python
chosen
[ { "from": "system", "value": "Fix typo in test name\n" }, { "from": "human", "value": "from .utils import TemplateTestCase, Mock\n\nfrom knights import Template\n\n\nclass LoadTagTest(TemplateTestCase):\n\n def test_load_default(self):\n t = Template('{! knights.defaultfilters !}')\n ...
python
chosen
[ { "from": "system", "value": "Add non-PayPal fields to exclude\n\nAll the non-paypal fields are blanked if you don't exclude them from the form.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport django\n\nfrom pay...
python
chosen
[ { "from": "system", "value": "Fix spelling in coord_utils import.\n\n\nFormer-commit-id: 03182f09c5e7cc2d7a5ca8b996baa82e4557e7fa [formerly 4011394beda266f4f43120e951b99bdc0470f93e]\nFormer-commit-id: 78985fde51ef15145a5ff42d8bd9fe05a8890b22" }, { "from": "human", "value": "# coding: utf-8\n# Co...
python
chosen
[ { "from": "system", "value": "Change answers attribute to dictionary\n" }, { "from": "human", "value": "from sympy import symbols, cos, sin\nfrom mathdeck import rand\n\nmetadata = {\n 'author': 'Bob Hope',\n 'institution': 'University of Missouri',\n 'subject': 'algebra',\n 'minor subject':...
python
chosen
[ { "from": "system", "value": "Handle logging when a '%' character is in the URL.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"Extend werkzeug request handler to suit our needs.\"\"\"\n\nimport time\nfrom werkzeug.serving import BaseRequestHandler\n\nclass ShRequestHandler(...
python
chosen
[ { "from": "system", "value": "Add support for adding a task to a specific list\nAdd support for listing all tasks in a specific list" }, { "from": "human", "value": "#!/usr/bin/env python\nimport TheHitList\nfrom optparse import OptionParser\n\nif __name__ == '__main__':\n\tparser = OptionParser...
python
chosen
[ { "from": "system", "value": "Add socket connect timeout option to sentinel connection\n" }, { "from": "human", "value": "from redis import sentinel, StrictRedis\n\n\nclass Sentinel(object):\n\n def __init__(self, app=None):\n self.app = app\n self.master = StrictRedis()\n ...
python
chosen
[ { "from": "system", "value": "Fix error in the case when no ID is provided\n" }, { "from": "human", "value": "# Filename: test_account.py\n\n\"\"\"\nTest the lendingclub2.accountmodule\n\"\"\"\n\n# PyTest\nimport pytest\n\n# lendingclub2\nfrom lendingclub2.account import InvestorAccount\nfrom le...
python
chosen
[ { "from": "system", "value": "Add test for contact page\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom django.core.urlresolvers import reverse\n\nclass ViewsTestCase(TestCase):\n def test_about_view(self):\n response = self.client.get(reverse('about'))\n ...
python
chosen
[ { "from": "system", "value": "Add simple test for _load_file\n\nSigned-off-by: Michal Kuffa <005ee1c97edba97d164343c993afee612ac25a0c@gmail.com>\n" }, { "from": "human", "value": "import os\n\nfrom pg_bawler import bawlerd\n\n\nclass TestBawlerdConfig:\n\n def test_build_config_location_list(...
python
chosen
[ { "from": "system", "value": "Add specialized getters for flags 'debug', 'verbose', and 'confirmation'\n" }, { "from": "human", "value": "import re\n\n\nclass TimeWarriorConfig(object):\n def __init__(self, config=None):\n self.__config = config if config is not None else {}\n\n def...
python
chosen
[ { "from": "system", "value": "Add app_label to jitishcron TaskExecution model\n\nThe TaskExecution model is loaded before apps are done loading, which in\nDjango 1.9 will no longer be permitted unless the model explicitly\nspecifies an app_label.\n" }, { "from": "human", "value": "from django.db...
python
chosen
[ { "from": "system", "value": "Fix parsing file - FileType already read\n" }, { "from": "human", "value": "import sys\nimport argparse\n\nfrom sqf.parser import parse\nimport sqf.analyser\nfrom sqf.exceptions import SQFParserError\n\n\ndef analyze(code, writer=sys.stdout):\n try:\n resu...
python
chosen
[ { "from": "system", "value": "Fix so both input and output are the same format!\n\nMatt\n" }, { "from": "human", "value": "#!/usr/bin/env python\n#\n# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)\n# All Rights Reserved.\n#\n# You may only modify and redistribute thi...
python
chosen
[ { "from": "system", "value": "Fix bug in simplify expression transformation.\n" }, { "from": "human", "value": "\"\"\"Simplify Expression\"\"\"\n\n\nfrom transf import parse\nimport ir.match\nimport ir.path\n\n\nparse.Transfs(r'''\n\nsimplify =\n\tBinary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),...
python
chosen
[ { "from": "system", "value": "Remove commented out code from build/lib/__main__.py\n" }, { "from": "human", "value": "\"\"\"Simply keeps track of the current version of the client\"\"\"\n\nVERSION=\"0.10.0\"\n" }, { "from": "gpt", "value": "\"\"\"Simply keeps track of the current ver...
python
chosen
[ { "from": "system", "value": "deps: Update PROVISION_VERSION for webpack upgrade.\n" }, { "from": "human", "value": "ZULIP_VERSION = \"1.5.1+git\"\nPROVISION_VERSION = '5.1'\n" }, { "from": "gpt", "value": "ZULIP_VERSION = \"1.5.1+git\"\nPROVISION_VERSION = '5.2'\n" } ]
python
chosen
[ { "from": "system", "value": "Add mod selection to the search command\n" }, { "from": "human", "value": "\"\"\"Package command line interface.\"\"\"\n\nimport click\n\nfrom .curse import Game, Mod\n\n\n# Static data\nMINECRAFT = {'id': 432, 'name': 'Minecraft'}\n\n\n@click.group()\ndef cli():\n ...
python
chosen
[ { "from": "system", "value": "Add wine type to the list.\n" }, { "from": "human", "value": "from django.contrib import admin\n\nfrom .models import Wine, Grape, Winery\n\nclass GrapeInline(admin.TabularInline):\n model = Grape\n extra = 0\n\n\n@admin.register(Wine)\nclass WineAdmin(admin.M...
python
chosen
[ { "from": "system", "value": "Add some package and feed group types for api handling\n\nSigned-off-by: Zach Hill <9de8c4480303b5335cd2a33eefe814615ba3612a@anchore.com>\n" }, { "from": "human", "value": "\"\"\"\nCommon utilities/lib for use by multiple services\n\"\"\"\n\nsubscription_types = ['p...
python
chosen
[ { "from": "system", "value": "Replace Markdown README with reStructured text\n" }, { "from": "human", "value": "__version_info__ = (1, 0, 1)\n__version__ = '.'.join(map(str, __version_info__))\n" }, { "from": "gpt", "value": "__version_info__ = (1, 0, 2)\n__version__ = '.'.join(map(s...
python
chosen
[ { "from": "system", "value": "Add v2 dev version designation.\n" }, { "from": "human", "value": "\"\"\"Define project metadata\n\"\"\"\n\n__all__ = [\n '__title__',\n '__summary__',\n '__url__',\n '__version__',\n '__author__',\n '__email__',\n '__license__',\n]\n\n__title__...
python
chosen
[ { "from": "system", "value": "Remove loop parameter from scheduler.start()" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# FOGLAMP_BEGIN\n# See: http://foglamp.readthedocs.io/\n# FOGLAMP_END\n\nimport signal\nimport asyncio\nfrom aiohttp import web\n\nfrom foglamp.core import route...
python
chosen
[ { "from": "system", "value": "Remove module docstring as we have it on the func\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2016 Ionuț Arțăriși <ionut@artarisi.eu>\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exce...
python
chosen
[ { "from": "system", "value": "Save confirmed files with Google Books ID\n" }, { "from": "human", "value": "from flask import Flask, render_template, request, jsonify\nimport os\nimport shutil\n\napp = Flask(__name__)\napp.config.from_object('config.Debug')\n\n@app.route('/upload', methods=['GET'...
python
chosen
[ { "from": "system", "value": "Disable adding registries for non-superusers\n" }, { "from": "human", "value": "from django.contrib import admin\nfrom models import *\nfrom registry.groups.models import User\n\nclass SectionAdmin(admin.ModelAdmin):\n list_display = ('code', 'display_name')\n\nc...
python
chosen
[ { "from": "system", "value": "Update to follower, reduce speed to motors.\n" }, { "from": "human", "value": "\n\nimport sys\nfrom time import time\n\n\nclass PID(object):\n\n def __init__(self):\n \"\"\"initizes value for the PID\"\"\"\n self.kd = 0\n self.ki = 0\n ...
python
chosen
[ { "from": "system", "value": "Allow pulling batch of runs for analysis\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Grab runs from S3 and do analysis\n#\n# Daniel Klein, 2015-08-14\n\nimport sys\nimport subprocess\nimport glob\n\n# Putting this in front of expensive imports\nimp...
python
chosen
[ { "from": "system", "value": "Fix compatibility problems with django.\n" }, { "from": "human", "value": "from django.conf.urls.defaults import patterns, url\nfrom p3p.views import XmlView, P3PView\n\nurlpatterns = patterns('p3p.views',\n url(r'^p3p.xml$', XmlView.as_view(), name='p3p'),\n ...
python
chosen
[ { "from": "system", "value": "Allow meals with unknown payer\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass Wbw_list(models.Model):\n list_id = models.IntegerField(unique=True)\n name = models.CharField(max_length=200, blank=True)\n\n def __str__(self):\n ...
python
chosen
[ { "from": "system", "value": "Use CUnicode for width and height in ImageWidget\n" }, { "from": "human", "value": "\"\"\"ButtonWidget class. \n\nRepresents a button in the frontend using a widget. Allows user to listen for\nclick events on the button and trigger backend code when the clicks are...
python
chosen
[ { "from": "system", "value": "Rename the filename argument to spreadsheet.\n" }, { "from": "human", "value": "from qiprofile_rest_client.helpers import database\nfrom qiprofile_rest_client.model.subject import Subject\nfrom qiprofile_rest_client.model.imaging import Session\nfrom . import (clini...
python
chosen
[ { "from": "system", "value": "Fix bugs in rf and xgb models\n" }, { "from": "human", "value": "import numpy as np\nimport pandas as pd\nimport sys\nimport os\nfrom sklearn.externals import joblib\nimport xgboost as xgb\n\nscriptpath = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../'\nsys....
python
chosen
[ { "from": "system", "value": "Set .PYMAKE so we can distinguish pymake from gmake\n" }, { "from": "human", "value": "\"\"\"\nImplicit variables; perhaps in the future this will also include some implicit\nrules, at least match-anything cancellation rules.\n\"\"\"\n\nvariables = {\n 'RM': 'rm ...
python
chosen
[ { "from": "system", "value": "Fix test failure in MPI\n" }, { "from": "human", "value": "import hoomd\nimport io\nimport numpy\n\n\ndef test_table_pressure(simulation_factory, two_particle_snapshot_factory):\n \"\"\"Test that write.table can log MD pressure values.\"\"\"\n thermo = hoomd.m...
python
chosen
[ { "from": "system", "value": "Remove CR from auparser for linux\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='PyAuParser',\n version='0.53',\n author=\"Esun Kim\",\n author_email='veblush+git_at_gmail.com',\n url='https://github.com/veblush/...
python
chosen
[ { "from": "system", "value": "Move the script to the main directory.\n" }, { "from": "human", "value": "#! /usr/bin/env python\n# -*- coding:utf-8 -*- \n\n#\n# Setup for the PyMeshToolkit package\n#\n\n# External dependencies\nfrom setuptools import setup, find_packages\n\n# Setup configuration\...
python
chosen
[ { "from": "system", "value": "Test both correct and wrong samples of noun phrase\n\nExtended noun phrase test to check for the grammar refusing wrong\nsamples of noun phrases. Also added a utility module called\nutils.py\n" }, { "from": "human", "value": "from parser_tool import parse, get_parse...
python
chosen
[ { "from": "system", "value": "Make this the first release candidate.\n" }, { "from": "human", "value": "\"\"\"\nFlask-Selfdoc\n-------------\n\nFlask selfdoc automatically creates an online documentation for your flask app.\n\"\"\"\nfrom setuptools import setup\n\n\ndef readme():\n with open(...
python
chosen
[ { "from": "system", "value": "Increment version number, includes bug fixes for synchronized decorator and KeyboardInterrupt handling\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(\n name = \"deco\",\n version = \"0.5.1\",\n description =...
python
chosen
[ { "from": "system", "value": "Make it possible to manually override version numbers\n" }, { "from": "human", "value": "#!/usr/bin/python\nimport time\nfrom datetime import date\nfrom setuptools import setup\nfrom pagekite.common import APPVER\nimport os\n\ntry:\n # This borks sdist.\n os.remov...
python
chosen
[ { "from": "system", "value": "Rename binary back to jpb_generate_binary_package\n\nBinary jpb_generate_binary_package was named as jpb_build_source_package\nThis seems to be an accidental change made in commit df61be3d\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools i...
python
chosen
[ { "from": "system", "value": "Update requirements. Add bat file\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='lcinvestor',\n version=open('lcinvestor/VERSION').read(),\n author='Jeremy Gillick',\n author_email='none@none.com',\n packages=['l...
python
chosen
[ { "from": "system", "value": "Make a new release with the job id and cli args\n" }, { "from": "human", "value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nconfig = {\n 'description': 'Collect xUnit xml files and upload them to bob-ben...
python
chosen
[ { "from": "system", "value": "Bump version number to 1.2\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='nnpy',\n version='1.1',\n url='https://github.com/nanomsg/nnpy',\n license='MIT',\n author='Dirkjan Ochtman',\n author_email='dirkjan@ochtm...
python
chosen