conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a property descriptor for weakref'd members\n" }, { "from": "human", "value": "\"\"\"\n ${NAME}\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport logging\nlog = logging.getLogger(__name__)\n\ndef lazyprop(fn):...
python
chosen
[ { "from": "system", "value": "Add test for English time exceptions (\"1a.m.\" etc.)\n" }, { "from": "human", "value": "# coding: utf-8\n\"\"\"Test that tokenizer exceptions are handled correctly.\"\"\"\n\n\nfrom __future__ import unicode_literals\n\nimport pytest\n\n\n@pytest.mark.parametrize('t...
python
chosen
[ { "from": "system", "value": "Print warnings to standard error\n" }, { "from": "human", "value": "#!/usr/bin/python\n\nenv_vars = {}\n\n\ndef read_file(path):\n try:\n with open(path, 'r') as f:\n return f.read().strip()\n except IOError:\n return None\n\n\ndef get...
python
chosen
[ { "from": "system", "value": "Add user data export for foirequest follower" }, { "from": "human", "value": "from django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass FoiRequestFollowerConfig(AppConfig):\n name = 'froide.foirequestfollower'\n verb...
python
chosen
[ { "from": "system", "value": "Correct the order of coordinates.\n\nGeojson expects lon, lat.\n" }, { "from": "human", "value": "import pandas as pd\nimport geojson\nfrom geojson import FeatureCollection, Feature, Point\n\n# read in original data\ncsv = pd.read_csv(\"versaille_stock.csv\", sep=\"...
python
chosen
[ { "from": "system", "value": "Allow one or multiple texts to reground\n" }, { "from": "human", "value": "\"\"\"This is a Python-based web server that can be run to\nread with Eidos. To run the server, do\n\n python -m indra.sources.eidos.server\n\nand then submit POST requests to the `localho...
python
chosen
[ { "from": "system", "value": "Add language code in the command\n" }, { "from": "human", "value": "from optparse import make_option\nfrom datetime import datetime as dt\n\nfrom django.core.management.base import BaseCommand\nfrom django.utils import translation\nfrom django.conf import settings\n...
python
chosen
[ { "from": "system", "value": "Add constructor and get method with SA\n" }, { "from": "human", "value": "from MaxCliquesPercolation import MaxCliquesPercolationWeighted\n\n\nclass MaxCliquesPercolationSA(MaxCliquesPercolationWeighted):\n def __init__(self, graph, edges_weight, nodes_id, k, thr...
python
chosen
[ { "from": "system", "value": "Remove unused import. Facebook compliance support python3\n" }, { "from": "human", "value": "from json import dumps\nfrom oauthlib.common import urldecode\nfrom urlparse import parse_qsl\n\n\ndef facebook_compliance_fix(session):\n\n def _compliance_fix(r):\n ...
python
chosen
[ { "from": "system", "value": "Add additional error detail to cover other circumstances that intend to throw 401\n" }, { "from": "human", "value": "\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException\n\n\ndef json_api_exception_handler(exc, context):\n \"\"\...
python
chosen
[ { "from": "system", "value": "Mark instance list as staff-only, and give it a view name\n" }, { "from": "human", "value": "from __future__ import unicode_literals\nfrom django.conf.urls import patterns, url\nfrom . import views\nfrom django.contrib.admin.views.decorators import staff_member_requ...
python
chosen
[ { "from": "system", "value": "Make sure that Lexer.lex() returns str instead of bytes\n" }, { "from": "human", "value": "# -*- encoding: utf-8\n\nimport pygments\nimport pygments.lexers\n\n\nclass Lexer:\n def __init__(self, app):\n self.app = app\n\n def lex(self, code, lex):\n ...
python
chosen
[ { "from": "system", "value": "Use the get_secret function to grab the database configuration.\n\ngit-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8412 f04a3889-0f81-4131-97fb-bc517d1f583d\n" }, { "from": "human", "value": "from .base import *\n\n\n# Debug Settings\nDEBUG = False\n\nTEMPLATE_...
python
chosen
[ { "from": "system", "value": "Handle the case where the bucket already exists\n" }, { "from": "human", "value": "from boto.s3.connection import S3Connection\nfrom boto.exception import S3ResponseError\n\nfrom django.conf import settings\n\ndef upload(user, passwd, bucket, metadata, key, fd):\n ...
python
chosen
[ { "from": "system", "value": "Update the django path to flatatt module" }, { "from": "human", "value": "from django import forms\nfrom django.template.loader import render_to_string\nfrom django.utils.safestring import mark_safe\nfrom django.forms.util import flatatt\nfrom django.utils.encoding ...
python
chosen
[ { "from": "system", "value": "Fix bug for saving images in config\n" }, { "from": "human", "value": "from ckan.logic.action import update as update_core\nimport ckan.lib.uploader as uploader\n\n\ndef config_option_update(context, data_dict):\n upload = uploader.get_uploader('admin')\n uplo...
python
chosen
[ { "from": "system", "value": "Make functional testing compatible with selenium 3.141.0\n" }, { "from": "human", "value": "from django.contrib.staticfiles.testing import StaticLiveServerTestCase\n\nfrom selenium import webdriver\nfrom selenium.webdriver.common.keys import Keys\n\nfrom system_main...
python
chosen
[ { "from": "system", "value": "Make network name and slug unique\n" }, { "from": "human", "value": "import os\nfrom django.conf import settings\nfrom django.db import models\n\nfrom . import tenant\n\n\nif 'DJANGO_TENANT' in os.environ:\n tenant._set_for_tenant(os.environ['DJANGO_TENANT'])\nel...
python
chosen
[ { "from": "system", "value": "Make new settings test not run for xcode generator.\n\nTBR=evan\nReview URL: http://codereview.chromium.org/7472006\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Copyright (c) 2011 Google Inc. All rights reserved.\n# Use of this source code is govern...
python
chosen
[ { "from": "system", "value": "Tweak integration timeout test to match gtest\n" }, { "from": "human", "value": "\nclass ServiceTests(object):\n\n def test_bash(self):\n return self.check(\n input='bc -q\\n1+1\\nquit()',\n type='org.tyrion.service.bash',\n ...
python
chosen
[ { "from": "system", "value": "Add second test, trying to trigger travis\n" }, { "from": "human", "value": "# -*- coding:utf-8 -*-\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nfrom django.test import TestCase\n\nfrom django_mysq...
python
chosen
[ { "from": "system", "value": "Add parameter \"quiet\" to export function\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"export_all_data.py - script for exporting all available data\"\"\"\n\nimport os\nfrom collectionbatchtool import *\n\n\ndef export_all_data(output_dir=None):...
python
chosen
[ { "from": "system", "value": "Update test (endpoint was no longer result-less)\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport unittest\nimport waybackpack\nimport sys, os\n\n# via https://github.com/jsvine/waybackpack/issues/39\n\nURL = \"https://indianexpress.com/section/lifes...
python
chosen
[ { "from": "system", "value": "Remove explicit import in tests module.\n" }, { "from": "human", "value": "from .test_great_expectations import *\nfrom .test_util import *\nfrom .test_dataset import *\nfrom .test_pandas_dataset import *\nfrom tests.pandas.test_pandas_dataset_distributional_expecta...
python
chosen
[ { "from": "system", "value": "Test: Add clean up in app fixture\n" }, { "from": "human", "value": "import pytest\nfrom sanic import Sanic\nfrom sanic_openapi import swagger_blueprint\n\n\n@pytest.fixture()\ndef app():\n app = Sanic('test')\n app.blueprint(swagger_blueprint)\n return app...
python
chosen
[ { "from": "system", "value": "test: Test merge worker with commits and merges\n" }, { "from": "human", "value": "import pytest\nfrom mock import patch, MagicMock\n\nfrom gitfs.worker.merge import MergeWorker\n\n\nclass TestMergeWorker(object):\n def test_run(self):\n mocked_queue = Mag...
python
chosen
[ { "from": "system", "value": "Add tests for DPPL and DPPGreedy.\n" }, { "from": "human", "value": "from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom future import standard_library\nstandar...
python
chosen
[ { "from": "system", "value": "Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials\n" }, { "from": "human", "value": "from django.conf.urls import include, url\n\nfrom tutorials import views\n\nurlpatterns = [\n url(r'^$', views.Lis...
python
chosen
[ { "from": "system", "value": "Test cases changed and minor optimization\n" }, { "from": "human", "value": "import unittest\n\nimport cerebro.core.entities as en\nimport cerebro.core.usecases as uc\n\n\nclass TestUseCases(unittest.TestCase):\n def setUp(self):\n self.neurons_path = [\"....
python
chosen
[ { "from": "system", "value": "Change output filename for combined results to avoid recursive accumulation\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\nSimple script to combine JUnit test results into a single XML file.\n\nUseful for Jenkins.\n\nTODO: Pretty indentation\n\"\"...
python
chosen
[ { "from": "system", "value": "Add eps factor for numerical stability\n" }, { "from": "human", "value": "\"\"\" Assumes softplus activations for gaussian\n\"\"\"\nimport tensorflow as tf\nimport numpy as np\n\ndef log_bernoulli_with_logits(x, logits):\n return -tf.reduce_sum(tf.nn.sigmoid_cros...
python
chosen
[ { "from": "system", "value": "Remove exempt for hub url\n" }, { "from": "human", "value": "from os import environ\n\nimport dj_database_url\n\nfrom .base import *\n\n\nINSTALLED_APPS += (\n 'djangosecure',\n)\n\nPRODUCTION_MIDDLEWARE_CLASSES = (\n 'djangosecure.middleware.SecurityMiddlewar...
python
chosen
[ { "from": "system", "value": "Add a few methods used in admin.py\n" }, { "from": "human", "value": "import json\nimport os\n\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch_dsl import Index\nfrom model import APIDoc\n\n_dirname = os.path.dirname(__file__)\nwith open(os.path.join(_di...
python
chosen
[ { "from": "system", "value": "Allow using sslify even in DEBUG mode.\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.http import HttpResponsePermanentRedirect\n\n\nclass SSLifyMiddleware(object):\n \"\"\"Force all requests to use HTTPs. If we get an HTTP reque...
python
chosen
[ { "from": "system", "value": "Fix for negative values in duration\n" }, { "from": "human", "value": "def duration(value):\n ONE_SECOND = 1000\n ONE_MINUTE = ONE_SECOND * 60\n\n if not value:\n return '0 s'\n\n if value < 3 * ONE_SECOND:\n return '%d ms' % (value,)\n ...
python
chosen
[ { "from": "system", "value": "Add missing newline between imports\n" }, { "from": "human", "value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\nfrom ...setting.models import Setting\n\n\nclass SettingForm(forms.ModelForm):\n class Meta:\n model =...
python
chosen
[ { "from": "system", "value": "Remove no-longer needed wagtail 2.0 warning\n" }, { "from": "human", "value": "import warnings\n\nimport wagtail\n\nif wagtail.VERSION < (2, 0):\n warnings.warn(\"GeoPanel only works in Wagtail 2+\", Warning) # NOQA\n warnings.warn(\"Please import GeoPanel fr...
python
chosen
[ { "from": "system", "value": "Use StringIO instead of BytesIO\n" }, { "from": "human", "value": "from six import BytesIO\nfrom django.core.management import call_command\nfrom django.test import TestCase\nfrom mock import patch\n\nfrom contentstore.models import Schedule\nfrom seed_stage_based_m...
python
chosen
[ { "from": "system", "value": "Change test model elevation chart\n" }, { "from": "human", "value": "import os\n\nfrom django.test import TestCase\nfrom django.conf import settings\n\nfrom geotrek.trekking.factories import TrekFactory\nfrom geotrek.trekking.models import Trek\n\n\nclass AltimetryM...
python
chosen
[ { "from": "system", "value": "Add Slack action to init\n" }, { "from": "human", "value": "from .actions import (\n BasicValidationAction,\n NamespacedValidationAction,\n NoOpAction,\n SummarizeAndStoreAction,\n)\n\nfrom .validation_operators import (\n DefaultActionAwareValidation...
python
chosen
[ { "from": "system", "value": "Use default settings if no user settings\n" }, { "from": "human", "value": "from os.path import basename\n\nfrom website import settings\n\ndef serialize_addon_config(config):\n lookup = config.template_lookup\n\n return {\n 'addon_short_name': config.s...
python
chosen
[ { "from": "system", "value": "Fix ModuleNotFoundError for phawkins only with version\n" }, { "from": "human", "value": "# Copyright 2021 Google LLC\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.\n# You m...
python
chosen
[ { "from": "system", "value": "Put code in main function\n" }, { "from": "human", "value": "\"\"\"Run autopep8 on the selected buffer in Vim.\n\nmap <C-I> :pyfile <path_to>/vim_autopep8.py<CR>\n\nReplace \":pyfile\" with \":py3file\" if Vim is built with Python 3 support.\n\n\"\"\"\n\nfrom __futu...
python
chosen
[ { "from": "system", "value": "Test for missing __annotations__ in Python 3.\n" }, { "from": "human", "value": "import unittest\n\nimport jeni\n\nfrom test_jeni import BasicInjector\n\n\nclass Python3AnnotationTestCase(unittest.TestCase):\n def test_annotate_without_annotations(self):\n ...
python
chosen
[ { "from": "system", "value": "Fix test migration to actually save updates.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations\n\n\ndef forwards(apps, schema_editor):\n DualText = apps.get_model('testmigrate',...
python
chosen
[ { "from": "system", "value": "Tweak to bam file name calling\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Standard packages\nimport sys\nimport argparse\n\n# Third-party packages\nfrom toil.job import Job\n\n# Package methods\nfrom ddb import configuration\nfrom ddb_ngsflow impo...
python
chosen
[ { "from": "system", "value": "Remove unused import of compat unittest\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ntest_compat\n------------\n\nTests for `cookiecutter.compat` module.\n\"\"\"\n\nfrom cookiecutter.compat import unittest, which\n\n\n...
python
chosen
[ { "from": "system", "value": "Add login mode to reset-instances\n" }, { "from": "human", "value": "# coding: utf-8\n\nfrom qingcloud.cli.misc.utils import explode_array\nfrom qingcloud.cli.iaas_client.actions.base import BaseAction\n\n\nclass ResetInstancesAction(BaseAction):\n\n action = 'Re...
python
chosen
[ { "from": "system", "value": "Remove invalid reference to unnecessary JS for image gallery plugin\n" }, { "from": "human", "value": "\"\"\"\nDefinition of the plugin.\n\"\"\"\nfrom django.utils.translation import ugettext_lazy as _\nfrom fluent_contents.extensions import ContentPlugin, plugin_po...
python
chosen
[ { "from": "system", "value": "Fix pep8\nSet version as 0.8.0.1\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\n Alignak backend import\n\n This module contains utility tools to import Nagios-like flat files configuration into\n an Alignak R...
python
chosen
[ { "from": "system", "value": "Add docstring to matplotlib imshow plugin\n\nThe image is now named as an argument, and the axes are returned, in\nkeeping with matplotlib convention.\n" }, { "from": "human", "value": "import matplotlib.pyplot as plt\n\n\ndef imshow(*args, **kwargs):\n if plt.gc...
python
chosen
[ { "from": "system", "value": "Update naming for spawner jobs\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nfrom django.conf import settings\nfrom polyaxon_schemas.polyaxonfile import constants\n\nJOB_NAME = 'plxjob...
python
chosen
[ { "from": "system", "value": "Add test for local visualization\n" }, { "from": "human", "value": "import pytest\nfrom numpy import random, ceil\nfrom lightning import Lightning, Visualization\n\n\nclass TestLightningAPIClient(object):\n\n @pytest.fixture(scope=\"module\")\n def lgn(self, h...
python
chosen
[ { "from": "system", "value": "Add basic support for MSYS, CYGWIN, and MINGW\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport ctypes\nimport platform\n\nif platform.system() == 'Windows':\n libbase = os.path.join(os.path.dirname(__file__), 'cppinterface...
python
chosen
[ { "from": "system", "value": "Fix title in the test\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Testing suite for ARG class.\n\n\"\"\"\nfrom __future__ import print_function, division\n\nimport unittest as ut\nimport numpy as np\n\nfrom skewstudent im...
python
chosen
[ { "from": "system", "value": "Add switch and sample decorators.\n" }, { "from": "human", "value": "import waffle\nfrom rest_framework.exceptions import NotFound\n\ndef require_flag(flag_name):\n \"\"\"\n Decorator to check whether flag is active.\n\n If inactive, raise NotFound.\n \"...
python
chosen
[ { "from": "system", "value": "Allow user to select bypass level\n" }, { "from": "human", "value": "import logging\nimport wpilib\n\n\nclass PeriodicFilter:\n \"\"\"\n Periodic Filter to help keep down clutter in the console.\n Simply add this filter to your logger and the logger...
python
chosen
[ { "from": "system", "value": "Fix for nullable author in blogpost factory\n" }, { "from": "human", "value": "# -*- coding: utf8 -*-\n# This file is part of PyBossa.\n#\n# Copyright (C) 2013 SF Isle of Man Limited\n#\n# PyBossa is free software: you can redistribute it and/or modify\n# it under t...
python
chosen
[ { "from": "system", "value": "Add topolofical_sort_recur(), 2 functions’s doc strings and DAG\n" }, { "from": "human", "value": "def topological_sort():\n\tpass\n\n\ndef main():\n\tpass\n\nif __name__ == '__main__':\n\tmain()\n" }, { "from": "gpt", "value": "def topological_sort_recu...
python
chosen
[ { "from": "system", "value": "Tidy up and expect warning\n" }, { "from": "human", "value": "# coding: utf-8\nfrom __future__ import unicode_literals\n\nfrom spacy.kb import KnowledgeBase\nfrom spacy.util import ensure_path\n\nfrom spacy.lang.en import English\nfrom spacy.tests.util import make_t...
python
chosen
[ { "from": "system", "value": "Fix ordering problem in tearDown\n" }, { "from": "human", "value": "from ...testcases import DustyIntegrationTestCase\nfrom ...fixtures import busybox_single_app_bundle_fixture\n\nclass TestSyncCLI(DustyIntegrationTestCase):\n def setUp(self):\n super(Test...
python
chosen
[ { "from": "system", "value": "Add simple Echo function and Bot initialisation\n" }, { "from": "human", "value": "from telegram import Updater\nimport json\nimport os\n\n\ndef getToken():\n token = []\n if not os.path.exists(file_path):\n token.append(input('Insert Token here: '))\n ...
python
chosen
[ { "from": "human", "value": "Add code to unequal segment length example\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n\"\"\" Example of calculation of g-functions with unequal segment lengths using\n uniform and equal borehole wall temperatures.\n\n The g-functions of a field o...
python
chosen
[ { "from": "system", "value": "Add the consumer key to the identifier\n\nUsed for rate limiting by API key.\n\nRefs #17338\n" }, { "from": "human", "value": "\"\"\"\nTastypie API Authorization handlers\n\"\"\"\n\nfrom tastypie.authentication import Authentication\nfrom tastypie.authorization impo...
python
chosen
[ { "from": "system", "value": "Set the name of the dynamic plugin conversion tests\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"py.test utilities.\"\"\"\n\n#------------------------------------------------------------------------------\n# Imports\n#-------------------------...
python
chosen
[ { "from": "system", "value": "Change DEVICE_OWNER to make it more Neutron compliant\n\nChange-Id: Id7a2973928c6df9e134e7b91000e90f244066703\n" }, { "from": "human", "value": "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance wit...
python
chosen
[ { "from": "system", "value": "Add config to disable WYCI.\n" }, { "from": "human", "value": "import random\nimport re\nfrom typing import Match\nfrom discord import Message\nfrom MoMMI import master, always_command, MChannel\n\n@always_command(\"wyci\")\nasync def wyci(channel: MChannel, _match:...
python
chosen
[ { "from": "system", "value": "Fix pep8 on articles new man admin: E302 expected 2 blank lines\n" }, { "from": "human", "value": "from django.utils.translation import ugettext_lazy as _\n\nfrom ella.core.newman_admin import ListingInlineAdmin, PublishableAdmin,\\\n RelatedInlineAdmin\nfrom ell...
python
chosen
[ { "from": "system", "value": "Handle empty strings from unanswered items\n" }, { "from": "human", "value": "#-*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nimport likert_field.forms as for...
python
chosen
[ { "from": "system", "value": "Increase package version to 0.10.0\n" }, { "from": "human", "value": "__version__ = '0.9.4'\n\nfrom dicomweb_client.api import DICOMwebClient\n" }, { "from": "gpt", "value": "__version__ = '0.10.0'\n\nfrom dicomweb_client.api import DICOMwebClient\n" }...
python
chosen
[ { "from": "system", "value": "Solve the issue of the power got disconnected during the ride\n" }, { "from": "human", "value": "import numpy as np\n\nfrom fitparse import FitFile\n\ndef load_power_from_fit(filename):\n \"\"\" Method to open the power data from FIT file into a numpy array.\n\n ...
python
chosen
[ { "from": "system", "value": "Include the eval'd node type in the async return\n" }, { "from": "human", "value": "\"\"\"\nRESTful interface to interacting with OCR plugins.\n\"\"\"\nfrom django.http import HttpResponse, HttpResponseRedirect, Http404\nfrom django.shortcuts import render_to_respon...
python
chosen
[ { "from": "system", "value": "Replace prints by an exception\n" }, { "from": "human", "value": "# coding: utf-8\n\"\"\"Patched Conics Computations\n\nContains methods to compute interplanetary trajectories approximating the three\nbody problem with Patched Conics.\n\"\"\"\n\nfrom astropy import ...
python
chosen
[ { "from": "system", "value": "Add user to raw_id_fields, drastically improves UX on sites with many users\n" }, { "from": "human", "value": "from django.conf.urls import url\nfrom django.contrib import admin\n\nfrom admin_sso import settings\nfrom admin_sso.models import Assignment\n\n\nclass As...
python
chosen
[ { "from": "system", "value": "Allow bootstrapping config with values\n" }, { "from": "human", "value": "import os\n\nimport click\n\nfrom parsec.cli import pass_context\nfrom parsec import options\nfrom parsec import config\nfrom parsec.io import warn, info\n\nCONFIG_TEMPLATE = \"\"\"## Parsec G...
python
chosen
[ { "from": "system", "value": "Fix import location of biblio package\n" }, { "from": "human", "value": "\"\"\"\nConnect to the UGent Biblio API\n\"\"\"\nfrom .biblio import search, BASE_URL, publications_by_person\n\n__author__ = 'Stef Bastiaansen'\n__email__ = 'stef.bastiaansen@ugent.be'\n__copy...
python
chosen
[ { "from": "system", "value": "Reorder TemplateSpec attributes and add to docstring.\n" }, { "from": "human", "value": "# coding: utf-8\n\n\"\"\"\nProvides a class to customize template information on a per-view basis.\n\nTo customize template properties for a particular view, create that view\nf...
python
chosen
[ { "from": "system", "value": "Return the parameter for channel mode +l as a list\n\nThis fixes a bug where every digit was handled as a separate parameter, causing\n\"MODE #channel +l 10\" to turn into \"MODE #channel +ll 1 0\"\n" }, { "from": "human", "value": "from twisted.plugin import IPlugi...
python
chosen
[ { "from": "system", "value": "Add message_age property to ParsedMessage\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
python
chosen
[ { "from": "system", "value": "Add to stream redis db\n" }, { "from": "human", "value": "import redis\n\nfrom api.utils import config\n\n\nclass RedisPools(object):\n EXPERIMENTS_STATUS = redis.ConnectionPool.from_url(\n config.get_string('POLYAXON_REDIS_EXPERIMENTS_STATUS_URL'))\n J...
python
chosen
[ { "from": "system", "value": "Check if new parent is not a descendant of current category\n" }, { "from": "human", "value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\nfrom mptt.forms import TreeNodeChoiceField\n\nfrom ...product.models import Category\n\n...
python
chosen
[ { "from": "system", "value": "Revert \"Added script for cron job to load surveys to database.\"\n\nThis reverts commit 34e5560437348e5cfeab589b783c9cc524aa2abf.\n" }, { "from": "human", "value": "from surveyextractor import QualtricsExtractor\nimport getopt\nimport sys\n\n### Script for scheduli...
python
chosen
[ { "from": "system", "value": "Fix `Tourney` model's database table name\n" }, { "from": "human", "value": "\"\"\"\nbyceps.services.tourney.models.tourney\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\...
python
chosen
[ { "from": "system", "value": "Add tests for component to SUSE package mapping\n\nSigned-off-by: David Disseldorp <589a549dc9f982d9f46aeeb82a09ab6d87ccf1d8@suse.de>\n" }, { "from": "human", "value": "from ceph_deploy.hosts import suse \n\nclass TestSuseInit(object):\n def setup(self):\n ...
python
chosen
[ { "from": "system", "value": "Fix initial create for camoco class\n" }, { "from": "human", "value": "\"\"\" \n\nCamoco Library - CoAnalysis of Molecular Components \n\nCacheMoneyCorn\n\n\"\"\"\n\n__license__ = \"\"\" \n Creative Commons Non-Commercial 4.0 Generic\n http://creativecommons.o...
python
chosen
[ { "from": "system", "value": "Add a test for the file object\n" }, { "from": "human", "value": "from tectonic import prefork\n\n\ndef test_WorkerMetadata():\n \"\"\"\n This is a simple test, as WorkerMetadata only holds data\n \"\"\"\n\n pid = 'pid'\n health_check_read = 100\n ...
python
chosen
[ { "from": "system", "value": "Add length parameter to sort and remove semicolons\n\nThe sort function requires a length parameter, so the function\ndeclaration and the initial call were modified to reflect that.\nA length of just 1 element represents the base case of the\nrecursion, so the function simply r...
python
chosen
[ { "from": "system", "value": "Revert \"beginning hyperlink model serialization\"\n\nThis reverts commit 6d41c54397512da69604f7e730757f4aff96374f.\n" }, { "from": "human", "value": "from django.contrib.auth.models import User\n\nfrom rest_framework import serializers\n\nfrom .models import UserDe...
python
chosen
[ { "from": "system", "value": "Declare that cyrtranslit supports Python 3.7\n" }, { "from": "human", "value": "from distutils.core import setup\nsetup(\n name='cyrtranslit',\n packages=['cyrtranslit'],\n version='0.4',\n description='Bi-directional Cyrillic transliteration. Transliterate Cyri...
python
chosen
[ { "from": "system", "value": "Upgrade to working MozillaPulse version\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\ndeps = [\n 'ijson==2.2',\n 'mozci==0.15.1',\n 'MozillaPulse==1.2.1',\n 'requests==2.7.0', # Maximum version taskcluster will work wi...
python
chosen
[ { "from": "system", "value": "Update development status and keywords\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\n\nwith open('README.rst') as readme_file:\n readme = readme_file.read()\n\nwith open('HISTORY.rst') as histor...
python
chosen
[ { "from": "system", "value": "Cut out blank lines at the start of PyPi README\n" }, { "from": "human", "value": "import os\n\nfrom setuptools import find_packages, setup\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as readme:\n README = readme.read().s...
python
chosen
[ { "from": "system", "value": "Update the version for manifest update\n" }, { "from": "human", "value": "from setuptools import setup\n\nPACKAGE_VERSION = '1.0'\ndeps = []\n\nsetup(name='wptserve',\n version=PACKAGE_VERSION,\n description=\"Python webserver intended for in web browser t...
python
chosen
[ { "from": "system", "value": "Reset version for future development\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\nimport os\n\nhere = os.path.abspath(os.path.dirname(__file__))\nwith open(os.path.join(here, 'README')) as f:\n README = ...
python
chosen
[ { "from": "system", "value": "Tag version 3.0.4 for PyPI\n\n3.x had a minor bug (see SHA:74b0a36) but it broke logging for Solr\nerrors which seems worth an easily deployed fix\n" }, { "from": "human", "value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core...
python
chosen
[ { "from": "system", "value": "Add PyYAML as a dependency\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"PyRundeck\",\n version=\"0.3.4\",\n description=\"A thin, pure Python wrapper for the Rundeck API\",\n author=\"Panagiotis Koutso...
python
chosen
[ { "from": "system", "value": "Change version to match RC (v0.27.0)\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\n\nsetup(\n name=\"redshift-etl\",\n version=\"0.27b.1\",\n author=\"Harry's Data Engineering and Contributors\",\n description=\"ETL co...
python
chosen
[ { "from": "system", "value": "Use public github URL for package homepage\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\nsetup(name=\"hal-json\",\n version=\"0.1\",\n description=\"Parse and encode link...
python
chosen
[ { "from": "system", "value": "Stop pinning to specific patch versions\n\nThis package should not require specific patch versions. Rather, it\nshould express the broadest range of possible versions that it supports.\n\nIn the current `setup.py`, we are very particular about which versions\nmust be used. Beca...
python
chosen
[ { "from": "system", "value": "Update description and add 'tox' as a testing dependency.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nreadme = open('REA...
python
chosen