conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix script for release file already present case\n\nThis avoids a:\n\"AttributeError: 'HTTPError' object has no attribute 'message'\"\n\nSigned-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com>\n" }, { "from": "human", "value": "from __futu...
python
chosen
[ { "from": "system", "value": "Handle the fact that to_check is a set\n" }, { "from": "human", "value": "import logging\nimport mothermayi.errors\nimport mothermayi.files\nimport subprocess\n\nLOGGER = logging.getLogger(__name__)\n\ndef plugin():\n return {\n 'name' : 'pylint',...
python
chosen
[ { "from": "system", "value": "Rename the SQL module vars for consistency.\n" }, { "from": "human", "value": "from __future__ import unicode_literals, print_function\nimport sqlite3, os, random\n\n_select = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});'\n_uncom...
python
chosen
[ { "from": "system", "value": "Introduce scope_types in server diagnostics\n\noslo.policy introduced the scope_type feature which can\ncontrol the access level at system-level and project-level.\n - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope\n - http://specs.openstack.org/ope...
python
chosen
[ { "from": "system", "value": "Modify test_process_list()'s expect sub-strings to be up-to-date.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@128697 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "\"\"\"\nTest some lldb platform commands.\n\"\"\"\n\nimport os,...
python
chosen
[ { "from": "system", "value": "Read center point from config\n\nSigned-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>\n" }, { "from": "human", "value": "import database as db\nfrom database.model import Team\nfrom geotools import simple_distance\nfrom geotools.r...
python
chosen
[ { "from": "system", "value": "Rework commented out code a tad\n" }, { "from": "human", "value": "# Copyright 2013 IBM Corporation\n# All rights reserved\n\n# This is the main application.\n# It should check for existing UDP socket to negotiate socket listen takeover\n# It will have three paths i...
python
chosen
[ { "from": "system", "value": "Make is_call handle multiple arguments.\n\nCan now be called with a sequence, as in\nis_call(ancestor::Function/@name)\nor just several literals, as in is_call('eval', 'feval').\nIn both cases, it does an or.\n" }, { "from": "human", "value": "import sys\n\nimport l...
python
chosen
[ { "from": "system", "value": "Add logging to player season creation script\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport concurrent.futures\n\nfrom db.common import session_scope\nfrom db.player import Player\nfrom utils.player_data_retriever import ...
python
chosen
[ { "from": "system", "value": "Remove marker from option spec\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\n\tsphinxcontrib.openstreetmap\n\t===========================\n\n\tEmbed OpenStreetMap on your documentation.\n\n\t:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@gm...
python
chosen
[ { "from": "system", "value": "Add with_cache function for storing cached data\n" }, { "from": "human", "value": "\"\"\"\nUseful utilities.\n\"\"\"\nimport json\n\nfrom kyokai import Request\nfrom kyokai.context import HTTPRequestContext\n\n\ndef jsonify(func):\n \"\"\"\n JSON-ify the respo...
python
chosen
[ { "from": "system", "value": "Use radio buttons for most of the interface.\n\nSigned-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>\n" }, { "from": "human", "value": "from django import forms\n\nfrom .models import Config\n\nclass ConfigForm(forms.ModelForm):\n class...
python
chosen
[ { "from": "system", "value": "Fix running detection for master\n" }, { "from": "human", "value": "import os\nimport subprocess\n\nname = \"gobuildmaster\"\n\ncurrent_hash = \"\"\nif os.path.isfile('hash'):\n current_hash = open('hash').readlines()[0]\nnew_hash = os.popen('git rev-parse HEAD')...
python
chosen
[ { "from": "system", "value": "Test changing file path for nosetests\n" }, { "from": "human", "value": "import unittest\nimport src\nimport resources.Constants as const\n\n\nclass TestAssignments(unittest.TestCase):\n\n string_file = ''\n int_file = ''\n\n @classmethod\n def setUpClas...
python
chosen
[ { "from": "system", "value": "rcos: Add / to rcos tests\n" }, { "from": "human", "value": "import pytest\nfrom django.core.urlresolvers import reverse\n\n@pytest.mark.django_db\ndef test_homepage(client):\n\n for url in (\n \"/donor\",\n \"/students\",\n \"/co...
python
chosen
[ { "from": "system", "value": "Refactor a lightweight Mock class.\n" }, { "from": "human", "value": "import unittest\nfrom event import Event\n\n\nclass EventTest(unittest.TestCase):\n def test_a_listener_is_notified_when_event_is_raised(self):\n called = False\n\n def listener()...
python
chosen
[ { "from": "system", "value": "Fix bug to display all branches when there is only 1 repo\n" }, { "from": "human", "value": "from __future__ import absolute_import\nimport os\nimport logging\n\nfrom workspace.commands import AbstractCommand\nfrom workspace.commands.helpers import ProductPager\nfro...
python
chosen
[ { "from": "human", "value": "Add docstring explaining how to run benchmarks\n" }, { "from": "gpt", "value": "\"\"\"Benchmarks for graphql\n\nBenchmarks are disabled (only executed as tests) by default in setup.cfg.\nYou can enable them with --benchmark-enable if your want to execute them.\n\nE.g...
python
chosen
[ { "from": "system", "value": "Add fallback for loading json encoded celery messages\n" }, { "from": "human", "value": "import base64\nimport json\nimport pickle\n\n\ndef decode_message(message):\n message_body = message.get_body()\n json_body = json.loads(message_body)\n if 'task' in me...
python
chosen
[ { "from": "system", "value": "Add package_dir which uses project.repo_url.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport sys\n\nimport {{ project.repo_name }}\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\ni...
python
chosen
[ { "from": "system", "value": "Rename vars in get_all_exits to make it more clear\n" }, { "from": "human", "value": "#!/usr/bin/python3\n\n\nclass Puzzle:\n def get_all_exits(self, graph):\n exits = []\n for key, value in graph.items():\n for item in value:\n ...
python
chosen
[ { "from": "system", "value": "Add various classifications for pypi\n" }, { "from": "human", "value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL...
python
chosen
[ { "from": "system", "value": "Use custom font for watermark\n\nSigned-off-by: Michal Čihař <a2df1e659c9fd2578de0a26565357cb273292eeb@cihar.com>\n" }, { "from": "human", "value": "from django.conf import settings\nfrom versatileimagefield.datastructures.filteredimage import FilteredImage\nfrom ve...
python
chosen
[ { "from": "system", "value": "Drop Python 2 support in tests\n" }, { "from": "human", "value": "import sys\nimport unittest\n\ndef main():\n\tif sys.version_info[0] >= 3:\n\t\tfrom unittest.main import main\n\t\tmain(module=None)\n\telse:\n\t\tunittest.main()\n\nif __name__ == '__main__':\n\tmai...
python
chosen
[ { "from": "system", "value": "Add missing secret key to circle ci settings\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nDEBUG = True\n\nLOCAL_DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql',\n 'NAME': 'circle_test',\n 'USER': 'cir...
python
chosen
[ { "from": "system", "value": "Index now only displays published articles.\n" }, { "from": "human", "value": "from django.shortcuts import render\nfrom datetime import date, datetime, timedelta\nfrom .models import Event\n\ndef index(request):\n if date.today().isoweekday() in...
python
chosen
[ { "from": "system", "value": "[IMP] Order document topics by name\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom odoo import api, fields, models\n\n\nclass DocumentTopic(models.Model):\n\n _name = 'tmc.document_topic'\n _description = 'document_topic'\n _inherit = 't...
python
chosen
[ { "from": "system", "value": "Test for RegexURLPattern.callback on Django 1.10\n\nThanks Paul J Stevens for the initial patch, Tim Graham for review\nand Matt Westcott for tweak of initial patch\n" }, { "from": "human", "value": "from __future__ import absolute_import, unicode_literals\n\nfrom f...
python
chosen
[ { "from": "system", "value": "Add FLX to the release train\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# Copyright 2015 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n# See https:...
python
chosen
[ { "from": "system", "value": "Comment about a possible attack vector." }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.cache import cache\nfrom django.template import Template\nfrom django.template.context import RequestContext\n\nfrom snapboard.utils import ge...
python
chosen
[ { "from": "system", "value": "Add builtin removal as an option to cli\n" }, { "from": "human", "value": "import ast\n\nimport click\n\nfrom parsing.parser import FileVisitor\n\n\n@click.command()\n@click.argument('code', type=click.File('rb'))\n@click.option('--printed', default=False, is_flag=T...
python
chosen
[ { "from": "system", "value": "Fix indenting.\nCreate any schemas that were just loaded.\n" }, { "from": "human", "value": "from django.core.management.commands import loaddata\nfrom django.core.management.base import CommandError\nfrom django.db import DatabaseError\n\nfrom optparse import make_...
python
chosen
[ { "from": "system", "value": "Allow import without optional requirements\n" }, { "from": "human", "value": "from bigsi.storage.berkeleydb import BerkeleyDBStorage\nfrom bigsi.storage.redis import RedisStorage\nfrom bigsi.storage.rocksdb import RocksDBStorage\n\n\ndef get_storage(config):\n re...
python
chosen
[ { "from": "system", "value": "Remove print statement from crypto utils...\n" }, { "from": "human", "value": "from Crypto.Cipher import AES\n\n\ndef decrypt(data, key_iv):\n key = key_iv[0:16]\n iv = key_iv[16:]\n print(data)\n cipher = AES.new(key, AES.MODE_CBC, iv)\n return ciphe...
python
chosen
[ { "from": "system", "value": "Revert 5505 - introduced numerous regressions into the test suite" }, { "from": "human", "value": "from axiom import iaxiom, userbase\n\nfrom xmantissa import website, offering, provisioning\n\nfrom sine import sipserver, sinetheme\n\nsineproxy = provisioning.Benefa...
python
chosen
[ { "from": "system", "value": "Update interface for sphinxcontrib module\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2011 Takeshi KOMIYA\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with th...
python
chosen
[ { "from": "system", "value": "Fix args being appended continuously to SassCompiler\n" }, { "from": "human", "value": "from .base import CommandCompiler\n\n\nclass SassCompiler(CommandCompiler):\n content_type = 'text/css'\n options = {'compass': True}\n command = 'sass'\n params = ['...
python
chosen
[ { "from": "system", "value": "Make uniqueness error message recognize email duplicates.\n" }, { "from": "human", "value": "# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By:...
python
chosen
[ { "from": "system", "value": "Use the functional merge; just for formatting\n" }, { "from": "human", "value": "from keras.layers import Convolution2D, Merge\nfrom keras.layers.advanced_activations import PReLU\nfrom keras.engine.topology import merge\n\nfrom eva.layers.masked_convolution2d impor...
python
chosen
[ { "from": "system", "value": "Fix the security for the merge after closing memberships\n" }, { "from": "human", "value": "# Copyright 2022 ACSONE SA/NV\n# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).\n\nfrom odoo import models\n\n\nclass BasePartnerMergeAutomaticWizard(models.T...
python
chosen
[ { "from": "system", "value": "REL: Add license to module init file.\n" }, { "from": "human", "value": "\"\"\"\nZipline\n\"\"\"\n\n# This is *not* a place to dump arbitrary classes/modules for convenience,\n# it is a place to expose the public interfaces.\n\n__version__ = \"0.5.11.dev\"\n\nfrom ....
python
chosen
[ { "from": "system", "value": "Drop support for naming Deck objects\n" }, { "from": "human", "value": "import logging\nimport random\nfrom .card import Card\nfrom .enums import GameTag, Zone\nfrom .utils import CardList\n\n\nclass Deck(CardList):\n\tMAX_CARDS = 30\n\tMAX_UNIQUE_CARDS = 2\n\tMAX_U...
python
chosen
[ { "from": "system", "value": "Use a lambda as a proxy.\n" }, { "from": "human", "value": "import asyncore\nimport util\n\ntry:\n\timport simplejson as json\nexcept ImportError:\n\timport json\n\n\nclass ChannelServer(asyncore.dispatcher):\n\t\n\tdef __init__(self, sock, dest):\n\t\tasyncore.disp...
python
chosen
[ { "from": "system", "value": "Use reentrant lock on SynchronizedMessageSender\n" }, { "from": "human", "value": "import threading\n\nfrom bot.logger.message_sender import MessageSender, IntermediateMessageSender\n\n\nclass SynchronizedMessageSender(IntermediateMessageSender):\n \"\"\"\n Th...
python
chosen
[ { "from": "system", "value": "Set pillow engine as default\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\ndef get_current_engine():\n return None\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\nfrom thumbnails.engines.pillow import PillowEngine\n\n\ndef ...
python
chosen
[ { "from": "system", "value": "NEW: Read appengine refresh_token from oauth file automatically.\n" }, { "from": "human", "value": "from fabric.api import *\nfrom fabric.contrib.console import confirm\n\ncfg = dict(\n appengine_dir='appengine-web/src',\n goldquest_dir='src',\n appengine_t...
python
chosen
[ { "from": "system", "value": "Add alpha argument to eventplot().\n" }, { "from": "human", "value": "__author__ = 'jgosmann'\n\nfrom matplotlib.cbook import iterable\n\nfrom prettyplotlib.utils import remove_chartjunk, maybe_get_ax\nfrom prettyplotlib.colors import set2\n\n\ndef eventplot(*args, ...
python
chosen
[ { "from": "system", "value": "Add graceful handling for creating search with similar names\n" }, { "from": "human", "value": "from rest_framework import serializers\n\nfrom db.models.searches import Search\n\n\nclass SearchSerializer(serializers.ModelSerializer):\n\n class Meta:\n mode...
python
chosen
[ { "from": "system", "value": "Use __description__ with parser instantiation.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Copyright 2015 Chris Fordham\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with t...
python
chosen
[ { "from": "system", "value": "Fix typing for JSONInput and JSONInputBin.\n" }, { "from": "human", "value": "from pathlib import Path\nfrom typing import Union, Dict, Any, List, Tuple\nfrom collections import OrderedDict\n\n\n# fmt: off\nFilePath = Union[str, Path]\n# Superficial JSON input/outpu...
python
chosen
[ { "from": "system", "value": "Add parametrized fixture for at, node_bc, link_bc.\n" }, { "from": "human", "value": "import pytest\n\nfrom landlab import NetworkModelGrid, RasterModelGrid\n\n\n@pytest.fixture\ndef four_by_four_raster():\n mg = RasterModelGrid((4, 4))\n return mg\n\n\n@pytes...
python
chosen
[ { "from": "system", "value": "Check the model beig indexed\n" }, { "from": "human", "value": "from django.core.management import BaseCommand\nfrom django.db.models import get_app, get_models\nfrom django.conf import settings\nfrom common.utilities.search_utils import index_instance\n\n\nclass Co...
python
chosen
[ { "from": "system", "value": "Add tasks/build_from_config to the public API.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright 2015 by Ecpy Authors, see AUTHORS for more details.\n#\n# Distribu...
python
chosen
[ { "from": "system", "value": "Update test version following release\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# encoding: utf8\n\n\nfrom __future__ import (absolute_import, print_function, division, unicode_literals)\n\n# See - http://www.python.org/dev/peps/pep-0440/\n# See - ht...
python
chosen
[ { "from": "system", "value": "Add unittest account and password\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n#DEBUG = True\nSECRET_KEY = \"change secret key in production\"\nSESSION_COOKIE_HTTPONLY = True\nSESSION_COOKIE_SECURE = True\n#PERMANENT_SESSION_LIFETIME = timedelta(min...
python
chosen
[ { "from": "system", "value": "Write pdb result to disk\n" }, { "from": "human", "value": "# import porter_paleale\n\n\n\n\ndef write_pdb(aa_sequence, fragment_angles, gap_length, filepath):\n \"\"\"\n Generate pdb file with results\n\n :param aa_sequence: Amino acid sequence\n :param...
python
chosen
[ { "from": "system", "value": "Fix path to pybossa tests\n" }, { "from": "human", "value": "import json\nimport random\n\nfrom mock import patch\n\nfrom pybossa.model.task import Task\nfrom pybossa.model.project import Project\nfrom pybossa.model.user import User\nfrom pybossa.model.task_run impo...
python
chosen
[ { "from": "system", "value": "Remove suppress() as it's no longer required\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nimport contextlib\nimport sys\n\ntry:\n import fcntl\nexcept ImportError:\n fcntl = None\n\nfrom ipybind.common import is_kernel\nfrom ipybind.ext.wurlit...
python
chosen
[ { "from": "system", "value": "Fix build break with Fixtures 1.3\n\nOur explicit call to cleanUp messes things up in latest\nfixture, so we need to call _clear_cleanups to stop\nthe test from breaking\n\nChange-Id: I8ce2309a94736b47fb347f37ab4027857e19c8a8\n" }, { "from": "human", "value": "# Cop...
python
chosen
[ { "from": "system", "value": "Allow specification of GALAPAGOS bands\n" }, { "from": "human", "value": "# coding: utf-8\n\ndef galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',\n out_filename=None):\n \"\"\"Convert a GALAPA...
python
chosen
[ { "from": "system", "value": "Allow migrations to be run on extra databases.\n\n- Remove duplicate registration of save and delete signals. Already\nregistered in apps.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom django.db.models.signals import pre_save, pre_delete\nfrom d...
python
chosen
[ { "from": "system", "value": "Increment minor version after ArcGIS fix and improved tests and docs" }, { "from": "human", "value": "import subprocess\nimport sys\n\nfrom setuptools import Command, setup\n\n\nclass RunTests(Command):\n user_options = []\n\n def initialize_options(self):\n ...
python
chosen
[ { "from": "system", "value": "Fix pip install errors when (py)pandoc is missing\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom pypandoc import convert\nfrom setuptools import setup\n\nsetup(\n name='mws',\n version='0.7',\n maintainer=\"James Hiew\",\n maintainer_em...
python
chosen
[ { "from": "system", "value": "Support a range of redis client versions\n" }, { "from": "human", "value": "import os\nimport re\n\nfrom setuptools import (\n find_packages,\n setup,\n)\n\nversion_re = re.compile(r\"__version__\\s*=\\s*['\\\"](.*?)['\\\"]\")\n\n\ndef get_version():\n base...
python
chosen
[ { "from": "system", "value": "Fix email address to be able to upload to pypi\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nimport chagallpy\n\nsetup(\n name='chagallpy',\n version=chagallpy.__version__,\n packages=find_packages(),...
python
chosen
[ { "from": "system", "value": "Rename package oracle-paas -> nodeconductor-paas-oracle\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\n\ndev_requires = [\n 'Sphinx==1.2.2',\n]\n\ninstall_requires = [\n 'nodeconductor>=0.95.0',\n]\n\...
python
chosen
[ { "from": "system", "value": "Allow pandas 1.1 as dependency" }, { "from": "human", "value": "#! /usr/bin/env python\n\n\"\"\"Setup information of demandlib.\n\"\"\"\n\nfrom setuptools import setup, find_packages\nimport os\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__fi...
python
chosen
[ { "from": "system", "value": "Remove not working download URI\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\nversion_tuple = __import__('pymysql').VERSION\n\nif version_tuple[3] is not None:\n version = \"%d.%d.%d_%s\" % version_tuple\...
python
chosen
[ { "from": "system", "value": "Maintain alphabetical order in `install_requires`\n\nPiperOrigin-RevId: 395092683\nChange-Id: I87f23eafcb8a3cdafd36b8fd700f8a1f24f9fa6e\nGitOrigin-RevId: a0819922a706dec7b8c2a17181c56a6900288e67\n" }, { "from": "human", "value": "# Copyright 2021 DeepMind Technologi...
python
chosen
[ { "from": "system", "value": "LS-5226: Make requests dependency version more flexible\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name='lightstep',\n version='3.0.11',\n description='LightStep Python OpenTracing Implementation',\n long_d...
python
chosen
[ { "from": "system", "value": "Fix download url and bump version\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name='django-admin-extend',\n version='0.0.1',\n description=('Provides functionality for extending'\n ...
python
chosen
[ { "from": "system", "value": "Update install_requires to be more accurate\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nfrom distutils.core import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name='whack...
python
chosen
[ { "from": "system", "value": "Set version to 0.2.1. Ready for PyPI.\n" }, { "from": "human", "value": "import os\ntry:\n from setuptools import setup, Extension\nexcept ImportError:\n # Use distutils.core as a fallback.\n # We won't be able to build the Wheel file on Windows.\n from ...
python
chosen
[ { "from": "system", "value": "Make dependency versions more explicit\n" }, { "from": "human", "value": "from distribute_setup import use_setuptools\nuse_setuptools()\n\nfrom setuptools import setup\n\nsetup(\n name = \"open511\",\n version = \"0.1\",\n url='',\n license = \"\",\n ...
python
chosen
[ { "from": "system", "value": "Change development status to beta\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup,find_packages\n\nMETADATA = dict(\n name='django-allauth',\n version='0.0.1',\n author='Raymond Penners',\n author_email='raymond.pen...
python
chosen
[ { "from": "system", "value": "Change package name to vxtwinio\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"vumi_twilio_api\",\n version=\"0.0.1a\",\n url=\"https://github.com/praekelt/vumi-twilio-api\",\n license=\"BSD\",\n desc...
python
chosen
[ { "from": "system", "value": "Update URL since repository has moved to pytest-dev\n" }, { "from": "human", "value": "from setuptools import setup\n\n\nwith open(\"README.rst\") as readme_file:\n readme = readme_file.read()\n\n\nsetup(\n name='pytest-describe',\n version='1.0.0',\n de...
python
chosen
[ { "from": "system", "value": "Decrease scipy version to 0.17 (for RTD)\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nwith open('README.rst') as rdm:\n README = rdm.read()\n\nsetup(\n name='stagpy',\n use_scm_version=True,\n\n descriptio...
python
chosen
[ { "from": "system", "value": "Add 'scripts/woa_calibration.py' to scripts list\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name = \"biofloat\",\n version = \"0.3.0\",\n packages = find_packages(),\n requires = ['Python (>=2.7)'],\n in...
python
chosen
[ { "from": "system", "value": "Add bumpversion, sync package version\n" }, { "from": "human", "value": "\"\"\"\ntrafficserver_exporter\n----------------------\n\nAn Apache Traffic Server metrics exporter for Prometheus. Uses the\nstats_over_http plugin to translate JSON data into Prometheus form...
python
chosen
[ { "from": "system", "value": "Add api and model to packages\n" }, { "from": "human", "value": "from distutils.core import setup, Command\n\n\nclass PyTest(Command):\n user_options = []\n\n def initialize_options(self):\n pass\n\n def finalize_options(self):\n pass\n\n d...
python
chosen
[ { "from": "system", "value": "Allow looser version of nose\n\nTravisCI provides `nose` already installed:\n\n- http://docs.travis-ci.com/user/languages/python/#Pre-installed-packages\n\nHowever it's now at a later version and causes our tests to fail:\n\n pkg_resources.VersionConflict: (nose 1.3.4 (/home...
python
chosen
[ { "from": "system", "value": "Move inf to shortest_path_d for clarity\n" }, { "from": "human", "value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nfrom ds_binary_heap_tuple import BinaryHeap\n\ndef dijkstra(weighted_graph_d,...
python
chosen
[ { "from": "system", "value": "Add commandline interface with Click.\n" }, { "from": "human", "value": "from PIL import Image\nfrom os import get_terminal_size\n\ndefault_palette = list('░▒▓█')\n\nprint(get_terminal_size())\n\ndef scale(val, src, dst):\n \"\"\"\n Scale the given value from ...
python
chosen
[ { "from": "system", "value": "Rename the OpenStack AWS resource to avoid name clash with native\n\nOpenStack ships a native ASG resource type with the same name. We\nrename this to AWSAutoScalingGroup to avoid the clash and make way\nto the native type to come.\n" }, { "from": "human", "value": ...
python
chosen
[ { "from": "system", "value": "organisation: Fix references to old model fields\n" }, { "from": "human", "value": "from haystack import indexes\nfrom .models import Person, Project, WorkingGroup, NetworkGroup\n\n\nclass PersonIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.Char...
python
chosen
[ { "from": "system", "value": "Fix typo in the script\n" }, { "from": "human", "value": "#!/usr/bin/python\n# vim : set fileencoding=utf-8 :\n \n#\n# mergeSegToCtm.py\n#\n# Enhance the Bck file by adding extra fields with the diarisation\n# information\n#\nimport sys\n\nwith open(sys.argv[1], 'r'...
python
chosen
[ { "from": "system", "value": "Add not enough characters condition\n\n" }, { "from": "human", "value": "# coding: utf8\n\nfrom io import StringIO\nfrom collections import deque\n\n\nclass StreamReader:\n def __init__(self, *args, stream_class=StringIO, **kwargs):\n self.streamClass = st...
python
chosen
[ { "from": "system", "value": "virus_scan: Increase valid period for token" }, { "from": "human", "value": "from django.core.signing import TimestampSigner\n\n\nclass TokenSigner:\n signer = TimestampSigner()\n\n def unsign(self, value):\n return self.signer.unsign(value=value, max_a...
python
chosen
[ { "from": "system", "value": "Add validator that selected father is male and mother is female.\nValidate that the animal is younger than it's parents.\n" }, { "from": "human", "value": "from rest_framework import serializers\nfrom .models import Animal\n\nclass AnimalSerializer(serializers.Model...
python
chosen
[ { "from": "system", "value": "Add url join which serves our needs\n\nExisting functions in common libraries add extra slashes.\n" }, { "from": "human", "value": "\n\ndef as_int(value):\n try:\n return int(value)\n except ValueError:\n return None\n" }, { "from": "gpt"...
python
chosen
[ { "from": "system", "value": "Add event return fork behavior\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''\nStart the reactor!\n'''\n# Import salt libs\nimport salt.utils.reactor\n# Import ioflo libs\nimport ioflo.base.deeding\n\n\n@ioflo.base.deeding.deedify(\n 'SaltRae...
python
chosen
[ { "from": "system", "value": "Python: Refactor PyYAML tests a bit\n" }, { "from": "human", "value": "import yaml\nfrom yaml import SafeLoader\n\nyaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput\nyaml.load(payload, SafeLoader) # $ decode...
python
chosen
[ { "from": "system", "value": "Improve error message when alias not available.\n" }, { "from": "human", "value": "class CashewException(Exception):\n pass\n\nclass InternalCashewException(CashewException):\n pass\n\nclass UserFeedback(CashewException):\n pass\n\nclass InactivePlugin(User...
python
chosen
[ { "from": "system", "value": "Add unit test to verify that blog posts are ordered by most recent\n\nVerifies that blog posts are ordered by most recent first even if\nthe blog posts are posted on the same day.\n" }, { "from": "human", "value": "from django.test import TestCase\n\n# Create your t...
python
chosen
[ { "from": "system", "value": "oss: Fix overquoting of thrift paths\n\nSummary: This overquotes the paths in travis builds. This will fix the opensource broken builds\n\nReviewed By: snarkmaster\n\nDifferential Revision: D5923131\n\nfbshipit-source-id: 1ff3e864107b0074fc85e8a45a37455430cf4ba3\n" }, { ...
python
chosen
[ { "from": "system", "value": "Add another attribute and some annotations\n\nWe write the annotations in rst for the moment.\n" }, { "from": "human", "value": "\ndef process( node_name, handle ):\n\n handle.editorTemplate( beginScrollLayout=True )\n\n handle.editorTemplate( beginLayout=\"Fl...
python
chosen
[ { "from": "system", "value": "Add --test-files option to py.test\n\nAt this point, py.test should be equivalent to test/run.py\n" }, { "from": "human", "value": "from os.path import join, dirname, abspath\ndefault_base_dir = join(dirname(abspath(__file__)), 'completion')\n\nimport run\n\n\ndef p...
python
chosen
[ { "from": "system", "value": "Use a OneToMany field for the activity joiner.\n" }, { "from": "human", "value": "from django.db import models\n\nclass Activity(models.Model):\n group = models.CharField(max_length=4)\n grouptype = models.TextField()\n groupdetail = models.TextField()\n ...
python
chosen
[ { "from": "system", "value": "[api]: Correct debug mode with env.\n" }, { "from": "human", "value": "import os\nfrom ricardo_api import app\n\nisDebug = False\nif os.environ['FLASK_ENV'] == \"development\":\n isDebug = True\n\napp.run(host= '0.0.0.0', debug=isDebug)\n" }, { "from": "g...
python
chosen