conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Revert \"bump to 1.2 after shell revert\"\n\nThis reverts commit e2fcb76f6f6ee99a98ee529917959235576e2d07.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='pbdeploy',\n description='a port-based deployment framework for practic...
python
chosen
[ { "from": "system", "value": "Add project URL to the distribution info\n" }, { "from": "human", "value": "import codecs\nimport os\nfrom setuptools import setup, find_packages\n\n\ndef read(filename):\n filepath = os.path.join(os.path.dirname(__file__), filename)\n return codecs.open(filep...
python
chosen
[ { "from": "system", "value": "Add package resources for subcommands\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nwith open('README.rst', 'r', encoding='utf-8') as f:\n long_description = f.read()\n\n\nsetup(\n name='jacquard',\n version='0.1.0',\n ...
python
chosen
[ { "from": "system", "value": "Use package_data for data files.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\ndef read(fname1, fname2):\n if os.path.exists(fname1):\n fname = fname1\n else:\n fname = fname2\n return open(os.path.join(os.path....
python
chosen
[ { "from": "system", "value": "Include *.js and *.jinja files in sdist packages\n" }, { "from": "human", "value": "\"\"\"\n----------------\n Flask-Mustache\n----------------\n\n`Mustache`__ integration for Flask.\n\n__ http://mustache.github.com/\n\nFlask-Mustache adds template helpers and cont...
python
chosen
[ { "from": "system", "value": "Update language trove classifier list to include Python 3\n\nThe Python 3.x support is now reasonably well-tested (74% coverage), so this closes #5.\n" }, { "from": "human", "value": "from setuptools import setup\n\nfrom timebook import get_version\n\nsetup(\n na...
python
chosen
[ { "from": "system", "value": "Build for either python 2 or python 3\n" }, { "from": "human", "value": "##\n# Copyright (c) 2006-2007 Apple Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the ...
python
chosen
[ { "from": "system", "value": "Correct name of extras package for hypothesis.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='qual',\n version='0.1',\n description='Calendar stuff',\n url='http://github.com/jwg4/qual',\n author='Jack Grahl',\n a...
python
chosen
[ { "from": "system", "value": "Copy readme.md to readme when building\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom setuptools import setup\n\nsetup(name = \"MarkdownPP\",\n description = \"Markdown preprocessor\",\n version = \"1.0\",\n ...
python
chosen
[ { "from": "system", "value": "Fix PyPI README.MD showing problem.\n\nThere is a problem in the project's pypi page. To fix this I added the following line in the setup.py file:\r\n```python\r\nlong_description_content_type='text/markdown'\r\n```" }, { "from": "human", "value": "from os.path impo...
python
chosen
[ { "from": "system", "value": "Use version 0.2.3 of schemer and bump the version number to 0.7.14 in the process\n" }, { "from": "human", "value": "import setuptools\n\n\nsetuptools.setup(\n name=\"Mongothon\",\n version=\"0.7.13\",\n author=\"Tom Leach\",\n author_email=\"tom@gc.io\"...
python
chosen
[ { "from": "system", "value": "Add webargs requirement, and sort requirements.\n" }, { "from": "human", "value": "import re\nimport subprocess\n\nfrom setuptools import setup\n\n\ndef _get_git_description():\n try:\n return subprocess.check_output([\"git\", \"describe\"]).decode(\"utf-8...
python
chosen
[ { "from": "system", "value": "Use function 'findpackages' to collect packages.\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nimport keyvaluestore\n\nsetup(\n name=\"django-keyvaluestore\",\n version=keyvaluestore.__version__,\n ur...
python
chosen
[ { "from": "system", "value": "Allow overriding doc type defaults\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport json\n\nfrom elasticsearch import (\n Elasticsearch,\n TransportError\n)\n\nELASTICSEARCH_URL = \"localhost...
python
chosen
[ { "from": "system", "value": "Develop here. Belongs in top level Orthologs Project.\n" }, { "from": "human", "value": "\nfrom setuptools import setup, find_packages\n# To use a consistent encoding\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\nPACK...
python
chosen
[ { "from": "system", "value": "Clear caches on DynamicRateDefinition deletion for completeness\n\nand to help with tests\n" }, { "from": "human", "value": "from django.db import models\n\n\nclass DynamicRateDefinition(models.Model):\n key = models.CharField(max_length=512, blank=False, null=Fa...
python
chosen
[ { "from": "system", "value": "Remove outdated Python 3.4 classifier.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\n\nwith open('README.rst') as f:\n readme = f.read()\n\nsetup(\n name='django-session-cleanup',\n version='2.0...
python
chosen
[ { "from": "system", "value": "Simplify the definision of install_requires\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\ninstall_requires = []\nwith open(\"requirements.txt\") as fp:\n for s in fp:\n install_requires.append(s....
python
chosen
[ { "from": "system", "value": "Upgrade dependency appdirs to ==1.4.1\n" }, { "from": "human", "value": "import os\n\nfrom setuptools import setup\n\nfrom withtool import __version__\n\n\ndef read(fname):\n path = os.path.join(os.path.dirname(__file__), fname)\n with open(path, encoding='utf...
python
chosen
[ { "from": "system", "value": "Change project name to avoid pypi conflict\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom __future__ import with_statement\n\nimport sys\n\nfrom setuptools import setup, find_packages\n\nlong_description = \"\"\"\nPypimirror - A Pypi mirror script ...
python
chosen
[ { "from": "system", "value": "BUILD: Tag 0.2 for correct org.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nfrom sys import version_info\n\n\ndef install_requires():\n requires = [\n 'traitlets>=4.1',\n 'six>=1.9.0',\n 'pyyaml>=3.11',\n ...
python
chosen
[ { "from": "system", "value": "Allow using redis-py 2.7.4 (lowest revision with set keyword arguments)." }, { "from": "human", "value": "# -*- encoding: utf8 -*-\nfrom setuptools import setup, find_packages\n\nimport os\n\nsetup(\n name = \"python-redis-lock\",\n version = \"0.1.1\",\n u...
python
chosen
[ { "from": "system", "value": "Add undeclared dependency on GenomicConsensus\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name = 'CorrelatedVariants',\n version = '0.1.0',\n author = 'Pacific Biosciences',\n author_email = 'devnet@pacificb...
python
chosen
[ { "from": "system", "value": "Add missing project URL to the project meta\n" }, { "from": "human", "value": "import setuptools\n\n\ndef content_of(fpath):\n with open(fpath, 'r') as fd:\n return fd.read()\n\n\nsetuptools.setup(\n name='tox-battery',\n description='Additional func...
python
chosen
[ { "from": "system", "value": "Add third place in version number, why not\n" }, { "from": "human", "value": "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.o...
python
chosen
[ { "from": "system", "value": "Bump version for bug fixes\n" }, { "from": "human", "value": "\"\"\"\nA multi-user, multi-group task management and assignment system for Django.\n\"\"\"\n__version__ = '1.6'\n\n__author__ = 'Scot Hacker'\n__email__ = 'shacker@birdhouse.org'\n\n__url__ = 'https://gi...
python
chosen
[ { "from": "system", "value": "Fix return statement for `invite`\n" }, { "from": "human", "value": "import json\nfrom slackipycore import invite, get_team_info\nfrom slackipycore import (AlreadyInTeam, InvalidInviteeEmail,\n InvalidAuthToken, AlreadyInvited, APIRequestErr...
python
chosen
[ { "from": "system", "value": "Set MIDDLEWARE_CLASSES to empty list\n" }, { "from": "human", "value": "import os\n\nPROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': os.pa...
python
chosen
[ { "from": "system", "value": "Handle only /client requests to file serving.\n" }, { "from": "human", "value": "import SimpleHTTPServer\nimport SocketServer\n\n\nclass KcaaHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n\n def do_HEAD(self):\n # Note: HTTP request handle...
python
chosen
[ { "from": "system", "value": "Correct the HTTP status from GET / - it should be 300 (Multiple Choices) not 200. Implement the details of a given version.\n" }, { "from": "human", "value": "from webob import Response\nfrom apiversion import APIVersion\nfrom application import Application\nfrom ap...
python
chosen
[ { "from": "human", "value": "Add Dijkstra implementation of shortest path.\n" }, { "from": "gpt", "value": "from simple_graph.weighted_graph import Wgraph\n\n\ndef dijkstra(weighted_graph, start, end):\n\n list_of_tuples_node_totalweight = []\n list_of_tuples_node_totalweight.append((start...
python
chosen
[ { "from": "system", "value": "Add tests for nonlistening addresses as well.\n" }, { "from": "human", "value": "import socket\n\nimport pytest\n\nimport portend\n\n\ndef socket_infos():\n\t\"\"\"\n\tGenerate addr infos for connections to localhost\n\t\"\"\"\n\thost = ''\n\tport = portend.find_ava...
python
chosen
[ { "from": "system", "value": "Allow HeaderRegexp to be imported directly from header_filter package.\n" }, { "from": "human", "value": "from header_filter.matchers import Header # noqa: F401\nfrom header_filter.middleware import HeaderFilterMiddleware # noqa: F401\nfrom header_filter.rules imp...
python
chosen
[ { "from": "system", "value": "Add Path to Vulk package\n" }, { "from": "human", "value": "\"\"\"Vulk 3D engine\n\nCross-plateform 3D engine\n\"\"\"\n__version__ = \"0.2.0\"\n" }, { "from": "gpt", "value": "\"\"\"Vulk 3D engine\n\nCross-plateform 3D engine\n\"\"\"\nfrom os import path...
python
chosen
[ { "from": "system", "value": "Store files in /tmp/ and fetch API key from $HOME\n" }, { "from": "human", "value": "import os\nimport urllib\nimport requests\n\nfrom api_key import API_KEY\n\nfrom IPython import embed as qq\n\nURL = \"https://bingapis.azure-api.net/api/v5/images/search\"\nNUMBER_...
python
chosen
[ { "from": "system", "value": "Use no_async api to query if a chat member is a group admin\n" }, { "from": "human", "value": "from bot.action.core.action import IntermediateAction\nfrom bot.api.domain import Message\n\n\nclass GroupAdminAction(IntermediateAction):\n def process(self, event):\n...
python
chosen
[ { "from": "system", "value": "Remove debugging code, not needed outside of DEV\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\n\"\"\"Documentation about the module... may be multi-line\"\"\"\n\nfrom registration.backends.hmac.views import RegistrationView as BaseRegistrationView\nfr...
python
chosen
[ { "from": "system", "value": "Support python 2 with io.open\n" }, { "from": "human", "value": "import os.path\nimport yaml\nfrom sphinx.util.osutil import ensuredir\n\n\ndef create_directory(app):\n ''' Creates the yaml directory if necessary '''\n app.env.yaml_dir = os.path.join(app.build...
python
chosen
[ { "from": "system", "value": "Add redirect from site base url to admin index for now\n" }, { "from": "human", "value": "\"\"\"winthrop URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.10/topics/http/urls/\...
python
chosen
[ { "from": "system", "value": "Add NORM as influence function\n" }, { "from": "human", "value": "import numpy as np\nfrom ..util import linalgebra\n\ndef w(problem,X,type):\n \n if type == \"ONE\":\n return 1.\n if type == \"EXP\":\n len = linalgebra.norm(X)\n retur...
python
chosen
[ { "from": "system", "value": "Make code follow the Python style guidelines\n\n+ Use a doc string for the whole file.\n\n+ Lower case function names.\n\n+ Consistently use single-quotes for quoted strings.\n\n+ align wrapped elements with opening delimiter.\n\n+ use a main() function\nReview URL: https://chr...
python
chosen
[ { "from": "system", "value": "Raise exception if unable to find a usable key in property mapping dict\n" }, { "from": "human", "value": "from types import UnicodeType, StringType\n\nclass PropertyMappingFailedException(Exception):\n pass\n\ndef get_transformed_properties(source_properties, pr...
python
chosen
[ { "from": "system", "value": "Fix RichTextField form field generation.\n\nAll standard properties that would affect formfield were being ignored\n(such as blank=True).\n" }, { "from": "human", "value": "from django import forms\nfrom django.db import models\n\n\nclass RichTextFormField(forms.fie...
python
chosen
[ { "from": "system", "value": "Make use of the return value of begin() and measure()" }, { "from": "human", "value": "import NDIR\nimport time\n\nsensor = NDIR.Sensor(0x4D)\nsensor.begin()\n\nwhile True:\n sensor.measure()\n print(\"CO2 Concentration: \" + str(sensor.ppm) + \"ppm\")\n ti...
python
chosen
[ { "from": "system", "value": "Clean up the erepl code a little bit.\n" }, { "from": "human", "value": "# Use with\n# py -i etiquette_easy.py\n\nimport etiquette\nimport os\nimport sys\n\nP = etiquette.photodb.PhotoDB()\nimport traceback\n\ndef easytagger():\n while True:\n i = input('>...
python
chosen
[ { "from": "system", "value": "Move framework downloads to github release\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys\nimport os\n\nfrom lib.util import safe_mkdir, extract_zip, tempdir, download\n\n\nSOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file_...
python
chosen
[ { "from": "system", "value": "Remove choices for any number of updates.\n" }, { "from": "human", "value": "from django.db import models\nfrom cms.models import CMSPlugin\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Update(models.Model):\n \"\"\"\n Defines a date on w...
python
chosen
[ { "from": "system", "value": "Fix no notification service client issue.\n" }, { "from": "human", "value": "import os\nimport traceback\nfrom django.utils import timezone\nfrom django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer\n\n\ndef no_action(msg):\n pass...
python
chosen
[ { "from": "system", "value": "Remove standard imports from check in init\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# encoding: utf-8\n\ntry:\n import argparse\n import configparser\n import mimetypes\n import os\n import re\n import shutil\n import signal\n ...
python
chosen
[ { "from": "system", "value": "Put numpy namespace in scipy for backward compatibility...\n\ngit-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@1530 d6536bca-fef9-0310-8506-e4c0a848fbcf\n" }, { "from": "human", "value": "\"\"\"\\\nSciPy --- A scientific computing package for Python\n===========...
python
chosen
[ { "from": "system", "value": "Raise NotImplementedError instead of just passing in AttributeObject\n\nThat way, if somebody uses it directly, it will fail with a proper error.\n" }, { "from": "human", "value": "class AttributeObject:\n def __init__(self, *excluded_keys):\n self._exclud...
python
chosen
[ { "from": "system", "value": "Test version of web package. See cinch.py for usage.\n" }, { "from": "human", "value": "#!/usr/bin/python3\n\"\"\"\nConfiguration settings for server.py.\n\"\"\"\nHOSTNAME = \"localhost\"\nPORT = 8080\t\t\t\t\t# integer\n\nOK_RESPONSE = 200\n\n" }, { "from":...
python
chosen
[ { "from": "system", "value": "Revert \"Move build.branch-names to project settings\"\n\nThis reverts commit a38fc17616ae160aa41046470964034294eade1a.\n" }, { "from": "human", "value": "import logging\n\nfrom flask import current_app\nfrom fnmatch import fnmatch\n\nfrom changes.api.build_index im...
python
chosen
[ { "from": "system", "value": "Switch off weird AEP-1.0 model-renaming bullshit.\n\ngit-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@295 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff\n" }, { "from": "human", "value": "from ragendja.settings_pre import *\n\nimport environment\n\nMEDIA_VERSION = enviro...
python
chosen
[ { "from": "system", "value": "Use __repr__ instead of __str__ to print setting's value\n" }, { "from": "human", "value": "class Settings(object):\n def __init__(self):\n self._settings = {}\n\n def __setattr__(self, name, value):\n if name != '_settings':\n self._s...
python
chosen
[ { "from": "system", "value": "Make Container widgets take children as the first positional argument\n\nThis makes creating containers less cumbersome: Container([list, of, children]), rather than Container(children=[list, of, children])\n" }, { "from": "human", "value": "\"\"\"ContainerWidget cl...
python
chosen
[ { "from": "system", "value": "Tweak kv migration to improve compatibility across Django versions\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport jsonfield.fields\n\n\nclass Migration(migration...
python
chosen
[ { "from": "system", "value": "Allow to disable events persistence at app class" }, { "from": "human", "value": "from abc import abstractmethod, ABCMeta\n\nfrom six import with_metaclass\n\nfrom eventsourcing.infrastructure.event_store import EventStore\nfrom eventsourcing.infrastructure.persiste...
python
chosen
[ { "from": "system", "value": "Update GitHub access token on each login\n" }, { "from": "human", "value": "import github3\nfrom flask import render_template, current_app, redirect, url_for\nfrom flask.ext.login import login_user, logout_user, login_required\n\nfrom kozmic import db\nfrom kozmic.m...
python
chosen
[ { "from": "system", "value": "Transform sentences to arrays of words\n" }, { "from": "human", "value": "from os import listdir\nfrom os.path import join\n\ndef file_paths(data_path):\n return [join(data_path, name) for name in listdir(data_path)]\n\ndef training_data(data_path):\n paths = file...
python
chosen
[ { "from": "system", "value": "Use shutil instead of `os.rename`\n" }, { "from": "human", "value": "import os\nimport argparse\nfrom astropy.utils import data\nfrom astroplan import download_IERS_A\n\n\ndef download_all_files(data_folder=\"{}/astrometry/data\".format(os.getenv('PANDIR'))):\n d...
python
chosen
[ { "from": "system", "value": "Correct test to support changing N release name\n\noslo.log is going to change to use Newton rather than N so this test\nshould not make an assumption about the way that\nversionutils.deprecated is calling report_deprecated_feature.\n\nChange-Id: I06aa6d085232376811f73597b2d84b...
python
chosen
[ { "from": "system", "value": "Make sure ssh config directory exists\n" }, { "from": "human", "value": "\n__all__ = [\"SSHKnownHost\", \"SSHAuthorizedKey\"]\n\nimport os.path\nfrom kokki import *\n\nclass SSHKnownHost(Resource):\n provider = \"*ssh.SSHKnownHostProvider\"\n\n action = Forced...
python
chosen
[ { "from": "system", "value": "Throw 500 error on multiple accounts in account context processor\n" }, { "from": "human", "value": "\nfrom account.models import Account, AnonymousAccount\n\ndef openid(request):\n return {'openid': request.openid}\n\ndef account(request):\n if request.user.i...
python
chosen
[ { "from": "system", "value": "Update sim hooks for 2018\n" }, { "from": "human", "value": "from hal_impl.data import hal_data\n\nclass PyFrcFakeHooks:\n '''\n Defines hal hooks that use the fake time object\n '''\n \n def __init__(self, fake_time):\n self.fake_time = fa...
python
chosen
[ { "from": "system", "value": "Use correct auth in cycles view, now that API permissions are fixed.\n" }, { "from": "human", "value": "from django.template.response import TemplateResponse\n\nfrom ..products.models import Product\nfrom ..static import testcyclestatus\nfrom ..users.decorators impo...
python
chosen
[ { "from": "system", "value": " Divide two numbers using python code\n" }, { "from": "human", "value": "def divide(a, b):\n return a / b\n\nprint divide(20, 2)\n" }, { "from": "gpt", "value": "num1 = input('Enter first number: ')\nnum2 = input('Enter second number: ')\n\n\n\nif num...
python
chosen
[ { "from": "system", "value": "Add basic breadth first return\n" }, { "from": "human", "value": "import math\n\n\ndef succ_fcn(x):\n \"\"\"\n takes an element of the Calkin Wilf tree and returns the next element\n following a breadth first traversal\n \"\"\"\n return 1 / (math.floo...
python
chosen
[ { "from": "system", "value": "Remove history domain in partner in eamil module.\n\nbzr revid: ysa@tinyerp.com-20110204091248-wnzm7ft6cx3v34p1" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP,...
python
chosen
[ { "from": "system", "value": "[LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text\n\n- Preserved explicit 3rd-party copyright notices\n- Explicit boilerplate should not be necessary - copyright law applies\n automatically in all countries thanks to Berne Convention + WTO rules,\n and a ref...
python
chosen
[ { "from": "system", "value": "Format in PowerlineLogger._log, not in pl.exception arguments\n" }, { "from": "human", "value": "# vim:fileencoding=utf-8:noet\n\nfrom subprocess import Popen, PIPE\n\n\ndef run_cmd(pl, cmd, stdin=None):\n\ttry:\n\t\tp = Popen(cmd, stdout=PIPE, stdin=PIPE)\n\texcept...
python
chosen
[ { "from": "system", "value": "Allow to enable graphical UI via command line option.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Run the Better Bomb Defusal Manual\n\n:Copyright: 2015 Jochen Kupperschmidt\n:License: MIT, see LICENSE for details.\n\"\...
python
chosen
[ { "from": "system", "value": "Change services number in test\n" }, { "from": "human", "value": "from hamcrest import *\nfrom nose.tools import nottest\n\nfrom test.features import BrowserTest\n\n\nclass test_create_pages(BrowserTest):\n\n def test_about_page(self):\n self.browser.visit...
python
chosen
[ { "from": "system", "value": "Add a read_dict function if it does not exist\n\nThis is used for testing purposes, but when we drop Py2 support we can\nmore easily remove it here than worrying about removing a monkeypatch in\nthe testing code.\n" }, { "from": "human", "value": "# flake8: noqa\n\n...
python
chosen
[ { "from": "system", "value": "Allow test for analytics to deal with compiled JS\n" }, { "from": "human", "value": "import mock\nfrom nose.tools import assert_equal, assert_true\nfrom ..helpers import BaseApplicationTest\n\n\nclass TestApplication(BaseApplicationTest):\n def setup(self):\n ...
python
chosen
[ { "from": "system", "value": "Return empty Configuration instance when .marten/ directory is missing\n" }, { "from": "human", "value": "\"\"\"Stupid simple Python configuration management\"\"\"\n\nfrom __future__ import absolute_import\n\nimport os as _os\n\n__version__ = '0.5.0'\n\n\n\n# Attemp...
python
chosen
[ { "from": "system", "value": "Use absolute value for E and logscale\n" }, { "from": "human", "value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nparser = argparse.ArgumentParser(description='Plot data from output of the...
python
chosen
[ { "from": "system", "value": "[infra] Add .bat to pub command on Windows\n\n#32656\n\nChange-Id: I3a34bf2c81676eea0ab112a8aad701962590a6c3\nReviewed-on: https://dart-review.googlesource.com/55165\nCommit-Queue: Alexander Thomas <29642742b6693024c89de8232f2e2542cf7eedf7@google.com>\nReviewed-by: William Hess...
python
chosen
[ { "from": "system", "value": "Exclude Python 2 specific code from pep8\n" }, { "from": "human", "value": "import sys\n\nPY3 = sys.version_info[0] == 3\n\nif PY3:\n def is_nonstr_iter(v):\n if isinstance(v, str): # pragma: no cover\n return False\n return hasattr(v, '...
python
chosen
[ { "from": "system", "value": "Set Content-Length header in get_file view\n" }, { "from": "human", "value": "# django\nfrom wsgiref.util import FileWrapper\nfrom django.http import HttpResponse, HttpResponseBadRequest\nfrom django.utils.translation import ugettext as _\n# project\nfrom db_file_st...
python
chosen
[ { "from": "system", "value": "Add InfobipError to things exported by Infobip package.\n" }, { "from": "human", "value": "\"\"\"Infobip transport.\"\"\"\n\nfrom vumi.transports.infobip.infobip import InfobipTransport\n\n__all__ = ['InfobipTransport']\n" }, { "from": "gpt", "value": "\...
python
chosen
[ { "from": "system", "value": "Change version schema from 0.12.1dev to 0.12.1a for sake of following pep 440\n" }, { "from": "human", "value": "# This relies on each of the submodules having an __all__ variable.\n\n__version__ = '0.12.1dev'\n\n\nfrom .protocol import * # noqa\nfrom .connector im...
python
chosen
[ { "from": "system", "value": "Set root log level to INFO\n" }, { "from": "human", "value": "import logging.config\n\n\n_logging_config = dict(\n version=1,\n disable_existing_loggers=False,\n formatters={\n 'verbose': {\n 'format': '%(asctime)s [%(levelname)s] %(messag...
python
chosen
[ { "from": "system", "value": "Add task to update policies\n" }, { "from": "human", "value": "from fabric.api import task, local\nfrom buildercore import project\nimport utils\nimport sys\nimport logging\nLOG = logging.getLogger(__name__)\n\ndef vault_addr():\n defaults, _ = project.raw_projec...
python
chosen
[ { "from": "system", "value": "Sort list by recursing through both parts\n\nThe array is split into two parts: everything up to and including\nthe pivot, and everything after the pivot. Sort() is called on\neach part and the resulting arrays are combined and returned. This\nsorts the array.\n" }, { "...
python
chosen
[ { "from": "system", "value": "Use Python PEP 8 naming for derived class.\n\n" }, { "from": "human", "value": "# Input: ${SGE_TASK_ID}\n# Output: generated models in *.B* files, calculated energies in *.E* files\n#\n\nfrom modeller import *\nfrom modeller.automodel import *\nimport sys\n\n# to ge...
python
chosen
[ { "from": "system", "value": "Use absolute resource path in Pyglet\n\nIt appears that a recent change in Pyglet causes relative paths to fail here.\n" }, { "from": "human", "value": "\"\"\"Loads and manages art assets\"\"\"\nimport pyglet\n\n_ASSET_PATHS = [\"res\"]\n_ASSET_FILE_NAMES = [\n \...
python
chosen
[ { "from": "system", "value": "Change to return 'label' not 'name'.\n" }, { "from": "human", "value": "from django.core.urlresolvers import reverse\nfrom django.utils.encoding import smart_unicode\n\n\nclass LookupBase(object):\n\n def _name(cls):\n app_name = cls.__module__.split('.')[...
python
chosen
[ { "from": "system", "value": "Remove code duplication from PD Incident class.\n" }, { "from": "human", "value": "from pagerduty_events_api.pagerduty_rest_client import PagerdutyRestClient\n\n\nclass PagerdutyIncident:\n def __init__(self, service_key, incident_key):\n self.__service_ke...
python
chosen
[ { "from": "system", "value": "Remove ominous TESTING_LOGIN config comment\n" }, { "from": "human", "value": "# TODO @Sumukh Better Secret Management System\n\nclass TestConfig(object):\n DEBUG = True\n SECRET_KEY = 'Testing*ok*server*'\n RESTFUL_JSON = {'indent': 4}\n TESTING_LOGIN =...
python
chosen
[ { "from": "system", "value": "Change back the url so site root is at /imagr again\n" }, { "from": "human", "value": "from django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns('',\n url(r'^', include('imagr.urls', namespace='imagr')),\n ...
python
chosen
[ { "from": "system", "value": "Fix mock Qt objects again\n" }, { "from": "human", "value": "has_qt = True\n\ntry:\n from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets\nexcept ImportError:\n try:\n from matplotlib.backends.qt4_compat import QtGui, QtCore\n QtWid...
python
chosen
[ { "from": "system", "value": "Remove false docstring from common cog.\n" }, { "from": "human", "value": "from collections import OrderedDict\n\nimport threading\n\nfrom joku.bot import Jokusoramame\n\n\nclass _CogMeta(type):\n def __prepare__(*args, **kwargs):\n # Use an OrderedDict fo...
python
chosen
[ { "from": "system", "value": "Update version number for release\n" }, { "from": "human", "value": "__version_info__ = (0, 4, 0, None)\n\n# Dot-connect all but the last. Last is dash-connected if not None.\n__version__ = '.'.join(str(i) for i in __version_info__[:-1])\nif __version_info__[-1] is ...
python
chosen
[ { "from": "system", "value": "conan: Copy find modules to root of module path\n" }, { "from": "human", "value": "from conans import ConanFile\nfrom conans.tools import download, unzip\nimport os\n\nVERSION = \"0.0.2\"\n\n\nclass VeraPPTargetCmakeConan(ConanFile):\n name = \"verapp-target-cmak...
python
chosen
[ { "from": "system", "value": "Add create shopping item form\n" }, { "from": "human", "value": "from wtforms import Form, BooleanField, StringField, PasswordField, validators\nfrom wtforms.validators import DataRequired, InputRequired\n\n\nclass LoginForm(Form):\n username = StringField('usern...
python
chosen
[ { "from": "system", "value": "Fix creation of json for image (pandoc 1.12.3.3)\n\nAt least with pandoc 1.12.3.3 otherwise you get an error\r\n\r\n pandoc: when expecting a [a], encountered Object instead" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"\nPandoc filter to proces...
python
chosen
[ { "from": "system", "value": "Fix typo in name of variable\n" }, { "from": "human", "value": "#!/usr/bin/env python3\nimport os\nfrom datetime import timedelta\n\n_BAYESIAN_JOBS_DIR = os.path.dirname(os.path.realpath(__file__))\n\nDEFAULT_SERVICE_PORT = 34000\nSWAGGER_YAML_PATH = os.path.join(_B...
python
chosen
[ { "from": "system", "value": "Use a much simpler (and faster) output building step.\n\nThis implementation is much easeir to read, and is a lot clearer\nabout what's going on. It turns out that it's about 3 times faster\nin python too!\n" }, { "from": "human", "value": "import random\nimport tim...
python
chosen
[ { "from": "system", "value": "Allow Pro users to specify multiple domains to serve their blog. Specifically for www/non-www setups.\n" }, { "from": "human", "value": "from django.shortcuts import get_object_or_404\nfrom django.contrib.auth.models import User\n\nfrom annoying.functions import get...
python
chosen