conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add \"page_link\" to \"raw_id_fields\" to prevent the run of \"decompress\"\n\nSame issue as the already merged pull request for issue #106 however this applies to cmsfiler_link" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom cms.plu...
python
chosen
[ { "from": "system", "value": "Add some tiny docstring to the unicode method\n" }, { "from": "human", "value": "import threading\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom cms.models.pluginmodel import CMSPlugin\nfrom cmsplugin_simple_markdown imp...
python
chosen
[ { "from": "system", "value": "Remove deadman alerttask init method\n" }, { "from": "human", "value": "from alerttask import AlertTask\n\n\nclass DeadmanAlertTask(AlertTask):\n def __init__(self):\n self.deadman = True\n\n def executeSearchEventsSimple(self):\n # We override t...
python
chosen
[ { "from": "system", "value": "Use trial logging. Tweak numpy logging output.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport climate\nimport joblib\nimport lmj.cubes\nimport numpy as np\n\n\ndef _check(t):\n t.load()\n t.add_velocities(smooth=0)\n vel = abs(t.df[t.mar...
python
chosen
[ { "from": "system", "value": "Fix code string length (PEP8)\n" }, { "from": "human", "value": "import time\n\n\nclass Plugin:\n def __init__(self, vk_bot):\n self.vk_bot = vk_bot\n self.vk_bot.add_command('uptime', self.uptime)\n\n async def uptime(self, vk_api, sender, messa...
python
chosen
[ { "from": "system", "value": "Print a list of which URLs got loaded. This doesn't help that much when\ntrying to debug errors that keep URLs from getting loaded. But it's a\nstart.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport os\n\n\nurlpattern...
python
chosen
[ { "from": "system", "value": "Reduce Peewee's logging level to INFO in tests.\n" }, { "from": "human", "value": "from unittest import TestCase\nfrom redash import settings, db, app\nimport redash.models\n\n# TODO: this isn't pretty...\nsettings.DATABASE_CONFIG = {\n 'name': 'circle_test',\n ...
python
chosen
[ { "from": "system", "value": "Fix an issue when unit tests always return 0 status.\n" }, { "from": "human", "value": "import unittest\n\nif __name__ == '__main__':\n all_tests = unittest.TestLoader().discover('./', pattern='*_tests.py')\n unittest.TextTestRunner().run(all_tests)\n" }, ...
python
chosen
[ { "from": "system", "value": "Set DEFAULT_AUTO_FIELD for the test project\n\nhttps://docs.djangoproject.com/en/dev/releases/3.2/#customizing-type-of-auto-created-primary-keys\n\nAvoid warnings on Django master:\n\n```\ntests.TestModelPhoneNU: (models.W042) Auto-created primary key used when not defining a p...
python
chosen
[ { "from": "system", "value": "Allow IP to be blank in form\n" }, { "from": "human", "value": "from lingcod.features.forms import FeatureForm\nfrom lingcod.bookmarks.models import Bookmark\nfrom django import forms\n\nclass BookmarkForm(FeatureForm):\n name = forms.CharField(label='Bookmark Na...
python
chosen
[ { "from": "system", "value": "Add EmptyStatement exception to default imports\n" }, { "from": "human", "value": "#\n# -*- coding: utf-8 -*-\nfrom .cmd2 import __version__, Cmd, CmdResult, Statement, categorize\nfrom .cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args...
python
chosen
[ { "from": "system", "value": "Use np.inf for max/min limit values\n" }, { "from": "human", "value": "import random\nfrom ..player import Player\nfrom ..utils import utility\n\n\nclass AlphaBeta(Player):\n\n name = 'Alpha-Beta'\n\n def __init__(self, eval_func=utility, max_depth=1000):\n ...
python
chosen
[ { "from": "system", "value": "Add helpers for parsing files and strings\n" }, { "from": "human", "value": "\"\"\"Coil: A Configuration Library.\"\"\"\n\n__version__ = \"0.2.2\"\n" }, { "from": "gpt", "value": "\"\"\"Coil: A Configuration Library.\"\"\"\n\n__version__ = \"0.3.0\"\n\nf...
python
chosen
[ { "from": "system", "value": "Send SIGTERM and SIGKILL to child processes.\n\nWith the removal of subprocess there was no way to known what were the\nsubprocesses, however after the introduction of Jobs tracking the PIDs\nit is now possible. Use those PIDs.\n" }, { "from": "human", "value": "\"...
python
chosen
[ { "from": "system", "value": "Add 'common_name' to company's form\n" }, { "from": "human", "value": "from django import forms\n\nfrom . import models\nfrom pola.forms import (CommitDescriptionMixin,\n FormHorizontalMixin, SaveButtonMixin,\n ReadOnlyF...
python
chosen
[ { "from": "system", "value": "Add full base URL for site to default context.\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom settings import DeploymentType\n\ndef default(request):\n context = {}\n context['DEPLOYMENT'...
python
chosen
[ { "from": "system", "value": "Add initial support for pygments styles\n" }, { "from": "human", "value": "# This file is part of python-markups module\n# License: BSD\n# Copyright: (C) Dmitry Shachnev, 2012\n\nimport os.path\n\n# Some common constants and functions\n(LANGUAGE_HOME_PAGE, MODULE_HO...
python
chosen
[ { "from": "system", "value": "Implement query_filter for MyGenericChannel, because it should search by something other than search_name in the case of Address\n" }, { "from": "human", "value": "import autocomplete_light\n\nfrom models import Contact, Address\n\nclass MyGenericChannel(autocomplet...
python
chosen
[ { "from": "system", "value": "[idp/idp_openid] Remove vim instruction in prologue.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# vim: set ts=4 sw=4 : */\n\nfrom django.contrib import admin\nfrom models import TrustedRoot, Association, Nonce\n\nadmin.site.register(TrustedRoot)\nad...
python
chosen
[ { "from": "system", "value": "Use full code to check if api language actually exists\n" }, { "from": "human", "value": "from importlib import import_module\n\nfrom django.conf import settings\nfrom django.contrib.sessions import middleware\nfrom django.db import connection\nfrom django.utils imp...
python
chosen
[ { "from": "system", "value": "Make the 0012 migration reversible\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom distutils.version import LooseVersion\n\nfrom django.db import models, migrations\n\ndef set_position_value_for_levin_class...
python
chosen
[ { "from": "system", "value": "Print exceptions since pychromecast just ignores them\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nclass Listener(object):\n def __init__(self):\n import zmqclient\n\n self.artist = None\n self.title = None\n pub = zmqc...
python
chosen
[ { "from": "system", "value": "Modify to handle exception properly\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\nimport sys\n\nimport logbook\nimport...
python
chosen
[ { "from": "system", "value": "Fix mod log optional channel\n" }, { "from": "human", "value": "import json\nimport logging\nimport typing\nfrom datetime import datetime\n\nimport discord\n\nfrom cogbot.types import ServerId, ChannelId\n\n\nlog = logging.getLogger(__name__)\n\n\nclass CogBotServer...
python
chosen
[ { "from": "system", "value": "Add \"no cover\" pragma to version setting code\n" }, { "from": "human", "value": "import pkg_resources\n\ntry:\n __version__ = pkg_resources.get_distribution(__name__).version\nexcept pkg_resources.DistributionNotFound:\n __version__ = None\n" }, { "f...
python
chosen
[ { "from": "system", "value": "Add Froide Dry Run Domain and Language Code to context_processor" }, { "from": "human", "value": "from django.conf import settings\n\ndef froide(request):\n return {\"froide\": settings.FROIDE_CONFIG}\n\ndef site_settings(request):\n return {\"SITE_NAME\": set...
python
chosen
[ { "from": "system", "value": "Use path given as argument\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport glob\nimport re\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ncsv_files = glob.glob('*.csv')\n\nfig = plt.figure()\nax = fig.add_sub...
python
chosen
[ { "from": "system", "value": "Make it more complex (((\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\n# -*- coding: utf8 -*-\n\nimport tweepy\n\nconsumer_key = \"\"\nconsumer_secret = \"\"\n\naccess_token = \"\"\naccess_token_secret = \"\"\n\nauth = tweepy.OAuthHandler(consumer_key...
python
chosen
[ { "from": "system", "value": "Update sys.path to import heatmap\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"Test coordinate classes.\"\"\"\n\nimport sys\n\ntry:\n import unittest2 as unittest # Python 2.6\nexcept ImportError:\n import unittest\n\nimport heatmap as hm\n...
python
chosen
[ { "from": "system", "value": "Add option to rlisten on al interfaces\n" }, { "from": "human", "value": "import glpi.server;glpi.server.app.run(debug = True)\n" }, { "from": "gpt", "value": "import glpi.server;glpi.server.app.run(debug = True, host='0.0.0.0')\n" } ]
python
chosen
[ { "from": "system", "value": "Switch to dokku for deployment.\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nimport argparse\n\ndef run():\n\tos.system(\"gunicorn server:app --reload --config gunicorn_config.py\")\n\ndef deploy():\n\tos.system(\"git push heroku master\")\n\...
python
chosen
[ { "from": "system", "value": "Move export to a background process\n" }, { "from": "human", "value": "from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader\nfrom corehq.apps.reports.generic import GenericTabularReport\nfrom corehq.apps.reports.standard import CustomProject...
python
chosen
[ { "from": "system", "value": "Add metadata.tables to mock db.\n" }, { "from": "human", "value": "from flexmock import flexmock\nfrom flask.ext.storage import MockStorage\nfrom flask_uploads import init\n\n\nclass TestCase(object):\n added_objects = []\n committed_objects = []\n created_...
python
chosen
[ { "from": "system", "value": "Use hypothesis setting load_profile to setup health check\n\nFixes #779\n" }, { "from": "human", "value": "'''\nGeneral-purpose fixtures for vdirsyncer's testsuite.\n'''\nimport logging\nimport os\n\nimport click_log\n\nfrom hypothesis import HealthCheck, Verbosity,...
python
chosen
[ { "from": "system", "value": "Use new entry point for python -m IPython\n" }, { "from": "human", "value": "# encoding: utf-8\n\"\"\"Terminal-based IPython entry point.\n\"\"\"\n#-----------------------------------------------------------------------------\n# Copyright (c) 2012, IPython Developm...
python
chosen
[ { "from": "system", "value": "Fix comment for `mediapipe` license.\n\nThe `\"\"\"` comment indicates a public docstring for the module, and will end up in the generated docs. By using a \"private\" comment (`#`) we will not document the license as part of the API.\n\nThe Apache license is noted in the foote...
python
chosen
[ { "from": "system", "value": "Revert \"make AUR tests more flaky\"\n\nThis reverts commit 61df628bd8bc97acbed40a4af67b124c47584f5f.\n\nIt doesn't help :-(\n" }, { "from": "human", "value": "# MIT licensed\n# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.\n\nfrom flaky import flaky...
python
chosen
[ { "from": "system", "value": "Print scenario/step names on failure\n" }, { "from": "human", "value": "from __future__ import print_function\n\nimport os\nfrom contextlib import contextmanager\n\nfrom selenium import webdriver\n\nfrom aloe import around, world\n\nhere = os.path.dirname(__file__)\...
python
chosen
[ { "from": "system", "value": "Add attachment support to email sender CLI\n" }, { "from": "human", "value": "from typing import Tuple\n\nfrom opwen_email_server import azure_constants as constants\nfrom opwen_email_server import config\nfrom opwen_email_server.services.queue import AzureQueue\nfr...
python
chosen
[ { "from": "system", "value": "Add flake8-debugger to list of flake8 checks" }, { "from": "human", "value": "from setuptools import setup\n\n\nsetup(\n name='flake8-config-4catalyzer',\n version='0.2.1',\n url='https://github.com/4Catalyzer/python/tree/packages/flake8-config-4catalyzer',...
python
chosen
[ { "from": "system", "value": "Fix uptime and uptime timing\n" }, { "from": "human", "value": "import discord\nfrom modules.botModule import BotModule\nfrom modules.help import *\nimport time\nimport datetime\n\nclass Status(BotModule):\n name = 'status'\n\n description = 'Allow for...
python
chosen
[ { "from": "system", "value": "Refactor code so we can use command in tests" }, { "from": "human", "value": "from django.core.management.base import BaseCommand\nfrom dateutil.relativedelta import relativedelta\n\nfrom legalaid.models import Case\nfrom cla_butler.tasks import DeleteOldData\n\n\nc...
python
chosen
[ { "from": "system", "value": "Select Queries Table names changed\n" }, { "from": "human", "value": "SELECT_MOVIES_ORDERED_BY_RATING = '''\n SELECT *\n FROM MOVIE\n ORDER BY RATING;\n'''\n\nSELECT_PROJECTION_FOR_MOVIE = '''\n SELECT p.*, COUNT(r.ROW * r.COL)\n FROM PROJECTION as p\...
python
chosen
[ { "from": "system", "value": "Add call to monitoring app\n" }, { "from": "human", "value": "from dbaas_cloudstack.provider import CloudStackProvider\nfrom pre_provisioned.pre_provisioned_provider import PreProvisionedProvider\nimport logging\n\nLOG = logging.getLogger(__name__)\n\nclass IaaSMan...
python
chosen
[ { "from": "system", "value": "[tools] Add better way to generate MDK project file.\n" }, { "from": "human", "value": "import os\nimport sys\n\ndef usage():\n print '%s all -- build all bsp' % os.path.basename(sys.argv[0])\n print '%s clean -- clean all bsp' % os.path.basename(sys.arg...
python
chosen
[ { "from": "system", "value": "Refactor to allow different event loops" }, { "from": "human", "value": "import queue\nimport threading\n\n\ndef loop(queue, actor):\n while True:\n message = queue.get()\n actor.behavior(message)\n\n \nclass Actor(object):\n\n def __init_...
python
chosen
[ { "from": "system", "value": "Modify pyauto test ChromeosPrivateViewTest to use 2.2.28 data file.\n\nBUG=none\nTEST=This is a test.\n\nReview URL: https://chromiumcodereview.appspot.com/10389084\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@136454 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { ...
python
chosen
[ { "from": "system", "value": "linters: Add linter to catch unquoted use of $(TEST_HC)\n\nThis is a common bug that creeps into Makefiles (e.g. see T12674).\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\n\"\"\"\nWarn for use of `--interactive` inside Makefiles (#11468).\n\nEncourage...
python
chosen
[ { "from": "system", "value": "Remove useless default from migration\n\n - wal-26\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport nodeconductor.core.fields\n\n\nclass Migration(migrations.Migra...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.16.3\n" }, { "from": "human", "value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.16.2\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\"...
python
chosen
[ { "from": "system", "value": "Remove IDs for all candidates, not just Zac\n" }, { "from": "human", "value": "import json\n\nfrom django.core.management.base import BaseCommand\nfrom django.db import transaction\n\n\nfrom people.models import Person\nfrom candidates.views.version_data import get_...
python
chosen
[ { "from": "system", "value": "Make the openquake namespace compatible with old setuptools\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright (C) 2010-2016 GEM Foundation\n#\n# OpenQuake is free software: you can redistribute it...
python
chosen
[ { "from": "system", "value": "Make DotDict repr() use class name so that it doesn't print misleading results if subclassed\n" }, { "from": "human", "value": "class DotDict(dict):\n\n __getattr__ = dict.__getitem__\n __setattr__ = dict.__setitem__\n __delattr__ = dict.__delitem__\n\n ...
python
chosen
[ { "from": "system", "value": "Add domain route and case handling\n" }, { "from": "human", "value": "from flask import Flask, request, render_template\n\nimport os\n\n\napp = Flask(__name__)\napp.debug = True\n\n# Secret Key setting based on debug setting\nif app.debug:\n app.secret_key = \"T3...
python
chosen
[ { "from": "system", "value": "admin_programme: Fix form to reflect model change\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom django import forms\nfrom uni_form.helper import FormHelper\nfrom uni_form.layout import Submit, Layout, Fieldset, ButtonHolder\nfrom Instanssi.ext_p...
python
chosen
[ { "from": "system", "value": "Extend the test to compile a second time after setting include dirs again.\n" }, { "from": "human", "value": "import os\nimport sys\nimport platform\nimport textwrap\nimport sysconfig\n\nimport pytest\n\nfrom distutils import ccompiler\n\n\ndef _make_strs(paths):\n ...
python
chosen
[ { "from": "system", "value": "Undo error changes for now\n" }, { "from": "human", "value": "from traceback import format_exc\n\nfrom django.conf import settings\n\n\nclass GraphQLError(Exception):\n def __init__(self, message):\n super(GraphQLError, self).__init__(message)\n sel...
python
chosen
[ { "from": "system", "value": "Add custom CSS style to FIWARE doc\n\nChange-Id: I74293d488e0cd762ad023b94879ee618a4016110\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# on_rtd is whether we are on readthedocs.org\nimport os\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'...
python
chosen
[ { "from": "system", "value": "Remove function to reset _once_warnings (messy)\n" }, { "from": "human", "value": "# vim: fdm=indent\n# author: Fabio Zanini\n# date: 02/08/17\n# content: Support module for filenames related to the Google Sheet APIs.\n# Modules\nimport os\nimport yaml\...
python
chosen
[ { "from": "system", "value": "Comment about display_name == password\n" }, { "from": "human", "value": "from django.contrib.auth import get_user_model\nfrom factory import DjangoModelFactory, CREATE_STRATEGY, LazyAttribute, PostGeneration, SubFactory\nfrom yunity.walls.factories import Wall\nfro...
python
chosen
[ { "from": "system", "value": "Fix Blacklists usage of RestClient\n" }, { "from": "human", "value": "from .rest import RestClient\n\n\nclass Blacklists(object):\n def __init__(self, domain, jwt_token):\n url = 'https://%s/api/v2/blacklists/tokens' % domain\n\n self.client = RestC...
python
chosen
[ { "from": "system", "value": "Add new words to wordlist\n" }, { "from": "human", "value": "# Copyright 2016 Adler Brediks Medrado\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 may obtain a copy o...
python
chosen
[ { "from": "system", "value": "Hide password in terminal input\n" }, { "from": "human", "value": "from FbFeed import NewsFeed\n\n\nusername = raw_input('Enter your email id registered with facebook : ')\npassword = raw_input('Enter your Password : ')\nprint('Creating new session on Firefox..')\nf...
python
chosen
[ { "from": "system", "value": "dblog: Handle optional field saving with exceptions, save module name.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom logging import Handler\nfrom datetime import datetime \n\nclass DBLogHandler(Handler, object):\n def __init__(self):\n ...
python
chosen
[ { "from": "system", "value": "Test functionality has been added. Paired by Richard and Michael.\n\nThe functionality for the minutify function has now been tested; and the tests work (Support 231)\n" }, { "from": "human", "value": "\"\"\"\nThis module contains the testing framework for the displ...
python
chosen
[ { "from": "system", "value": "Disable printing error messages not in debug\n" }, { "from": "human", "value": "import logging\n\n\nclass ExceptionFilter(logging.Filter):\n def __init__(self, debug=None):\n self.debug = debug\n\n def filter(self, record):\n if self.debug:\n ...
python
chosen
[ { "from": "system", "value": "Add context to login view\n" }, { "from": "human", "value": "from demoapp.forms import DemoLoginForm\nfrom django.shortcuts import render_to_response\nfrom django.shortcuts import redirect\nfrom demoapp import app_settings\nfrom demoapp.utils import get_salt\n\n\nde...
python
chosen
[ { "from": "system", "value": "Copy static dirs as well\n" }, { "from": "human", "value": "import os.path\nfrom shutil import copyfile\ntry:\n from jinja2 import Template\nexcept:\n print \"Could not import Jinja2, run 'easy_install Jinja2'\"\n exit()\n\noutput_dir = os.path.join('./', '...
python
chosen
[ { "from": "system", "value": "Fix for LazyModel infinite recursion" }, { "from": "human", "value": "class LazyModel(object):\n \"\"\"\n It's a helper class that is used in case you have model_class and object\n primary key. You might need to use only object id.\n \n If you try to ...
python
chosen
[ { "from": "system", "value": "Connect to Celery using config options\n" }, { "from": "human", "value": "import redis\nfrom celery import Celery\n\nfrom .driller import Driller\n\napp = Celery('tasks', broker='amqp://guest@localhost//', backend='redis://localhost')\nredis_pool = redis.ConnectionP...
python
chosen
[ { "from": "system", "value": "Add Python inclusion path to YCM config\n\nIn the script, the path is read from the result from pkg-config. So it\nshould work in most places.\n" }, { "from": "human", "value": "import os\n\ndef FlagsForFile(filename, **kwargs):\n\n flags = ['-std=c++14', '-I/us...
python
chosen
[ { "from": "system", "value": "Add message_type field into message model\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass Channel(models.Model):\n def __str__(self):\n return self.name\n\n name = models.CharField(max_length=20, unique=True)\n\n\nclass Messag...
python
chosen
[ { "from": "system", "value": "Add Satoumi as a classification.\n" }, { "from": "human", "value": "from model_utils import Choices\n\nfrom ohashi.constants import OTHER\n\n\nBLOOD_TYPE = Choices('A', 'B', 'O', 'AB')\n\nCLASSIFICATIONS = Choices(\n (1, 'major', 'Major Unit'),\n (2, 'minor', ...
python
chosen
[ { "from": "system", "value": "Fix in enable scheduler patch\n" }, { "from": "human", "value": "# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors\n# MIT License. See license.txt\n\nfrom __future__ import unicode_literals\nimport frappe\nfrom frappe.utils.scheduler import dis...
python
chosen
[ { "from": "system", "value": "Remove comment containing incorrect conversion function.\n" }, { "from": "human", "value": "# midi-beeper-orchestra - program to create an orchestra from PC speakers\n# Copyright (C) 2015 The Underscores\n# This program is free software: you can redistribute it and/...
python
chosen
[ { "from": "system", "value": "Add timeout to dead links script\n" }, { "from": "human", "value": "from operator import itemgetter\nfrom itertools import chain\n\nimport os\n\nimport yaml\nimport requests\n\nyaml.load_all\n\ndirectory = \"_companies\"\n\nflat = chain.from_iterable\n\ndef link_sta...
python
chosen
[ { "from": "system", "value": "Change 'language' to 'syntax', that is more precise terminology.\n" }, { "from": "human", "value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Aparajita Fishman\n# Copyright (c) 2013 Aparajita Fishman\n...
python
chosen
[ { "from": "system", "value": "Add more rules for test purposes.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport scrapy\n\n\nclass DataScienceJobsSpider(scrapy.Spider):\n name = \"data-science-jobs\"\n allowed_domains = [\"www.data-science-jobs.com\"]\n start_urls = (\...
python
chosen
[ { "from": "system", "value": "Make number parameter optional to testimonials tag" }, { "from": "human", "value": "from django import template\n\nfrom ..models import Testimonial\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef random_testimonials(number):\n return Testimonial.o...
python
chosen
[ { "from": "system", "value": "Add basic coverage for the setup_logging method\n" }, { "from": "human", "value": "from raven.conf import load\nfrom unittest2 import TestCase\n\n\nclass LoadTest(TestCase):\n def test_basic(self):\n dsn = 'https://foo:bar@sentry.local/1'\n res = {}...
python
chosen
[ { "from": "system", "value": "Make the readers tests a bit more verbose.\n" }, { "from": "human", "value": "# coding: utf-8\ntry:\n import unittest2\nexcept ImportError, e:\n import unittest as unittest2\n\nimport datetime\nimport os\n\nfrom pelican import readers\n\nCUR_DIR = os.path.dirn...
python
chosen
[ { "from": "system", "value": "Add engine connection, and close engine connection to worker dyno\n" }, { "from": "human", "value": "import sys\nimport os\nsys.path.insert(0, \"../financialScraper\")\nimport pandas as pd\nfrom financialScraper import getqf\nfrom sqlalchemy import create_engine\n\n...
python
chosen
[ { "from": "system", "value": "Add program name to parser\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom .command import Command\nfrom matador import utils\n\n\nclass DeployTicket(Command):\n\n def _add_arguments(self, parser):\n parser.add_argument(\n '-e', '...
python
chosen
[ { "from": "system", "value": "Use NodeNG instead of astroid.ALL_NODE_CLASSES\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals, print_function\n\nimport re\n\nimport astroid\n\nfrom . import tools, test_mark_tokens\n\n\nclass TestAstroid(test_mar...
python
chosen
[ { "from": "system", "value": "Update test to use new name of helper for dois\n" }, { "from": "human", "value": "from scrapi.base import helpers\n\n\nclass TestHelpers(object):\n\n def test_format_one_tag(self):\n single_tag = ' A single tag '\n single_output = helpers.format_tag...
python
chosen
[ { "from": "system", "value": "Add custom authentication form to set the label 'username' label to 'student number' for the login form.\n" }, { "from": "human", "value": "from django.contrib.auth import get_user_model\nfrom django.core.exceptions import ObjectDoesNotExist, ValidationError\nfrom d...
python
chosen
[ { "from": "system", "value": "Update tests to import see\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nUnit tests for see.py\n\"\"\"\nfrom __future__ import print_function, unicode_literals\ntry:\n import unittest2 as unittest\nexcept ImportError:\n i...
python
chosen
[ { "from": "system", "value": "Make text a list in the index. " }, { "from": "human", "value": "import six\nfrom datetime import datetime, date\nfrom collections import Mapping, Iterable\n\nfrom jsonmapping.transforms import transliterate\n\nIGNORE_FIELDS = ['$schema', '$sources', '$latin', '$tex...
python
chosen
[ { "from": "system", "value": "Add display of client geoip info. And print description of what we are printing.\n" }, { "from": "human", "value": "\"\"\"Code snippet to test the Java ServerProxy interface to the Pings server.\"\"\"\n\nimport ServerProxy, ClientInfo\n\nsp = ServerProxy('localhost'...
python
chosen
[ { "from": "system", "value": "Fix a bug in file_open (os.open does not take keyword argument).\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nimport os\nimport errno\n\n\ndef ensure_intermediate_dir(path):\n \"\"\"\n Basiclly equivalent to command `mkdir -p`\n\n \"\"\"\...
python
chosen
[ { "from": "system", "value": "Change %default to %(default)s for removing warning\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom pytest import fixture\n\nfrom iamport import Iamport\n\nDEFAULT_TEST_IMP_KEY = 'imp_apikey'\nDEFAULT_TEST_IMP_SECRET = ('ekKoeW8RyKuT0zgaZsUtXXTLQ4Ah...
python
chosen
[ { "from": "system", "value": "Convert lifetime to float instead of sympy type.\n" }, { "from": "human", "value": "\"\"\"Add electron lifetime\n\"\"\"\n\nfrom sympy.parsing.sympy_parser import parse_expr\nfrom pax import units\n\nfrom cax import config\nfrom cax.task import Task\n\n\nclass AddEle...
python
chosen
[ { "from": "system", "value": "Increase waitress setting max_request_body_size to 5GiB\n\nPython waitress limits the body size to 1GiB by default, thus\nuploading of larger objects will fail if this value is not\nincreased.\nPlease note that this value should be increased if your Swift\ncluster supports uplo...
python
chosen
[ { "from": "system", "value": "Return Content-Type header with JSON size info\n" }, { "from": "human", "value": "import argparse\nimport json\n\nfrom flask import Flask, request\n\nparser = argparse.ArgumentParser(description=\"Start a Blindstore server.\")\nparser.add_argument('-d', '--debug', a...
python
chosen
[ { "from": "system", "value": "Add display name for from address\n" }, { "from": "human", "value": "#!/usr/bin/env python\n#\n# Copyright 2010 Eric Entzel <eric@ubermac.net>\n#\n\nfrom google.appengine.api import mail\nfrom google.appengine.ext.webapp import template\nimport os\n\n\nfrom_address ...
python
chosen
[ { "from": "system", "value": "Make tests throw better error if env vars are missing\n" }, { "from": "human", "value": "import ibmiotf.application\nimport os\n\nclass AbstractTest(object):\n\n WIOTP_API_KEY=os.getenv(\"WIOTP_API_KEY\")\n WIOTP_API_TOKEN=os.getenv(\"WIOTP_API_TOKEN\")\n O...
python
chosen
[ { "from": "system", "value": "Test person adding to addressbook\n" }, { "from": "human", "value": "from unittest import TestCase\n\n\nclass AddressBookTestCase(TestCase):\n\n def test_add_person(self):\n pass\n\n def test_add_group(self):\n pass\n\n def test_find_person_by...
python
chosen
[ { "from": "system", "value": "Make installation print data path.\n" }, { "from": "human", "value": "from __future__ import print_function\n\nimport sys\n\nimport sputnik\nfrom sputnik.package_list import (PackageNotFoundException,\n CompatiblePackageNotFoundExcep...
python
chosen
[ { "from": "system", "value": "Rename test. Fix copy/pasta forgetfulness.\n" }, { "from": "human", "value": "import webtest\n\nimport moksha.tests.utils as testutils\n\nfrom moksha.api.widgets.live import get_moksha_socket\nfrom moksha.middleware import make_moksha_middleware\nfrom tw2.core impo...
python
chosen
[ { "from": "system", "value": "Increase docker-py timeout to 180\n" }, { "from": "human", "value": "import pytest\n\n\n@pytest.fixture(autouse=True)\ndef tagschecker(request):\n tags = set(request.config.getini('TAGS'))\n\n tags_marker = request.node.get_marker('tags')\n xfailtags_marker...
python
chosen