conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove star imports to remove pyflakes errors\n"
},
{
"from": "human",
"value": "from .permission_checks import *\nfrom .public import *\nfrom .retrieve import *\n"
},
{
"from": "gpt",
"value": "from .permission_checks import user_id_matches\nfrom .publi... | python | chosen |
[
{
"from": "system",
"value": "Change ping result error handling to return values instead of raise exception\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ i... | python | chosen |
[
{
"from": "system",
"value": "Drop threads down to limit memory consumption\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport sys\n\nimport requests\n\nfrom gratipay.utils import markdown\nfrom gratipay.utils.threaded_... | python | chosen |
[
{
"from": "system",
"value": "Put un-stash in finally block\n\nWithout it a failure will lead to us not putting the user back in the\nstate they expect to be in\n"
},
{
"from": "human",
"value": "import contextlib\nimport logging\nimport subprocess\n\nLOGGER = logging.getLogger(__name__)\n\ndef ... | python | chosen |
[
{
"from": "system",
"value": "Update ImageProblem to use PrepareImage step.\n"
},
{
"from": "human",
"value": "import numpy as np\n\nfrom puzzle.problems import problem\n\n\nclass ImageProblem(problem.Problem):\n def __init__(self, name: str, data: np.ndarray, *args, **kwargs) -> None:\n sup... | python | chosen |
[
{
"from": "system",
"value": "Fix no input call command\n"
},
{
"from": "human",
"value": "from django.apps import apps\nfrom django.conf import settings\nfrom django.contrib.gis.gdal import SpatialReference\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.core.management im... | python | chosen |
[
{
"from": "system",
"value": "Make output similar to Define NGS experiment tool"
},
{
"from": "human",
"value": "# TOOL test-phenodata-output.py: \"Test phenodata output in Python\" () \n# OUTPUT phenodata.tsv\n# OUTPUT output.tsv\n\nwith open('output.tsv', 'w') as f:\n\tf.write('test\toutput\\n... | python | chosen |
[
{
"from": "system",
"value": "Make get_compiler_flags optional for PythonValidator. (Fixes ptipython.)\n"
},
{
"from": "human",
"value": "from __future__ import unicode_literals\n\nfrom prompt_toolkit.validation import Validator, ValidationError\n\n__all__ = (\n 'PythonValidator',\n)\n\n\ncla... | python | chosen |
[
{
"from": "system",
"value": "Complete lonely int by naive dict & bit op\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\ndef lonely_integer():\n\tpass\n\n\ndef main():\n\tpass\n\n\nif __name__ ==... | python | chosen |
[
{
"from": "system",
"value": "Fix cfg_manager not existing in AbstractDatabaseGateway\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2005 onwards University of Deusto\n# All rights reserved.\n#\n# This software is licensed as described in the fi... | python | chosen |
[
{
"from": "system",
"value": "Check final count of statements.\n"
},
{
"from": "human",
"value": "from indra.sources import rlimsp\n\n\ndef test_simple_usage():\n rp = rlimsp.process_from_webservice('PMC3717945')\n stmts = rp.statements\n assert len(stmts) == 6, len(stmts)\n for s in... | python | chosen |
[
{
"from": "system",
"value": "Make wrapper returned by `returns_blocks` decorator, understand additional `args` and `kwargs` arguments.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nimport os.path\n\nfrom django.http import HttpResponse\nfrom django.conf import settings\nfrom funct... | python | chosen |
[
{
"from": "system",
"value": "Update database close timeout value.\n"
},
{
"from": "human",
"value": "import thread\n\nimport time\nfrom django.db import close_old_connections\n\n\nclass DatabaseConnectionMaintainer(object):\n def __init__(self):\n self.clients = set()\n # self.... | python | chosen |
[
{
"from": "system",
"value": "Test barcode function with all shippers\n"
},
{
"from": "human",
"value": "import pytest\n\nimport drogher\nfrom drogher.exceptions import InvalidBarcode\n\n\nclass TestDrogher:\n def test_barcode(self):\n shipper = drogher.barcode('1Z999AA10123456784')\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix problem on letter list display when the letter is a <space>\n\nWork around for now for issue #10. And will need to be permanant, since\nthe real fix to the database import would make removing the space\noptional.\n"
},
{
"from": "human",
"value": "# encoding: ci... | python | chosen |
[
{
"from": "system",
"value": "Add order in nodes in topic creation form\n"
},
{
"from": "human",
"value": "# -*- coding:utf-8 -*-\n\nfrom flask.ext.sqlalchemy import models_committed\nfrom gather.extensions import db, cache\n\n\nclass Node(db.Model):\n id = db.Column(db.Integer, primary_key=T... | python | chosen |
[
{
"from": "system",
"value": "Fix env vars always evaluating as true\n\nEnv vars come through as strings. Which are true. The default on our\nvalues is also true. Meaning it would never change. So we have to do\nspecial string checking to get it to actually change. Yay.\n"
},
{
"from": "human",
... | python | chosen |
[
{
"from": "system",
"value": "Fix admin login failure for django upgrade\n"
},
{
"from": "human",
"value": "from osf.models.user import OSFUser\nfrom framework.auth.core import get_user\nfrom django.contrib.auth.backends import ModelBackend\n\n# https://docs.djangoproject.com/en/1.8/topics/auth/... | python | chosen |
[
{
"from": "system",
"value": "Prepare for next major release\n"
},
{
"from": "human",
"value": "__version__ = '1.4.0'\n__author__ = \"James Laska\"\n__author_email__ = \"<jlaska@ansible.com>\"\n"
},
{
"from": "gpt",
"value": "__version__ = '2.0.0'\n__author__ = \"James Laska\"\n__aut... | python | chosen |
[
{
"from": "system",
"value": "Use 'true' while filtering a boolean as opposed to 'True'\n"
},
{
"from": "human",
"value": "import re\n\nfrom django.db.models.fields.related import ManyToManyField\nfrom rest_framework import filters\n\n\nclass JSONAPIFilterBackend(filters.DjangoFilterBackend):\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix for all members in the news page.\n"
},
{
"from": "human",
"value": "\"\"\"The manager for managing team.\"\"\"\nfrom apps.managers.score_mgr import score_mgr\nfrom apps.managers.team_mgr.models import Team\n\n\ndef team_members(team):\n \"\"\"Get the team me... | python | chosen |
[
{
"from": "system",
"value": "Add `metafields()` method to `Image` resource."
},
{
"from": "human",
"value": "from ..base import ShopifyResource\nimport base64\nimport re\n\n\nclass Image(ShopifyResource):\n _prefix_source = \"/admin/products/$product_id/\"\n\n def __getattr__(self, name):... | python | chosen |
[
{
"from": "system",
"value": "Stabilize order of payment methods in mark-as-paid form\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.blueprints.admin.shop.order.forms\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2021 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` ... | python | chosen |
[
{
"from": "system",
"value": "Test VTODO serialization for all data types\n"
},
{
"from": "human",
"value": "from datetime import datetime\n\nimport pytest\nimport pytz\n\nfrom todoman.model import Todo, VtodoWritter\n\n\ndef test_serialize_created_at(todo_factory):\n now = datetime.now(tz=py... | python | chosen |
[
{
"from": "system",
"value": "Mark optional news image and item fields as such\n"
},
{
"from": "human",
"value": "\"\"\"\nbyceps.services.news.transfer.models\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Copyright: 2006-2020 Jochen Kupperschmidt\n:License: Modified BSD, see LICENSE for details.\n\"... | python | chosen |
[
{
"from": "system",
"value": "Change all instances list of Meta from a global to a class variable.\n"
},
{
"from": "human",
"value": "\"\"\"Databench module.\"\"\"\n\n__version__ = \"0.3.0\"\n\n# Need to make sure monkey.patch_all() is applied before any\n# 'import threading', but cannot raise e... | python | chosen |
[
{
"from": "system",
"value": "Fix the order of importing\n"
},
{
"from": "human",
"value": "from chainer.training.triggers import interval_trigger # NOQA\nfrom chainer.training.triggers import minmax_value_trigger # NOQA\n\n\n# import class and function\nfrom chainer.training.triggers.early_st... | python | chosen |
[
{
"from": "system",
"value": "MMCorePy: Add MMCore/Host.cpp to Unix build.\n\nWas missing. Note that build is still broken (even though it does not\nexplicitly fail), at least on Mac OS X, because of missing libraries\n(IOKit, CoreFoundation, and boost.system, I think).\n\nAlso removed MMDevice/Property.cpp... | python | chosen |
[
{
"from": "system",
"value": "Change some comments as documentation"
},
{
"from": "human",
"value": "# Script to change the UID of Users\n#\n# Author: Christoph Stoettner\n# E-Mail: christoph.stoettner@stoeps.de\n#\n# example: wsadmin.sh -lang jython -f changeUID.py file.csv\n#\n# Format of CSV-... | python | chosen |
[
{
"from": "system",
"value": "Allow shift to be required using a factory trait.\n"
},
{
"from": "human",
"value": "#------------------------------------------------------------------------------\n#\n# Copyright (c) 2008, Enthought, Inc.\n# All rights reserved.\n# \n# This software is provide... | python | chosen |
[
{
"from": "system",
"value": "Remove subdomain check on pages where subdomain is none\n"
},
{
"from": "human",
"value": "from django.http import Http404\n\nfrom .models import Organization\n\n\nclass OrganizationMiddleware(object):\n\n def process_request(self, request):\n try:\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix post_process_fieldsets: This filter is only called for FeinCMS inlines anyway\n\nThanks to mjl for the report and help in fixing the issue.\n"
},
{
"from": "human",
"value": "from django import template\n\n\nregister = template.Library()\n\n\n@register.filter\nd... | python | chosen |
[
{
"from": "system",
"value": "Use Count() in Blood Knight\n"
},
{
"from": "human",
"value": "from ..utils import *\n\n\n# Big Game Hunter\nclass EX1_005:\n\taction = [Destroy(TARGET)]\n\n\n# Mountain Giant\nclass EX1_105:\n\tdef cost(self, value):\n\t\treturn value - (len(self.controller.hand) -... | python | chosen |
[
{
"from": "system",
"value": "IMPLEMENT JARAXXUS, EREDAR LORD OF THE BURNING LEGION\n"
},
{
"from": "human",
"value": "import random\nfrom ..card import *\n\n\n# Blood Imp\nclass CS2_059(Card):\n\tdef endTurn(self):\n\t\tif self.game.currentPlayer is self.owner:\n\t\t\tif self.owner.field:\n\t\t... | python | chosen |
[
{
"from": "system",
"value": "Revert \"Remove name from organisation\"\n"
},
{
"from": "human",
"value": "\"\"\"empty message\n\nRevision ID: 0093_data_gov_uk\nRevises: 0092_add_inbound_provider\nCreate Date: 2017-06-05 16:15:17.744908\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevis... | python | chosen |
[
{
"from": "system",
"value": "Add short integration test for ExecCLI.build\n"
},
{
"from": "human",
"value": "from piper import build\nfrom piper.db import core as db\nfrom piper.cli import cmd_piper\nfrom piper.cli.cli import CLIBase\n\nimport mock\n\n\nclass TestEntry(object):\n @mock.patch... | python | chosen |
[
{
"from": "system",
"value": "Fix JSON serialization issue with view and projection matrices\n"
},
{
"from": "human",
"value": "if 'imported' in locals():\n import imp\n import bpy\n imp.reload(blendergltf)\nelse:\n imported = True\n from . import blendergltf\n\n\nimport json\nimp... | python | chosen |
[
{
"from": "system",
"value": "Fix pagination of locations filter\n"
},
{
"from": "human",
"value": "from django.http.response import JsonResponse\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic.base import View\n\nfrom corehq.apps.domain.decorators import login_a... | python | chosen |
[
{
"from": "system",
"value": "Move to run.py at higher level."
},
{
"from": "human",
"value": "#!/usr/bin/env python\n\"\"\"\n See LICENSE.txt file for copyright and license details.\n\"\"\"\nfrom flask import Flask\nfrom app import views\nimport sys\n\n\napp = Flask(__name__)\napp.config.fro... | python | chosen |
[
{
"from": "system",
"value": "Replace using tests.utils with openstack.common.test\n\nIt is the first step to replace using tests.utils with openstack.common.test.\nAll these tests don't use mock objects, stubs, config files and use only\nBaseTestCase class.\n\nChange-Id: I511816b5c9e6c5c34ebff199296ee4fc8b... | python | chosen |
[
{
"from": "system",
"value": "Fix IMWRITE_JPEG_QUALITY ref for the newest OpenCV"
},
{
"from": "human",
"value": "__author__ = 'paulo'\n\nimport cv2\n\n\nclass OpenCVIntegration(object):\n\n\n @staticmethod\n def adaptive_threshold(filename_in, filename_out):\n img = cv2.imread(file... | python | chosen |
[
{
"from": "system",
"value": "Fix typo in inheritence/super call\n"
},
{
"from": "human",
"value": "\"\"\"This contains code for setting up parallel tempering calcs\"\"\"\n\n########################################################################\n# ... | python | chosen |
[
{
"from": "system",
"value": "Update pika requirement in /python_apps/airtime_analyzer\n\nUpdates the requirements on [pika](https://github.com/pika/pika) to permit the latest version.\n- [Release notes](https://github.com/pika/pika/releases)\n- [Commits](https://github.com/pika/pika/compare/1.1.0...1.2.0)\... | python | chosen |
[
{
"from": "system",
"value": "Remove ssid/key from example script.\n"
},
{
"from": "human",
"value": "# MQTT Example.\n# This example shows how to use the MQTT library.\n#\n# 1) Copy the mqtt.py library to OpenMV storage.\n# 2) Install the mosquitto client on PC and run the following command:\n#... | python | chosen |
[
{
"from": "system",
"value": "Add a test for ``Enum.__repr__``; ``spiralgalaxygame.sentinel`` now has full coverage.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom spiralgalaxygame.sentinel import Sentinel, Enum\n\n\nclass SentinelTests (unittest.TestCase):\n def setUp(self):\n ... | python | chosen |
[
{
"from": "system",
"value": "Add pacakge object for working with conda compressed archives.\n"
},
{
"from": "human",
"value": "import tarfile\nimport os\nimport json\n\n\nclass Package(object):\n\n def __init__(self, path, mode='r'):\n self.path = path\n self.mode = mode\n ... | python | chosen |
[
{
"from": "system",
"value": "Return a serialized object instead of creating the table output in the command\n"
},
{
"from": "human",
"value": "from .._util import TableOutput\nfrom ..commands import command, description, option\nfrom .._profile import Profile\n\n@command('resource group list')\... | python | chosen |
[
{
"from": "system",
"value": "Use string instead of class\n"
},
{
"from": "human",
"value": "from django.db import models\nfrom django.db.models import signals\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom core.mixins import AuditableMixin\nfrom .invoice import Invoice\n\n\ncl... | python | chosen |
[
{
"from": "system",
"value": "Revert to previous way of setting 'authenticate'\n\nThis reverts commit a055f97a342f670171f30095cabfd4ba1bfdad17.\nThis reverts commit 4cec5250a3f9058fea5af5ef432a5b230ca94963.\n"
},
{
"from": "human",
"value": "import os\n\nmylang = 'test'\nfamily = 'wikipedia'\n\n... | python | chosen |
[
{
"from": "system",
"value": "Add Docstrings for class methods.\n"
},
{
"from": "human",
"value": "\"\"\"\nName: Paul Briant\nDate: 11/29/16\nClass: Introduction to Python\nSession: 08\nAssignment: Circle Lab\n\nDescription:\nClasses for Circle Lab\n\"\"\"\n\nimport math\n\nclass Circle:\n de... | python | chosen |
[
{
"from": "system",
"value": "Add numeric name test case\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom tailor.utils import charformat\n\nclass MyTestCase(unittest.TestCase):\n\n def is_upper_camel_case_test_upper_camel_case_name(self):\n self.assertTrue(charformat.is_upper... | python | chosen |
[
{
"from": "system",
"value": "Increase wait time for element loading from 10s to 1min\n"
},
{
"from": "human",
"value": "# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n# Created By: j... | python | chosen |
[
{
"from": "system",
"value": "Use the new wireframe mode to render the Wireframe view correctly\n"
},
{
"from": "human",
"value": "from Cura.View.View import View\nfrom Cura.View.Renderer import Renderer\nfrom Cura.Scene.Iterator.DepthFirstIterator import DepthFirstIterator\n\nclass WireframeVie... | python | chosen |
[
{
"from": "system",
"value": "Set LOGPATH to nailgun folder by default\n"
},
{
"from": "human",
"value": "import os\nimport os.path\n\nLOGPATH = \"/var/log/nailgun\"\nLOGFILE = os.path.join(LOGPATH, \"nailgun.log\")\nLOGLEVEL = \"DEBUG\"\nCELERYLOGFILE = os.path.join(LOGPATH, \"celery.log\")\nCE... | python | chosen |
[
{
"from": "system",
"value": "Support for Django > 1.4 for test proj\n"
},
{
"from": "human",
"value": "from django.conf.urls.defaults import *\nfrom django.conf import settings\nfrom django.contrib import admin\n\nadmin.autodiscover()\n\nurlpatterns = patterns('',\n (r'^admin/', include(admi... | python | chosen |
[
{
"from": "system",
"value": "Use os.environ instead of getenv\n\nNone.lower() fails too, but KeyError() is a nicer errormessage\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n'''\nGeneral-purpose fixtures for vdirsyncer's testsuite.\n'''\nimport logging\nimport os\n\nimport click_l... | python | chosen |
[
{
"from": "system",
"value": "Add override settings for CI without local settings.\n"
},
{
"from": "human",
"value": "from mock import patch\n\nfrom sms.tests.test_sms import GarfieldTwilioTestCase\nfrom sms.tests.test_sms import GarfieldTwilioTestClient\n\n\nclass GarfieldTestSimSmsCaseNewJohn(... | python | chosen |
[
{
"from": "system",
"value": "Fix response tests in py3\n"
},
{
"from": "human",
"value": "import json\n\nfrom echo.response import EchoResponse, EchoSimplePlainTextResponse\nfrom echo.tests import BaseEchoTestCase\n\n\nclass TestEchoSimplePlainTextResponse(BaseEchoTestCase):\n def test_popul... | python | chosen |
[
{
"from": "system",
"value": "Remove tcp-check connect option for redis on haproxy\n\ntcp-check connect option for redis on haproxy.cfg causes the client\nconnections in the redis-server to grow continuously and reaches the max\nlimit resulting in connection failure/response error for requests from\ncollect... | python | chosen |
[
{
"from": "system",
"value": "Add encode method to flat filter\n"
},
{
"from": "human",
"value": "\"\"\"\nCompression filters\n\"\"\"\n\nfrom ..stream_filter import StreamFilter\n\nfrom io import BytesIO\nimport zlib\n\nclass LZWDecode(StreamFilter):\n \"\"\"LZW compression\"\"\"\n filter_... | python | chosen |
[
{
"from": "system",
"value": "Disable an OpenMP test that requires threadprivate\n"
},
{
"from": "human",
"value": "#threadprivate supprimé, est ce que c'est grave?\ndef omp_parallel_copyin():\n sum = 0\n sum1 = 7\n num_threads = 0\n\n if 'omp parallel copyin(sum1) private(i)':\n ... | python | chosen |
[
{
"from": "system",
"value": "Fix bugs with lettuce-webdriver Django steps\n"
},
{
"from": "human",
"value": "\"\"\"\nDjango-specific extensions\n\"\"\"\n\n\ndef site_url(url):\n \"\"\"\n Determine the server URL.\n \"\"\"\n base_url = 'http://%s' % socket.gethostname()\n\n if ser... | python | chosen |
[
{
"from": "system",
"value": "Remove unnecessary blocks of code\n"
},
{
"from": "human",
"value": "import contextlib\nimport functools\nimport logging\nimport sys\n\nimport webob.exc\n\nLOG = logging.getLogger(__name__)\n\n\ndef http_success_code(code):\n \"\"\"Attaches response code to a met... | python | chosen |
[
{
"from": "system",
"value": "Define which examples to use in OpenAPI\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n\nimport os\n\nfrom openfisca_core.taxbenefitsystems import TaxBenefitSystem\n\nfrom . import entities\n\n\nCOUNTRY_DIR = os.path.dirname(os.path.abspath(__file__))\n... | python | chosen |
[
{
"from": "system",
"value": "Rewrite to replace IC_FLAG by FLAG_from_IC.\n"
},
{
"from": "human",
"value": "'''\n\n\n>>> IC_FLAG[2]\narray([[1, 3],\n [1, 4]])\n\n\n>>> IC_FLAG[3]\narray([[1, 4, 6],\n [1, 5, 8],\n [1, 6, 9]])\n\n'''\n\n# For Python2 compatibility\nfrom __future... | python | chosen |
[
{
"from": "system",
"value": "Drop the hurtinq username patching of username that also affects edition\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo\n# Copyright (C) 2015 Didier Raboud <me+defivelo@odyx.org>\n#\n# ... | python | chosen |
[
{
"from": "system",
"value": "Change of function name due to deprecation.\n"
},
{
"from": "human",
"value": "import pandas as PD\n\n\nINFO_LINK = 'http://ds.iris.edu/files/earthscope/usarray/_US-MT-StationList.txt'\n\"\"\"Full URL link to USArray MT site information text file.\"\"\"\n\n\nHEADER ... | python | chosen |
[
{
"from": "system",
"value": "Add repocheck looper, git checker\n"
},
{
"from": "human",
"value": "from git import Repo\nfrom git.exc import InvalidGitRepositoryError\nimport os\n\ndef reposearch(*folders):\n for folder in folders:\n for dir, subdirs, files in os.walk(folder):\n ... | python | chosen |
[
{
"from": "system",
"value": "Comment added to create generic decode method\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nimport sys\nfrom lib.bot import *\nfrom lib.utils import *\nfrom lib.event import *\nfrom lib.cache import *\nimport time\n\nclass MalwareDomainsBot(Bot):\n\n de... | python | chosen |
[
{
"from": "system",
"value": "Add documentation for the hash function.\n"
},
{
"from": "human",
"value": "'''Module to solve the algoritm question:\nGiven a string S, how to count how many permutations\nof S is in a longer string L, assuming, of course, that\npermutations of S must be in contagi... | python | chosen |
[
{
"from": "system",
"value": "Include output in result inline\n"
},
{
"from": "human",
"value": "\"\"\"Django admin interface for `~builds.models.Build` and related models.\n\n\"\"\"\n\nfrom django.contrib import admin\nfrom readthedocs.builds.models import Build, VersionAlias, Version, BuildCom... | python | chosen |
[
{
"from": "system",
"value": "TEST potentially fix brittle stopwatch test\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\"\"\"Created on Dec 16, 2014.\n\n@author: Katharina Eggensperger\n@projekt: AutoML2015\n\n\"\"\"\n\nfrom __future__ import print_function\nimport time\nimport ... | python | chosen |
[
{
"from": "system",
"value": "Convert the adapter into a pytest fixture\n"
},
{
"from": "human",
"value": "from schematics.models import Model\nfrom schematics.types import IntType\n\nfrom hyp.adapters.schematics import SchematicsSerializerAdapter\n\n\nclass Post(object):\n def __init__(self)... | python | chosen |
[
{
"from": "system",
"value": "Use ColorSchemeunit new run with package API\n\nRe: https://github.com/gerardroche/sublime-color-scheme-unit/issues/18\n\nThe new API allows to run with package name so Unittesting doesn't need\nto open any files before running the tests.\n\nI also added an async parameter whic... | python | chosen |
[
{
"from": "system",
"value": "Add integration test for --color never.\n"
},
{
"from": "human",
"value": "\nimport __builtin__\n\nimport mock\nimport pytest\n\nfrom git_code_debt.list_metrics import color\nfrom git_code_debt.list_metrics import CYAN\nfrom git_code_debt.list_metrics import main\nf... | python | chosen |
[
{
"from": "system",
"value": "Refactor CustomTreeView test to use pytest-qt\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import, print_function\nimport unittest\nfrom qtpy.QtWidgets import QApplication\nfrom addie.utilities.customtreeview import CustomizedTreeView\n\n\nclas... | python | chosen |
[
{
"from": "system",
"value": "Add ID to Entity upon creation\n"
},
{
"from": "human",
"value": "class Universe:\n def __init__(self, height=100000000, width=100000000):\n self.entities = []\n self.height = height\n self.width = width\n self.teams = []\n self.state = []\n \n d... | python | chosen |
[
{
"from": "system",
"value": "Move the super() up on ContributorMixin.\n"
},
{
"from": "human",
"value": "from django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin\nfrom django.contrib.auth.models import Group\n\nfrom .models import Editor\n\n\nclass ContributorMixin(admi... | python | chosen |
[
{
"from": "system",
"value": "Allow to simulate fatal errors\n"
},
{
"from": "human",
"value": "from bot.action.core.action import Action\n\n\nclass FailAction(Action):\n def process(self, event):\n raise NotARealError(\"simulated error\")\n\n\nclass NotARealError(Exception):\n pass... | python | chosen |
[
{
"from": "system",
"value": "Clean string returned by website\n\n=> remove newline-characters and strip\n"
},
{
"from": "human",
"value": "import re\n\nfrom bs4 import BeautifulSoup\n\nimport cfscrape\n\n\ndef nplstatus():\n scraper = cfscrape.create_scraper()\n data = scraper.get('http:/... | python | chosen |
[
{
"from": "system",
"value": "Move register outside of guard\n\nEven if we don't load the ``verbatim`` tag backbport, the module\nstill needs to have a ``register`` variable.\n\nAddresses #660\n"
},
{
"from": "human",
"value": "\"\"\"\nHandlebars templates use constructs like:\n\n {{if condit... | python | chosen |
[
{
"from": "system",
"value": "Add test for beta passing through nans\n"
},
{
"from": "human",
"value": "from plasmapy.physics.dimensionless import (beta)\n\nimport astropy.units as u\n\nB = 1.0 * u.T\nn_i = 5e19 * u.m ** -3\nT_e = 1e6 * u.K\n\n\ndef test_beta():\n # Check that beta is dimensi... | python | chosen |
[
{
"from": "system",
"value": "Fix false positive for the social login\n"
},
{
"from": "human",
"value": "from django.utils.translation import ugettext\nfrom social_auth.exceptions import AuthAlreadyAssociated\nfrom social_auth.backends.pipeline.associate import associate_by_email as super_associ... | python | chosen |
[
{
"from": "system",
"value": "Update example for architecture upload\n"
},
{
"from": "human",
"value": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport glob\nimport datetime\n\nfrom ... | python | chosen |
[
{
"from": "system",
"value": "Revert trying to test in virtualenv for now.\n"
},
{
"from": "human",
"value": "import unittest\n\nfrom vext.env import findsyspy, in_venv\n\n\nclass TestVextAPI(unittest.TestCase):\n def test_findsyspy(self):\n # Stub test, checks no exceptions are thrown... | python | chosen |
[
{
"from": "system",
"value": "Fix rules x,y on image_obj\nCoordinates for manual cropping. The first pair are X and Y coordinates,\nfor the left, top point and the second pair are X and Y coordinates, for\nthe right, bottom point (thus forming the square to crop);\n"
},
{
"from": "human",
"value... | python | chosen |
[
{
"from": "system",
"value": "Store results under correct experiment key\n"
},
{
"from": "human",
"value": "from copy import deepcopy\n\nfrom simpleflake import simpleflake\n\nfrom lab_assistant import conf, utils\n\n\n__all__ = [\n 'get_storage',\n 'store',\n 'retrieve',\n 'retrieve... | python | chosen |
[
{
"from": "system",
"value": "Add a comment explaining -kb.\n"
},
{
"from": "human",
"value": "#! -*- coding: koi8-r -*-\r\n\r\nimport unittest\r\nfrom test import test_support\r\n\r\nclass PEP263Test(unittest.TestCase):\r\n\r\n def test_pep263(self):\r\n self.assertEqual(\r\n ... | python | chosen |
[
{
"from": "system",
"value": "Make maximum number of words a parameter\n"
},
{
"from": "human",
"value": "import os\nfrom operator import itemgetter\n\nfrom haystack.query import SearchQuerySet\nfrom pombola.hansard import models as hansard_models\n\n\nBASEDIR = os.path.dirname(__file__)\n# norm... | python | chosen |
[
{
"from": "system",
"value": "Add exception type for script_fields related errors"
},
{
"from": "human",
"value": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__author__ = 'Alberto Paro'\n\n__all__ = ['NoServerAvailable',\n \"QueryError\",\n \"NotFoundException\",\n ... | python | chosen |
[
{
"from": "system",
"value": "Add views in Pynuts init\n"
},
{
"from": "human",
"value": "\"\"\"__init__ file for Pynuts.\"\"\"\n\nimport flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\n\nimport document\nimport view\n\n\nclass Pynuts(flask.Flask):\n \"\"\"Create the Pynuts class.\n\n ... | python | chosen |
[
{
"from": "system",
"value": "Add average_roundoff to rounding base class.\n"
},
{
"from": "human",
"value": "'''\nCreated on Oct 6, 2013\n\n@author: dmaust\n'''\nimport math\n\nclass RounderBase(object):\n '''\n Abstract base class for rounding\n '''\n\n\n def __init__(self, precisi... | python | chosen |
[
{
"from": "system",
"value": "Rewrite Heroku's scope handling a bit to better match reality\n"
},
{
"from": "human",
"value": "import foauth.providers\n\n\nclass Heroku(foauth.providers.OAuth2):\n # General info about the provider\n provider_url = 'https://heroku.com/'\n docs_url = 'htt... | python | chosen |
[
{
"from": "system",
"value": "Use xpath to find messages instead of a loop\n"
},
{
"from": "human",
"value": "from pyramid.view import view_config\n\nfrom lxml import etree\n\n@view_config(route_name='index', renderer='index.mako')\ndef my_view(request):\n smsfile = \"sms.xml\"\n with open... | python | chosen |
[
{
"from": "system",
"value": "Fix compat module for Python 3\n"
},
{
"from": "human",
"value": "try:\n from urlparse import urlparse\nexcept ImportError: # Python3\n from urllib import parse as urlparse\n\ntry:\n _xrange = xrange\nexcept NameError:\n _xrange = range\n"
},
{
"... | python | chosen |
[
{
"from": "system",
"value": "Disable a pointless override warning.\n\nThis is a valid warning, but only on python3. On python2, the default\nis False. I don't want to crud up the code with a bunch of conditionals\nfor stuff like this.\n"
},
{
"from": "human",
"value": "#!/usr/bin/python\n\nim... | python | chosen |
[
{
"from": "system",
"value": "Fix tweepy.debug() by using six's module helpers.\n"
},
{
"from": "human",
"value": "# Tweepy\n# Copyright 2009-2010 Joshua Roesslein\n# See LICENSE for details.\n\n\"\"\"\nTweepy Twitter API library\n\"\"\"\n__version__ = '3.1.0'\n__author__ = 'Joshua Roesslein'\n_... | python | chosen |
[
{
"from": "system",
"value": "Fix error messages for bad stash references\n"
},
{
"from": "human",
"value": "\"\"\"Restash changes.\"\"\"\n\nimport re\nimport sys\nfrom subprocess import check_output, PIPE, Popen\n\nfrom utils.messages import error\n\n\ndef restash(stash='stash@{0}'):\n \"\"\... | python | chosen |
[
{
"from": "system",
"value": "Use color output for tests outside of dockbot\n"
},
{
"from": "human",
"value": "from SCons.Script import *\nimport subprocess\nimport sys\nimport shlex\n\n\ndef run_tests(env):\n subprocess.call(shlex.split(env.get('TEST_COMMAND')))\n sys.exit(0)\n\n\ndef gen... | python | chosen |
[
{
"from": "system",
"value": "Fix docstring for Target values\n"
},
{
"from": "human",
"value": "from citrination_client.base.errors import CitrinationClientError\n\n\nclass Target(object):\n \"\"\"\n The optimization target for a design run. Consists of\n the name of the output column ... | python | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.