conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Use six.text_type for python3 compat"
},
{
"from": "human",
"value": "import decimal\nimport msgpack\nfrom dateutil.parser import parse\n\nfrom rest_framework.parsers import BaseParser\nfrom rest_framework.exceptions import ParseError\n\n\nclass MessagePackDecoder(o... | python | chosen |
[
{
"from": "system",
"value": "Add a dependency on docker-compose\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python3\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"portinus\",\n version=\"1.0.10\",\n author=\"Justin Dray\",\n author_email=\"justin@dray.be\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix shellish requirement bump rev to 2.3.1\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\nREADME = 'README.md'\n\n\ndef long_desc():\n try:\n import pypandoc\n except ImportError:\n with... | python | chosen |
[
{
"from": "system",
"value": "Add management file to packages so django can find it\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\n\nsetup(\n name='django-simpleimages',\n version='1.0.0',\n author='Saul Shanabrook',\n author_email='s.shanabrook@gmail.com',\n p... | python | chosen |
[
{
"from": "system",
"value": "Mark syweb as not being zip safe so that bundled files are accessible from the filesystem\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\n# Copyright 2014 OpenMarket Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n... | python | chosen |
[
{
"from": "system",
"value": "Fix version number to be higher\n"
},
{
"from": "human",
"value": "from setuptools import setup\n\nwith open(\"README.md\", \"r\") as fh:\n long_description = fh.read()\n\nsetup(\n name = 'invokust',\n version = '0.7',\n author = 'Max Williams',\n aut... | python | chosen |
[
{
"from": "system",
"value": "Use parser to add command line arg\n"
},
{
"from": "human",
"value": "from django.core.management import BaseCommand\n\nfrom corehq.apps.domain.forms import DimagiOnlyEnterpriseForm\nfrom corehq.apps.domain.models import Domain\nfrom corehq.util.decorators import re... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Version move to 2.0.0a1\"\n\nThis reverts commit 4cd7d3062037dab13c99f0dd9b44f08fbd894ffa.\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom hamcrest.core import *\nfrom hamcrest.library import *\n\n__version__ = \"2.0.0a1\"\n_... | python | chosen |
[
{
"from": "system",
"value": "Add profilers selection as CLI option.\n"
},
{
"from": "human",
"value": "\"\"\"Visual profiler for Python.\"\"\"\nimport argparse\nimport functools\nimport json\nimport profile\nimport stats_server\nimport subprocess\nimport sys\n\n_MODULE_DESC = 'Python visual pro... | python | chosen |
[
{
"from": "system",
"value": "Change is_luci default to True.\n\nMost things should be on LUCI now, so this better reflects reality, and\nmight help shakeout any obsolete non-LUCI handling.\n\nBug: 993137\nRecipe-Nontrivial-Roll: build\nRecipe-Nontrivial-Roll: build_limited_scripts_slave\nRecipe-Nontrivial-... | python | chosen |
[
{
"from": "system",
"value": "Fix reversion register in sample app\n"
},
{
"from": "human",
"value": "from django.db import models\n\nimport reversion\nfrom yawf.revision import RevisionModelMixin\n\n\nclass WINDOW_OPEN_STATUS:\n\n MINIMIZED = 'minimized'\n MAXIMIZED = 'maximized'\n NOR... | python | chosen |
[
{
"from": "system",
"value": "Send query from android device to server\n"
},
{
"from": "human",
"value": "''' \nScript used to query Wikipedia for summary of object \n'''\n\nimport sys\nimport wikipedia \n\ndef main():\n\t# Check that we have the right number of arguments \n\tif (len(sys.argv) !... | python | chosen |
[
{
"from": "system",
"value": "Check for the first part of the version string\n\nOlder CentOS Linux images only used the xxxx part of the full xxxx.yy\nversion string from Atlas.\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nclass PolicyError(RuntimeError):\n de... | python | chosen |
[
{
"from": "system",
"value": "Add CORS headers to js files for local dev\n"
},
{
"from": "human",
"value": "\"\"\"\nsentry.web.frontend.generic\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details... | python | chosen |
[
{
"from": "system",
"value": "fix(macro): Change the byline format for NPK MAcro\n"
},
{
"from": "human",
"value": "\"\"\"\r\n NPKSisteNytt Metadata Macro will perform the following changes to current content item:\r\n - change the byline to \"(NPK-NTB)\"\r\n - change the signoff to \"n... | python | chosen |
[
{
"from": "system",
"value": "Add tests for measuring the speed of probabilistic interleaving\n"
},
{
"from": "human",
"value": "import interleaving as il\nimport numpy as np\nimport pytest\nnp.random.seed(0)\nfrom .test_methods import TestMethods\n\nclass TestProbabilisticInterleaveSpeed(TestMe... | python | chosen |
[
{
"from": "system",
"value": "Update reshape_image test for new decoupled io function\n"
},
{
"from": "human",
"value": "import numpy as np\nimport rasterio\n\ndef test_reshape():\n with rasterio.open('tests/data/RGB.byte.tif') as src:\n im_data = rasterio.plot.reshape_as_image(src)\n ... | python | chosen |
[
{
"from": "system",
"value": "Update settings for reading config files\n\nUpdate the definition of comments, now only allowing the use of \"#\"\nfor comments. Add a converter function to parse list of floats,\nsuch as:\n\n list_of_floats = [1.0, 2.0, 3.0]\n"
},
{
"from": "human",
"value": "\"... | python | chosen |
[
{
"from": "system",
"value": "Fix local interface addr parsing\n\nOn Fedora 21 the format of ifconfig is a little different.\n\nFixes #17\n"
},
{
"from": "human",
"value": "r'''\nCopyright 2014 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\... | python | chosen |
[
{
"from": "system",
"value": "Remove vendor-specific paths on LBaaS agent executables\n\nThe monasca agent uses simple string matching in the process detection\nplugin. This can result in false positive matches in the case where a\nprocess name appears elsehwere in the \"ps\" output. In particular,\n\"neu... | python | chosen |
[
{
"from": "system",
"value": "ENH: Add example for injecting user transform\n"
},
{
"from": "human",
"value": "import statsmodels.api as sm\nimport numpy as np\n\nstar98 = sm.datasets.star98.load_pandas().data\n\nformula = 'SUCCESS ~ LOWINC + PERASIAN + PERBLACK + PERHISP + PCTCHRT '\nformula +=... | python | chosen |
[
{
"from": "system",
"value": "Use pathlib to read ext.conf\n"
},
{
"from": "human",
"value": "import os\n\nfrom mopidy import config, ext\nfrom mopidy.exceptions import ExtensionError\n\n__version__ = \"2.1.0\"\n\n\nclass Extension(ext.Extension):\n\n dist_name = \"Mopidy-SoundCloud\"\n ex... | python | chosen |
[
{
"from": "system",
"value": "Use production dashboard API endpoint"
},
{
"from": "human",
"value": "import click\nimport requests\n\nfrom shub.utils import find_api_key\nfrom shub.click_utils import log\n\n\n@click.command(help=\"Download a project's eggs from the Scrapy Cloud\")\n@click.argume... | python | chosen |
[
{
"from": "system",
"value": "Make an error go to stderr and remove net 1 LOC\n"
},
{
"from": "human",
"value": "\"\"\"\nThis file provides a single interface to unittest objects for our\ntests while supporting python < 2.7 via unittest2.\n\nIf you need something from the unittest namespace it s... | python | chosen |
[
{
"from": "system",
"value": "Add a test to check for regular object reference count\n\nhttps://bugzilla.gnome.org/show_bug.cgi?id=639949\n"
},
{
"from": "human",
"value": "# -*- Mode: Python -*-\n\nimport unittest\n\nimport gobject\nimport testhelper\n\n\nclass TestGObjectAPI(unittest.TestCase)... | python | chosen |
[
{
"from": "system",
"value": "Add test to ensure talons.helpers.import_function returns a callable\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n#\n# Copyright 2013 Jay Pipes\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file exce... | python | chosen |
[
{
"from": "system",
"value": "Update deprecated allow_tags to format_html\n"
},
{
"from": "human",
"value": "from django.db import models\n\n\nclass WebMentionResponse(models.Model):\n response_body = models.TextField()\n response_to = models.URLField()\n source = models.URLField()\n ... | python | chosen |
[
{
"from": "system",
"value": "Move exclude pattern to its own line.\n"
},
{
"from": "human",
"value": "from django.conf import settings\n\n# The name of the iterable ``django-discoverage`` looks for in the discovery\n# process\nTESTED_APPS_VAR_NAME = getattr(settings, 'TESTED_APPS_VAR_NAME', 'TE... | python | chosen |
[
{
"from": "system",
"value": "Add the standard __future__ imports\n"
},
{
"from": "human",
"value": "class FailedSynchronization(Exception):\n pass\n\n\nclass SynchronizationTimeout(Exception):\n \"\"\"\n A synchronization for a particular project took longer than the timeout.\n \"\"... | python | chosen |
[
{
"from": "system",
"value": "Support deprecated use of the interface property of Bond.\n"
},
{
"from": "human",
"value": "# Copyright 2015 Internap.\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... | python | chosen |
[
{
"from": "system",
"value": "Update the put put text\n"
},
{
"from": "human",
"value": "musketeersName = 'Tom Dick Harry'\nprint 'Three musketeers are', musketeersName\n\nmusketeer_1 = musketeersName[0:3]\nprint 'First musketeer :', musketeer_1\n\nmusketeer_2 = musketeersName[4:8]\nprint 'Secon... | python | chosen |
[
{
"from": "system",
"value": "Handle importerrors when f.x. we are installing\n"
},
{
"from": "human",
"value": "import logging\n\nimport click\nfrom lockfile import LockFile, LockTimeout\n\nlogger = logging.getLogger('spoppy.main')\n\n\ndef get_version():\n return '1.1.0'\n\n\n@click.command... | python | chosen |
[
{
"from": "system",
"value": "circuits.web: Add url and expose to this namesapce\n"
},
{
"from": "human",
"value": "# Module:\t__init__\n# Date:\t\t3rd October 2008\n# Author:\tJames Mills, prologic at shortcircuit dot net dot au\n\n\"\"\"Circuits Library - Web\n\ncircuits.web contains the circu... | python | chosen |
[
{
"from": "system",
"value": "Hide debug_toolbar in admin application\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nfrom .base import *\n\nDEBUG = True\nTEMPLATE_DEBUG = True\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.contrib.gis.db.backends.postgis',\n 'NAME': 'd... | python | chosen |
[
{
"from": "system",
"value": "Use exitcode of running the annotated steps script\n\nIf there is an error in the annotated steps we will still have a green bot!!!!\n\nExample:\nhttp://chromegw.corp.google.com/i/client.dart/builders/dartium-lucid64-full-be/builds/3566/steps/annotated_steps/logs/stdio\n\nTBR=w... | python | chosen |
[
{
"from": "system",
"value": "Fix version in web pages\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015, Daniele Venzano\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": "Use Instance Objects for Start/Stop\n\nThis patch makes the start and stop operations use the Instance\nobject instead of passing SQLA-derived dicts over RPC. Until\nsomething more sophisticated is needed (and developed), it also\nadds a nova.object.register_all() function whic... | python | chosen |
[
{
"from": "system",
"value": "Remove extra whitespace from bug title\n\nSigned-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Debian Changes Bot\n# Copyright (C) 2008 Chris Lamb <chris@chris-lamb... | python | chosen |
[
{
"from": "system",
"value": "Update to use token instead of email+pass\n"
},
{
"from": "human",
"value": "import discord\r\nimport asyncio\r\nfrom tqdm import tqdm\r\nimport argparse\r\n\r\nparser = argparse.ArgumentParser(description='Discord channel scraper')\r\nrequiredNamed = parser.add_arg... | python | chosen |
[
{
"from": "system",
"value": "Use unittest and make sure a few other cases don't crash\n"
},
{
"from": "human",
"value": "from test.test_support import vereq, TestFailed\n\nimport symtable\n\nsymbols = symtable.symtable(\"def f(x): return x\", \"?\", \"exec\")\n\n## XXX\n## Test disabled because... | python | chosen |
[
{
"from": "system",
"value": "Convert OMDB scrapper to grab xml\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n# OMDB_api_scrape.py - parses a movie and year from the command line, grabs the\n# JSON and saves a copy for later\n\nimport json, requests, sys, os\n\nURL_... | python | chosen |
[
{
"from": "system",
"value": "Add fab task for syncing pgup with mezzo\n"
},
{
"from": "human",
"value": "from fabric.api import task, local\n\n@task\ndef up():\n \"\"\"\n Deploy new release to pypi. Using twine util\n \"\"\"\n local(\"rm -rf dist\")\n local(\"rm -rf pgup.egg-... | python | chosen |
[
{
"from": "system",
"value": "Mark instance variables private with leading _\n"
},
{
"from": "human",
"value": "class Node(object):\n def __init__(self, value):\n pass\n\n def value(self):\n pass\n\n def next(self):\n pass\n\n\nclass LinkedList(object):\n def __i... | python | chosen |
[
{
"from": "system",
"value": "Add all optional dependencies to version info dict\n"
},
{
"from": "human",
"value": "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nThis module provides tools to return the installed astropy and photutils\nversions.\n\"\"\"\nfrom datetime ... | python | chosen |
[
{
"from": "human",
"value": "test: Create stub of fit testing\n"
},
{
"from": "gpt",
"value": "\"\"\"\nThis module contains tests of code from the file named\n`../forecastonishing/selection/on_the_fly_selector.py`.\n\n@author: Nikolay Lysenko\n\"\"\"\n\n\nimport unittest\n\nimport numpy as np\ni... | python | chosen |
[
{
"from": "system",
"value": "Add a update query to fix templates_history where the created_by_id is missing.\n"
},
{
"from": "human",
"value": "\"\"\"empty message\n\nRevision ID: 0014_add_template_version\nRevises: 0013_add_loadtest_client\nCreate Date: 2016-05-11 16:00:51.478012\n\n\"\"\"\n\n... | python | chosen |
[
{
"from": "system",
"value": "Fix STL Writer to properly advertise itself as mesh writer\n\nThis makes the STL writer show up correctly\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 Ultimaker B.V.\n# Uranium is released under the terms of the AGPLv3 or higher.\n\nfrom . import STLWrite... | python | chosen |
[
{
"from": "system",
"value": "Fix return value in case user was not found\n"
},
{
"from": "human",
"value": "from rest_framework_httpsignature.authentication import SignatureAuthentication\n\nfrom keybar.models.user import User\n\n\nclass KeybarApiSignatureAuthentication(SignatureAuthentication)... | python | chosen |
[
{
"from": "system",
"value": "Fix creation of BOM when create Variant\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom odoo import models, api\n\n\nclass ProductTemplate(models.Model):\n _inherit = 'product.template'\n\n @api.multi\n def create_variant(self, value_ids,... | python | chosen |
[
{
"from": "system",
"value": "Allow overriding the DATABASE_URL with an environment varible if in development mode\n"
},
{
"from": "human",
"value": "from os import getenv\n\nclass Config(object):\n DEBUG = False\n TESTING = False\n SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL')\n ... | python | chosen |
[
{
"from": "system",
"value": "Include player data migration in setup\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setup.create_teams import migrate_teams\nfrom setup.create_divisions import create_divisions\n\n\nif __name__ == '__main__':\n # migra... | python | chosen |
[
{
"from": "system",
"value": "Fix tests for Django 1.8\n"
},
{
"from": "human",
"value": "import django.template\nimport django.template.loader\nimport pretend\n\n\ndef test_compile_filter(monkeypatch):\n\n compile_static = pretend.call_recorder(lambda source_path: \"compiled\")\n monkeypa... | python | chosen |
[
{
"from": "system",
"value": "Add tests to minimally exercise basic conversion functionality\n"
},
{
"from": "human",
"value": "from asciisciit import conversions as conv\nimport numpy as np\n\n\ndef test_lookup_method_equivalency():\n img = np.random.randint(0, 255, (300,300), dtype=np.uint8... | python | chosen |
[
{
"from": "system",
"value": "Make Nao say its name and the programming language\n"
},
{
"from": "human",
"value": "\"\"\"Export long monologues for Nao.\n\nFunctions:\nintroduction -- Make Nao introduce itself.\n\"\"\"\n\nimport time\nfrom say import say\n\n\ndef introduction(tts):\n \"\"\"M... | python | chosen |
[
{
"from": "system",
"value": "Fix line ending printing on Python 3\n\nTo reflect the changes in\nhttps://chromium-review.googlesource.com/c/chromium/src/+/2896248/8/third_party/node/node.py\n\nR=993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org\n\nBug: none\nChange-Id: I25ba29042f537bfef57fba93115be2c19... | python | chosen |
[
{
"from": "system",
"value": "Add MCMemoryNetwork as a usable solver\n"
},
{
"from": "human",
"value": "from .nn_solver import NNSolver\nfrom .lstm_solver import LSTMSolver\nfrom .tree_lstm_solver import TreeLSTMSolver\nfrom .memory_network import MemoryNetworkSolver\nfrom .differentiable_search... | python | chosen |
[
{
"from": "system",
"value": "Update clear buffer cache plugin to only flush page cache.\n\nMore detail: http://linux-mm.org/Drop_Caches\n\nChange-Id: I7fa675ccdc81f375d88e9cfab330fca3bc983ec8\nReviewed-on: http://gerrit.ent.cloudera.com:8080/1157\nReviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f246... | python | chosen |
[
{
"from": "system",
"value": "Return tuple instead of list."
},
{
"from": "human",
"value": "\"\"\"\nConvert code to human readable text\n\"\"\"\n\n# Standard library modules.\nimport re\n\n# Third party modules.\n\n# Local modules.\n\n# Globals and constants variables.\n_CAMELCASE_TO_WORDS_PATT... | python | chosen |
[
{
"from": "system",
"value": "Initialize rotors with notches and wiring data\n"
},
{
"from": "human",
"value": "import string\n\n\nclass Steckerbrett:\n def __init__(self):\n pass\n\n\nclass Umkehrwalze:\n def __init__(self, wiring):\n self.wiring = wiring\n\n def encode(s... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in RNN dropout\n"
},
{
"from": "human",
"value": "import tensorflow as tf\n\n\ndef rnn_cell(num_units, dropout, mode, residual=False, name=None, reuse=None):\n dropout = dropout if mode == tf.contrib.learn.ModeKeys.TRAIN else 0.0\n\n cell = tf.nn.rnn_c... | python | chosen |
[
{
"from": "system",
"value": "Remove /submit endpoint from UI blueprint for now\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport base64\nimport json\n\nfrom nacl.encoding import URLSafeBase64Encoder\nimport nacl.exceptions\nimport nacl.signing\nfrom flask import Blueprint, ab... | python | chosen |
[
{
"from": "system",
"value": "Make aquilon a namespace package\n\nIn the future we may want to import the protocols as \"from\naquilon.protocols import blah\", and that needs both the broker and the\nprotocols to be marked as namespace packages.\n\nChange-Id: Ib3b712e727b0dd176c231a396bec4e7168a0039e\nRevie... | python | chosen |
[
{
"from": "system",
"value": "Add exception for Logic Errors\n"
},
{
"from": "human",
"value": "# Copyright 2014 Cloudbase Solutions Srl\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with th... | python | chosen |
[
{
"from": "system",
"value": "Add helper function for connecting with Neovim\n"
},
{
"from": "human",
"value": "from client import Client\nfrom uv_stream import UvStream\n\n__all__ = ['Client', 'UvStream', 'c']\n"
},
{
"from": "gpt",
"value": "from client import Client\nfrom uv_strea... | python | chosen |
[
{
"from": "system",
"value": "Increase timeout for GM on Android\n\nUnreviewed.\n(SkipBuildbotRuns)\n\nReview URL: https://codereview.chromium.org/18845002\n\ngit-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9906 2bbb7eff-a529-9590-31e7-b0007b416f81\n"
},
{
"from": "human",
"value": "#!/usr/... | python | chosen |
[
{
"from": "system",
"value": "Entity: Remove components as class attribute\n\nIt is meant to be an instance attribute and should be defined in\ninit() instead.\n"
},
{
"from": "human",
"value": "\"\"\"This module contains base classes for defining game objects as well\nas their individual compon... | python | chosen |
[
{
"from": "system",
"value": "Fix broken link to ragged tensor guide\n\nPiperOrigin-RevId: 368443422\nChange-Id: I69818413b7ed8cf2f372580878860a469b9735a8\n"
},
{
"from": "human",
"value": "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Ver... | python | chosen |
[
{
"from": "system",
"value": "[build] Add libbz2-dev dependency for PinPlay\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\nimport sys, os\n\n# list of (packagename, filename)\n\nDEPENDENCIES = [\n ('zlib1g-dev / zlib-devel', '/usr/include/zlib.h'),\n ('g++ / gcc-c++', '/usr/bin/g+... | python | chosen |
[
{
"from": "system",
"value": "Make user field read-only in InstitutionSerializer\n"
},
{
"from": "human",
"value": "from rest_framework import serializers\n\nfrom .models import Institution\n\n\nclass InstitutionSerializer(serializers.HyperlinkedModelSerializer):\n on_site = serializers.CharF... | python | chosen |
[
{
"from": "system",
"value": "Add new model fields to form\n"
},
{
"from": "human",
"value": "from django import forms\nfrom .models import Tutorial\n\n\nclass TutorialForm(forms.ModelForm):\n # ToDO: Set required fields??\n\n class Meta:\n model = Tutorial\n fields = ('title... | python | chosen |
[
{
"from": "system",
"value": "Add a reset task to drop and recreate the db tables with one command."
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nfrom flask import current_app, g\nfrom flask.ext.script import Manager, Server, prompt_bool\nfrom massa import create_app\n\n\nmanager =... | python | chosen |
[
{
"from": "system",
"value": "Manage can now clean up pyc files\n"
},
{
"from": "human",
"value": "# Set the path\nimport os, sys\nsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))\n\nfrom flask.ext.script import Manager, Server\nfrom maproulette import app\n\nmanag... | python | chosen |
[
{
"from": "system",
"value": "Remove erase of coverage file as it's needed by coveralls\n"
},
{
"from": "human",
"value": "import os\n\nCOV = None\n\nif os.environ.get('FLASK_COVERAGE'):\n import coverage\n COV = coverage.coverage(branch=True, include='app/*')\n COV.start()\n\nfrom flas... | python | chosen |
[
{
"from": "system",
"value": "Update the default url port"
},
{
"from": "human",
"value": "'''\r\nCreated on 01.06.2014\r\n\r\n@author: ionitadaniel19\r\n'''\r\nfrom selenium.webdriver.support.wait import WebDriverWait\r\nfrom selenium.webdriver.support import expected_conditions as EC\r\nfrom s... | python | chosen |
[
{
"from": "system",
"value": "Test to enforce that center_image preserves shape\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os.path\n\nimport numpy as np\nfrom numpy.testing import ass... | python | chosen |
[
{
"from": "system",
"value": "Fix test for Python 3\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom jip.repository import MavenFileSystemRepos\nfrom jip.maven import Artifact\nfrom contextlib import contextmanager\nimport shutil\nimport tempfile\n\nimport errno \nimport os\n\n@cont... | python | chosen |
[
{
"from": "system",
"value": "Fix bug in format suffix patterns\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import url\nfrom rest_framework.settings import api_settings\n\n\ndef format_suffix_patterns(urlpatterns, suffix_required=False, suffix_kwarg=None):\n \"\"\"\n ... | python | chosen |
[
{
"from": "system",
"value": "Remove redundant _is_multivariate in ConditionSet\n\nSigned-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>\n"
},
{
"from": "human",
"value": "from __future__ import print_function, division\n\nfrom sympy.core.basic import Basic\nfrom sympy.... | python | chosen |
[
{
"from": "system",
"value": "Add `--cancel-jobs` to manual cleanup script\n\nAdd an option to this script to cancel all ACTIVE,INACTIVE tasks (i.e.\nnot SUCCEDED,FAILED).\nWhile this can disrupt a run of the tests pretty badly if you run it\nwhile the tets are running, it's pretty much the only way to \"fi... | python | chosen |
[
{
"from": "system",
"value": "Call super constructor for BitforgeError\n"
},
{
"from": "human",
"value": "\nclass BitforgeError(Exception):\n def __init__(self, *args, **kwargs):\n self.cause = kwargs.pop('cause', None)\n self.prepare(*args, **kwargs)\n self.message = sel... | python | chosen |
[
{
"from": "system",
"value": "Include user in create_access_token return value\n"
},
{
"from": "human",
"value": "from datetime import datetime, timedelta\n\nfrom ..schema import UserSchema\n\n\nclass TokenFactory(object):\n def __init__(self, request, user):\n self.user = user\n ... | python | chosen |
[
{
"from": "system",
"value": "Make m2sh have the same version number as mongrel2."
},
{
"from": "human",
"value": "\ntry:\n from setuptools import setup\nexcept ImportError:\n from distutils.core import setup\n\nconfig = {\n 'description': 'Python Connector for Mongrel2',\n 'author':... | python | chosen |
[
{
"from": "system",
"value": "Update to the v3 api\n"
},
{
"from": "human",
"value": "#!/usr/bin/python3\n\nimport requests\nimport pprint\nimport argparse\n\nparser = argparse.ArgumentParser(description='A tool to check if your email account has been in a breach By Jay Townsend')\nparser.add_ar... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in BackdropUser admin model\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\nfrom django.contrib import admin\nfrom django.db import models\nimport reversion\nfrom stagecraft.apps.datasets.models.backdrop_user import BackdropUser\... | python | chosen |
[
{
"from": "system",
"value": "Add test for button URLs including a 'next' parameter\n"
},
{
"from": "human",
"value": "from django.test import TestCase\nfrom django.urls import reverse\n\nfrom wagtail.tests.utils import WagtailTestUtils\n\n\nclass TestContentTypeUse(TestCase, WagtailTestUtils):\... | python | chosen |
[
{
"from": "system",
"value": "Fix end_date management with Question Page\n"
},
{
"from": "human",
"value": "from django.contrib.postgres.fields import ArrayField\nfrom django.db import models\n\n\nclass Track(models.Model):\n \"\"\"\n This model help us to store midi files.\n It will be... | python | chosen |
[
{
"from": "system",
"value": "Make IRC message delay configurable\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.util.irc\n~~~~~~~~~~~~~~~\n\nSend IRC messages to a bot via HTTP.\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"\"\"\n\nfrom ti... | python | chosen |
[
{
"from": "system",
"value": "Remove namespace from RD2 enablement check\n"
},
{
"from": "human",
"value": "import simple_salesforce\nfrom cumulusci.tasks.salesforce import BaseSalesforceApiTask\n\nclass is_rd2_enabled(BaseSalesforceApiTask):\n def _run_task(self):\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Allow testing of specific apps.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# coding: utf-8\nimport sys\nfrom os.path import abspath\nfrom os.path import dirname\n\n# Load Django-related settings; necessary for tests to run and for Django\n# imports to... | python | chosen |
[
{
"from": "system",
"value": "Version: Fix __version_full__ for new scheme.\n"
},
{
"from": "human",
"value": "\"\"\"Cloud browser application.\n\nProvides a simple filesystem-like browser interface for cloud blob datastores.\n\"\"\"\n\nVERSION = (0, 2, 1)\n\n__version__ = \".\".join(str(v) for ... | python | chosen |
[
{
"from": "system",
"value": "Update tests to work under django 1.8+\n"
},
{
"from": "human",
"value": "from bitcategory import models\nfrom django.dispatch import receiver\nfrom django.db.models.signals import post_syncdb\n\n\n@receiver(post_syncdb, sender=models)\ndef load_test_categories(send... | python | chosen |
[
{
"from": "system",
"value": "Allow processor to handle the fact that the attribute might have no values, or that they are not scoped\n"
},
{
"from": "human",
"value": "from ..attribute_processor import AttributeProcessorError\nfrom .base_processor import BaseProcessor\n\n\nCONFIG_KEY_MAPPEDATTR... | python | chosen |
[
{
"from": "system",
"value": "Fix typo: `dolphine` -> `dolphin`\n"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\nAutocompletion example.\n\nPress [Tab] to complete the current word.\n- The first Tab press fills in the common part of all completions\n and shows all the complet... | python | chosen |
[
{
"from": "system",
"value": "FIX default behaviour of printing\n"
},
{
"from": "human",
"value": "# Copyright (c) 2018 Emanuel Cino <ecino@compassion.ch>\n\nfrom odoo import models, api\n\n\nclass IrActionsReport(models.Model):\n\n _inherit = \"ir.actions.report\"\n\n @api.multi\n def ... | python | chosen |
[
{
"from": "system",
"value": "refactor: Add a redirect for / -> /api\n\n- This got really annoying in development to remember to go to /api all the time\n- Potentially in the future we will build a test landing page on / to test that\nthe API works instead of having to rely on third party tools or just manu... | python | chosen |
[
{
"from": "system",
"value": "Add _all__ to the module.\n"
},
{
"from": "human",
"value": "# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright owner... | python | chosen |
[
{
"from": "system",
"value": "Change dateparser to datetime to use with Jupyter\n"
},
{
"from": "human",
"value": "import json\nimport os\nimport sys\n\nimport dateparser\n\n__DATA_DIR = '../data/'\n\ndef harmonize_data( data ):\n ## make dates as date objects\n data2 = []\n for d in da... | python | chosen |
[
{
"from": "system",
"value": "Insert a valid test task\n"
},
{
"from": "human",
"value": "import json\nimport sys\nimport shutil\nimport os\n\n#Copy /ro/task (which is read-only) in /task. Everything will be executed there\nshutil.copytree(\"/ro/task\",\"/task\")\n\n#Change directory to /task\no... | python | chosen |
[
{
"from": "system",
"value": "Fix unit-test failing on disabled functions.\n"
},
{
"from": "human",
"value": "# OpenMV Unit Tests.\n#\nimport os, sensor, gc\n\nTEST_DIR = \"unittest\"\nTEMP_DIR = \"unittest/temp\"\nDATA_DIR = \"unittest/data\"\nSCRIPT_DIR = \"unittest/script\"\n\nif no... | python | chosen |
[
{
"from": "system",
"value": "Fix test_runner_work_in_environments_with_no_pip to work under --use-zipapp\n"
},
{
"from": "human",
"value": "import os\nfrom pathlib import Path\n\nfrom pip import __version__\nfrom tests.lib import PipTestEnvironment\n\n\ndef test_runner_work_in_environments_with... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.