conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix dependency specification and update version\n" }, { "from": "human", "value": "#! /usr/bin/env python\n# coding: utf-8\n\nfrom setuptools import find_packages, setup\n\nsetup(name='ego.io',\n author='openego development group',\n author_email='oemof@rl...
python
chosen
[ { "from": "system", "value": "Remove absent extractor from entry points\n" }, { "from": "human", "value": "import sys\nfrom setuptools import setup\nfrom setuptools.command.test import test as TestCommand\n\n\nclass PyTest(TestCommand):\n def finalize_options(self):\n # XXX sometimes T...
python
chosen
[ { "from": "system", "value": "Add isodate to the required dependencies.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\nfrom version import get_git_version\n\nsetup(name='thecut-durationfield',\n author='The Cut', author_email='development@thecut.net.au',\n ...
python
chosen
[ { "from": "system", "value": "Make sure Django is required\n" }, { "from": "human", "value": "import codecs\n\nfrom os import path\nfrom setuptools import find_packages, setup\n\n\ndef read(*parts):\n filename = path.join(path.dirname(__file__), *parts)\n with codecs.open(filename, encodin...
python
chosen
[ { "from": "system", "value": "Add postgresql extra to sqlalchemy\n\nWas implicitly being installed with testcontainers\n" }, { "from": "human", "value": "import re\n\nfrom setuptools import setup, find_packages\n\n\nINIT_FILE = 'pg_grant/__init__.py'\ninit_data = open(INIT_FILE).read()\n\nmetada...
python
chosen
[ { "from": "system", "value": "Update mock requirement from <3.1,>=2.0 to >=2.0,<4.1\n\nUpdates the requirements on [mock](https://github.com/testing-cabal/mock) to permit the latest version.\n- [Release notes](https://github.com/testing-cabal/mock/releases)\n- [Changelog](https://github.com/testing-cabal/mo...
python
chosen
[ { "from": "system", "value": "Include Python 3.2 and 3.3 classifiers.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\n\n\ndef read_file(filename):\n \"\"\"Read a file into a string\"\"\"\n path = os.path.abspath(os.path.dirname(__file__))\n fil...
python
chosen
[ { "from": "system", "value": "Change msgpack-python requirement to msgpack\n\nThis package has been renamed to `msgpack` starting with their `0.5.0` version. The old package seems likely to be deprecated soon, but this change will keep the dependency being updated as intended.\r\n\r\nhttps://pypi.python.org...
python
chosen
[ { "from": "system", "value": "Change filter() to list(filter()) for python 3+\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\n\ndef reqs_from_file(filename):\n with open(filename) as f:\n lineiter = (line.rstrip() for line in f)\n retu...
python
chosen
[ { "from": "system", "value": "Remove shebang line that directed to python2" }, { "from": "human", "value": "#! /usr/bin/env python\n\nfrom setuptools import find_packages, setup\n# import subprocess\n#\n# subprocess.call([\"sudo\", \"apt-get\", \"install\", \"libgeos-dev\"])\n\nsetup(name='dingo...
python
chosen
[ { "from": "system", "value": "Update classifiers for supported Python versions [ci skip]\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\nfrom virtualenvapi import __version__\n\nsetup(\n name='virtualenv-api',\n version=__version__,\n license='BSD',\n ...
python
chosen
[ { "from": "system", "value": "Remove version number for snowballstemmer" }, { "from": "human", "value": "from __future__ import with_statement\nimport os\nfrom setuptools import setup\n\n\nthis_dir = os.path.dirname(__file__)\n\nwith open(os.path.join(this_dir, 'src', 'pydocstyle', 'utils.py')) ...
python
chosen
[ { "from": "system", "value": "Exclude doc from pypi module\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# HACK for `nose.collector` to work on python 2.7.3 and earlier\nimport multiprocessing\nfrom setuptools import setup, find_packages\n\nsetup(name='quantized-mesh-tile',\n ...
python
chosen
[ { "from": "system", "value": "Prepare for new version: 0.3\n" }, { "from": "human", "value": "from distutils.core import setup\nimport os\n\nf = open(\"README.rst\")\ntry:\n try:\n readme_text = f.read()\n except:\n readme_text = \"\"\nfinally:\n f.close()\n\nsetup(name=\"...
python
chosen
[ { "from": "system", "value": "Add more pypi trove classifiers\n" }, { "from": "human", "value": "from setuptools import setup\n\n\nsetup(name='glreg',\n version='0.9.0',\n description='OpenGL XML API registry parser',\n url='https://github.com/pyokagan/pyglreg',\n author='Pau...
python
chosen
[ { "from": "system", "value": "Change version number to '1.0.3'\n\nSigned-off-by: daniel <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@yunify.com>\n" }, { "from": "human", "value": "# coding:utf-8\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name = 'qsctl',\n version = '1.0.2',\n ...
python
chosen
[ { "from": "system", "value": "Update dependencies and add tested version information\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='Supermega',\n version='0.1.0',\n author='Lorenz Bauer',\n packages=['supermega', 'supermega.schemata'],\n # sc...
python
chosen
[ { "from": "system", "value": ":tada: Add optional dependency for collation\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nimport sys\nfrom setuptools import setup, find_packages\n\n\nIS_PY3 = sys.version_info > (3,)\n\n\ninstall_requires = [\n 'jinja2',\n 'lxml',\n ]\ntests...
python
chosen
[ { "from": "system", "value": "Use phonenumberslite and pin to <8.0 Justin Case\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\nsentry-twilio\n=============\n\nA plugin for Sentry which sends SMS notifications via Twilio.\n\n:copyright: (c) 2012 by Matt Robenolt\n:license: BSD, ...
python
chosen
[ { "from": "system", "value": "Add build step to PyPI publish command.\n" }, { "from": "human", "value": "import os\nimport sys\n\nfrom setuptools import setup\n\nif sys.argv[-1] == 'publish':\n os.system('python setup.py sdist upload')\n sys.exit()\n\nimport quill\n\nwith open('README.md',...
python
chosen
[ { "from": "system", "value": "Set umask appropriately for all processes\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\n# obtain o...
python
chosen
[ { "from": "system", "value": "Fix model name for BlogComment after previous refactoring\n" }, { "from": "human", "value": "from .models import BlogPost, Comment\nfrom django.forms import ModelForm\n\nclass BlogPostForm(ModelForm):\n class Meta:\n model = BlogPost\n exclude = ('u...
python
chosen
[ { "from": "system", "value": "Remove `body_html_escaped`.\nAdd rendering filtered by formats.\n" }, { "from": "human", "value": "from base64 import b64encode\n\nfrom django.conf import settings\n\nfrom mail_factory.messages import EmailMultiRelated\n\n\nclass PreviewMessage(EmailMultiRelated):\n...
python
chosen
[ { "from": "system", "value": "Allow specifying test.py flags in 'inv test'\n" }, { "from": "human", "value": "from os import mkdir\nfrom os.path import join\nfrom shutil import rmtree, copytree\n\nfrom invoke import Collection, ctask as task\nfrom invocations.docs import docs, www\nfrom invocati...
python
chosen
[ { "from": "system", "value": "Add kill, list, and create commands\n" }, { "from": "human", "value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport subprocess\nimport argparse\n\n__version__ = 1.0\n__description__ = \"A tmux wrapper featuring shortcuts and session presets.\"\n\...
python
chosen
[ { "from": "system", "value": "Test bad call/better error msg\n" }, { "from": "human", "value": "from __future__ import (absolute_import, division, print_function)\n\nimport subprocess\nimport tempfile\n\n\ndef test_call():\n output = subprocess.check_output(['yaml2ncml', 'roms_0.yaml'])\n ...
python
chosen
[ { "from": "system", "value": "Support for testing robot steering.\n" }, { "from": "human", "value": "\"\"\"A stub for the gopigo module.\"\"\"\n\ncalls = []\n\ndef servo(angle):\n\tcalls.append('servo({0})'.format(angle))\n\ndef set_speed(speed):\n\tcalls.append('set_speed({0}'.format(speed))\n\...
python
chosen
[ { "from": "system", "value": "Make effective_user handle exceptions properly\n\nRight now the context manager is just syntactic sugar - setegid\nand seteuid aren't called if there's an exception.\n\nChange-Id: I9e2f1d0ada00b03099fe60a8735db1caef8527e9\n" }, { "from": "human", "value": "import os...
python
chosen
[ { "from": "system", "value": "Fix gradient checking for softplus op\n\nSummary:\nkmatzen why did you set the stepsize in https://github.com/caffe2/caffe2/commit/ff84e7dea6e118710859d62a7207c06b87ae992e?\n\nThe test is flaky before this change. Solid afterwards.\nCloses https://github.com/caffe2/caffe2/pull/...
python
chosen
[ { "from": "system", "value": "Make math method wrapping nicer\n" }, { "from": "human", "value": "import operator\n\n\ndef math_method(name, right=False):\n def wrapper(self, other):\n value = self.value\n math_func = getattr(operator, name)\n\n if right:\n valu...
python
chosen
[ { "from": "system", "value": "Make taggit case-insensitive by default\n\n" }, { "from": "human", "value": "import os\n\nfrom appconf import AppConf\nfrom django.conf import settings\n\n\nclass DjExperimentAppConf(AppConf):\n DATA_DIR = \"./\"\n BASE_DATA_DIR = os.path.join(settings.BASE_DI...
python
chosen
[ { "from": "system", "value": "Remove custom project name, since it changes copyright statements.\n\nR=qyearsley@chromium.org\n\nReview URL: https://codereview.chromium.org/1212843006.\n" }, { "from": "human", "value": "# Copyright (c) 2015 The Chromium Authors. All rights reserved.\n# Use of thi...
python
chosen
[ { "from": "system", "value": "Add import exception module init.\n\nPiperOrigin-RevId: 421941098\n" }, { "from": "human", "value": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licens...
python
chosen
[ { "from": "system", "value": "Revert debugging changes: clean up tempfiles\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom __future__ import print_function, absolute_import, division\n\nimport os\nimport shutil\nimport subprocess\nimport tempfile\nimport time\nimport unittest2\n\n...
python
chosen
[ { "from": "system", "value": "Add a unicode method for the Nonces\n" }, { "from": "human", "value": "from django.db import models\nfrom django.contrib.auth.models import User\nimport datetime\n\ndef default_expiry_time():\n return datetime.datetime.now() + datetime.timedelta(days=1)\n\ndef rand...
python
chosen
[ { "from": "system", "value": "Fix inverted coordinate bug in Compass .PLT Parser example script\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport sys\n\nimport networkx as nx\n\nfrom matplotlib import pyplot\n\nfrom davies.compass.plt import CompassPltParser\n\n\ndef pltparser(p...
python
chosen
[ { "from": "system", "value": "Add reversion middle ware, but not work.\n" }, { "from": "human", "value": "__author__ = 'weijia'\n\n\nINSTALLED_APPS += (\n 'mptt',\n 'django_mptt_admin',\n 'tagging',\n 'ajax_select',\n 'django_extensions',\n 'geoposition',\n 'obj_sys',\n #...
python
chosen
[ { "from": "system", "value": "Print total number of posts added and total elapsed time\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom django.core.management.base import BaseCommand\n\nfrom planet.management.commands import process_feed\nfrom planet.mode...
python
chosen
[ { "from": "system", "value": "Add loaders and ConfFiles model to public API.\n" }, { "from": "human", "value": "\"\"\"\nNon-init module for doing convenient * imports from.\n\"\"\"\n\nfrom confab.diff import diff\nfrom confab.generate import generate\nfrom confab.pull import pull\nfrom confab.pu...
python
chosen
[ { "from": "system", "value": "Add the 'status_code' attribute to the APIError exception if it's available\n" }, { "from": "human", "value": "from requests.exceptions import HTTPError\n\n\nclass BaseException(Exception):\n pass\n\n\nclass APIError(BaseException, HTTPError):\n \"\"\"\n Th...
python
chosen
[ { "from": "system", "value": "Add StatementDescriptor for card direct payins" }, { "from": "human", "value": "from mangopaysdk.types.payinexecutiondetails import PayInExecutionDetails\n\n\nclass PayInExecutionDetailsDirect(PayInExecutionDetails):\n \n def __init__(self):\n # dir...
python
chosen
[ { "from": "system", "value": "Replace string interpolation with format()\n" }, { "from": "human", "value": "'''\nCreated on Apr 4, 2016\n\n@author: pab\n'''\nimport inspect\nimport numpy as np\n\n\ndef rosen(x):\n \"\"\"Rosenbrock function\n\n This is a non-convex function used as a perfor...
python
chosen
[ { "from": "system", "value": "Fix command line entry point\n" }, { "from": "human", "value": "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\nimport sys\nfrom ubitflashtool.cli import main\nfrom ubitflashtool.gui import open_editor\n\n\nif __name__ == \"__main__\":\n if len(sys.argv) > 1 and...
python
chosen
[ { "from": "system", "value": "Allow _job_manager special object to be overriden by task if desired\n" }, { "from": "human", "value": "import imp\nimport json\nimport sys\n\n\ndef run(task, inputs, outputs, task_inputs, task_outputs, **kwargs):\n custom = imp.new_module(\"custom\")\n\n for ...
python
chosen
[ { "from": "system", "value": "Handle period in url slugs\n" }, { "from": "human", "value": "from django.conf.urls import url\n\nimport core.views\n\nurlpatterns = [\n url(r'^u/(?P<slug>[\\w-]+)/$', core.views.run_fn, name=\"run_fn\"),\n]\n" }, { "from": "gpt", "value": "from djang...
python
chosen
[ { "from": "system", "value": "Update link to institute in footer to say \"Institute for Software Technology\"" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- #\nfrom __future__ import unicode_literals\n\nAUTHOR = u'DLR'\nSITENAME = u'RCE'\nSITEURL = ''\n\nPATH = '...
python
chosen
[ { "from": "system", "value": "Update to make compatible with Python 3\n" }, { "from": "human", "value": "#!/usr/bin/env python\r\n\"\"\"counterid - Simple utility to discover perfmon counter paths\"\"\"\r\n# Compile to EXE using c:\\Python27\\scripts\\pyinstaller.exe -F counterid.py\r\n\r\n__aut...
python
chosen
[ { "from": "system", "value": "Update documentation generator for new directory structure.\n" }, { "from": "human", "value": "#!python3\nimport os, glob, sys\nimport nustack\nimport nustack.doc.gen as gen\n\nexportdir = sys.argv[1]\n\n# Get module names\npath = os.path.join(os.path.dirname(nustac...
python
chosen
[ { "from": "system", "value": "Fix a typo in the variable name\n" }, { "from": "human", "value": "from flask.ext.login import current_user\n\n\ndef create(app=None):\n if current_user.is_authenticated():\n if current_user.admin is True:\n return True\n else:\n ...
python
chosen
[ { "from": "system", "value": "Remove the limitation to the top 100 items.\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport numpy as np\nimport sys\nimport scipy.io as sio\nimport os\nimport operator\n\nbase_dir = '/data/amnh/darwin/'\ncurves_fft_dir = base_dir + 'image_csvs_fft/'...
python
chosen
[ { "from": "system", "value": "Add more HTTP/1.1 status codes\n" }, { "from": "human", "value": "STATUSES = {\n 200: \"200 OK\",\n 201: \"201 Created\",\n 202: \"202 Accepted\",\n 300: \"300 Multiple Choices\",\n 301: \"301 Moved Permanently\",\n 302: \"3...
python
chosen
[ { "from": "system", "value": "Use dict.get not dict[] to fail gracefully\n" }, { "from": "human", "value": "# flake8: noqa\n# This module is how we import settings, and override settings with various\n# precedences.\n\n# First our base.py settings module is imported, with all of the\n# important...
python
chosen
[ { "from": "system", "value": "Fix for AJAX cache bug in IE\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom django.http import HttpResponse\nfrom updateable import settings\n\n\nclass UpdateableMiddleware(object):\n\n def process_request(self, request):\n updateable =...
python
chosen
[ { "from": "system", "value": "Use pkg_resources to resolve the version. Requires that the necessary package metadata have been built before building docs.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport setuptools_scm\n\nextensions = [\n 'sphinx.ex...
python
chosen
[ { "from": "system", "value": "Add links for the document\n" }, { "from": "human", "value": "import time\n\nfrom chainer.training import extension\n\n\ndef observe_value(key, target_func):\n \"\"\"Returns a trainer extension to continuously record a value.\n\n Args:\n key (str): Key ...
python
chosen
[ { "from": "system", "value": "Include is still needed for the url patterns\n" }, { "from": "human", "value": "from django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.contrib.auth.views import login\n\nfrom movies.urls import urlpatterns as movie_urls\n\nurlpatter...
python
chosen
[ { "from": "system", "value": "Update help line and print system number\n" }, { "from": "human", "value": "import sys\nimport datetime\nimport csv\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.conf import settings\nfrom django.utils import timezone\nfrom radio....
python
chosen
[ { "from": "system", "value": "Update to expand exception string\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# TM1py Exceptions are defined here\n\n\nclass TM1pyException(Exception):\n \"\"\" The default exception for TM1py\n\n \"\"\"\n def __init__(self, response, stat...
python
chosen
[ { "from": "system", "value": "Remove unused imports from test_check_get_new\n" }, { "from": "human", "value": "from __future__ import absolute_import, print_function\n\nfrom ..pyautoupdate.launcher import Launcher\nfrom .pytest_skipif import needinternet\nfrom .pytest_makevers import fixture_upd...
python
chosen
[ { "from": "system", "value": "Test runs two jobs and 200 tasks\n" }, { "from": "human", "value": "from antZoo.ant import AntJobRunner\n\nant = AntJobRunner( None )\n\nant.start()\n\nclass Job:\n def __init__( self, source ):\n self.source = source\n\nj = Job( \"/Users/elchupa/code/school/ant...
python
chosen
[ { "from": "system", "value": "Add additional test to increase test coverage\n" }, { "from": "human", "value": "from django.test import TestCase\n\nfrom ..commands.makemessages import Command as MakeMessagesCommand\n\n\nclass CustomMakeMessagesTest(TestCase):\n def test_update_options(self):\n...
python
chosen
[ { "from": "system", "value": ":art: Rename fields and remove verbose_name attr (1st arg is it by default)\n" }, { "from": "human", "value": "import datetime\n\n#from labsys.patients import Patient\n\nfrom django.db import models\n\nclass AdmissionNote(models.Model):\n id_gal = models.CharFiel...
python
chosen
[ { "from": "system", "value": "Update feature kind to account for normalisation and test min_zoom.\n" }, { "from": "human", "value": "# http://www.openstreetmap.org/way/287494678\nz = 18\nx = 77193\ny = 98529\nwhile z >= 16:\n assert_has_feature(\n z, x, y, 'buildings',\n { 'kind...
python
chosen
[ { "from": "system", "value": "Swap order of name and description when listing image types\n\nUses the same order as target types, which puts the most important information,\nthe name, in front.\n\nRefs APPENG-3419\n" }, { "from": "human", "value": "#\n# Copyright (c) SAS Institute Inc.\n#\n# Lic...
python
chosen
[ { "from": "system", "value": "Allow to run get on promise multiple times.\n" }, { "from": "human", "value": "class AsyncApiCommunicator(object):\n def __init__(self, inner):\n self.inner = inner\n\n def call(self, *args, **kwargs):\n tag = self.inner.send(*args, **kwargs)\n ...
python
chosen
[ { "from": "system", "value": "Use mechanize instead of urllib2\n" }, { "from": "human", "value": "import cookielib\nimport os\nimport pickle\nimport urllib2\n\nclass Opener:\n user_agent = u\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; \" + \\\n u\"en-US; rv:1.9.2.11) Gecko/2010101...
python
chosen
[ { "from": "system", "value": "Fix test that wasn't running\n" }, { "from": "human", "value": "import mock\nimport unittest\n\nfrom cumulusci.core.config import ServiceConfig\nfrom cumulusci.core.config import TaskConfig\nfrom cumulusci.tasks.github import PullRequests\nfrom cumulusci.tests.util ...
python
chosen
[ { "from": "system", "value": "Improve db relations:\n- User->UserProfile is One to One\n- UserProfile <-> Teachers/Websites/EclassLessons are Many to Many\n" }, { "from": "human", "value": "from cronos.teilar.models import Departments\nfrom django.contrib.auth.models import User\nfrom django.db ...
python
chosen
[ { "from": "system", "value": "Disable caching on custom images\n" }, { "from": "human", "value": "import logging\n\nimport yorm\nfrom yorm.types import List, Object\n\n\nlog = logging.getLogger(__name__)\n\n\n@yorm.attr(items=List.of_type(Object))\n@yorm.sync(\"data/images/cache.yml\")\nclass Ca...
python
chosen
[ { "from": "system", "value": "Add the prefs and pref url\n" }, { "from": "human", "value": "from django.conf.urls import url\nfrom . import views\nfrom django.conf import settings\n\nurlpatterns=[\n\turl(r'^login/$', views.login, name='login'),\n\turl(r'^logout/$', views.logout, name='logout'),\...
python
chosen
[ { "from": "system", "value": "Refresh page when creating menus, module bi_view_editor\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2017 Onestein (<http://www.onestein.eu>)\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom odoo import api, mo...
python
chosen
[ { "from": "system", "value": "Set content-type header of POST.\n" }, { "from": "human", "value": "import requests\nfrom Adafruit_BMP085 import BMP085\nimport json\n\n#initialise sensor\nprint ('Initialising sensor...')\nbmp = BMP085(0x77, 3) # ULTRAHIRES Mode\n\nprint ('Reading sensor...')\ntem...
python
chosen
[ { "from": "system", "value": "Remove unused test function at top level.\n" }, { "from": "human", "value": "from . import utils\nfrom . import crimetype\n\nfrom .crimetype.tag import CrimeTags\nfrom .geoloc.tag import GeoCoder, get_lat_longs_from_geostrings\nfrom .utils.load_data import load_data...
python
chosen
[ { "from": "system", "value": "Fix process spawn on Mac os, simplify logic\n" }, { "from": "human", "value": "from PIL import Image\nfrom pystray import Icon, Menu, MenuItem\nimport webview\n\nimport sys\nif sys.platform == 'darwin':\n # System tray icon needs to run in it's own process on Mac...
python
chosen
[ { "from": "system", "value": "Fix parent package of io.matlab.\n\n\ngit-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@3963 d6536bca-fef9-0310-8506-e4c0a848fbcf\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distu...
python
chosen
[ { "from": "system", "value": "Read data from correct CSV file.\n" }, { "from": "human", "value": "# Domestic-Workers\n# ================\nimport csv\n\n\ndef read_data(filename):\n \"\"\"\n Read specified csv file, and return it as a list of dicts.\n \"\"\"\n\n with open(filename, 'r...
python
chosen
[ { "from": "system", "value": "fix: Add dists to twine call\n" }, { "from": "human", "value": "\"\"\"PyPI\n\"\"\"\nfrom invoke import run\n\n\ndef upload_to_pypi(\n dists: str = 'sdist bdist_wheel',\n username: str = None,\n password: str = None,\n skip_existing: bool ...
python
chosen
[ { "from": "system", "value": "Update test in case if home page has redirection.\n" }, { "from": "human", "value": "from http import client as http_client\n\nfrom oscar.test.testcases import WebTestCase\nfrom oscar.apps.customer.notifications import services\nfrom oscar.test.factories import User...
python
chosen
[ { "from": "system", "value": "Fix locale_date for the Alpine strftime\n" }, { "from": "human", "value": "# -*- encoding: utf-8\n\"\"\"\nProvides template utilities.\n\"\"\"\n\nimport jinja2\n\nfrom . import markdown as md, plugins\n\n# TODO: Make this a setting\nTEMPLATE_DIR = 'templates'\n\n\n#...
python
chosen
[ { "from": "system", "value": "Apply werkzeug ProxyFix so that request.remote_addr is correct.\n" }, { "from": "human", "value": "import gevent.monkey\ngevent.monkey.patch_all()\n\nimport logging\nhandler = logging.StreamHandler()\nlog_format = '{levelname}:etiquette.{module}.{funcName}: {message...
python
chosen
[ { "from": "system", "value": "Support correctly weird characters in filenames when downloading\n\nThis commit add support for the following:\n- Correctly encoded oData parameter sent to the endpoint.\n- Support for # and % in filenames by using a newer 365 endpoint.\n\nSummary:\n\nCurrent implementation was...
python
chosen
[ { "from": "system", "value": "Fix bug related to creating the log directory\n" }, { "from": "human", "value": "import threading\nimport subprocess\n\n\nclass TestExecutor(threading.Thread):\n \"\"\"\n The general thread to perform the tests executions\n \"\"\"\n\n def __init__(self, ...
python
chosen
[ { "from": "system", "value": "Allow splitting to zero-length parts\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# encoding: utf-8\n\n\n# Splits a word into multiple parts\ndef split_word(word):\n if len(word) < 2:\n raise Exception(\n \"You obviously need at le...
python
chosen
[ { "from": "system", "value": "Add action to select the multiple assemblies.\n" }, { "from": "human", "value": "import pyblish.api\n\n\nclass ValidateMindbenderSingleAssembly(pyblish.api.InstancePlugin):\n \"\"\"Each asset must have a single top-level group\n\n The given instance is test-ex...
python
chosen
[ { "from": "system", "value": "Change to make metaclass clearer\n" }, { "from": "human", "value": "from fields import FieldBase\n\nclass Model(object):\n\n class __metaclass__(type):\n def __init__(cls, name, bases, attrs):\n fields = {}\n for name, value in attrs....
python
chosen
[ { "from": "system", "value": "Remove `import *`. Replace with explicit public interface.\n" }, { "from": "human", "value": "\"\"\"\nplotly\n======\n\nThis module defines functionality that requires interaction between your\nlocal machine and Plotly. Almost all functionality used here will requir...
python
chosen
[ { "from": "system", "value": "Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file)\n\ngit-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@2214 af82e41b-90c4-0310-8c96-b1721e28e2e2\n" }...
python
chosen
[ { "from": "system", "value": "Fix load config from local db config file\n" }, { "from": "human", "value": "import click\n\nfrom .history import clone\nfrom . import config\n\n\ndef validate_remote(ctx, param, value):\n if value:\n try:\n remote, branch = value.split('/')\n ...
python
chosen
[ { "from": "system", "value": "Add comments model to blog\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom django.db import models\nfrom django.utils import timezone\n\n# Create your models here.\n\nclass Post(models.Model):\n author = models.ForeignKey('auth....
python
chosen
[ { "from": "system", "value": "Clarify that self_chosen_courses == enrolled\n\nFixes #75.\n" }, { "from": "human", "value": "from django import forms\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom dal import autocomplete\n\nfrom .models import Course, Options\n\nclass OptionsFor...
python
chosen
[ { "from": "system", "value": "Fix script not working from bash\n" }, { "from": "human", "value": "#!/usr/bin/env python3.5\n\nimport subprocess\n\n\nclass NvidiaCommandsLayerException(Exception):\n pass\n\n\nclass NvidiaCommandsLayer(object):\n @staticmethod\n def set_fan_percentage(\n ...
python
chosen
[ { "from": "system", "value": "Fix issue in Python 2\n" }, { "from": "human", "value": "import venusian\n\n\nclass tween_config(object):\n \"\"\" A decorator which allows developers to annotate tween factories. \"\"\"\n\n venusian = venusian\n\n def __init__(self, *args, **kwargs):\n ...
python
chosen
[ { "from": "system", "value": "Use explicit relative imports for Python3 Compat\n" }, { "from": "human", "value": "from attribute_dict import AttributeDict\nfrom alias_dict import AliasDict\n\n\n__version__ = \"0.1.2\"\n\n\nclass Lexicon(AttributeDict, AliasDict):\n def __init__(self, *args, *...
python
chosen
[ { "from": "system", "value": "Remove models/ subpackage from api due to migration to QuantEcon.applications\n" }, { "from": "human", "value": "\"\"\"\nImport the main names to top level.\n\"\"\"\n\nfrom . import models as models\nfrom .compute_fp import compute_fixed_point\nfrom .discrete_rv imp...
python
chosen
[ { "from": "system", "value": "Make this constant-generating script independent of the solidity emulation module.\n" }, { "from": "human", "value": "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__),'..'))\n\n\nfrom decimal import Decimal\nfrom decimal import getcontex...
python
chosen
[ { "from": "system", "value": "Rename class to AuroraWatchUK_SS and add documentation\n" }, { "from": "human", "value": "import aurorawatchuk as aw\n\n\nclass AuroraWatchUK(object):\n \"\"\"Take a snapshot of the AuroraWatch UK status.\n\n This class mimics the behaviour of the aurorawatchu...
python
chosen
[ { "from": "system", "value": "Fix float diff comparison in dict differ function.\n" }, { "from": "human", "value": "# coding=utf-8\n\n__all__ = ['UTC']\n\nfrom datetime import timedelta, tzinfo\n\n\n_ZERO = timedelta(0)\n\n\ndef is_dict_different(d1, d2, epsilon=0.00000000001):\n s1 = set(d1....
python
chosen
[ { "from": "system", "value": "Change the test board size to make it run faster\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport unittest\n\nimport pdb\nimport gui\nimport human_player\nimport rules\nimport game\n#import profile\n\nfrom ai_player import *\n\nclass AIPlayerTest(u...
python
chosen
[ { "from": "system", "value": "Change url protocol for more secure access" }, { "from": "human", "value": "import requests\n\n\ndef get_latest_header_images(idx=0, num=5):\n resp = requests.get(\"http://www.bing.com/HPImageArchive.aspx?format=js&n={0}&idx={1}\".format(num, idx)).json()\n \n...
python
chosen
[ { "from": "system", "value": "Set flake8 to ignore F401 violations\n" }, { "from": "human", "value": "# from .model.fileio import (stitch_fitted_results, spec_to_hdf, create_movie,\n# combine_data_to_recon, h5file_for_recon, export_to_view)\n# from .model.load_data_fr...
python
chosen