conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update for latest Sendgrid webhook format" }, { "from": "human", "value": "import json\n\nfrom django.db import models\nfrom django.utils import timezone\n\nfrom jsonfield import JSONField\n\nfrom sendgrid_events.signals import batch_processed\n\n\nclass Event(model...
python
chosen
[ { "from": "system", "value": "docs: Fix a typo, it should be \"networks\", not \"network\".\n" }, { "from": "human", "value": "from pprint import pprint\n\nfrom libcloud.compute.types import Provider\nfrom libcloud.compute.providers import get_driver\n\napikey = 'your api key'\nsecretkey = 'your...
python
chosen
[ { "from": "system", "value": "Add filtering option to indentation script\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Indents a CAF log with trace verbosity. The script does *not* deal with a log\n# with multiple threads.\n\n# usage (read file): indent_trace_log.py FILENAME\n# ...
python
chosen
[ { "from": "system", "value": "Make tag map available in Indonesian defaults\n" }, { "from": "human", "value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom .stop_words import STOP_WORDS\nfrom .punctuation import TOKENIZER_SUFFIXES, TOKENIZER_PREFIXES, TOKENIZER_INFIXES\nfrom ....
python
chosen
[ { "from": "system", "value": "Add correct_mesh_orientation to skimage.measure imports\n" }, { "from": "human", "value": "from ._find_contours import find_contours\nfrom ._marching_cubes import marching_cubes, mesh_surface_area\nfrom ._regionprops import regionprops, perimeter\nfrom ._structural_...
python
chosen
[ { "from": "system", "value": "Revert \"Trying to fix the path\"\n\nThis reverts commit f89b139ba7e17af8bc7ca42a8cc9a3f821825454.\n" }, { "from": "human", "value": "import distutils.sysconfig\nfrom distutils.core import setup\nsetup(name = 'robotframework-whitelibrary',\n version ...
python
chosen
[ { "from": "system", "value": "Change location of static files on server\n" }, { "from": "human", "value": "from fabric.api import local, env, sudo\n\nenv.hosts = ['nkhumphreys.co.uk']\nenv.user = 'root'\n\nNAME = \"gobananas\"\n\n\ndef deploy():\n base_cmd = \"scp -r {local_path} root@{host}:...
python
chosen
[ { "from": "system", "value": "Remove exception in migration\nSome users moved their data folder despite the code not permitting it yet.\nThis migration will fail for those users, but they will still be able to run\nthe app.\n" }, { "from": "human", "value": "import sqlite3\nfrom config import DA...
python
chosen
[ { "from": "system", "value": "Fix deployment check return value\n\nAssertionError: The function <function storage_check at 0x7f8571c1a048> did not return a list. All functions registered with the checks registry must return a list.\n" }, { "from": "human", "value": "from django.core.checks impor...
python
chosen
[ { "from": "system", "value": "Fix pep8 violations in the doc examples.\n" }, { "from": "human", "value": "from libcloud.compute.types import Provider\nfrom libcloud.compute.providers import get_driver\n\nEC2_ACCESS_ID = 'your access id'\nEC2_SECRET_KEY = 'your secret key'\n\ncls = get_driver(Pro...
python
chosen
[ { "from": "system", "value": "Add unicode to slug creation\n" }, { "from": "human", "value": "from django.db.models.signals import pre_save\nfrom django.dispatch import receiver\n\nimport logging\nlog = logging.getLogger('apps.convention')\n\nfrom django.utils.text import slugify\n\nfrom .models...
python
chosen
[ { "from": "system", "value": "[Feature] Add Login, Registration, Bucketlists endpoints.\n" }, { "from": "human", "value": "\"\"\"This module runs the api server.\"\"\"\nimport os\nfrom app import flask_app, db\nfrom app.models import User, BucketList, BucketListItem\nfrom flask.ext.script import...
python
chosen
[ { "from": "system", "value": "Add test for model representation\n" }, { "from": "human", "value": "from django.contrib.auth import get_user_model\nfrom django.db import DataError\nfrom django.db import IntegrityError\nfrom django.test import TestCase\n\n\nclass TestUserModel(TestCase):\n @cla...
python
chosen
[ { "from": "system", "value": "Add transcription to and from IPA\n" }, { "from": "human", "value": "import app.selector as selector\nimport app.applier as applier\n\nfrom app.rules import rules\n\n\ndef rule_representation(rule):\n '''Takes a Rule and returns a list of strings which represent ...
python
chosen
[ { "from": "system", "value": "Check W/L Ratio and K/D Ratio\n" }, { "from": "human", "value": "import unirest\n\ndef getTeam(summonerID):\n response = unirest.get(\"https://na.api.pvp.net/api/lol/na/v1.3/game/by-summoner/\" + str(summonerID) + \"/recent?api_key=4ef4ddb0-44e4-4757-8cd5-6aa9f512a...
python
chosen
[ { "from": "system", "value": "Add purchase_security.xml file entry in update_xml section\n\nbzr revid: mga@tinyerp.com-231e8ef2a888ac261ce0278ca7f6c387760d8ea3" }, { "from": "human", "value": "{\n\t\"name\" : \"Purchase Management\",\n\t\"version\" : \"1.0\",\n\t\"author\" : \"Tiny\",\n\t\"websi...
python
chosen
[ { "from": "system", "value": "Fix argument reference in docstring.\n" }, { "from": "human", "value": "# :coding: utf-8\n# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips\n# :license: See LICENSE.txt.\n\nfrom .handler.distribute import Distribute\nfrom .configurator import classic\n\n#: T...
python
chosen
[ { "from": "system", "value": "Migrate density example to cartopy.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"Plot to demonstrate the density colormap.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom netCDF4 import Dataset\nfrom mpl_toolkits.basemap i...
python
chosen
[ { "from": "system", "value": "Improve performance of find tags function\n" }, { "from": "human", "value": "import hmac\nimport hashlib\nfrom flask import current_app as app\nfrom urllib.parse import urlparse\nfrom github import Github\n\n\ndef verify_signature(gh_signature, body, secret):\n s...
python
chosen
[ { "from": "system", "value": "Load tasks module on app load.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\n\nfrom ..settings import SST_DEFAULT_SETTINGS, GA_DEFAULT_SETTINGS, update_default...
python
chosen
[ { "from": "system", "value": "Add info about version to log\n" }, { "from": "human", "value": "from killer import kill\nfrom log import logname\nimport os\nimport argparse\nimport sys\nfrom version import version_info\n\nlogger = logname()\n\ndef start_server():\n logger.info('Starting Turtle...
python
chosen
[ { "from": "system", "value": "Sort ast nodes in constants + remove duplicates\n" }, { "from": "human", "value": "\"\"\"Constants relevant to ast code.\"\"\"\n\nimport ast\n\nNODE_TYPE_TO_TOKENS = {\n ast.Add: ('+',),\n ast.Sub: ('-',),\n ast.Mult: ('*',),\n ast.Div: ('/',),\n ast....
python
chosen
[ { "from": "system", "value": "Add test for the intended use case\n" }, { "from": "human", "value": "import pytest\nimport os\n\nfrom great_expectations.data_context.util import (\n safe_mmkdir,\n)\n\ndef test_safe_mmkdir(tmp_path_factory):\n project_path = str(tmp_path_factory.mktemp('empt...
python
chosen
[ { "from": "system", "value": "Rename function arg and spelling fix in docstring\n" }, { "from": "human", "value": "from pyramda.function.curry import curry\nfrom . import filter\n\n\n@curry\ndef reject(f, xs):\n \"\"\"\n Acts as a compliment of `filter`\n\n :param f: function\n :para...
python
chosen
[ { "from": "system", "value": "Support for custom user model\n" }, { "from": "human", "value": "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass Poll(models.Model):\n question = models.CharField(max_length=255)\n description = models.TextField(blank=True)...
python
chosen
[ { "from": "system", "value": "Add a test for `get_linux_version` for GCP\n" }, { "from": "human", "value": "try:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\nfrom pika import compat\n\n\nclass UtilsTests(unittest.TestCase):\n\n def test_get_linux_version_norm...
python
chosen
[ { "from": "system", "value": "Add splitter with treeview/editor split.\n" }, { "from": "human", "value": "from PySide import QtGui\n\nfrom editor import Editor\n\n\nclass MainWindow(QtGui.QMainWindow):\n def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\n ...
python
chosen
[ { "from": "system", "value": "Fix test model to be case-insensitive.\n" }, { "from": "human", "value": "from axiom.store import Store\nfrom hypothesis import given\nfrom hypothesis.strategies import binary, lists, text, tuples, characters\nfrom testtools import TestCase\nfrom testtools.matchers ...
python
chosen
[ { "from": "system", "value": "Set docker log encoding to utf-8\n" }, { "from": "human", "value": "# stdlib\nimport os\nfrom pathlib import Path\nfrom pathlib import PosixPath\nimport subprocess\n\n# Make a log directory\nlog_path = Path(\"logs\")\nlog_path.mkdir(exist_ok=True)\n\n# Get the githu...
python
chosen
[ { "from": "system", "value": "Make RedisWordCountBolt inherit direclty from Bolt\n" }, { "from": "human", "value": "from collections import Counter\n\nfrom redis import StrictRedis\n\nfrom streamparse import Bolt\n\n\nclass WordCountBolt(Bolt):\n outputs = ['word', 'count']\n\n def initial...
python
chosen
[ { "from": "system", "value": "Add Field for Playbook filename\n" }, { "from": "human", "value": "from django import forms\nfrom django.conf import settings\nfrom django.forms import ModelForm\nfrom ansible.models import Playbook\n\nclass AnsibleForm1(ModelForm):\n class Meta:\n model =...
python
chosen
[ { "from": "system", "value": "Return component instance from Declaration.install()\n" }, { "from": "human", "value": "def declaration(*args, **kwargs):\n def decorator(factory):\n return Declaration(factory, *args, **kwargs)\n return decorator\n\n\nclass Declaration(object):\n de...
python
chosen
[ { "from": "system", "value": "Remove extraneous test for already handled edge case\n" }, { "from": "human", "value": "import datetime\ndef get_default_time_display(dt, show_timezone=True):\n \"\"\"\n Converts a datetime to a string representation. This is the default\n representation us...
python
chosen
[ { "from": "system", "value": "Implement removing of unreachable symbols\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\n:Author Patrik Valkovic\n:Created 17.08.207 13:29\n:Licence GNUv3\nPart of grammpy-transforms\n\n\"\"\"\n\nfrom grammpy import Grammar\nfrom copy import copy\...
python
chosen
[ { "from": "system", "value": "Update \"Active Records\" PDF URL\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport pandas as pd\nimport pdfplumber\nimport requests\nimport datetime\nimport re\nfrom io import BytesIO\n\ndef parse_date(pdf):\n text = pdf.pages[0].extract_text(x_to...
python
chosen
[ { "from": "system", "value": "Mark these tests on FreeBSD and Linux as non-flakey. We don't know that they are\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@257656 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "\"\"\"\nTest that LLDB correctly allows scripted c...
python
chosen
[ { "from": "system", "value": "Fix error in communicate function.\n" }, { "from": "human", "value": "\nfrom subprocess import Popen as BasePopen\n\n\nclass Popen(BasePopen):\n\n def communicate(self, input=None, timeout=None):\n \"\"\"\n Communicate\n :param input: Optio...
python
chosen
[ { "from": "system", "value": "Make the MokshaHub and reactor available in the moksha.api.hub module\n" }, { "from": "human", "value": "# This file is part of Moksha.\n# Copyright (C) 2008-2009 Red Hat, Inc.\n# \n# This program is free software: you can redistribute it and/or modify\n# it under ...
python
chosen
[ { "from": "system", "value": "Add DEFAULT_NAMES as a global tuple constant\n\nThey will be referenced in various places in the game and should not\nbe subject to change.\n\nINPUT_NAMES was also changed into a tuple for guaranteed immutability.\n" }, { "from": "human", "value": "\"\"\"This module...
python
chosen
[ { "from": "system", "value": "Fix storage migration to process all storages\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.16 on 2019-02-26 04:08\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\ndef set_data_relatio...
python
chosen
[ { "from": "system", "value": "Add base exeption for Watson project\n" }, { "from": "human", "value": "\"\"\"Watson's base exception handling.\"\"\"\n" }, { "from": "gpt", "value": "\"\"\"Watson's base exception handling.\"\"\"\n\n\nclass WatsonException(Exception):\n \"\"\"Base wa...
python
chosen
[ { "from": "system", "value": "Disable the VT test, the code ain't mature enough.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n'''\n :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`\n :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.\n :licens...
python
chosen
[ { "from": "system", "value": "Add repr to data structures\n" }, { "from": "human", "value": "# Copyright (c) 2017 The Regents of the University of Michigan.\n# All Rights Reserved. Licensed according to the terms of the Revised\n# BSD License. See LICENSE.txt for details.\n\nclass ReadOnlyDataSt...
python
chosen
[ { "from": "system", "value": "Revert \"Revert \"Added nickname and punct, removed parens\"\"\n\nThis reverts commit ab4e279a6866d432cd1f58a07879e219360b4911.\n" }, { "from": "human", "value": "import random\n\nateball = [\n \"It is certain\",\n \"It is decidedly so\",\n \"Wi...
python
chosen
[ { "from": "system", "value": "Fix gettatr object and name.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nclass Manager(object):\n\n # should be re-defined in a subclass\n state_name = None\n object_type = None\n\n def __init__(self, api):\n self.api = api\n\n ...
python
chosen
[ { "from": "system", "value": "Fix displaying multiple images command\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom .greengraph import GreenGraph\nfrom .googlemap import GoogleMap\nfrom argparse import ArgumentParser\nimport IPython\n\nif __name__ == \"__main__\":\n\n\tparser = A...
python
chosen
[ { "from": "system", "value": "Make the sync integration tests self-contained on autotest\n\nIn the past, the sync integration tests used to require a password file\nstored on every test device in order to do a gaia sign in using\nproduction gaia servers. This caused the tests to be brittle.\n\nAs of today, ...
python
chosen
[ { "from": "system", "value": "Fix unicode declaration on test\n" }, { "from": "human", "value": "import random\n\nfrom ..pipeline import TextCategorizer\nfrom ..lang.en import English\nfrom ..vocab import Vocab\nfrom ..tokens import Doc\nfrom ..gold import GoldParse\n\n\ndef test_textcat_learns_...
python
chosen
[ { "from": "system", "value": "Remove unneeded get_default_scope from EventbriteProvider\n" }, { "from": "human", "value": "\"\"\"Customise Provider classes for Eventbrite API v3.\"\"\"\nfrom allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2....
python
chosen
[ { "from": "system", "value": "Add code to allow user to configure their own hostname, source, and sourcetype (with defaults)\n" }, { "from": "human", "value": "import logging\nimport socket\nimport traceback\n\nfrom threading import Thread\n\nimport requests\n\n\nclass SplunkHandler(logging.Hand...
python
chosen
[ { "from": "system", "value": "Update fabfile for moved mnist example\n" }, { "from": "human", "value": "from fabric.api import task, local, run, lcd, cd, env, shell_env\nfrom os.path import exists as file_exists\nfrom fabtools.python import virtualenv\nfrom os import path\n\n\nPWD = path.join(pa...
python
chosen
[ { "from": "system", "value": "Use the correct syntax when iterating a week's games.\n" }, { "from": "human", "value": "from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden\nfrom django.shortcuts import get_object_or_404, redirect, render_to_response\nfrom django.te...
python
chosen
[ { "from": "system", "value": "Add pdbpp to dev dependencies\n" }, { "from": "human", "value": "\"\"\"Mailmerge build and install configuration.\"\"\"\nimport os\n\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nwith open(os.path.join(os.path....
python
chosen
[ { "from": "system", "value": "Update description for consistency with readme\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\n\nPROJECT_DIR = os.path.dirname(__file__)\n\nsetup(\n name = 'django-right-to-left',\n packages = ['rtl'],\n version = '0.1',\n l...
python
chosen
[ { "from": "system", "value": "Order categories in search fields\n" }, { "from": "human", "value": "from django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef dimension(value, arg):\n \"\"\"\n Dimension integers\n\n If value, append arg, otherwise output noth...
python
chosen
[ { "from": "system", "value": "Fix for exception due to missing buzzer.wav\n" }, { "from": "human", "value": "try:\n import winsound\nexcept ImportError:\n winsound = None\ntry:\n import alsaaudio\n import wave\nexcept ImportError:\n alsaaudio = None\nfrom syncplay import utils\n\n...
python
chosen
[ { "from": "system", "value": "Set pynacl as an optional requirement.\n" }, { "from": "human", "value": "\"\"\"Setup module for txrudp.\"\"\"\n\nimport codecs\nfrom os import path\nimport sys\n\nfrom setuptools import setup\n\n\n_HERE = path.abspath(path.dirname(__file__))\nwith codecs.open(path....
python
chosen
[ { "from": "system", "value": "Revert \"Another attempt to fix the RTD build.\"\n\nThis reverts commit 43807c085493962ca0f79105b64b3be8ddc6fc39.\n\nReferences #25\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nVERSION = '1.1.4'\n\nsetup(\n name=\"puresnmp\",\...
python
chosen
[ { "from": "system", "value": "Remove install requires and added download_url\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom __future__ import unicode_literals\nfrom csv_generator import __version__\nfrom setuptools import setup, find_packages\n\nsetup(\n name='csv_generator'...
python
chosen
[ { "from": "system", "value": "Use dirty macOS workaround only on OSX on Travis\n" }, { "from": "human", "value": "import os\n\nimport invoke\n\n\ninvoke.run = os.system\n\n\nclass BaseTest(object):\n def download_mspec(self):\n if not os.path.isdir(\"../mspec\"):\n invoke.ru...
python
chosen
[ { "from": "system", "value": "Decrease version to bare minimum plus 0.0.1\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nsetup(\n name=\"psycho\",\n version=\"1.0\",\n description=\"An ultra simple wrapper for Python psycopg2 with very basic ...
python
chosen
[ { "from": "system", "value": "Exclude more characters at the end of a link.\n" }, { "from": "human", "value": "import re\n\nurlExp = re.compile(\"(\\w+)://[^ \\t\\\"'<>]+[^ \\t\\\"'<>,.]\")\n\ndef URLToTag(message):\n\t\"\"\"\n\t\tsearches for an URL in message and sets an <a>-tag arround\n\t\ti...
python
chosen
[ { "from": "system", "value": "Bump minor release number, thanks to @lanjelot's fixes\n" }, { "from": "human", "value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\n\nsetup(\n name='paddingoracle',\n author='Marcin Wielgoszewski',\n ...
python
chosen
[ { "from": "system", "value": "Update project url after github maintainer renaming\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport io\n\ntry:...
python
chosen
[ { "from": "system", "value": "Make sure the code is rebuilt if quaternion.h changes\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n# Copyright (c) 2014, Michael Boyle\n# See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE>\n\nfrom auto_version impo...
python
chosen
[ { "from": "system", "value": "Make sure protobuf comes from pypi\n\nWithout this, it gets the outdated zip package from googlecode and fail.\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport glob\nimport os\nimport subprocess\nimport platform\nfrom setuptools import setup, find_pa...
python
chosen
[ { "from": "system", "value": "Tweak output file name of source distribution.\n" }, { "from": "human", "value": "#\n# This file is part of Python-AD. Python-AD is free software that is made\n# available under the MIT license. Consult the file \"LICENSE\" that is\n# distributed together with this ...
python
chosen
[ { "from": "system", "value": "Add pytest-cov and fix change requirements to >=\n" }, { "from": "human", "value": "from codecs import open as codecs_open\nfrom setuptools import setup, find_packages\n\n\nwith codecs_open('README.md', encoding='utf-8') as f:\n long_description = f.read()\n\n\ns...
python
chosen
[ { "from": "system", "value": "Implement PEP 246 compliant environment markers\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nfrom setuptools import setup\n\ntry:\n from unittest import mock # noqa\nexcept:\n kwargs = {\n 'tests_require': 'moc...
python
chosen
[ { "from": "system", "value": "Add configparser to the install_requires list.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nrequires = [\n 'python-dateutil',\n 'pytz',\n 'requests',\n 'simplejson'\n]\n\nsetup(\n name='amaascore',\n version='0....
python
chosen
[ { "from": "system", "value": "Fix having special characters in login/password field.\n\nSigned-off-by: thomnico <5d7b651831a7f5cf7c72a23146042589c88b16b7@googlemail.com>\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\ndef readme():\n with open('RE...
python
chosen
[ { "from": "system", "value": "Fix install versions of pytest and pylint\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\npytest-pylint\n=============\n\nPlugin for py.test for doing pylint tests\n\"\"\"\n\nfrom setuptools import setup\n\nsetup(\n name='pytest-pylint',\n ...
python
chosen
[ { "from": "system", "value": "Fix broken test after blast web removal\n" }, { "from": "human", "value": "import unittest\nfrom unittest import mock\nfrom io import StringIO\nfrom cref.sequence.alignment import Blast\n\n\nclass AlignmentTestCase(unittest.TestCase):\n\n def test_blast_local(sel...
python
chosen
[ { "from": "system", "value": "Refactor thread based concurrency tests\n" }, { "from": "human", "value": "'''\n@author: Rahul Tanwani\n\n@summary: Test cases to make sure sequential execution and concurrent execution return\n the same response.\n'''\nimport json\nfrom tests.test_base imp...
python
chosen
[ { "from": "system", "value": "Support for Python 2.7 and PyPy in the classifiers!\n\n✨\n" }, { "from": "human", "value": "import sys\nfrom setuptools import setup, find_packages\n\n# defines __version__\nexec(open(\"h11/_version.py\").read())\n\nsetup(\n name=\"h11\",\n version=__version__...
python
chosen
[ { "from": "system", "value": "Increment version to trigger release of previous changes\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\n\nwith open(path.join(here, 'README....
python
chosen
[ { "from": "system", "value": "Copy default plugins and extend\n" }, { "from": "human", "value": "import cursingspock\nfrom spockbot import Client\nfrom spockbot.plugins import default_plugins as plugins\nfrom bat import bat, command\n\nplugins.extend([\n ('bat', bat.BatPlugin),\n ('command...
python
chosen
[ { "from": "system", "value": "Reduce number of entries shown on index\n" }, { "from": "human", "value": "from django.contrib.auth.decorators import login_required\nfrom django.http import Http404\nfrom django.shortcuts import render, get_list_or_404\nfrom django.db.models import Q\nfrom .models ...
python
chosen
[ { "from": "system", "value": "Fix migration if no language exists\n" }, { "from": "human", "value": "# Generated by Django 2.2.20 on 2021-08-25 08:18\nfrom django.db import migrations\nfrom bluebottle.clients import properties\n\n\ndef set_default(apps, schema_editor):\n try: \n Langua...
python
chosen
[ { "from": "system", "value": "Fix to use Root Page vs Body Component\n" }, { "from": "human", "value": "\"\"\"\nchime_dash/app\n\ndash instance defined here\n\"\"\"\n\nfrom dash import Dash\nfrom typing import TypeVar\nfrom chime_dash.app.config import from_object\nfrom penn_chime.settings impor...
python
chosen
[ { "from": "system", "value": "Complete recur w/ time/space complexity\n" }, { "from": "human", "value": "\"\"\"Leetcode 226. Invert Binary Tree\nEasy\n\nURL: https://leetcode.com/problems/invert-binary-tree/\n\nInvert a binary tree.\n\nExample:\n\nInput:\n\n 4\n / \\\n 2 7\n / \\ ...
python
chosen
[ { "from": "system", "value": "Add comment to like_num re: future work\n" }, { "from": "human", "value": "# coding: utf8\nfrom __future__ import unicode_literals\n\nfrom ...attrs import LIKE_NUM\n\n\n_num_words = set(\"\"\"\nnul een één twee drie vier vijf zes zeven acht negen tien elf twaalf der...
python
chosen
[ { "from": "system", "value": "Call a spade a spade.\n" }, { "from": "human", "value": "from os.path import join, normpath\n\nfrom .base import SITE_ROOT\n\n\nclass LocalStatic(object):\n \"\"\" Static File Configuration \"\"\"\n \n # See: https://docs.djangoproject.com/en/dev/ref/settin...
python
chosen
[ { "from": "system", "value": "api: Allow overriding database URI from command line\n\nSigned-off-by: Kai Blin <ad3597797f6179d503c382b2627cc19939309418@biosustain.dtu.dk>\n" }, { "from": "human", "value": "from flask import Flask\n\nDB_CONNECTION = \"host='localhost' port=5432 user='postgres' pa...
python
chosen
[ { "from": "system", "value": "Configure documentation version for release." }, { "from": "human", "value": "\"\"\"\nFunctions that return external URLs, for example for the Vesper documentation.\n\"\"\"\n\n\nimport vesper.version as vesper_version\n\n\n_USE_LATEST_DOCUMENTATION_VERSION = True\n\...
python
chosen
[ { "from": "system", "value": "Fix problems w/ class variables and fix bug with max function on an empty set\n" }, { "from": "human", "value": "from database import QuizDB\n\ndb = QuizDB(host=config.REDIS_HOST, port=config.REDIS_PORT)\n\nclass Quiz(Base):\n def __init__(self, id):\n sel...
python
chosen
[ { "from": "system", "value": "Update for cached_method so it doesn't try to do anythin if the first argument doesn't have an ID attribute\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.cache import cache\nfrom functools import wraps\n\n\ndef cached_method(c...
python
chosen
[ { "from": "system", "value": "FIX: Remove new instnace of 'controls' from status test.\n" }, { "from": "human", "value": "from ophyd.controls.ophydobj import StatusBase\n\n\ndef _setup_st():\n st = StatusBase()\n state = {}\n\n def cb():\n state['done'] = True\n\n return st, s...
python
chosen
[ { "from": "system", "value": "Remove \"recursive symlink detected\" UserWarning\n" }, { "from": "human", "value": "import os\nfrom pathlib import Path\nfrom typing import Iterable, Iterator, List, Set\nfrom warnings import warn\n\nfrom isort.settings import Config\n\n\ndef find(\n paths: Iter...
python
chosen
[ { "from": "system", "value": "Fix initial buf variable to act as an array\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n\ndef merge_sort(lyst):\n buf = [len(lyst)]\n _merge_sort(lyst, buf, 0, len(lyst)-1)\n\n\ndef _merge_sort(lyst, buf, low, high):\n ...
python
chosen
[ { "from": "system", "value": "Rename Output + smaller Register\n" }, { "from": "human", "value": "#!python3\nfrom methods import output, data\nimport tokenz\n\nimport interpreter\n\nintp = interpreter.Interpreter()\n\nclass UndefinedFunctionError(Exception): pass\n\n\n\nclass Call:\n def __in...
python
chosen
[ { "from": "system", "value": "Fix firefox invocation as browser\n" }, { "from": "human", "value": "import os.path, os\n\ndef run_as_browser(fn):\n def wrapped(*args, **kwargs):\n rv = fn(*args, **kwargs)\n return 'sudo -Hiu browser %s' % rv\n return wrapped\n\nclass Helpers:\...
python
chosen
[ { "from": "system", "value": "Add test to model Profile\n" }, { "from": "human", "value": "from django.test import TestCase\n\n# Create your tests here.\n" }, { "from": "gpt", "value": "from django.test import TestCase\nfrom core.models import Profile, User\n\n\nclass ProfileTestCase...
python
chosen
[ { "from": "system", "value": "Remove some API tests for now\n" }, { "from": "human", "value": "import os\nimport json\n\nfrom django.core.urlresolvers import reverse\nfrom rest_framework import status\nfrom rest_framework.test import APITestCase\n\nTEST_IMAGES = ['1.jpg', '2.jpg', '3.jpg', '4.jp...
python
chosen
[ { "from": "system", "value": "Make sure exists always resturns None in the non-existant test case\n" }, { "from": "human", "value": "from unittest import TestCase\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nfrom configstore.backends.docker_secret import DockerSe...
python
chosen
[ { "from": "system", "value": "[PeasDemo] Fix a typo in the python plugin.\n\nIt was indicating \"do_activate\" in the console when actually\ndeactivating the plugin.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# ex:set ts=4 et sw=4 ai:\n\nimport gobject\nimport libpeas\nimport gt...
python
chosen
[ { "from": "system", "value": "Configure Flask from global config\n" }, { "from": "human", "value": "import os\n\nfrom flask import Flask\n\nfrom molly.config import ConfigLoader\nfrom molly.apps.homepage import App as Homepage\n\nflask_app = Flask(__name__)\n\nwith open(os.environ.get('MOLLY_CON...
python
chosen
[ { "from": "system", "value": "Fix for SQLite3 foreign keys.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nNodular provides a Flask-SQLAlchemy database object that all models in\nyour app must use. Typical usage::\n\n from nodular import db\n from coaster.sqlalchemy ...
python
chosen
[ { "from": "system", "value": "Use canonical matplotlib.pyplot as plt.\n" }, { "from": "human", "value": "import tables\nimport tables as tb\nimport fipy\nimport fipy as fp\nimport numpy\nimport numpy as np\nimport scipy\nimport scipy as sp\nimport pylab\nimport pylab as pl\n\n" }, { "fro...
python
chosen
[ { "from": "system", "value": "dist/docker: Use stdout as logging output\n\nIf early startup fails in docker-entrypoint.py, the container does not\nstart. It's therefore not very helpful to log to a file _within_ the\ncontainer...\n\nMessage-Id: <f797be0a54dde0f854601eff980092b84c77ada6@scylladb.com>\n" },...
python
chosen