conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Apply gevent monkey patching before importing django (which imports threading).\n"
},
{
"from": "human",
"value": "# This file mainly exists to allow `python setup.py test` to work.\nimport os\nimport sys\n\nimport dddp\nimport django\nfrom django.test.utils import ... | python | chosen |
[
{
"from": "system",
"value": "Add missing import of dendrogram data factory\n"
},
{
"from": "human",
"value": "def setup():\n from .qt_widget import DendroWidget\n from glue.config import qt_client\n qt_client.add(DendroWidget)\n"
},
{
"from": "gpt",
"value": "def setup():\n... | python | chosen |
[
{
"from": "system",
"value": "Use settings classes and set wmt_root_path.\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask import Flask\nfrom flask_login import LoginManager\n\nfrom passlib.context import CryptContext\n\nfrom .core import db\nfrom .blueprints import register_blueprints... | python | chosen |
[
{
"from": "system",
"value": "Add regex to know if one field is use in a model where this field is not declared"
},
{
"from": "human",
"value": "\"\"\"Analyse the tests log file given as argument.\n\nPrint a report and return status code 1 if failures are detected\n\"\"\"\n\nimport sys\nimport r... | python | chosen |
[
{
"from": "system",
"value": "Move dask.array.creation.* into dask.array.* namespace\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function\n\nfrom ..utils import ignoring\nfrom .core import (Array, stack, concatenate, tensordot, transpose, from_array... | python | chosen |
[
{
"from": "system",
"value": "Fix issue in spec 82.0.0 with DynamoDB KeySchema Type\n"
},
{
"from": "human",
"value": "patches = [\n # duplicate GlobalSecondaryIndex\n {\n \"op\": \"move\",\n \"from\": \"/PropertyTypes/AWS::DynamoDB::GlobalTable.GlobalSecondaryIndex\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add marker as required parameter\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\"\"\"\n\tsphinxcontrib.openstreetmap\n\t===========================\n\n\tEmbed OpenStreetMap on your documentation.\n\n\t:copyright: Copyright 2015 HAYASHI Kentaro <kenhys@... | python | chosen |
[
{
"from": "system",
"value": "Add __all__ to feature package\n"
},
{
"from": "human",
"value": "from ._daisy import daisy\nfrom ._hog import hog\nfrom .texture import greycomatrix, greycoprops, local_binary_pattern\nfrom .peak import peak_local_max\nfrom .corner import (corner_kitchen_rosenfeld,... | python | chosen |
[
{
"from": "system",
"value": "Return `f` if no decomposition\n\nSigned-off-by: AMiT Kumar <a9f82ad3e8c446d8f49d5b7e05ec2c64a9e15ea9@gmail.com>\n"
},
{
"from": "human",
"value": "from sympy.core import Function, Pow, sympify\nfrom sympy.polys import Poly\n\n\ndef decompogen(f, symbol):\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Fix return value of tests.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\n\nimport os\nimport sys\nimport unittest\n\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))\n\nload = unittest.defaultTestLoader.loadTestsFromModule\n\nsuites = [... | python | chosen |
[
{
"from": "system",
"value": "Fix typo on logging configuration"
},
{
"from": "human",
"value": "import logging\nfrom . import config, cli\n\n\ndef main():\n logging.basicConfig(levle=logging.INFO, format=\"%(message)s\")\n conf = config.load_config()\n cli.dothub(obj={}, default_map=co... | python | chosen |
[
{
"from": "system",
"value": "Convert Path to str for Python 3.5\n"
},
{
"from": "human",
"value": "import shutil\nfrom pathlib import Path\n\nimport pytest\n\nfrom pandas_profiling.utils.cache import cache_file\n\n\n@pytest.fixture(scope=\"function\")\ndef get_data_file(tmpdir):\n def getter... | python | chosen |
[
{
"from": "system",
"value": "Use in, because has_key seems to be deprecated\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n"
},
{
"from": "human",
"value": "import unittest\nfrom parameterized import parameterized\nfrom som.vm.universe import Universe\n... | python | chosen |
[
{
"from": "system",
"value": "Implement a test for environment.datetime_format\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom freezegun import freeze_time\nfrom jinja2 import Environment, exceptions\n\n\n@pytest.fixture(scope='session')\ndef environment():\n ... | python | chosen |
[
{
"from": "system",
"value": "Add create and drop db tasks\n"
},
{
"from": "human",
"value": "import os\n\nfrom flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\n\nfrom api import create_app, db\n\napplication = create_app(os.getenv('FLASK_CONFIG') or 'default')\n\n... | python | chosen |
[
{
"from": "system",
"value": "Rearrange imports of gettext and release because of dependencies in\ncircular import.\n"
},
{
"from": "human",
"value": "# 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#... | python | chosen |
[
{
"from": "system",
"value": "Make touch plugin touch files with lists\n"
},
{
"from": "human",
"value": "from pelican import signals\n\nimport logging\nimport os\nimport time\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef touch_file(path, context):\n content = context.get('article', cont... | python | chosen |
[
{
"from": "system",
"value": "Refresh script now displays error message\n"
},
{
"from": "human",
"value": "#from CreateTableFromDatabase import getRankingsFromDatabase\nimport time\nfrom CheckAndPostForSeriesSubmissions import checkNewSubmissions\n\n# Refreshes all other scripts every couple of ... | python | chosen |
[
{
"from": "system",
"value": "Add delimiter between global stuff and test cases\n\nHelps provide some oversight since this module is about to explode in size.\n\nContributes to issue CURA-3497.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2017 Ultimaker B.V.\n# Cura is released under the t... | python | chosen |
[
{
"from": "system",
"value": "Update random forest face example to use several cores\n"
},
{
"from": "human",
"value": "\"\"\"\n=======================================\nPixel importances with forests of trees\n=======================================\n\nThis example shows the use of forests of tr... | python | chosen |
[
{
"from": "system",
"value": "Hide the django backend db log messages.\n"
},
{
"from": "human",
"value": "import os\n\nfrom job_runner.settings.base import *\n\n\nDEBUG = True\nTEMPLATE_DEBUG = True\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'N... | python | chosen |
[
{
"from": "system",
"value": "Correct tuple for error message arguments\n"
},
{
"from": "human",
"value": "from . import bluegreen, context_handler\n\n# TODO: move as buildercore.concurrency.concurrency_for\ndef concurrency_for(stackname, concurrency_name):\n \"\"\"concurrency default is to p... | python | chosen |
[
{
"from": "system",
"value": "Change check_db connection resize step to wait database start process\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport logging\nfrom ...util.base import BaseStep\n\nLOG = logging.getLogger(__name__)\n\n\nclass CheckDatabaseStatus(BaseStep):\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add a package argument to import_symbol.\n"
},
{
"from": "human",
"value": "import importlib\n\n\ndef import_symbol(typename):\n \"\"\"Import a module or typename within a module from its name.\"\"\"\n try:\n return importlib.import_module(typename)\n\n... | python | chosen |
[
{
"from": "system",
"value": "Correct the off-by one error from logical to physical pages\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\nfrom lxml import etree\nimport sys\n\ncomments_file = open(\"examples/Technical_Document_Comments.xfdf\", \"r\")\ncomments_xml = etree.parse(comment... | python | chosen |
[
{
"from": "system",
"value": "Add the modules models and testtools to the doctest globals\n"
},
{
"from": "human",
"value": "from glob import glob\nimport doctest\nfrom doctest import DocFileSuite\nfrom os.path import dirname\nimport unittest\n\nfrom adhocracy.tests.testbrowser import ADHOCRACY_... | python | chosen |
[
{
"from": "system",
"value": "BUG: Fix test example so it runs."
},
{
"from": "human",
"value": "from numpy.testing import NumpyTest, NumpyTestCase\n\nclass test_Template(NumpyTestCase):\n\n def setUp(self): pass\n #print \"TestCase initialization...\"\n\n def test_foo(self): pass\n... | python | chosen |
[
{
"from": "system",
"value": "Use gpx.name as index to gpx data_frame\n"
},
{
"from": "human",
"value": "__author__ = 'max'\n\nimport gpxpy\nimport pandas as pd\n\n\ndef parse_gpx(gpx_file_name):\n return gpxpy.parse(gpx_file_name)\n\n\ndef data_frame_for_track_segment(segment):\n seg_dict... | python | chosen |
[
{
"from": "system",
"value": "Increase and fuzz sleep time\n"
},
{
"from": "human",
"value": "from listing import Listing, session\nfrom scraper import Scraper\nfrom slack import Slack\n\nimport sys\nimport traceback\nimport time\n\nslack = Slack()\n\ndef scrape():\n results = 0\n duplicat... | python | chosen |
[
{
"from": "system",
"value": "Switch to explicit imports for jujupy."
},
{
"from": "human",
"value": "from jujupy.client import *\nfrom jujupy.client import _temp_env\n\n__all__ = ['_temp_env']\n"
},
{
"from": "gpt",
"value": "from jujupy.client import (\n AgentsNotStarted,\n A... | python | chosen |
[
{
"from": "system",
"value": "Use explicit API(s) for examples\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# XXX: Broken - Does O_NONBLOCK work at all?\n\n\"\"\"An implementation of the Python Concurrency Problem of 99 Bottles of Beer\n\nSee: http://wiki.python.org/moin/Concurren... | python | chosen |
[
{
"from": "system",
"value": "Add capability to upload Leaflets\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.contrib import admin\n\n\nclass Leaflet(models.Model):\n '''\n Represents a given (generated) leaflet.\n '''\n\n competition = models.ForeignKe... | python | chosen |
[
{
"from": "system",
"value": "Add PySide to as.studio init preferred binding\n"
},
{
"from": "human",
"value": "\n#\n# This source file is part of appleseed.\n# Visit http://appleseedhq.net/ for additional information and resources.\n#\n# This software is released under the MIT license.\n#\n# Co... | python | chosen |
[
{
"from": "system",
"value": "Update new migration to match existing docstring\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ... | python | chosen |
[
{
"from": "system",
"value": "Use md5 password hasher for tests\n"
},
{
"from": "human",
"value": "import dj_database_url\n\n\nDATABASES = {\n 'default': dj_database_url.config(\n default='postgres://localhost/test_utils',\n ),\n}\nINSTALLED_APPS = (\n 'django.contrib.auth',\n ... | python | chosen |
[
{
"from": "system",
"value": "Add new way of retreiving graph layouts\n"
},
{
"from": "human",
"value": "from .random import random # noqa\nfrom .circular import circular # noqa\n"
},
{
"from": "gpt",
"value": "import inspect\n\nfrom .random import random\nfrom .circular import cir... | python | chosen |
[
{
"from": "system",
"value": "Add coverage to some of log.py\n"
},
{
"from": "human",
"value": "import json\nimport logging\nfrom unittest.mock import Mock, patch\n\nfrom jsonrpcclient.log import _trim_string, _trim_values\n\n\ndef test_trim_string():\n message = _trim_string(\"foo\" * 100)\n... | python | chosen |
[
{
"from": "system",
"value": "Update collections imports for deprecations\n"
},
{
"from": "human",
"value": "import collections\nfrom copy import deepcopy\n\n\nclass OrderedSet(collections.Set):\n\n def __init__(self, iterable=()):\n self.d = collections.OrderedDict.fromkeys(iterable)\... | python | chosen |
[
{
"from": "system",
"value": "Test case: failing print for python3\n"
},
{
"from": "human",
"value": "import sys\n\ndef parseCommandLine(argv):\n return argv[1] if len(argv) > 1 else \"\"\n\n\nif __name__ == \"__main__\":\n latin = parseCommandLine(sys.argv)\n print(latin)\n print(\"... | python | chosen |
[
{
"from": "system",
"value": "[libdotify] Fix path creation/git detection bugs\n"
},
{
"from": "human",
"value": "import os\nimport shlex\nimport logging\nimport subprocess\nimport contextlib\n\n@contextlib.contextmanager\ndef cd(newdir):\n prevdir = os.getcwd()\n os.chdir(os.path.expandus... | python | chosen |
[
{
"from": "system",
"value": "Update to run on port 5000\n\nFor development we will want to run multiple apps, so they should each bind to a different port number.\nThe default port is 5000 anyway, but we should state the port explicitly in the code which is why I've added it here.\n"
},
{
"from": "... | python | chosen |
[
{
"from": "system",
"value": "Fix up paths in system test.\n"
},
{
"from": "human",
"value": "\nfrom __future__ import print_function\n\nimport os\nimport netCDF4 as nc\n\nfrom model_test_helper import ModelTestHelper\n\nclass TestCouplingFields(ModelTestHelper):\n\n def __init__(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Set stratis-cli version to 3.1.0\n\nSigned-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>\n"
},
{
"from": "human",
"value": "# Copyright 2016 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not ... | python | chosen |
[
{
"from": "system",
"value": "Update KeyValuePair model so delete and other operations which require \"id\"\nattribute to be present still work.\n"
},
{
"from": "human",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTIC... | python | chosen |
[
{
"from": "system",
"value": "Improve subprocess call during deployment\n"
},
{
"from": "human",
"value": "import subprocess\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom django.http import JsonResponse, HttpResponseBadRequest\nfrom django.shortcuts import... | python | chosen |
[
{
"from": "system",
"value": "Improve on the collections, work, ...\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2017 Camptocamp SA\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)\n\n# TODO make API short paths\n# from odoo.addons.connector import ... | python | chosen |
[
{
"from": "system",
"value": "Update our fake test for debugging purpose.\n\n"
},
{
"from": "human",
"value": "import sys\n\nimport TestSCons\n\ntest = TestSCons.TestSCons(match = TestSCons.match_re)\n\nif sys.platform != 'win32':\n msg = \"Skipping Visual C/C++ test on non-Windows platform '... | python | chosen |
[
{
"from": "system",
"value": "Stop watching movies while editing code!"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\nfrom flask import jsonify\nfrom flask import current_app\n\nfrom influxdb import InfluxDBClient\n\n\nfrom app.base import ApiResource\n\nclass... | python | chosen |
[
{
"from": "system",
"value": "Add comment to explain import inside method\n"
},
{
"from": "human",
"value": "\nfrom rest_framework import status\nfrom rest_framework.exceptions import APIException\n\n\ndef json_api_exception_handler(exc, context):\n \"\"\" Custom exception handler that return... | python | chosen |
[
{
"from": "system",
"value": "Improve error message for authentication issues.\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the MIT License.\n\n\nclass Error(Exception):\n pass\n\n\... | python | chosen |
[
{
"from": "system",
"value": "Add message if transformer_hash already exists\n"
},
{
"from": "human",
"value": "from django.core.management.base import BaseCommand\n\nfrom ...utils import transformer\n\n\nclass Command(BaseCommand):\n def handle(self, filename, *args, **kwargs):\n read... | python | chosen |
[
{
"from": "system",
"value": "Add name to logout url regex\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\n\nurlpatterns = patterns('django.contrib.auth.views',\n\n url(r'^login/$', 'login', {'template_name': 'authentication/login.html'}),\n url(r'^l... | python | chosen |
[
{
"from": "system",
"value": "Add current_user to app properties\n"
},
{
"from": "human",
"value": "from flask import Flask\r\nfrom flask_login import LoginManager\r\nfrom config import config\r\n\r\ndatabase = {}\r\nlogin_manager = LoginManager()\r\n\r\ndef create_app(config_name):\r\n app =... | python | chosen |
[
{
"from": "system",
"value": "Check the instance against the original class declaration.\n"
},
{
"from": "human",
"value": "\"\"\"\nTo run this test:\n1. cd importlazy/tests\n2. python -m unittest test_importlazy.py\n\"\"\"\n\nimport unittest\nimport sys\n\n\nclass ImportLazyTest(unittest.TestCa... | python | chosen |
[
{
"from": "system",
"value": "Update test case for status handler accordingly\n"
},
{
"from": "human",
"value": "\"\"\"\n Test Status Endpoint\n\n GET /status\n HEAD /status\n\n\"\"\"\n\nfrom biothings.tests.web import BiothingsTestCase\nfrom setup import setup_es # pylint: disable=un... | python | chosen |
[
{
"from": "system",
"value": "Use Exception instead of StandardError\n\nStandardError was deprecated in python 3.X.\n"
},
{
"from": "human",
"value": "# Copyright 2016 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except ... | python | chosen |
[
{
"from": "system",
"value": "Adjust for new IATI Updates API; don't have to page through results\n"
},
{
"from": "human",
"value": "\n# IATI Data Quality, tools for Data QA on IATI-formatted publications\n# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith\n#\n# Copyright (C) 2013 ... | python | chosen |
[
{
"from": "system",
"value": "Change logging to use standard logging library.\n"
},
{
"from": "human",
"value": "__author__ = 'Matt Stibbs'\n__version__ = '1.27.00'\ntarget_schema_version = '1.25.00'\n\nfrom flask import Flask\napp = Flask(__name__)\n\n\ndef startup():\n import blockbuster.bb... | python | chosen |
[
{
"from": "system",
"value": "Check if target directory is empty instead of current directory and remove overwrite_if_exists argument\n"
},
{
"from": "human",
"value": "import os\n\ndef execute(name, branch, overwrite_if_exists=False):\n try:\n from cookiecutter.main import cookiecutte... | python | chosen |
[
{
"from": "system",
"value": "Raise exception is EMAIL_RECIPIENT not set\n"
},
{
"from": "human",
"value": "from contextlib import contextmanager\nimport logging\nimport smtplib\n\nfrom email.mime.multipart import MIMEMultipart\nfrom email.mime.text import MIMEText\n\nfrom settings import Settin... | python | chosen |
[
{
"from": "system",
"value": "Add get_bool to package exports\n"
},
{
"from": "human",
"value": "from .configobj import Config\n\nconfig = Config.from_environ()\n\n# Add the data and some of the API as attributes of the top-level package.\nglobals().update(config)\nget = config.get\n"
},
{
... | python | chosen |
[
{
"from": "system",
"value": "Make sure to set the test application instance as app for Signals\n\nThis makes singals be properly emitted in tests\n"
},
{
"from": "human",
"value": "# Copyright (c) 2016 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or higher.\n\nimport pyte... | python | chosen |
[
{
"from": "system",
"value": "Set xfailtags as first priority\n"
},
{
"from": "human",
"value": "import pytest\n\n\n@pytest.fixture(autouse=True)\ndef tagschecker(request):\n tags = set(request.config.getini('TAGS'))\n\n tags_marker = request.node.get_marker('tags')\n xfailtags_marker =... | python | chosen |
[
{
"from": "system",
"value": "Add strongly connected components's methods\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\n\ndef strongly_connected_components():\n \"\"\"Strongly connected comp... | python | chosen |
[
{
"from": "system",
"value": "Add URL to enable user list view\n"
},
{
"from": "human",
"value": "from django.conf.urls import patterns, include, url\nfrom django.views.generic.simple import direct_to_template\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\n\nfrom django.co... | python | chosen |
[
{
"from": "system",
"value": "Change name of results array.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# paramrunner.py\n# Run findparams on linde model and save results\nimport helpers\nimport findparams\nimport tables\nimport numpy as np \n\nsavedir = \"/home/ith/results/\"\ns... | python | chosen |
[
{
"from": "system",
"value": "Put modules in alphabetical order\n"
},
{
"from": "human",
"value": "__version__ = \"0.0.12\"\n\n__all__ = [\n 'adipls',\n 'utils',\n 'constants',\n 'gyre',\n 'fgong',\n 'mesa',\n 'stars'\n ]\n"
},
{
"from": "gpt",
"value": "__ver... | python | chosen |
[
{
"from": "system",
"value": "Fix list of submodules so that from tomso import * works\n"
},
{
"from": "human",
"value": "__version__ = \"0.0.11a\"\n\n__all__ = [\n 'adipls',\n 'common',\n 'gyre',\n 'io',\n 'mesa',\n 'stars'\n ]\n"
},
{
"from": "gpt",
"value": "_... | python | chosen |
[
{
"from": "system",
"value": "Build as 0.0.0-debug for now.\n"
},
{
"from": "human",
"value": "import os.path\r\nfrom buildlib import *\r\n\r\nCONFIGURATION = 'Debug'\r\n\r\nproject = Project(__file__, 'build')\r\n\r\nproject.version = '0.1.0'\r\nproject.versioninfo = 'alpha'\r\nproject.build_nu... | python | chosen |
[
{
"from": "system",
"value": "Add created to list_display; make it editable.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom django.contrib import admin\n\nfrom .models import Ticket\n\n\nclass TicketAdmin(admin.ModelAdmin):\n list_display = ['name', 'display_name', 'updated'... | python | chosen |
[
{
"from": "system",
"value": "Put course location urls in heartbeat page, rather than lists\n"
},
{
"from": "human",
"value": "import json\nfrom datetime import datetime\nfrom django.http import HttpResponse\nfrom xmodule.modulestore.django import modulestore\n\n\ndef heartbeat(request):\n \"... | python | chosen |
[
{
"from": "system",
"value": "Add the . into file_extension\n"
},
{
"from": "human",
"value": "\"\"\"Python script Exporter class\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, the IPython Development Team.\n#\n# Distributed under t... | python | chosen |
[
{
"from": "system",
"value": "Add a harder test example.\n"
},
{
"from": "human",
"value": "import numpy as np\nimport matplotlib.pyplot as pl\n\nimport pygp as pg\nimport pybo.models as pbm\nimport pybo.policies as pbp\n\n\nif __name__ == '__main__':\n sn = 0.2\n ell = 0.670104947766\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow changing domain to own\n"
},
{
"from": "human",
"value": "from flask_wtf import Form\nfrom wtforms import StringField, IntegerField, PasswordField, SubmitField, SelectField\nfrom wtforms.validators import Required, Length, Regexp\nfrom ..core.db import db\nfro... | python | chosen |
[
{
"from": "system",
"value": "Add User-Agent for better netiquette\n"
},
{
"from": "human",
"value": "import urllib.request\nimport urllib.parse\n\ndef get(urlStr,params={}):\n if params == {}:\n req = urllib.request.urlopen(urlStr)\n else:\n reqdata = urllib.request.Request(... | python | chosen |
[
{
"from": "system",
"value": "Fix NameError: global name 'messsage' is not defined\n"
},
{
"from": "human",
"value": "import json\n\n\nclass Database(dict):\n \"\"\"Holds a dict that contains all the information about the users in a channel\"\"\"\n def __init__(self, irc):\n super(D... | python | chosen |
[
{
"from": "system",
"value": "Remove old commented out code, and update version to 0.3\n"
},
{
"from": "human",
"value": "# These lines ARE needed, as they actually set up sys.meta_path\nfrom . import PatchWarnings\nfrom . import PatchBaseScientific\nfrom . import PatchScientific\n\nfrom .log im... | python | chosen |
[
{
"from": "system",
"value": "Fix unintended ImportError for wrong subcommnad\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport click\n\nfrom . import __version__\n\n\nclass JungleCLI(click.MultiCommand):\n\n \"\"\"Jangle CLI main class\"\"\"\n\n def list_commands(self, ct... | python | chosen |
[
{
"from": "system",
"value": "Change car color depending on acceleration rate\n"
},
{
"from": "human",
"value": "import pygame\n\n\nclass Graphic:\n car_color = (255, 50, 50)\n car_width = 3\n road_color = (255, 255, 255)\n road_width = 6\n draw_methods = {\n 'Car': 'draw_c... | python | chosen |
[
{
"from": "system",
"value": "[openmm] Update test for 7.2 beta build\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom simtk import openmm\n\n# Check major version number\n# If Z=0 for version X.Y.Z, out put is \"X.Y\"\nassert openmm.Platform.getOpenMMVersion() == '7.1.1', \"open... | python | chosen |
[
{
"from": "system",
"value": "Move deprecate reg classed to init\n"
},
{
"from": "human",
"value": "from .base import (\n BaseRegularization,\n LeastSquaresRegularization,\n BaseSimilarityMeasure,\n Small,\n SmoothDeriv,\n SmoothDeriv2,\n)\nfrom .regularization_mesh import Regu... | python | chosen |
[
{
"from": "system",
"value": "Fix missing numpy import in ucr test\n"
},
{
"from": "human",
"value": "\"\"\"\nScript for performing queries on large time series by using UCR ED and DTW algs.\n\"\"\"\n\n\nfrom time import time\nimport blaze\nfrom blaze.ts.ucr_dtw import ucr\n\n\n# Convert txt fil... | python | chosen |
[
{
"from": "system",
"value": "Fix that makes the media uploads work correctly.\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import patterns, url, include\nfrom django.conf import settings\nfrom django.contrib import admin\n\n\nadmin.autodiscover()\n\n\nurlpatterns = patterns... | python | chosen |
[
{
"from": "system",
"value": "Update DB to v4.2 on note pdf support\n"
},
{
"from": "human",
"value": "{\n PDBConst.Name: \"config\",\n PDBConst.Columns: [\n {\n PDBConst.Name: \"Name\",\n PDBConst.Attributes: [\"varchar(128)\", \"not null\", \"primary key\"]\n },\n ... | python | chosen |
[
{
"from": "system",
"value": "Return str rather than bytes for the description strings on python3.\n"
},
{
"from": "human",
"value": "def _magic_get_file_type(f, _):\n file_type = magic.from_buffer(f.read(1024), mime=True)\n f.seek(0)\n return file_type.decode('utf-8')\n\n\ndef _guess_f... | python | chosen |
[
{
"from": "system",
"value": "Fix an oversight in new type definitions\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nfrom typing import * # NOQA pylint:disable=wildcard-import,unused-wildcard-import\nfrom typing import NewType\n\nT_Address = bytes\nAddress = NewType('Address', byt... | python | chosen |
[
{
"from": "system",
"value": "Add o2m between project and logical frameworks lines\n"
},
{
"from": "human",
"value": "{\n 'name': \"Project Logical Framework\",\n 'category': 'Project',\n 'sequence': 1,\n 'description': \"\"\"\nProject Logical Framework\n=========================\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow API version specification via env var\n\nHard-coding the API version to '1.18' with the docker-py constructor will\ncause the docker-py logic at\nhttps://github.com/docker/docker-py/blob/master/docker/client.py#L143-L146\nto always fail, which will cause authentication is... | python | chosen |
[
{
"from": "system",
"value": "Fix logging so it doesn't erase the file\n"
},
{
"from": "human",
"value": "from threading import Thread\nfrom Queue import Queue\nfrom twisted.python import log\nimport time\nimport Mailbox, Web\nimport sys\nimport argparse\n\nparser = argparse.ArgumentParser()\npa... | python | chosen |
[
{
"from": "system",
"value": "Correct typo in setting names\n"
},
{
"from": "human",
"value": "import string\n\nfrom django.conf import settings\n\n\nCOUPON_TYPES = getattr(settings, 'COUPONS_COUPON_TYPES', (\n ('monetary', 'Money based coupon'),\n ('percentage', 'Percentage discount'),\n ... | python | chosen |
[
{
"from": "system",
"value": "Add OAuth class information to the UserAdmin page.\n"
},
{
"from": "human",
"value": "\n\nimport logging\n\nfrom django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin\nfrom django.contrib.auth.models import User\nfrom rest_framework.authtoken.... | python | chosen |
[
{
"from": "system",
"value": "Add a link for database urls\n"
},
{
"from": "human",
"value": "from quick_orm.core import Database\r\nfrom sqlalchemy import Column, String\r\n\r\n__metaclass__ = Database.DefaultMeta\r\n\r\nclass User:\r\n name = Column(String(30))\r\n\r\nDatabase.register()\r\... | python | chosen |
[
{
"from": "system",
"value": "Remove imports in Orange, except data\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom importlib import import_module\n\ntry:\n from .import version\n # Always use short_version here (see PEP 386)\n __version__ = version.short... | python | chosen |
[
{
"from": "system",
"value": "Handle missing and invalid email addresses.\n"
},
{
"from": "human",
"value": "from django.contrib.auth.models import User\nfrom django.contrib.sites.models import Site\nfrom django.core.management.base import BaseCommand\nfrom django.core.urlresolvers import revers... | python | chosen |
[
{
"from": "system",
"value": "FIX withholdings computation when payment come from invoices\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in m... | python | chosen |
[
{
"from": "system",
"value": "Fix OOM by reducing batch\n"
},
{
"from": "human",
"value": "#%% Setup.\nimport numpy as np\nimport scipy.io.wavfile\n\nfrom keras.utils.visualize_util import plot\nfrom keras.callbacks import TensorBoard, ModelCheckpoint\nfrom keras.utils import np_utils\n\nfrom ev... | python | chosen |
[
{
"from": "system",
"value": "Increase the timeout to an absurd value\n"
},
{
"from": "human",
"value": "# Load in core dependencies\nimport code\nimport os\nimport sublime\n\n# Set up constants\n__dir__ = os.path.dirname(os.path.abspath(__file__))\n\n\ndef run():\n # On every run, re-import ... | python | chosen |
[
{
"from": "system",
"value": "Add a new rating code\n"
},
{
"from": "human",
"value": "COMPANY_STANDARD_REPORT = \"NRGCompanyReportStandard\"\nCOMPANY_RATING_REPORT = \"NRGCompanyReportRating\"\n\nHIGH = 'AAA'\nGOOD = 'AA'\nWORTHY = 'A'\nBELOW_AVERAGE = 'B'\nBAD = 'C'\nMISSING = '-'\n\nRATING_CH... | python | chosen |
[
{
"from": "system",
"value": "Remove bootstrap helper to promote a user to organizer as there is a service function (and a script calling it) for that\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\n\"\"\"\nbootstrap.helpers\n~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2016 Jochen Kupper... | python | chosen |
[
{
"from": "system",
"value": "Add test for all plot types\n"
},
{
"from": "human",
"value": "\"\"\" Test ``yatsm line``\n\"\"\"\nimport os\n\nfrom click.testing import CliRunner\nimport matplotlib as mpl\nimport pytest\n\nfrom yatsm.cli.main import cli\n\nmpl_skip = pytest.mark.skipif(\n mpl.... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.