conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make fall back to ~/.eslintrc\n" }, { "from": "human", "value": "#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by roadhump\n# Copyright (c) 2014 roadhump\n#\n# License: MIT\n#\n\n\"\"\"This module exports the...
python
chosen
[ { "from": "system", "value": "Include the new Subscriptions stub" }, { "from": "human", "value": "from .feeds import Feeds\nfrom .finances import Finances\nfrom .inbound_shipments import InboundShipments\nfrom .inventory import Inventory\nfrom .merchant_fulfillment import MerchantFulfillment\nfr...
python
chosen
[ { "from": "system", "value": "Add a hack to overcome driver name inconsistency in libcloud.\n" }, { "from": "human", "value": "from libcloud.compute.types import Provider\nfrom libcloud.compute.providers import get_driver\nimport libcloud.security\n\nfrom config import get_config\n\n\ndef get_lc...
python
chosen
[ { "from": "system", "value": "Switch database connection string to pg" }, { "from": "human", "value": "#!/usr/bin/env python\n\"\"\"\n See LICENSE.txt file for copyright and license details.\n\"\"\"\nimport os\n\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\nWTF_CSRF_ENABLED = Tru...
python
chosen
[ { "from": "system", "value": "Create create_db, drop_db and create_admin functions\n" }, { "from": "human", "value": "from project import app, db\nfrom project import models\nfrom flask.ext.script import Manager\nfrom flask.ext.migrate import Migrate, MigrateCommand\n\nmigrate = Migrate(app, db)...
python
chosen
[ { "from": "system", "value": "Set a default settings module\n" }, { "from": "human", "value": "#!/usr/bin/env python\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" }, { "from": "g...
python
chosen
[ { "from": "system", "value": "Add a pure arrayfire cast test to check for seg faults\n" }, { "from": "human", "value": "import arrayfire\n\n# We're going to test several arrayfire behaviours that we rely on\n\n\nfrom asserts import *\nimport afnumpy as af\nimport numpy as np\n\ndef test_cast():\...
python
chosen
[ { "from": "system", "value": "Switch back to the substring method - it's faster\n" }, { "from": "human", "value": "SUPERLIST = \"superlist\"\nSUBLIST = \"sublist\"\nEQUAL = \"equal\"\nUNEQUAL = \"unequal\"\n\n\ndef check_lists(a, b):\n if a == b:\n return EQUAL\n elif is_sublist(a, ...
python
chosen
[ { "from": "system", "value": "Split migration script of customform\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.3 on 2017-12-04 10:03\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n...
python
chosen
[ { "from": "system", "value": "Set the window size to emulate a mobile device\n" }, { "from": "human", "value": "from kivy.app import App\n\n\nclass CalendarApp(App):\n \"\"\"Basic App to hold the calendar widget.\"\"\"\n\n def build(self):\n return self.root\n" }, { "from": ...
python
chosen
[ { "from": "system", "value": "Update capability token creation method\n\nOld method was `generate()`, it's not `to_jwt()`" }, { "from": "human", "value": "from flask import Flask, Response\nfrom twilio.jwt.client import ClientCapabilityToken\n\napp = Flask(__name__)\n\n\n@app.route('/token', met...
python
chosen
[ { "from": "system", "value": "Fix test by looking further east into the ocean\n" }, { "from": "human", "value": "# There should be a single, merged feature in each of these tiles\n\n# Natural Earth\nassert_less_than_n_features(5, 11, 11, 'water', {'kind': 'ocean'}, 2)\nassert_less_than_n_feature...
python
chosen
[ { "from": "system", "value": "Use remote fallback for API request\n" }, { "from": "human", "value": "from rest_framework.permissions import IsAuthenticated\nfrom rest_framework.response import Response\nfrom .serializers import ProductSerializer\nfrom ..models import Product\nfrom django.http im...
python
chosen
[ { "from": "system", "value": "Correct spacing in the test file.\n" }, { "from": "human", "value": "from pyQuantuccia import quantuccia\n\ndef test_get_holiday_date():\n \"\"\" At the moment the only thing this function\n can do is return NULL.\n \"\"\"\n assert(quantuccia.get_hol...
python
chosen
[ { "from": "system", "value": "Add videos dict to Games.\n" }, { "from": "human", "value": "from datetime import datetime\n\nGAME_VIDEO_BASE_URL = \"http://www.nfl.com/feeds-rs/videos/byGameCenter/{0}.json\"\nLIVE_UPDATE_BASE_URL = \"http://www.nfl.com/liveupdate/game-center/{0}/{0}_gtd.json\"\n\...
python
chosen
[ { "from": "system", "value": "Add pkg_resources back, working forward\n" }, { "from": "human", "value": "import json\n\nresource_package = __name__\nresource_path_format = 'datasource/{}.json'\n\nclass DatasourceRepository:\n def __init__(self):\n self.availableSources = json.loads(pkg...
python
chosen
[ { "from": "system", "value": "Rename shipping label in model admin\n" }, { "from": "human", "value": "from wagtail.contrib.modeladmin.options import (\n ModelAdmin, modeladmin_register\n)\nfrom longclaw.longclawshipping.models import ShippingCountry\n\n\nclass ShippingCountryModelAdmin(ModelA...
python
chosen
[ { "from": "system", "value": "Use [job.title] as genealogy of input_handler.save while submit job.\n" }, { "from": "human", "value": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"Helper functions.\n\"\"\"\n\n# built-in modules\nimport json\n\n# 3rd-party modules\nfrom botocore.client...
python
chosen
[ { "from": "system", "value": "Fix raw md content rendering\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom markdown2 import markdown, markdown_path\nfrom weasyprint import HTML, CSS\n\nfrom .exceptions import ValidationError\n\n\n__title__ = 'md2pdf'\n__version__ = '0.2.1'\n__au...
python
chosen
[ { "from": "system", "value": "Enhancement: Handle module reload exceptions gracefully\n\nIn some rare cases if the internal module structure has changed the 'reload' module can't recover all modules and will fail with ImportError. This is the situation we need to advice a restart of Sublime Text.\n" }, ...
python
chosen
[ { "from": "system", "value": "Fix the shape of gap_w" }, { "from": "human", "value": "import tensorflow as tf\n\nslim = tf.contrib.slim\n\n\ndef le_net(images, num_classes=10, scope='LeNet'):\n with tf.variable_scope(scope, 'LeNet', [images, num_classes]):\n net = slim.conv2d(images, 3...
python
chosen
[ { "from": "system", "value": "Use @python_2_unicode_compatible rather than repeating methods\n" }, { "from": "human", "value": "from django.contrib.auth.models import Group\nfrom django.db import models\n\nfrom jsonfield import JSONField\n\n\nclass KeyValue(models.Model):\n group = models.For...
python
chosen
[ { "from": "system", "value": "Handle a Werkzeug ClosingIterator (as exposed by the tests)\n" }, { "from": "human", "value": "# -*- encoding: utf-8\n\nimport json\n\nfrom flask import Response, jsonify\n\n\nclass ContextResponse(Response):\n \"\"\"\n This class adds the \"@context\" paramet...
python
chosen
[ { "from": "system", "value": "Rename base exception class; less ugly\n" }, { "from": "human", "value": "\"\"\"\nCustom *xml4h* exceptions.\n\"\"\"\n\n\nclass BaseXml4hException(Exception):\n \"\"\"\n Base exception class for all non-standard exceptions raised by *xml4h*.\n \"\"\"\n p...
python
chosen
[ { "from": "system", "value": "Add OS detection (mainly Windows vs Unix) to preferences directory selection\n" }, { "from": "human", "value": "from gi.repository import Gtk\nimport tempfile\nimport os.path\n\nversion = \"0.2.2\"\n\n# Define default port numbers\ndefault_socks_port = 19050\ndefaul...
python
chosen
[ { "from": "system", "value": "Fix bot not joining any channels\n\nAlso removed unnecessary usage comment.\n" }, { "from": "human", "value": "import ircbotframe\nimport sys\n\nclass Handler:\n def __init__(self, host, port=6667, name=\"MediaWiki\", description=\"MediaWiki recent changes bot\",...
python
chosen
[ { "from": "system", "value": "Improve the way that get all the routers\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nfrom flask import Blueprint, jsonify\n\nfrom me_api.configs import Config\n\n\nme = Blueprint('me'...
python
chosen
[ { "from": "system", "value": "[FIX] website_medical_patient_species: Fix lint\n* Remove stray import to fix lint\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2016 LasLabs Inc.\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n\nfrom openerp import ...
python
chosen
[ { "from": "system", "value": "Remove Havant election id (update expected)\n" }, { "from": "human", "value": "from data_collection.management.commands import BaseXpressWebLookupCsvImporter\n\nclass Command(BaseXpressWebLookupCsvImporter):\n council_id = 'E07000090'\n addresses_name = ...
python
chosen
[ { "from": "system", "value": "Update numpy array of tuples with np version\n" }, { "from": "human", "value": "# Numpy converts a list of tuples *not* into an array of tuples, but into a 2D\n# array instead.\nlist_of_tuples = [(1, 2), (3, 4)]\nimport numpy as np\nprint('list of tuples:', list_of_...
python
chosen
[ { "from": "system", "value": "Fix has_numba for travis build\n" }, { "from": "human", "value": "import os\nimport numpy as np\n\nimport xarray as xr\n\nfrom . import TestCase, assert_equal,assert_allclose,requires_numba\n\nfrom oocgcm.oceanfuncs.eos import misc\n\n@requires_numba\ndef test_numpy...
python
chosen
[ { "from": "system", "value": "Disable widget test. (does not run on travis)\n" }, { "from": "human", "value": "import os\nimport unittest\n\nfrom Orange.widgets.tests import test_setting_provider, \\\n test_settings_handler, test_context_handler, \\\n test_class_values_context_handler, tes...
python
chosen
[ { "from": "system", "value": "Update test version following release\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# encoding: utf8\n\n\"\"\" \nDescription\n\n.. note::\n Any additional note.\n\"\"\"\n\nfrom __future__ import (absolute_import, print_function, division, unicode_lite...
python
chosen
[ { "from": "system", "value": "Use aggregate Max to fetch new order value.\n" }, { "from": "human", "value": "from django.contrib.contenttypes.models import ContentType\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\n\n\nclass OrderedModel(models.Model):\n \"\"\"\n...
python
chosen
[ { "from": "system", "value": "Use include, not a view, for the root URL.\n" }, { "from": "human", "value": "\"\"\"podium URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFu...
python
chosen
[ { "from": "system", "value": "Drop mox, no longer needed\n\nThe porting of mistral-dashboard is complete.\nThis fullfills the community goal \"Remove Use of mox/mox3 for Testing\"\nset for Rocky: https://governance.openstack.org/tc/goals/rocky/mox_removal.html\n\nRemove use_mox and remove dead code.\n\nChan...
python
chosen
[ { "from": "system", "value": "Use state.single to not upgrade npm\n" }, { "from": "human", "value": "import pytest\nfrom salt.exceptions import CommandExecutionError\n\n\n@pytest.fixture(scope=\"module\", autouse=True)\ndef install_npm(sminion):\n try:\n sminion.functions.pkg.install(\...
python
chosen
[ { "from": "system", "value": "Fix newly-introduced crash under Windows\n\nref #14\n" }, { "from": "human", "value": "# Copyright 2017 Virgil Dupras\n\n# This software is licensed under the \"BSD\" License as described in the \"LICENSE\" file,\n# which should be included with this package. The te...
python
chosen
[ { "from": "system", "value": "Update the setting DATA_DIRECTORY to match the vagrant setup\n" }, { "from": "human", "value": "# This file contains the project wide settings. It is not\n# part of version control and it should be adapted to\n# suit each deployment. \n\nfrom os import environ\n\n\n...
python
chosen
[ { "from": "system", "value": "Fix wrong rtol in adjointTest" }, { "from": "human", "value": "'''\nThese are tests to assist with creating :class:`.LinearOperator`.\n'''\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\ndef adjointTest(O, significant = 7):\n ''' Test for verify...
python
chosen
[ { "from": "system", "value": "Add export job and print_job jobs\n" }, { "from": "human", "value": "import os\nimport sys\nimport time\n\nfrom redis import StrictRedis\nfrom rq import Queue\nfrom apscheduler.schedulers.blocking import BlockingScheduler\n\nsys.path.append('/usr/local/d1lod')\nfrom...
python
chosen
[ { "from": "system", "value": "Simplify the breakpoint command function. Instead of fetching the command interpreter\nand run the \"process continue\" command, use the SBProcess.Continue() API.\n\n\ngit-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@122434 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { ...
python
chosen
[ { "from": "system", "value": "Load file or path now.\n" }, { "from": "human", "value": "from tornado import ioloop, web, websocket\r\n\r\n\r\nclass EchoWebSocket(websocket.WebSocketHandler):\r\n def open(self):\r\n print(\"WebSocket opened\")\r\n\r\n def on_message(self, message):\r...
python
chosen
[ { "from": "system", "value": "Implement more TGT Shaman cards\n" }, { "from": "human", "value": "from ..utils import *\n\n\n##\n# Hero Powers\n\n# Lightning Jolt\nclass AT_050t:\n\tplay = Hit(TARGET, 2)\n\n\n##\n# Minions\n\n# Tuskarr Totemic\nclass AT_046:\n\tplay = Summon(CONTROLLER, RandomTot...
python
chosen
[ { "from": "system", "value": "Implement a couple of other French templates.\n\nStill need to add tests for these.\n" }, { "from": "human", "value": "#-*- encoding: utf-8 -*-\n\nimport base\n\nclass SnippetParser(base.SnippetParserBase):\n def strip_template(self, template, normalize, collapse...
python
chosen
[ { "from": "system", "value": "Add overrides for UpperCamelCase construct names\n" }, { "from": "human", "value": "from tailor.swift.swiftlistener import SwiftListener\nfrom tailor.utils.charformat import isUpperCamelCase\n\nclass MainListener(SwiftListener):\n\n def enterClassName(self, ctx):...
python
chosen
[ { "from": "system", "value": "Fix circular import problem in Django console (PY-9030).\n" }, { "from": "human", "value": "#!/usr/bin/env python\nfrom fix_getpass import fixGetpass\nimport os\nfrom django.core import management\nimport sys\n\ntry:\n from runpy import run_module\nexcept ImportErr...
python
chosen
[ { "from": "system", "value": "Increment version number to 0.9.1\n" }, { "from": "human", "value": "\"\"\"Configuration for Django system.\"\"\"\n\n__version__ = \"0.9.0\"\n__version_info__ = tuple(\n [\n int(num) if num.isdigit() else num\n for num in __version__.replace(\"-\", ...
python
chosen
[ { "from": "system", "value": "Add proxy app id to listener\n" }, { "from": "human", "value": "import os\nimport webapp2\n\nIS_DEV = os.environ[\"SERVER_SOFTWARE\"][:3] == \"Dev\"\nallowed_users = set()\nif IS_DEV:\n allowed_users.add(\"dev-instance\")\n\nclass LoggingHandler(webapp2.RequestHa...
python
chosen
[ { "from": "system", "value": "Make some attempt to preserve randomness. Use only 1 AES CTR step.\n" }, { "from": "human", "value": "import brainfuck\nimport scrypt\nimport prng\n\ndef hash(password, salt):\n k0 = scrypt.hash(password, salt, 512, 4, 8, 96)\n code_key = k0[ 0:32]\n data_k...
python
chosen
[ { "from": "system", "value": "Update to support multiple default gateways" }, { "from": "human", "value": "import socket, struct\nimport scapy.all as scapy\n\ndef get_default_gateway_linux():\n \"\"\"Read the default gateway directly from /proc.\"\"\"\n with open(\"/proc/net/route\") as fh...
python
chosen
[ { "from": "system", "value": "Add GitPython dependency for pdtools.\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name=\"pdtools\",\n version='0.8.0',\n author=\"ParaDrop Labs\",\n description=\"ParaDrop development tools\",\n install_r...
python
chosen
[ { "from": "system", "value": "Update UserRegistrationForm to be connected to an existing OSF user.\n" }, { "from": "human", "value": "from __future__ import absolute_import\n\nfrom django import forms\nfrom django.contrib.auth.forms import UserCreationForm\nfrom django.contrib.admin.widgets impo...
python
chosen
[ { "from": "system", "value": "Update permission names when syncing\n" }, { "from": "human", "value": "from django.contrib.auth.models import Permission\nfrom django.core.management.base import BaseCommand, CommandError\n\n\nclass Command(BaseCommand):\n\n help = \"Create admin permissions\"\n...
python
chosen
[ { "from": "system", "value": "Add host and port options to web runner\n" }, { "from": "human", "value": "import click\nfrom .manager import database\nfrom .webserver.web import get_app\n\n@click.group()\ndef main():\n pass\n\n@main.command()\ndef update():\n \"\"\"Update PyUniProt data\"\"...
python
chosen
[ { "from": "system", "value": "Add extra line for class in test admin\n\nSigned-off-by: Brandon Myers <9cda508be11a1ae7ceef912b85c196946f0ec5f3@mozilla.com>\n" }, { "from": "human", "value": "from web_test import WebTest\nfrom scoring_engine.models.team import Team\nfrom scoring_engine.models.use...
python
chosen
[ { "from": "system", "value": "Fix failing tests with recent versions of pytest-flake8\n" }, { "from": "human", "value": "import colorsys # It turns out Python already does HSL -> RGB!\n\n\ndef trim(s):\n return s if not s.endswith('.0') else s[:-2]\n\n\nprint('[')\nprint(',\\n'.join(\n '\...
python
chosen
[ { "from": "system", "value": "Test of standalone myrial mode\n" }, { "from": "human", "value": "\"\"\"Basic test of the command-line interface to Myrial.\"\"\"\n\nimport subprocess\nimport unittest\n\n\nclass CliTest(unittest.TestCase):\n\n def test_cli(self):\n out = subprocess.check_...
python
chosen
[ { "from": "system", "value": "Add cssmin and jsmin to requires\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='Fulfil-Shop',\n version='0.1dev',\n packages=['shop'],\n license='BSD',\n include_package_data=True,\n zip_safe=False,\n long_desc...
python
chosen
[ { "from": "system", "value": "Add BSD license as well\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(\n name='django-kewl',\n version=\".\".join(map(str, __import__('short_url').__version__)),\n packages=['django_kewl'],\n url='https://github.com/Alir3z4/dja...
python
chosen
[ { "from": "system", "value": "Add 3.7 to the trove classifiers\n" }, { "from": "human", "value": "import setuptools\n\nfrom flatdict import __version__\n\nsetuptools.setup(\n name='flatdict',\n version=__version__,\n description=('Python module for interacting with nested dicts as a '\n...
python
chosen
[ { "from": "system", "value": "Increase version so that my tests can run... :-]\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\nsetup(\n name='tw2.wysihtml5',\n version='0.2',\n description='WYSIHTML5 widget for ToscaWidgets2',\n author='Moritz Schlar...
python
chosen
[ { "from": "system", "value": "Install templates when using pip to install package.\n" }, { "from": "human", "value": "import os\nfrom distutils.core import setup\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\nsetup(\n name='django-mingus',\n ...
python
chosen
[ { "from": "system", "value": "Mark the module as not zip safe.\n\nThe template finder code in Flask doesn't handle zipped eggs well,\nand thus won't find index.template.html. This makes the module\ncrash when attempting to load the UI.\n" }, { "from": "human", "value": "from setuptools import s...
python
chosen
[ { "from": "system", "value": "Add entry_points to run executable pygraphc\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(name='pygraphc',\n version='0.0.1',\n description='Event log clustering in Python',\n long_description='This package contains event lo...
python
chosen
[ { "from": "system", "value": "Add Django as a dependency\n" }, { "from": "human", "value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n import ez_setup\n ez_setup.use_setuptools()\n from setuptools import...
python
chosen
[ { "from": "system", "value": "Fix license trove classifier, bump to 1.0.1\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\"\"\"setup.py -- setup file for antimarkdown\n\"\"\"\nimport os\nfrom setuptools import setup\n\nREADME = os.path.join(os.path.abspath(os.path.dirname(__file__))...
python
chosen
[ { "from": "system", "value": "Dev: Include changelog on pypi page\n" }, { "from": "human", "value": "from setuptools import setup, find_packages\n\n\nsetup(\n name='mittn',\n use_scm_version=True,\n description='Mittn',\n long_description=open('README.rst').read(),\n classifiers=[...
python
chosen
[ { "from": "system", "value": "Add trove classifiers for Python versions\n\nThese are set to the versions tested by Travis.\r\n\r\nThis fixes #39." }, { "from": "human", "value": "import os\nfrom setuptools import setup, find_packages\n\nLONG_DESCRIPTION = \"\"\"Django-Prometheus\n\nThis library ...
python
chosen
[ { "from": "system", "value": "Change download url for release 0.3.6\n" }, { "from": "human", "value": "from distutils.core import setup\n\nsetup(\n\tname = 'django-test-addons',\n\tpackages = ['test_addons'],\n\tversion = '0.3.5',\n\tdescription = 'Library to provide support for testing multiple...
python
chosen
[ { "from": "system", "value": "Reorder and group metadata and options together\n" }, { "from": "human", "value": "from setuptools import find_packages, setup\n\n\nsetup(name='satnogsclient',\n packages=find_packages(),\n version='0.2.5',\n author='SatNOGS team',\n author_email...
python
chosen
[ { "from": "system", "value": "Move download_url and bump version\n" }, { "from": "human", "value": "import setuptools\nfrom gitvendor.version import Version\nfrom setuptools import find_packages\n\nCLASSIFIERS = [\n 'Development Status :: 3 - Alpha',\n 'License :: OSI Approved :: MIT Licen...
python
chosen
[ { "from": "system", "value": "Change contact field and author field for PyPI.\n" }, { "from": "human", "value": "\"\"\"\n``onecodex``\n------------\n\n``onecodex`` provides a command line client for interaction with the\nOne Codex API.\n\n\n\nLinks\n`````\n* `One Codex: <https://www.onecodex.com...
python
chosen
[ { "from": "system", "value": "Update TreeTime dep link now that the py3 branch is merged\n" }, { "from": "human", "value": "import os\nfrom setuptools import setup\n\nsetup(\n name = \"augur\",\n version = \"0.1.0\",\n author = \"nextstrain developers\",\n author_emai...
python
chosen
[ { "from": "system", "value": "Change PyPI trove classifier for license terms.\n" }, { "from": "human", "value": "import os\nimport sys\nfrom distutils.core import setup\n\nif sys.version_info < (3,):\n print('\\nSorry, but Adventure can only be installed under Python 3.\\n')\n sys.exit(1)\...
python
chosen
[ { "from": "system", "value": "Fix requirement for diff tool\n" }, { "from": "human", "value": "from setuptools import setup\n\nsetup(name='osm_hall_monitor',\n version='0.2',\n description='Passive changeset monitoring for OpenStreetMap.',\n url='http://github.com/ethan-nelson/osm...
python
chosen
[ { "from": "system", "value": "Set permission mask to allow read/exec for all users\n" }, { "from": "human", "value": "#!/usr/bin/env python\n\nimport subprocess\nfrom distutils.core import setup\n\nrequirements = [pkg.split('=')[0] for pkg in open('requirements.txt').readlines()]\n\ndescription ...
python
chosen
[ { "from": "system", "value": "Use tags or direct url" }, { "from": "human", "value": "from bs4 import BeautifulSoup\nimport requests\n\ndef statsRoyale(tag):\n\tlink = 'http://statsroyale.com/profile/' + tag\n\tresponse = (requests.get(link)).text\n\tsoup = BeautifulSoup(response, 'html.parser')...
python
chosen
[ { "from": "system", "value": "Allow specifying custom host and port when starting app\n" }, { "from": "human", "value": "\"\"\"Task functions for use with Invoke.\"\"\"\nfrom invoke import task\n\n\n@task\ndef clean(context):\n cmd = '$(npm bin)/gulp clean'\n\n context.run(cmd)\n\n\n@task\...
python
chosen
[ { "from": "system", "value": "Add new release task w/ API doc prebuilding\n" }, { "from": "human", "value": "from os.path import join\n\nfrom invoke import Collection, ctask as task\nfrom invocations import docs as _docs\n\n\nd = 'sites'\n\n# Usage doc/API site (published as docs.paramiko.org)\n...
python
chosen
[ { "from": "system", "value": "Update labels for application form\n" }, { "from": "human", "value": "from django import forms\nfrom studygroups.models import StudyGroupSignup, Application\nfrom localflavor.us.forms import USPhoneNumberField\n\n\nclass ApplicationForm(forms.ModelForm):\n mobile...
python
chosen
[ { "from": "system", "value": "Fix intermittent failure in l10n language selector test\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\n# file, You can obtain one at htt...
python
chosen
[ { "from": "system", "value": "Fix UDF test, take two\n\nChange-Id: I817389d94dab665199d2c1b7365e8ce0d1495c41\nReviewed-on: http://gerrit.ent.cloudera.com:8080/504\nReviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>\nTested-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9...
python
chosen
[ { "from": "system", "value": "Add try catch to capture all the exceptions that might generate anywhere\ntodo: need to capture exceptions in specific places and raise them to log from the main catch\n" }, { "from": "human", "value": "from PdfProcessor import *\nimport argparse\nfrom datetime impo...
python
chosen
[ { "from": "system", "value": "Fix a Django deprecation warning\n\nReplace deprecated assignment_tag:\n\n`python/lib/python3.5/site-packages/admin_interface/templatetags/admin_interface_tags.py:11: RemovedInDjango20Warning: assignment_tag() is deprecated. Use simple_tag() instead`\n" }, { "from": "hu...
python
chosen
[ { "from": "system", "value": "Simplify python3 unicode fixer and make it replace all occurrences of __unicode__ with __str__.\n" }, { "from": "human", "value": "# Taken from jinja2. Thanks, Armin Ronacher.\n# See also http://lucumr.pocoo.org/2010/2/11/porting-to-python-3-a-guide\n\n\nfrom lib2to...
python
chosen
[ { "from": "system", "value": "Change biolookup test to work around service bug\n" }, { "from": "human", "value": "from indra.databases import biolookup_client\n\n\ndef test_lookup_curie():\n curie = 'pubchem.compound:40976'\n res = biolookup_client.lookup_curie(curie)\n assert res['name...
python
chosen
[ { "from": "system", "value": "Switch to wav test files for gstreamer tests\n" }, { "from": "human", "value": "import unittest\nimport os\n\nfrom mopidy.models import Playlist, Track\nfrom mopidy.backends.gstreamer import GStreamerBackend\n\nfrom tests.backends.base import (BasePlaybackController...
python
chosen
[ { "from": "system", "value": "Add filtering to view (nc-463)\n" }, { "from": "human", "value": "from rest_framework import generics, response\n\nfrom nodeconductor.events import elasticsearch_client\n\n\nclass EventListView(generics.GenericAPIView):\n\n def list(self, request, *args, **kwargs...
python
chosen
[ { "from": "system", "value": "Add more exemplar primitive generators\n" }, { "from": "human", "value": "from .context import tohu\nfrom tohu.v4.primitive_generators import *\nfrom tohu.v4.derived_generators import *\n\n__all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_...
python
chosen
[ { "from": "system", "value": "Correct name of output file\n" }, { "from": "human", "value": "#!/home/daniel/Software/anaconda3/bin/python\n\n# Import modules for CGI handling\nimport cgi, cgitb\nfrom abundanceDriver import abundancedriver\nfrom emailSender import sendEmail\n\n\ndef cgi2dict(form...
python
chosen
[ { "from": "system", "value": "Add article on core admin\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nfrom opps.core.admin.channel import *\nfrom opps.core.admin.profile import *\nfrom opps.core.admin.source import *\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 ...
python
chosen
[ { "from": "system", "value": "Use a string instead of a file\n\n(so that I can redirect input to heroku from a local file)\n" }, { "from": "human", "value": "from gratipay import wireup\n\nenv = wireup.env()\ndb = wireup.db(env)\n\nparticipants = []\n\nwith open('./sql/emails.txt') as f:\n em...
python
chosen
[ { "from": "system", "value": "[enh] Add a link between vote and subproposal\n" }, { "from": "human", "value": "from django.db import models\nfrom meps.models import MEP\n\nclass Proposal(models.Model):\n id = models.CharField(max_length=63, primary_key=True)\n title = models.CharField(max_...
python
chosen
[ { "from": "system", "value": "Change to cb_story, clean up TZ handling some more\n\n" }, { "from": "human", "value": "\"\"\"\nAdd a 'w3cdate' key to every entry -- this contains the date in ISO8601 format\n\nWARNING: you must have PyXML installed as part of your python installation \nin order fo...
python
chosen
[ { "from": "system", "value": "Fix for keystone / swift 1.8.0\n" }, { "from": "human", "value": "# Copyright (c) 2012 Spil Games\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of ...
python
chosen
[ { "from": "system", "value": "Include the tags module tests in the full library testsuite.\n" }, { "from": "human", "value": "import unittest\nimport test_primitives, test_astypes, test_helpers\n\ndef get_suite():\n modules = (test_primitives, test_astypes, test_helpers)\n suites = [unitte...
python
chosen
[ { "from": "system", "value": "Check that the permission migrations work\n" }, { "from": "human", "value": "import pytest\nfrom django.db import connection\nfrom django.db.migrations.executor import MigrationExecutor\n\n\n@pytest.mark.django_db(transaction=True)\ndef test_workstation_group_migrat...
python
chosen
[ { "from": "system", "value": "Add ability to disable frame evaluation\n\n(cherry picked from commit 6cd89d0)\n" }, { "from": "human", "value": "import os\nimport sys\n\nIS_PY36_OR_OLDER = False\nif (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3:\n IS_PY36_O...
python
chosen
[ { "from": "system", "value": "Fix to support django v1.7\n" }, { "from": "human", "value": "from django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.utils.safestring import mark_safe\n\nfrom django_enum_js import enum_wrapper\n\ndef enums_js(reques...
python
chosen