conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add get_absolute_url to Page model" }, { "from": "human", "value": "from django.db import models\n\n\nclass Chart(models.Model):\n\ttitle = models.CharField(max_length=50)\n\turl = models.CharField(max_length=1024)\n\n\tdef __unicode__(self):\n\t\treturn self.title\...
python
chosen
[ { "from": "system", "value": "Fix wiblog's use of the anti-spam validator\n" }, { "from": "human", "value": "# This file is part of the FragDev Website.\n# \n# the FragDev Website is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as p...
python
chosen
[ { "from": "system", "value": "Fix typo when using sys.stderr.write\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2015 OpenMarket Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licens...
python
chosen
[ { "from": "system", "value": "Resolve Django 1.10 deprecation warnings\n" }, { "from": "human", "value": "from django.conf.urls import patterns, url\n\nfrom .views import (DocumentationRecordListView, DocumentationRecordDetailView,\n MaintenanceRecordDetailView, MaintenanceRecordListView,\n ...
python
chosen
[ { "from": "system", "value": "Update sample task with pprint\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n__author__ = 'maxwu'\n\nimport json\n\nfrom me.maxwu.cistat import config\nfrom me.maxwu.cistat.reqs.circleci_request import CircleCiReq\nfrom me.maxwu....
python
chosen
[ { "from": "system", "value": "Allow for parameters to __init__()\n\nSigned-off-by: Steve Loranz <749f95e2748aaf836ea2a030a8b369f33fe35144@redhat.com>\n" }, { "from": "human", "value": "# Copyright 2011 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ...
python
chosen
[ { "from": "system", "value": "Move warning filter above other imports in init\n\n" }, { "from": "human", "value": "# -*- mode: python; coding: utf-8 -*-\n# Copyright (c) 2018 Radio Astronomy Software Group\n# Licensed under the 2-clause BSD License\n\n\"\"\"init file for pyuvdata.\n\n\"\"\"\nfro...
python
chosen
[ { "from": "system", "value": "Create zookeeper node if it doesn't exist\n" }, { "from": "human", "value": "# Polls Adzerk for current list of flights and saves the current targeting\n# information to zookeeper (to be run periodically with upstart)\n\nimport adzerk_api\nimport json\nfrom pylons i...
python
chosen
[ { "from": "system", "value": "Add some documentation to letters\n" }, { "from": "human", "value": "from dal import autocomplete\nfrom django import forms\nfrom django.contrib import admin\nfrom .models import Letter, Topic\nfrom prosopography.models import Person\n\n\nclass PersonInlineForm(form...
python
chosen
[ { "from": "system", "value": "Return conditional without using if/else to return boolean values\n\nIn this case, since both methods in the conditional strictly returns boolean values, it is defintely safe and more pythonic to return the conditional\n" }, { "from": "human", "value": "from django....
python
chosen
[ { "from": "system", "value": "Add data property for DataBroker class\n" }, { "from": "human", "value": "import glob\nimport io\n\n\nclass DataBroker(object):\n \"\"\"\n Read data and apply transformation to it as necessary.\n\n Args:\n config: A `dict` containing the fuzzer confi...
python
chosen
[ { "from": "system", "value": "Add install process for docker" }, { "from": "human", "value": "from genes import apt\nimport platform\n\nclass Config:\n OS = platform.system()\n DIST = platform.linux_distribution()\n\ndef main():\n if Config.OS == 'Linux':\n if Config.DIST[0] == '...
python
chosen
[ { "from": "system", "value": "Clarify argument name in build.\n" }, { "from": "human", "value": "import os\nfrom .repository import require_repo, presentation_files\nfrom .helpers import copy_files, remove_directory\n\n\ndefault_out_directory = '_site'\n\n\ndef build(directory=None, out_director...
python
chosen
[ { "from": "system", "value": "Tests: Move code inside __main__ block\n" }, { "from": "human", "value": "from urllib.parse import urlparse\n\nfrom twisted.internet import reactor\nfrom twisted.names.client import createResolver\n\nfrom scrapy import Spider, Request\nfrom scrapy.crawler import Cra...
python
chosen
[ { "from": "system", "value": "Test unstowing a package with no 'current' symlink\n" }, { "from": "human", "value": "import os\n\nimport steeve\n\n\ndef test_unstow(runner, stowed_foo_package):\n \"\"\"Must remove all previously linked files.\"\"\"\n result = runner.invoke(steeve.cli, ['uns...
python
chosen
[ { "from": "system", "value": "Set logging level to DEBUG in tests\n" }, { "from": "human", "value": "import pytest\n\nfrom .context import tohu\nfrom tohu.v5.primitive_generators import *\n\n\nEXEMPLAR_PRIMITIVE_GENERATORS = [\n Constant(\"quux\"),\n Boolean(p=0.3),\n]\n\n\n@pytest.fixture...
python
chosen
[ { "from": "system", "value": "Make trailing slash optional in meal URLs\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include, url\n\nfrom . import views\n\nurlpatterns = patterns('',\n url(r'^$', views.MealCreateView.as_view(), name='meal-create'),\n url(r'^(?P...
python
chosen
[ { "from": "system", "value": "Use cacheops.__version__ as source of truth\n" }, { "from": "human", "value": "VERSION = (3, 2, 1)\n__version__ = '.'.join(map(str, VERSION if VERSION[-1] else VERSION[:2]))\n\n\nfrom django.apps import AppConfig\n\nfrom .simple import *\nfrom .query import *\nfrom ...
python
chosen
[ { "from": "system", "value": "Fix a line too long lint error\n" }, { "from": "human", "value": "import asyncio\n\nimport aiohttp\n\nfrom seabird.decorators import command\nfrom seabird.plugin import Plugin\n\n\nMETAR_URL = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT'\n\n...
python
chosen
[ { "from": "system", "value": "Remove logger warning in favor of print for now\n" }, { "from": "human", "value": "import logging\nfrom django import forms\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Layout, HTML, Div, Submit\n\nlogger = logging.getLogger(\"sheepdo...
python
chosen
[ { "from": "system", "value": "Send date to process in message\n" }, { "from": "human", "value": "import json\nfrom datetime import date\nfrom boto import sqs\nfrom boto.dynamodb2.table import Table\n\n\ndef playlists_to_process():\n accounts = Table('accounts')\n target_date = date.isoform...
python
chosen
[ { "from": "system", "value": "Fix logging the JSON result\n" }, { "from": "human", "value": "from sublime_plugin import WindowCommand\n\nfrom ...common import util\nfrom ...core.git_command import GitCommand\nfrom .. import github, git_mixins\nfrom GitSavvy.core.runtime import enqueue_on_worker\...
python
chosen
[ { "from": "system", "value": "Fix in string representation of unit of measurement.\n" }, { "from": "human", "value": "from django.db import models\nfrom amadaa.models import AmadaaModel\nfrom django.urls import reverse\n\n# Create your models here.\n\nclass ProductCategory(AmadaaModel):\n nam...
python
chosen
[ { "from": "system", "value": "Make requirements optional. Add help text and fix display in admin form\n" }, { "from": "human", "value": "from django.contrib.auth.models import User\nfrom django.db import models\n\n\nclass ConferenceOptionGroup(models.Model):\n \"\"\"Used to manage relationshi...
python
chosen
[ { "from": "system", "value": "Edit bird now checks if the user has permission to access admin and edit the page before displaying edit page option\n" }, { "from": "human", "value": "from django.core.urlresolvers import reverse\nfrom django.template import RequestContext\nfrom django.template.loa...
python
chosen
[ { "from": "system", "value": "Improve tests\nTest VM creation, destruction and cloning\n" }, { "from": "human", "value": "# This code assumes vboxapi.py from VirtualBox distribution\n# being in PYTHONPATH, or installed system-wide\nimport unittest\nimport logging\nimport time\n\nimport virtualbo...
python
chosen
[ { "from": "system", "value": "Use -platform:anycpu while compiling .NET assemblies" }, { "from": "human", "value": "import os.path\nimport SCons.Builder\nimport SCons.Node.FS\nimport SCons.Util\n\ncsccom = \"$CSC $CSCFLAGS $_CSCLIBPATH -r:$_CSCLIBS -out:${TARGET.abspath} $SOURCES\"\ncsclibcom = ...
python
chosen
[ { "from": "system", "value": "Add support for looping sample\n" }, { "from": "human", "value": "import pyaudio\nimport wave\nimport time\nimport sys\nimport numpy as np\n\nif len(sys.argv) < 2:\n print(\"Plays a wave file.\\n\\nUsage: %s filename.wav\" % sys.argv[0])\n sys.exit(-1)\n\nwf =...
python
chosen
[ { "from": "system", "value": "Whitelist the official names for the starship factory blog.\n" }, { "from": "human", "value": "from .base import * # NOQA\nfrom os import environ\n\nenviron.setdefault('SFBLOG_CONFIG_PATH', '/etc/sfblog')\n\nDEBUG = False\n\nDATABASES = {\n 'default': {\n ...
python
chosen
[ { "from": "system", "value": "Format number as string or it errors in some webservers\n" }, { "from": "human", "value": "from django.conf.urls.defaults import *\n\nimport os.path\n\nurlpatterns = patterns('',\n url(r'^media/(?P<path>.+)?$', 'django.views.static.serve', {\n 'document_ro...
python
chosen
[ { "from": "system", "value": "Add missing return of Event methods" }, { "from": "human", "value": "class Event:\n def __init__(self, bot, data):\n self.bot = bot\n self.data = data\n def post_message(self, text, channel=None):\n if channel is None:\n channel...
python
chosen
[ { "from": "system", "value": "Fix incorrect signature for get_customer_ids function\n\nChange-Id: Ib44af3ac6437ad9fa4cbfd9fda9b055b7eff4547\n" }, { "from": "human", "value": "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use th...
python
chosen
[ { "from": "system", "value": "Use double quotes on help string\n" }, { "from": "human", "value": "from flask import request\nfrom flask_restful import Resource, Api, abort, reqparse\nfrom .models import db, Comment, Lecture\n\napi = Api()\n\n\nclass CommentListResource(Resource):\n def get(se...
python
chosen
[ { "from": "system", "value": "Upgrade Dropbox to OAuth 2\n" }, { "from": "human", "value": "import foauth.providers\nfrom oauthlib.oauth1.rfc5849 import SIGNATURE_PLAINTEXT\n\n\nclass Dropbox(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'https://www.dropbo...
python
chosen
[ { "from": "system", "value": "Correct bounds and boolean selector.\n" }, { "from": "human", "value": "import os\nimport errno\nimport sys\n\n\ndef _makedirs_31(path, exist_ok=False):\n try:\n os.makedirs(path)\n except OSError as exc:\n if not exist_ok or exc.errno != errno.E...
python
chosen
[ { "from": "system", "value": "Modify Fluorophore for more convenient coordinates.\n" }, { "from": "human", "value": "import numpy as np\n\nclass Fluorophore:\n \"\"\"A single fluorophore is specified by its 3D position, (unit) absorption\n dipole moment (theta, phi), and (unit) emission di...
python
chosen
[ { "from": "system", "value": "Fix database infra save method\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\nimport logging\nfrom django import forms\nfrom .. import models\n\nlog = logging.getLogger(__name__)\n\n\nclass Datab...
python
chosen
[ { "from": "system", "value": "spath: Allow importing even when not compiled.\n" }, { "from": "human", "value": "from spath import shortest_path\n" }, { "from": "gpt", "value": "try:\n from spath import shortest_path\nexcept ImportError:\n print \"\"\"*** The shortest path exten...
python
chosen
[ { "from": "system", "value": "tools: Make pydoc quieter on error.\n" }, { "from": "human", "value": "#!/usr/bin/env python3.7\n\n# Copyright (C) 2019 Andrew Hamilton. All rights reserved.\n# Licensed under the Artistic License 2.0.\n\n\nimport pydoc\nimport sys\n\nimport eris.termstr\n\n\nclass ...
python
chosen
[ { "from": "system", "value": "Fix bug in chain creation\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom pollirio.reactors import expose\nfrom pollirio import conf, choose_dest\n\nimport random\n\ndef create_chains(lines):\n markov_chain = {}\n hasPrev = False\n for li...
python
chosen
[ { "from": "system", "value": "Add managed roles to serializer\n" }, { "from": "human", "value": "from radar_api.serializers.groups import GroupReferenceField\nfrom radar_api.serializers.meta import MetaSerializerMixin\nfrom radar_api.serializers.user_mixins import UserSerializerMixin\nfrom radar...
python
chosen
[ { "from": "system", "value": "Add log_errors flag to _execute\n" }, { "from": "human", "value": "from __future__ import unicode_literals, print_function\nimport logging\nimport subprocess\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _execute(cmd, strict=False):\n \"\"\"\n Make execut...
python
chosen
[ { "from": "system", "value": "Use app request context directly rather than hacking with a test client\n" }, { "from": "human", "value": "import json\n\nfrom flask import request as current_request, Response\nfrom werkzeug.exceptions import BadRequest\n\n\nclass Aggregator(object):\n\n def __i...
python
chosen
[ { "from": "system", "value": "Add function which divide text to paragraphs\n" }, { "from": "human", "value": "import falcon\n\n\nclass BooksResource:\n def on_get(self, req, resp):\n resp.status = falcon.HTTP_200\n resp.body = open('/home/sanchopanca/Documents/thunder.txt').read...
python
chosen
[ { "from": "system", "value": "Revert \"Allow widget overwriting on form field\"\n\nThis reverts commit 23a9aaae78cc4d9228f8d0705647fbcadcaf7975.\n" }, { "from": "human", "value": "from django import forms\nfrom django.db import models\n\nfrom .widgets import MarkdownTextarea\n\n\nclass MarkdownF...
python
chosen
[ { "from": "system", "value": "OTHER: Handle symbolic refs in .git/HEAD\n" }, { "from": "human", "value": "import os\nimport sha\n\ndef gitsha(path):\n h = sha.sha()\n data = file(path).read()\n h.update(\"blob %d\\0\" % len(data))\n h.update(data)\n return h.hexdigest()\n\ndef git...
python
chosen
[ { "from": "system", "value": "Complete naive solution by nested for loops\n" }, { "from": "human", "value": "\"\"\"560. Subarray Sum Equals K\nMedium\n\nGiven an array of integers and an integer k, you need to find the total \nnumber of continuous subarrays whose sum equals to k.\n\nExample 1:\n...
python
chosen
[ { "from": "system", "value": "Order MongoForm fields according to the Document\n" }, { "from": "human", "value": "from django import forms\nfrom mongoengine.base import ValidationError\nfrom bson.objectid import ObjectId\n\n\ndef mongoengine_validate_wrapper(old_clean, new_clean):\n \"\"\"\n ...
python
chosen
[ { "from": "system", "value": "Tweak old integration test docstring\n" }, { "from": "human", "value": "from spec import skip, Spec, ok_\n\nfrom fabric.connection import Connection\n\n\nclass Main(Spec):\n def connection_open_generates_real_connection(self):\n c = Connection('localhost')...
python
chosen
[ { "from": "system", "value": "Revert \"Skip an x-failed test due to an unexpected assert\"\n\nThis reverts commit b04c3edb7a8bcb5265a1ea4265714dcb8d1b185a.\n\n(cherry picked from commit 76be04b7474d9a12d45256c3f31719e3b2ac425d)\n" }, { "from": "human", "value": "# TestSwiftFoundationValueTypes.p...
python
chosen
[ { "from": "system", "value": "Convert from pyqt4 to qtpy\n" }, { "from": "human", "value": "from PyQt4 import QtGui\nfrom addie.step1_handler.step1_gui_handler import Step1GuiHandler\n\n\nclass InitStep1(object):\n \n def __init__(self, parent=None):\n self.parent = parent\n ...
python
chosen
[ { "from": "system", "value": "callbacks: Make the value of FLOATING_IP match with api resource\n\nNote: BEFORE_RESPONSE code assumes they match. Nova notifier uses\nFLOATING_IP/BEFORE_RESPONSE.\n\nCloses-Bug: #1642918\nChange-Id: If834ca1ee52d538cae4a5d164e0e0343c7019546\n" }, { "from": "human", ...
python
chosen
[ { "from": "system", "value": "Update dsub version to 0.3.11.dev0\n\nPiperOrigin-RevId: 324910070\n" }, { "from": "human", "value": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in com...
python
chosen
[ { "from": "system", "value": "Fix bug: log dir path: set it thru file location, not current working path\n" }, { "from": "human", "value": "#!/usr/bin/python\nimport shlex, os\nfrom subprocess import Popen, PIPE\n#from time import sleep\nimport threading\n\ndef exe_cmd(log_name, command_line):\n...
python
chosen
[ { "from": "system", "value": "Enable consistent-hashing policy for Collector\n\nChange-Id: I7ed6747b6c3ef95d8fed0c62e786c7039fb510a6\nFixes-Bug: #1600368\n" }, { "from": "human", "value": "import string\n\ntemplate = string.Template(\"\"\"\n[DEFAULTS]\nzk_server_ip=$__contrail_zk_server_ip__\nzk...
python
chosen
[ { "from": "system", "value": "Add target to the warning log message\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''\nThis is the default list matcher.\n'''\nfrom __future__ import absolute_import, print_function, unicode_literals\nimport logging\n\nlog = logging.getLogger(__name_...
python
chosen
[ { "from": "system", "value": "Fix Django 1.10 deprecation warning\n" }, { "from": "human", "value": "from django.conf.urls import patterns, url\n\nurlpatterns = patterns('',\n url(r'^mask/$', 'masquerade.views.mask'),\n url(r'^unmask/$', 'masquerade.views.unmask'),\n)\n" }, { "from...
python
chosen
[ { "from": "system", "value": "Add argument to @wraps decorator\n" }, { "from": "human", "value": "from functools import wraps\n\n\ndef if_any(*conds):\n def wrapper(func):\n @wraps\n def run_if_any(*args, **kwargs):\n if any(conds):\n return func(*args,...
python
chosen
[ { "from": "system", "value": "Hide last task and services with negative score from main page\n" }, { "from": "human", "value": "from django.shortcuts import render\nfrom main.models import UserProfile, Transaction, Task, Service\nfrom django.db.models import Avg\n\n\ndef index(request):\n use...
python
chosen
[ { "from": "system", "value": "Add Justin to authors, fix comments\n" }, { "from": "human", "value": "# -*- coding:utf-8 -*-\n\"\"\"\nRoot package of MetaOpt.\n\"\"\"\n__author__ = 'Renke Grunwald, Bengt Lüers, Jendrik Poloczek'\n__author_email__ = 'info@metaopt.org'\n__license__ = '3-Clause BSD'...
python
chosen
[ { "from": "system", "value": "Support hostname that resolve to IPv6-only address\n\nThe current hostname validation does not cope with IPv6-only hostnames. Use getaddrinfo instead of gethostbyname to fix this. getaddrinfo raises the same exceptions and should work like a drop-in-replacement in this scenario...
python
chosen
[ { "from": "system", "value": "Fix for python 2.6 support\n" }, { "from": "human", "value": "# This Source Code Form is subject to the terms of the Mozilla Public\r\n# License, v. 2.0. If a copy of the MPL was not distributed with this\r\n# file, You can obtain one at http://mozilla.org/MPL/2.0/....
python
chosen
[ { "from": "system", "value": "Debug off for production settings.\n" }, { "from": "human", "value": "\"\"\"Overwrite and add settings specifically for production deployed instance.\"\"\"\nfrom delivercute.settings import *\n\n# DEBUG = False\nALLOWED_HOSTS.append('.us-west-2.compute.amazonaws.com...
python
chosen
[ { "from": "system", "value": "Fix reordering due to removal of Other\n" }, { "from": "human", "value": "'''\nJames D. Zoll\n\n4/15/2013\n\nPurpose: Defines template tags for the Leapday Recipedia application.\n\nLicense: This is a public work.\n'''\n\nfrom django import template\nregister = temp...
python
chosen
[ { "from": "system", "value": "import: Implement YAML file compilation into 'bytecode'\n\nStore serialized Python structures resulted from loading YAML source in\nthe .ymlc files, a-la .pyc\n" }, { "from": "human", "value": "import subprocess\n\nclass YamlValidationError(Exception): pass\nclass B...
python
chosen
[ { "from": "human", "value": "Convert image to base64 before sending Item to sync\n" }, { "from": "gpt", "value": "import io, base64, urllib, os\n\ndef pre_process(doc):\n\n\tfile_path = doc.image\n\tfile_name = os.path.basename(file_path)\n\n\tif file_path.startswith('http'):\n\t\turl = file_pat...
python
chosen
[ { "from": "system", "value": "Make htmlescape function available in templates\n\nFor when we explicitly call it.\n" }, { "from": "human", "value": "import aspen_jinja2_renderer as base\n\nfrom markupsafe import escape as htmlescape\n\n\nclass HTMLRenderer(base.Renderer):\n def render_content(...
python
chosen
[ { "from": "system", "value": "Update global lock, default connection\n" }, { "from": "human", "value": "#\n" }, { "from": "gpt", "value": "\"\"\"retools\n\nThis module holds a default Redis instance, which can be\nconfigured process-wide::\n \n from retools import Connection\n ...
python
chosen
[ { "from": "system", "value": "Add logging message when plugin fails to render custom panels\n" }, { "from": "human", "value": "import sys\nimport traceback\n\nfrom django.conf import settings\nfrom django.views.debug import ExceptionReporter\n\nfrom error_report.models import Error\n\nfrom plugi...
python
chosen
[ { "from": "system", "value": "Write OLS results to correct shelf\n" }, { "from": "human", "value": "from __future__ import print_function\n\nfrom genomic_neuralnet.methods import get_lr_prediction \nfrom genomic_neuralnet.analyses import run_optimization\n\ndef main():\n params = {} \n run...
python
chosen
[ { "from": "system", "value": "Add field channel on QuerySet boxes\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#from django.conf import settings\n#from django.utils.importlib import import_module\nfrom django.db import models\nfrom django.utils.translation i...
python
chosen
[ { "from": "system", "value": "Implement utc_timeout for PGSQL and MSSQL\n\nUTC_TIMESTAMP is a MySQL specific function. Use SQLAlchemy to implement it\nalso in MSSQL and PGSQL.\n\nChange-Id: If8673b543da2a89a2bad87daff2429cb09c735aa\nCloses-Bug: #1700873\n" }, { "from": "human", "value": "# Copyr...
python
chosen
[ { "from": "system", "value": "Change some naming in AnonymousAuthentication\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8\n\n\nclass AnonymousAuthentication(object):\n anonymous_allowed_methods = ['GET']\n\n def __init__(self, allowed=None):\n if allo...
python
chosen
[ { "from": "system", "value": "Create corresponding SmartTag resource with explicitly defined 'resource_name' attribute that will be used for its TastyFactory key.\n" }, { "from": "human", "value": "from tastypie.resources import ModelResource\nfrom tastypie.api import Api\nfrom tastypie import f...
python
chosen
[ { "from": "system", "value": "Test the parsing of all of the uploaded Jaguar files\n\ngit-svn-id: d468cea6ffe92bc1eb1f3bde47ad7e70b065426a@75 5acbf244-8a03-4a8b-a19b-0d601add4d27\n" }, { "from": "human", "value": "import os\r\nfrom cclib.parser import Jaguar\r\n\r\nos.chdir(os.path.join(\"..\",\...
python
chosen
[ { "from": "system", "value": "Put each unexpected dynamic symbols on its own line\n" }, { "from": "human", "value": "# Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n# file at the top-level directory of this distribution.\n#\n# Licensed under the Apache License, Version 2.0 <LIC...
python
chosen
[ { "from": "system", "value": "Fix data log fixture foreign keys\n" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom django.core import serializers\n\nfrom data_log import models\nimport json\n\n\nclass Command(BaseCommand):\n help = 'Create Data Log Re...
python
chosen
[ { "from": "system", "value": "Send unknown events to HipChat in red\n\nIf an event comes in to the test_app and has no matching template,\nthen send it to HipChat in red, not yellow, making it easier to\nmanage.\n" }, { "from": "human", "value": "# # -*- coding: utf-8 -*-\nimport logging\n\nfrom...
python
chosen
[ { "from": "system", "value": "Move unit tests data in setUp\n\nWhen unit testing the various methods of cat2cohort,\nwe need some example data (input and expected output).\nIt makes sense to share it among testing methods through\nthe setUp method mechanism.\n" }, { "from": "human", "value": "\"...
python
chosen
[ { "from": "system", "value": "Test that the api 404's when a user does not exist\n" }, { "from": "human", "value": "from json import loads\n\nfrom tests import AppTestCase, main\n\nfrom tentd import db\nfrom tentd.models.entity import Entity\n\nclass EntityBlueprintTest (AppTestCase):\n\tdef set...
python
chosen
[ { "from": "system", "value": "Make sure we flatten the labels attribute to a serializable simple type.\n" }, { "from": "human", "value": "__all__ = [\n 'issue_to_dict'\n]\n\n\ndef issue_to_dict(issue):\n result = {}\n\n if issue.closed_by:\n closed_by = issue.closed_by.name\n ...
python
chosen
[ { "from": "system", "value": "Format Error message in the exception\n" }, { "from": "human", "value": "class YAMLException(Exception):\n \"\"\"Base for the exception hierarchy of this module\n \"\"\"\n" }, { "from": "gpt", "value": "class YAMLException(Exception):\n \"\"\"Ba...
python
chosen
[ { "from": "system", "value": "Add test for collection creation with crs_wkt\n" }, { "from": "human", "value": "import os\nimport re\n\nimport fiona\nimport fiona.crs\n\nfrom .conftest import WGS84PATTERN\n\ndef test_collection_crs_wkt(path_coutwildrnp_shp):\n with fiona.open(path_coutwildrnp_...
python
chosen
[ { "from": "system", "value": "Fix mapping for codon keys for Tyrosine\n" }, { "from": "human", "value": "# Codon | Protein\n# :--- | :---\n# AUG | Methionine\n# UUU, UUC | Phenylalanine\n# UUA, UUG | Leucine\n# UCU, UCC...
python
chosen
[ { "from": "system", "value": "Add a test for the bug occuring when no restaurants exist\n" }, { "from": "human", "value": "from django.test import TestCase\nfrom randomizer.models import Restaurant\n\n\nclass RandomizerTest(TestCase):\n \"\"\"tests for the randomizer\"\"\"\n\n def test_hom...
python
chosen
[ { "from": "system", "value": "Change rc_counts to a dict instead of list.\n" }, { "from": "human", "value": "from convenience_hole import all_hands_in_range\nfrom convenience import pr\nfrom deuces.deuces import Card, Evaluator\n\ne = Evaluator()\n\nboard = [Card.new('Qs'), Card.new('Jd'), Card....
python
chosen
[ { "from": "system", "value": "Update development status to \"beta\"\n\nIt's live on the website so it can't really be called \"pre-alpha\" anymore!\n" }, { "from": "human", "value": "\"\"\"voting setuptools information.\"\"\"\n\nimport setuptools\n\n\nsetuptools.setup(\n name=\"voting\",\n ...
python
chosen
[ { "from": "system", "value": "Add Django version trove classifiers\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nfrom setuptools import find_packages\n\n\nsetup(\n name='django-p...
python
chosen
[ { "from": "system", "value": "Drop `mock` and `nose` as package dependencies\n\nThat `nose` is used as a test runner (and `mock` is used in those tests)\nhas nothing to do with the package itself. Rather, these are just\ndependencies needed in order to *run tests.*\n\nNote that we're still pinning to very p...
python
chosen
[ { "from": "system", "value": "Move to Development Status :: 4 - Beta\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name = \"blynk-library-python\",\n version = \"0.1.0\", #blynk.lib.__version__\n description = \"Blynk ...
python
chosen
[ { "from": "system", "value": "Fix typo in file_util import\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom distutils.core import setup\nfrom distutils.file_utl import copy_file\nimport platform\n\nversion = \"0.1.0\"\n\nsetup(name=\"riemann-sumd\",\n version=version,\n d...
python
chosen
[ { "from": "system", "value": "Increment version for django 1.9 support" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='jsonate',\n version='0.3.2',\n \n author='James Robert',\n author_email='jiaaro@gmail.com',\n \n description=('Django librar...
python
chosen
[ { "from": "system", "value": "Break multiple imports to multiple lines\n\nChange-Id: I62ba21f4447fada5bf1b86c261d0f7a65681ba76\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# Copyright (c) 2013 AT&T. All right reserved.\n\nfrom setuptools import setup, find_packages\n\n# move version...
python
chosen
[ { "from": "system", "value": "Switch to find_packages. Bump for PyPI.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='django-waffle',\n version='0.7',\n description='A feature flipper for Django.',\n long_description=open('README.rst').read(),\n a...
python
chosen
[ { "from": "system", "value": "Rename the python package to barn." }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\n\nsetup(\n name='docstash',\n version='0.2.2',\n description=\"Store a set of documents and metadata in an organized way\",\n long...
python
chosen
[ { "from": "system", "value": "Add a few PyPI classifiers.\n" }, { "from": "human", "value": "import os.path\nfrom setuptools import setup, find_packages\n\nimport stun\n\n\ndef main():\n src = os.path.realpath(os.path.dirname(__file__))\n README = open(os.path.join(src, 'README.rst')).read...
python
chosen
[ { "from": "system", "value": "Update to not include test packages.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nimport os\n\ndef read(fn):\n \"\"\"\n Read the contents of the provided filename.\n\n Args:\n fn: The filename to read in.\n\n Returns...
python
chosen
[ { "from": "system", "value": "Upgrade all dependencies to latest version.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='docker-ipsec',\n version='2.0.3',\n description='Scripts to start/stop ipsec VPN tunnels while adding/removing iptables rules for d...
python
chosen
[ { "from": "system", "value": "Add PyPi trove classifiers to document Python 3 support.\nAdd other applicable classifiers while we're here.\n" }, { "from": "human", "value": "from setuptools import setup\n\n\nsetup(\n name='pygelf',\n version='0.2.8',\n packages=['pygelf'],\n descript...
python
chosen
[ { "from": "system", "value": "Add dependency on Django 1.3.\n" }, { "from": "human", "value": "#/usr/bin/env python\nimport os\nfrom setuptools import setup, find_packages\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\n# Dynamically calculate the version based on...
python
chosen