conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add another test creating the index in the current working directory.\n" }, { "from": "human", "value": "\"\"\"Create an image index.\n\"\"\"\n\nimport os.path\nimport shutil\nimport filecmp\nimport pytest\nimport photo.index\nfrom conftest import tmpdir, gettestdat...
python
chosen
[ { "from": "system", "value": "Fix broken migration with try-except blocks\n\nDuplicate key errors were being caused if an employment similar to the\none being created by the migration already existed.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_lite...
python
chosen
[ { "from": "system", "value": "Make ExtraInfo list user-friendly in Django Admin\n\n`Register_cme/extrainfo` in Django Admin was previously displaying users\nas `ExtraInfo` objects which admins had to click on individually to see\neach user's information. Each user is now displayed with fields:\nusername, em...
python
chosen
[ { "from": "system", "value": "Use media root temp dir for tests\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom django.conf import settings\nimport django\n\nDEFAULT_SETTINGS = {\n 'INSTALLED_APPS': (\n 'django.contrib.gis',\n 'spillway',\...
python
chosen
[ { "from": "system", "value": "Insert empty line at to fix patch.\n\ngyptest-link-pdb.py was checked in without a blank line. This appears\nto cause a patch issue with the try bots. This CL is only a whitespace\nchange to attempt to fix that problem.\n\nSEE:\npatching file test/win/gyptest-link-pdb.py\nHun...
python
chosen
[ { "from": "system", "value": "Remove \"is is\" from lexical illusions\n" }, { "from": "human", "value": "\"\"\"WGD200: Lexical illusions.\n\n---\nlayout: post\nerror_code: WGD200\nsource: write-good\nsource_url: https://github.com/btford/write-good\ntitle: Lexical illusion present\n...
python
chosen
[ { "from": "system", "value": "Use `UnicodeText` instead of `Text` to ensure a unicode-capable column type is used in the backend\n" }, { "from": "human", "value": "\"\"\"\nbyceps.services.news.models.channel\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2019 Jochen Kupperschmidt\n:Lic...
python
chosen
[ { "from": "system", "value": "Add LFSR113 to init file.\n" }, { "from": "human", "value": "\"\"\"\nSimple Pseudo-random number generators.\n\nThis module provides iterators that generate unsigned 32-bit PRNs.\n\"\"\"\n\n__all__ = [\n \"RandomCongIterator\",\n \"RandomSHR3Iterator\",\n \...
python
chosen
[ { "from": "system", "value": "Handle doc without domain or domains\n" }, { "from": "human", "value": "from couchdbkit import ResourceNotFound\nfrom django.http import Http404\nfrom jsonobject.exceptions import WrappingAttributeError\n\n\ndef get_document_or_404(cls, domain, doc_id, additional_do...
python
chosen
[ { "from": "system", "value": "Add upload to Spaces API client\n" }, { "from": "human", "value": "\"\"\"Digital Ocean Spaces interaction\"\"\"\nimport boto3\nfrom django.conf import settings\n\n\nclass SpacesBucket():\n \"\"\"Interact with Spaces buckets\"\"\"\n def __init__(self):\n ...
python
chosen
[ { "from": "system", "value": "Use 1212 as the default port\n" }, { "from": "human", "value": "import werkzeug.debug\nimport werkzeug.serving\n\nfrom jacquard.commands import BaseCommand\nfrom jacquard.service import get_wsgi_app\n\n\nclass RunServer(BaseCommand):\n help = \"run a (local, debu...
python
chosen
[ { "from": "system", "value": "Load statics like posts and pages. Documentation.\n" }, { "from": "human", "value": "#!/usr/bin/python3\n\nimport argparse, sys\n\nfrom src import Configurator, Builder, Loader\n\ndef main():\n \"\"\" Parse command line arguments and execute passed subcommands. \...
python
chosen
[ { "from": "system", "value": "Tests: Define template_name for test widgets\n\nThis avoids an \"AssertionError: MyWidget0.template_name is not defined.\"\non Django 2.1, which no longer silences {% include %} exceptions.\n\nDjango deprecation notes:\n\nhttps://docs.djangoproject.com/en/2.1/internals/deprecat...
python
chosen
[ { "from": "system", "value": "Replace direct use of testtools BaseTestCase.\n\nUsing the BaseTestCase across the tests in the tree lets us put in log\nfixtures and consistently handle mox and stubout.\n\nPart of blueprint grizzly-testtools.\n\nChange-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0\n" }, {...
python
chosen
[ { "from": "system", "value": "Change time format to properly formatted UTC\n\n[#46004]\n" }, { "from": "human", "value": "\"\"\"\nLogging Handler\n\"\"\"\n\nimport logging\nimport logging.handlers\nimport os\nimport re\nimport socket\n\n\nclass IXAFormatter(logging.Formatter):\n \"\"\"\n A...
python
chosen
[ { "from": "system", "value": "Update connection to script to waitSeconds to load js" }, { "from": "human", "value": "\nfrom collections import OrderedDict\nfrom IPython.display import Javascript\nimport json\nfrom krisk.util import join_current_dir\n\nECHARTS_URL = 'https://cdnjs.cloudflare.com/...
python
chosen
[ { "from": "system", "value": "fix: Delete manual Pipeline before creating\n\nSee also: #72\n" }, { "from": "human", "value": "# Foremast - Pipeline Tooling\n#\n# Copyright 2016 Gogo, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file ...
python
chosen
[ { "from": "system", "value": "Add docstring to UserAccount model\n" }, { "from": "human", "value": "# coding: utf-8\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\nfrom registration.signals import user_activated\nfrom dj...
python
chosen
[ { "from": "system", "value": "Use default auth django app\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom django.shortcuts import render, redirect\n\nfrom django.http import HttpResponse\n\n\nfrom hackfmi.utils import json_view\nfrom .models import User\n\n\ndef homepage(request...
python
chosen
[ { "from": "system", "value": "Add simple function to get the version of the bse\n" }, { "from": "human", "value": "'''\nBasis Set Exchange\n\nContains utilities for reading, writing, and converting\nbasis set information\n'''\n\n# Just import the basic user API\nfrom .api import (get_basis, look...
python
chosen
[ { "from": "system", "value": "Test PrintReport with a real stream\n" }, { "from": "human", "value": "import sys\nimport unittest\n\nfrom mock import MagicMock\n\nfrom chainer import testing\nfrom chainer.training import extensions\n\nclass TestPrintReport(unittest.TestCase):\n def _setup(self...
python
chosen
[ { "from": "system", "value": "UPDATE - change env variable\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)\n" }, { ...
python
chosen
[ { "from": "system", "value": "Use env python instance, not a static location, fixes virtualenv oddities\n" }, { "from": "human", "value": "#!/usr/bin/python\nfrom django.core.management import execute_manager\ntry:\n import settings # Assumed to be in the same directory.\nexcept ImportError:\...
python
chosen
[ { "from": "system", "value": "Check configuration before specifying urlpatterns\n\nIf the configuration is incorrect, it doesn't make sense to specify the\nURL patterns in that case.\n" }, { "from": "human", "value": "\"\"\"URLs module\"\"\"\nfrom django.urls import path\nfrom django.conf import...
python
chosen
[ { "from": "system", "value": "[tests] Use mdptoolbox.example.small in the tests\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Aug 24 14:44:07 2013\n\n@author: steve\n\"\"\"\n\nimport numpy as np\nimport scipy as sp\n\nimport mdptoolbox.example\n\nSTATES = 10\...
python
chosen
[ { "from": "system", "value": "feat(stripe): Add proper stringification via StripeAccount.to_str\n\nBetter stringification for Stripe accounts, using the 'business_name'\nkey in extra_data. Addresses #1871.\n" }, { "from": "human", "value": "from allauth.socialaccount.providers.base import Provid...
python
chosen
[ { "from": "system", "value": "twitch: Add user_read as default scope\n" }, { "from": "human", "value": "from allauth.socialaccount.providers.base import ProviderAccount\nfrom allauth.socialaccount.providers.oauth2.provider import OAuth2Provider\n\n\nclass TwitchAccount(ProviderAccount):\n def...
python
chosen
[ { "from": "system", "value": "Save runlog as output is added.\n" }, { "from": "human", "value": "from django.db import models\n\nfrom .bugwarriorconfig import BugwarriorConfig\n\n\nclass BugwarriorConfigRunLog(models.Model):\n config = models.ForeignKey(\n BugwarriorConfig,\n re...
python
chosen
[ { "from": "system", "value": "Add function to figure out if a given daystate ID is valid for an org\n" }, { "from": "human", "value": "# Copyright (c) 2016 Luke San Antonio Bialecki\n# All rights reserved.\n\nfrom . import exceptions as ex\nfrom . import models\nfrom .models import db, User, Org...
python
chosen
[ { "from": "system", "value": "Copy email address to username\n" }, { "from": "human", "value": "from django import forms\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.forms import UserCreationForm\nfrom mentor.models import UserProfile\n\nclass RegistrationForm(UserCreat...
python
chosen
[ { "from": "system", "value": "Revert \"added GFK for group\"\n\nThis reverts commit 957e11ef62823a29472eeec4dade65ae01bbea70.\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom django.db.models.sig...
python
chosen
[ { "from": "system", "value": "Update deployed settings with results from deploy check.\n" }, { "from": "human", "value": "from settings import *\n\nDEBUG = TEMPLATE_DEBUG = False\nALLOWED_HOSTS = ['pttrack.snhc.wustl.edu']\n\nwith open(os.path.join(BASE_DIR, 'secrets/secret_key.txt')) as f:\n ...
python
chosen
[ { "from": "system", "value": "Add SimpleNamespace objects for model and result of challange parent class.\n" }, { "from": "human", "value": "# python\n# vim: set fileencoding=UTF-8 :\n\nclass Challenge:\n\n sample = 'sample'\n\n def __init__(self):\n self.lines = []\n self.mo...
python
chosen
[ { "from": "system", "value": "Rename an argument to be more precisely represent the use purpose\n" }, { "from": "human", "value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import, unicode_literals\n\ni...
python
chosen
[ { "from": "system", "value": "Fix cases migrations after drop tags\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n ...
python
chosen
[ { "from": "system", "value": "Add new outcome codes to tests\n" }, { "from": "human", "value": "from django.test import TestCase\n\nfrom cla_eventlog.tests.base import EventTestCaseMixin\n\n\nclass AlternativeHelpEventTestCase(EventTestCaseMixin, TestCase):\n EVENT_KEY = 'alternative_help'\n\...
python
chosen
[ { "from": "system", "value": "Add ending slash to regex for article-detail view\n" }, { "from": "human", "value": "from django.conf import settings\nfrom django.conf.urls import patterns, include, url, static\nfrom django.contrib import admin\n\n\nadmin.autodiscover()\n\n\nurlpatterns = patterns...
python
chosen
[ { "from": "system", "value": "Add a helper mixin for view test cases\n\nThe mixin defines some helper methods which are useful when testing\nviews (REST endpoints).\n" }, { "from": "human", "value": "from django.test import TestCase\n\n# Create your tests here.\n" }, { "from": "gpt", ...
python
chosen
[ { "from": "system", "value": "Optimize number of SQL queries in Order details view\n" }, { "from": "human", "value": "from django.db.models import Sum\nfrom django.db.models.query import QuerySet\nfrom django.shortcuts import render, get_object_or_404\nfrom django.utils import timezone\n\nfrom o...
python
chosen
[ { "from": "system", "value": "Add proper default values to config (although hardcoded).\n" }, { "from": "human", "value": "\"\"\"\nThis module is responsible for handling configuration and files related to it,\nincluding calibration parameters.\n\"\"\"\n\nimport configparser\nimport os\n\n\n\"\"...
python
chosen
[ { "from": "system", "value": "Fix regression autograd example for python3\n" }, { "from": "human", "value": "import autograd.numpy as np\n\nfrom pymanopt import Problem\nfrom pymanopt.solvers import TrustRegions\nfrom pymanopt.manifolds import Euclidean, Product\n\nif __name__ == \"__main__\":\n...
python
chosen
[ { "from": "system", "value": "Add code for generating test files.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\n\"\"\"\nThis module houses the \"highest-level\" programmatic API.\n\n\"\"\"\n\nimport sys\n\nfrom openrcv import models\nfrom openrcv.models import BallotList\nfrom open...
python
chosen
[ { "from": "system", "value": "Use 2D array instead of 1D to keep track of which edges have been drawn\n\nTODO: this probably isn't necessary\n" }, { "from": "human", "value": "import turtle\nimport math\nimport sys\n\nclass Paley:\n\n def __init__(self, p, radius = 290):\n self.p = p\n...
python
chosen
[ { "from": "human", "value": "Add test for eldag canonicalization\n\nThe test covers many cases for eldag canonicalization. Note that this\ntest does not covers a lot of error reporting, since the eldag\ncanonicalization is less likely to be called by users of drudge.\n" }, { "from": "gpt", "val...
python
chosen
[ { "from": "system", "value": "Replace gtk mainloop with glib mainloop\n\nThis is because Travis CI runs headless and importing gtk fails\n" }, { "from": "human", "value": "\nimport gtk\nimport dbus.service\nimport sys\nfrom dbus.mainloop.glib import DBusGMainLoop\n\n\nclass SLMService(dbus.servi...
python
chosen
[ { "from": "system", "value": "Test that there is a json content type\n" }, { "from": "human", "value": "import unittest\nimport tempfile\n\nfrom authentication import authentication\n\nclass SignupTests(unittest.TestCase):\n \"\"\"\n Signup tests.\n \"\"\"\n\n def test_signup(self):\...
python
chosen
[ { "from": "system", "value": "Add top-level function to control the loglevel\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom .version import __version__\n\ntry:\n __TYPHON_SETUP__\nexcept:\n __TYPHON_SETUP__ = False\n\nif not __TYPHON_SETUP__:\n from . import arts\n ...
python
chosen
[ { "from": "system", "value": "Fix ratio followers/following only displayed for \"humans\"\n" }, { "from": "human", "value": "import os\nfrom libraries.models import Tweet, User\nfrom config import app_config as cfg\nfrom libraries.graphs.graph import Graph\n\n# Twitter API configuration\nconsume...
python
chosen
[ { "from": "system", "value": "Move stuff to function for ross\n" }, { "from": "human", "value": "import json\nimport pprint\nimport requests\n\ndef sample_valid_reddit_response():\n\n\tr = requests.get('http://www.reddit.com/r/cscareerquestions/top.json')\n\tresponse_json = r.json()\n\n\tif 'dat...
python
chosen
[ { "from": "system", "value": "Make test environment use CNOT_CR implementation of CNOT.\n\nAt least for the test_pulse_types tests.\n" }, { "from": "human", "value": "import unittest\n\nfrom QGL import *\nfrom QGL.PulseSequencer import *\nfrom .helpers import setup_test_lib\n\nclass PulseTypes(u...
python
chosen
[ { "from": "system", "value": "Add test for invalid bearer token\n" }, { "from": "human", "value": "from oauth2_consumer.middleware import AuthenticationMiddleware\nfrom .test_cases import MiddlewareTestCase\n\n\nclass TestMiddleware(MiddlewareTestCase):\n \n def test_no_token(self):\n ...
python
chosen
[ { "from": "system", "value": "Add docstring to command line entrypoint function\n" }, { "from": "human", "value": "from __future__ import absolute_import\nimport click\nimport niftianon.anonymiser\n\n\n@click.command()\n@click.argument('identifiable_image', type=click.Path(exists=True))\n@click....
python
chosen
[ { "from": "system", "value": "Complete first pass of functions\n" }, { "from": "human", "value": "from __future__ import unicode_literals\n\nfrom linked_list import LinkedList\n\n\nclass Queue():\n\n def __init__(self, iterable=()):\n self.other = LinkedList()\n self.other_init_...
python
chosen
[ { "from": "system", "value": "Use BaseSudoTestCase instead of BaseLinuxTestCase\n\nBaseLinuxTestCase will be removed from neutron code[1]. This change\nuses BaseSudoTestCase instead of BaseLinuxTestCase as helper methods\nhave been transformed into fixtures.\n\n[1] https://review.openstack.org/161913\n\nCha...
python
chosen
[ { "from": "system", "value": "Remove extraneous vim editor configuration comments\n\nChange-Id: Id34b3ed02b6ef34b92d0cae9791f6e1b2d6cd4d8\nPartial-Bug: #1229324\n" }, { "from": "human", "value": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Licensed under the Apache License, Version 2.0 (...
python
chosen
[ { "from": "system", "value": "Revert \"added function to change OIA AdminServer nodemanager credentials\"\n\nThis reverts commit 134562138847b55853d22e4fa86c8a17e83d4b1d.\n" }, { "from": "human", "value": "import os\n\ncreateDomain=os.path.dirname(sys.argv[0]) +'/heinz/createDomain.py'\nif os.pa...
python
chosen
[ { "from": "system", "value": "Delete `randomSample()' because it is no longer used.\n" }, { "from": "human", "value": "\"\"\"\nProvides code to morph a chunk of data to a given probability distribution.\n\nThe class provides an interface to morph network packet lengths to a previously\ngenerated...
python
chosen
[ { "from": "system", "value": "Use `$ which bower` by default\n\n@benrudolph\nWhat do you think of this approach?\n" }, { "from": "human", "value": "\"\"\"\nThis is a home for shared dev settings. Feel free to add anything that all\ndevs should have set.\n\nAdd `from dev_settings import *` to th...
python
chosen
[ { "from": "system", "value": "Fix InstanceProfileProvider class for boto 2.24\n\n\"profile_name\" is now a parameter that must be supported in\n\"get_credentials\".\n\nYes, this is exactly the \"fragile base class\" problem, but let's hope\nthat the mechanisms there become dormant again for a long stretch\n...
python
chosen
[ { "from": "system", "value": "Update 13_gridftp to use OkSkip functionality\n\ngit-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@16527 4e558342-562e-0410-864c-e07659590f8c\n" }, { "from": "human", "value": "import os\nimport osgtest.library.core as core\nimport unittest\n\nclass TestStartGrid...
python
chosen
[ { "from": "system", "value": "Augment read to handle multiple connected DS18B20 devices\n" }, { "from": "human", "value": "import os\nimport glob\nimport time\n\nos.system('modprobe w1-gpio')\nos.system('modprobe w1-therm')\n\nbase_dir = '/sys/bus/w1/devices/'\ndevice_folder = glob.glob(base_dir...
python
chosen
[ { "from": "system", "value": "Set pyRiffle version to 0.2.2.\n" }, { "from": "human", "value": "from setuptools import setup, Extension\n\nsetup(\n name=\"pyRiffle\",\n version=\"0.2.1\",\n description=\"Riffle client libraries for interacting over a fabric\",\n author=\"Exis\",\n ...
python
chosen
[ { "from": "system", "value": "Drop the [security] descriptor from requests; it's soon deprecated\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\nfrom valohai_cli import __version__\n\nsetup(\n name='valohai-cli',\n version=__version__,\n entry_points={'...
python
chosen
[ { "from": "system", "value": "Update Webfilings info to Workiva\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\n\ndef get_version():\n import imp\n import os\n\n with open(os.path.join('furious', '_pkg_meta.py'), 'rb') as f:\n mod = imp.load_sour...
python
chosen
[ { "from": "system", "value": "Use same versions as requirements.pip to prevent unexpected upgrades of dependencies\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"\npyxform - Python library that converts XLSForms to XForms.\n\"\"\"\nfrom setuptools import find_packages, setup\n...
python
chosen
[ { "from": "system", "value": "Revert \"updated required sentrylogs version\"\n\nThis reverts commit 86f6fc2fb5a9e3c89088ddc135f66704cff36018.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\n\n\ndef read_file(filename):\n \"\"\"Read a file into a stri...
python
chosen
[ { "from": "system", "value": "Set x-Bit and add she-bang line\n" }, { "from": "human", "value": "try:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nfrom azurectl.version import __VERSION__\n\nconfig = {\n 'description': 'Manage Azure PubCloud ...
python
chosen
[ { "from": "system", "value": "Add a dependency to PyVEP.\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.org/MPL/2.0/.\nim...
python
chosen
[ { "from": "system", "value": "Update the version to 0.2.4\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nsetup(name='rhq-metrics-python-client',\n version='0.2.3',\n description='Python client to communicate with Hawkular Metrics over HT...
python
chosen
[ { "from": "system", "value": "Fix link to the tagged release.\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name = 'PyFVCOM',\n packages = ['PyFVCOM'],\n version = '1.3.4',\n description = (\"PyFVCOM is a collection of various tools and utilities which c...
python
chosen
[ { "from": "system", "value": "Use real mail address to make PyPi happy\n" }, { "from": "human", "value": "from setuptools import setup, Extension\n\nsetup(name='python-pytun',\n author='montag451',\n author_email='montag451 at laposte.net',\n maintainer='montag451',\n maintai...
python
chosen
[ { "from": "system", "value": "Add more Python 3 classifiers" }, { "from": "human", "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"A setuptools based setup module.\n\nSee:\nhttps://packaging.python.org/en/latest/distributing.html\nhttps://github.com/pypa/sampleproject\n\"\"\"\n\nfrom s...
python
chosen
[ { "from": "system", "value": "Add support mention of Python 3.6\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup\nfrom codecs import open\nfrom os import path\n\n\nhere = path.abspath(path.dirname(__file__))\n\nwith open(path.join(here, 'README.rst'), en...
python
chosen
[ { "from": "system", "value": "Bump up version to 0.2.2\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name = 'PyPokerEngine',\n version = '1.0.0',\n author = 'ishikota',\n author_email = 'ishikota086@gmail.com',\n description = 'Poker en...
python
chosen
[ { "from": "system", "value": "Make sure Windows modules are installed.\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport os\nimport sys\nfrom glob import glob\n\nsys.path.insert(0, os.path.abspath('lib'))\nfrom ansible import __version__, __author__\ntry:\n from setuptools im...
python
chosen
[ { "from": "system", "value": "Add manifest and bump version\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\nfrom setuptools import setup\n\ndef _read(fname):\n try:\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n except IOError:\n r...
python
chosen
[ { "from": "system", "value": "Remove dependency_links as it seems to be ignored.\n\nI also added ppp_datamodel to Pypi so it is not needed anymore.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='ppp_core',\n versio...
python
chosen
[ { "from": "system", "value": "Add clasifiers and short description.\n" }, { "from": "human", "value": "from setuptools import setup\n\nversion = '0.1dev'\n\nlong_description = '\\n\\n'.join([\n open('README.rst').read(),\n open('CREDITS.rst').read(),\n open('CHANGES.rst').read(),\n ]...
python
chosen
[ { "from": "system", "value": "Add packages for ecoapi e xapi\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\" Setup to allow pip installs of pok-eco module \"\"\"\n\nfrom setuptools import setup\n\nsetup(\n name='pok-eco',\n version='0.1.0',\n description='POK-ECO Integr...
python
chosen
[ { "from": "system", "value": "Add lxml to list of install_requires \n\nThis is literally the exact same thing as #19, but for some reason, that fix isn't included" }, { "from": "human", "value": "from distutils.core import setup\nfrom setuptools import setup\n\nsetup(\n name = 'spice_api',\n ...
python
chosen
[ { "from": "system", "value": "Increment to minor version 1.1.0\n\n" }, { "from": "human", "value": "import os\nimport setuptools\n\n\ndef readme():\n if os.path.isfile('README.md'):\n try:\n import requests\n r = requests.post(\n url='http://c.docve...
python
chosen
[ { "from": "system", "value": "Bump statsmodels from 0.10.2 to 0.11.0\n\nBumps [statsmodels](https://github.com/statsmodels/statsmodels) from 0.10.2 to 0.11.0.\n- [Release notes](https://github.com/statsmodels/statsmodels/releases)\n- [Changelog](https://github.com/statsmodels/statsmodels/blob/master/CHANGES...
python
chosen
[ { "from": "system", "value": "Make sure all submodules are installed\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n name='snactor',\n version='0.1',\n packages=['snactor'],\n url='https://github.com/leapp-to/snactor',\n license='ASL 2.0',\n auth...
python
chosen
[ { "from": "system", "value": "Update pyrax, and make it stop reverting if the version is too new\n" }, { "from": "human", "value": "#!/usr/bin/env python\nimport os\n\nfrom setuptools import setup, find_packages\n\n\n# Use the docstring of the __init__ file to be the description\nshort_descripti...
python
chosen
[ { "from": "system", "value": "Add pygooglechart to the requirements\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nsetup(\n name='django-sentry',\n version='.'.join(map(str, __import__('sentry').__version__)),\n author='David C...
python
chosen
[ { "from": "system", "value": "PYD-5: Update the classifier to specify support for Python 3 as well.\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()\nINSTALL_REQUIREMENTS = [\"Pillow\"]\nTEST...
python
chosen
[ { "from": "system", "value": "Add pip console script entry point\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Setup for yasi \"\"\"\n\nimport yasi\nimport sys\nimport setuptools\n\nsetuptools.setup(\n name='yasi',\n version=yasi.__version__,\n...
python
chosen
[ { "from": "system", "value": "Use pysqlite2 when sqlite3 is not available\n" }, { "from": "human", "value": "#! /usr/bin/python\n\nfrom distutils.core import setup\n\nsetup(name = 'myproxy_oauth',\n version = '0.11',\n description = 'MyProxy OAuth Delegation Service',\n author = 'Globus...
python
chosen
[ { "from": "system", "value": "Put the release number to 0.2\n" }, { "from": "human", "value": "from setuptools import setup\n\nrequires = [\n 'redis',\n 'retask',\n 'fedmsg',\n]\n\nsetup(\n name='autocloud',\n version='0.1',\n description='',\n author='',\n author_email='...
python
chosen
[ { "from": "system", "value": "Sort term frequency results by frequency\n" }, { "from": "human", "value": "class WordCloudOp:\n\n def run(self, data):\n terms = { }\n results = [ ]\n try:\n for corpus in data:\n tokens = corpus.tokenized_contents\...
python
chosen
[ { "from": "system", "value": "Use SortDir.DESCENDING for default sort direction\n\nSigned-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>\n" }, { "from": "human", "value": "\ndef default_pagination_params(limit=None, offset=None, sort=None):\n \"\"\"Returns defaul...
python
chosen
[ { "from": "system", "value": "Change validate HTTP method to PUT\n" }, { "from": "human", "value": "import flask\nfrom flask import request, json\n\ndef Response(data, status = 200):\n body = json.dumps(data)\n return flask.Response(body, status = status, mimetype = 'application/json')\n\n...
python
chosen
[ { "from": "system", "value": "Fix sys.version_info lookup for python 2\n" }, { "from": "human", "value": "import sys\n\nif sys.version_info.major < 3:\n from cStringIO import StringIO\n BytesIO = StringIO\nelse:\n from io import BytesIO\n from io import StringIO\n\n_ = BytesIO\n_ = S...
python
chosen
[ { "from": "system", "value": "Use Juju 2 compatible deploy." }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"TODO: add rough description of what is assessed in this module.\"\"\"\n\nfrom __future__ import print_function\n\nimport argparse\nimport logging\nimport sys\n\nfrom deploy_s...
python
chosen
[ { "from": "system", "value": "Add a command to find a measurement by id." }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nfrom sqlalchemy import (\n Column,\n Date,\n Integer,\n MetaData,\n Numeric,\n String,\n Table,\n)\n\n\ndef define_tables(metadata):\n Tabl...
python
chosen
[ { "from": "system", "value": "Add comment on mail connection\n" }, { "from": "human", "value": "from contextlib import closing\n\nfrom django.core import mail\nfrom django.template.loader import render_to_string\nfrom django.conf import settings\nfrom django.contrib.auth.models import User\n\nfr...
python
chosen
[ { "from": "system", "value": "Refactor Gradient to clean up loops and redundancy\n" }, { "from": "human", "value": "import blinkypattern\nimport blinkylib.blinkycolor\n\nclass Gradient(blinkypattern.BlinkyPattern):\n def __init__(self, blinkytape, start_color, end_color):\n super(Gradi...
python
chosen
[ { "from": "system", "value": "Add command to stop gkeepd\n" }, { "from": "human", "value": "# Copyright 2018 Nathan Sommer and Ben Coleman\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Fre...
python
chosen
[ { "from": "system", "value": "Fix the Class Type Test Cases class name, and enhance the create new\n" }, { "from": "human", "value": "from decimal import Decimal\nfrom django.db import IntegrityError\nfrom django.test import TestCase\nfrom .models import ClassType\n\n\nclass ClassTypeClassTypeTe...
python
chosen
[ { "from": "system", "value": "Validate the schema when loading it.\n" }, { "from": "human", "value": "\"\"\"The Pibstack.yaml parsing code.\"\"\"\n\nimport yaml\n\n\nclass StackConfig(object):\n \"\"\"The configuration for the stack.\"\"\"\n\n def __init__(self, path_to_repo):\n sel...
python
chosen