id
int64
0
6k
code
stringlengths
4k
8k
code_compressed
listlengths
0
44
0
#-*- coding: utf-8 -*- from vi import utils from vi.widgets import ListWidget, EditWidget from vi.priorityqueue import actionDelegateSelector, ModuleWidgetSelector from flare.i18n import translate from vi.config import conf from vi.pane import Pane from flare.button import Button class ContextAction(Button): def __...
[ { "body": "\t\tassert self.widget, u\"This action must be attached first!\"\n\t\tif isinstance(self.widget, ListWidget):\n\t\t\tfor s in self.widget.getCurrentSelection():\n\t\t\t\tself.openModule(s)\n\t\telif isinstance(self.widget, EditWidget):\n\t\t\td = self.widget.serializeForDocument()\n\t\t\tself.openMod...
1
from __future__ import annotations import asyncio import enum import time from functools import wraps from typing import Any, Callable, Coroutine, MutableMapping, TypeVar, Protocol from lru import LRU R = TypeVar('R') # Can't use ParamSpec due to https://github.com/python/typing/discussions/946 class CacheProtocol...
[ { "body": " ...", "name": "invalidate(self,CacheProtocol(Protocol[R]):" }, { "body": " ...", "name": "invalidate_containing(self,CacheProtocol(Protocol[R]):" }, { "body": " self.__ttl: float = seconds\n super().__init__()", "name": "__init__(self,CacheProt...
2
import logging import os import subprocess import time from dataclasses import dataclass, field from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional from fastapi import FastAPI, HTTPException from meerkat.interactive.server import Server from meerkat.tools.utils import WeakMapping if TYPE_CHECKING: ...
[ { "body": " try:\n return self.api_keys[api]\n except KeyError:\n raise HTTPException(\n status_code=404,\n detail=f\"No API key found for {api}.\\\n Add one with `secrets.add(api, api_key)`.\",\n )", "name": "get(s...
3
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('DeviceLifeCycleFlag')", "name": "get_DeviceLifeCycleFlag(self):UpdateSubscribeRelationRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('DeviceLifeCycleFlag',DeviceLifeCycleFlag)", "name": "set_DeviceLifeCycleFlag(self,DeviceLifeCycle...
4
# MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George # This file contains the core TaskQueue based on a pairing heap, and the core Task class. # They can optionally be replaced by C implementations. # This file is a modified version, based on the extmod in Circuitpython, for # unit te...
[ { "body": " if node is heap:\n child = heap.ph_child\n node.ph_child = None\n return ph_pairing(child)\n # Find parent of node\n parent = node\n while parent.ph_next is not None:\n parent = parent.ph_next\n parent = parent.ph_rightmost_parent\n if parent is None or ...
5
#!/usr/bin/env python #/*########################################################################## # # The PyMca X-Ray Fluorescence Toolkit # # Copyright (c) 2004-2014 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # ...
[ { "body": " if not os.path.exists(filename):\n return None\n self.motorNames = []", "name": "__init__(self,SpecFileAbstractScan(object):" }, { "body": " \"\"\"\n If there is only one scan returns 1:1\n with two scans returns 1:2\n \"\"\"\n ...
6
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('Environment')", "name": "get_Environment(self):ListSlotRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('Environment', Environment)", "name": "METHOD_NAME(self,ListSlotRequest(RpcRequest):" } ]
7
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ListenerForward')", "name": "get_ListenerForward(self):CreateLoadBalancerHTTPSListenerRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ListenerForward', ListenerForward)", "name": "set_ListenerForward(self,CreateLoadBalancerHTTPSLis...
8
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('Description')", "name": "get_Description(self):ModifyACLRuleRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('Description', Description)", "name": "set_Description(self,ModifyACLRuleRequest(RpcRequest):" }, { "body": "\t\tsel...
9
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('LogParams')", "name": "get_LogParams(self):VerifyUserAuthenticationRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('LogParams', LogParams)", "name": "METHOD_NAME(self,VerifyUserAuthenticationRequest(RpcRequest):" }, { "body"...
10
#!/usr/bin/env python # -*- coding: utf-8 -*- """`cssmin` - A Python port of the YUI CSS compressor.""" """ Home page: https://github.com/zacharyvoase/cssmin License: BSD: https://github.com/zacharyvoase/cssmin/blob/master/LICENSE Original author: Zachary Voase Modified for inclusion into web2py by: Ross Peoples <ros...
[ { "body": " \"\"\"Remove all CSS comment blocks.\"\"\"\n iemac = False\n preserve = False\n comment_start = css.find(\"/*\")\n while comment_start >= 0:\n # Preserve comments that look like `/*!...*/`.\n # Slicing is used to make sure we don\"t get an IndexError.\n preserve =...
11
from io import StringIO as TextIO from io import BytesIO as BytesIO from typing import Any, AnyStr, Callable, Generic, IO, List, Optional, Text, Tuple, TypeVar, Union, overload from typing_extensions import Final import sys _T = TypeVar("_T") class FDCapture(Generic[AnyStr]): def __init__(self, targetfd: int, tmp...
[ { "body": " self,\n out: Union[bool, IO[str]] = ...,\n err: Union[bool, IO[str]] = ...,\n mixed: bool = ...,\n in_: bool = ...,\n patchsys: bool = ...,\n now: bool = ...,", "name": "__init__(TerminalWriter:" }, { "body": " self,\n out: U...
12
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ArchVersion')", "name": "get_ArchVersion(self):CreateMultiZoneClusterRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ArchVersion',ArchVersion)", "name": "set_ArchVersion(self,ArchVersion):CreateMultiZoneClusterRequest(RpcRequest):"...
13
from plugin import plugin # General values for connect 4 game and board numberRows = 6 numberColumns = 7 numToWin = 4 GameBoard = [[0] * numberColumns for j in range(numberRows)] def restartBoard(): for i in range(numberRows): for j in range(numberColumns): GameBoard[i][j] = str(' ') # Func...
[ { "body": " # Temp row and col values to manipulate throughout function\n row = r\n col = c\n # Count matching tokens to the right. Stop when at end of board\n rightCounter = 0\n while col < numberColumns:\n if whatsAtPos(row, col) == p:\n rightCounter += 1\n else:\n ...
14
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('Description')", "name": "get_Description(self):CreateApiRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('Description', Description)", "name": "set_Description(self,CreateApiRequest(RpcRequest):" }, { "body": "\t\treturn self...
15
from pathlib import Path import pytest from click.testing import CliRunner from ggshield.__main__ import cli from ggshield.verticals.hmsl.crypto import hash_string from tests.unit.conftest import assert_invoke_exited_with, assert_invoke_ok RESULTS_CONTENT = ( '{"hint": "f7f17c88638b42465b6c620a0c7648ef470e611c1...
[ { "body": " \"\"\"\n GIVEN a cli\n WHEN running on non-existing files or other issues\n THEN the return code is 2\n \"\"\"\n result = cli_fs_runner.invoke(cli, command)\n assert_invoke_exited_with(result, 2)", "name": "METHOD_NAME(cli_fs_runner:" } ]
16
## @file # process FD generation # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # from __future__ import absolute_import from . import Region from . import Fv import Common.LongFilePathOs as os from io import BytesIO i...
[ { "body": " if self.FdUiName.upper() + 'fd' in GenFdsGlobalVariable.ImageBinDict:\n return GenFdsGlobalVariable.ImageBinDict[self.FdUiName.upper() + 'fd']\n #\n # Print Information\n #\n FdFileName = os.path.join(GenFdsGlobalVariable.FvDir, self.FdUiName + '.fd')\n ...
17
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):DescribeSnapshotsRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,DescribeSnapshotsRequest(RpcRequest):" ...
18
import IMP import IMP.atom import IMP.pmi import IMP.test import IMP.isd import IMP.pmi.restraints.proteomics import IMP.pmi.io import IMP.pmi.restraints import IMP.pmi.restraints.basic import IMP.rmf import RMF import math import sys class MembraneRestraintPrototype(IMP.Restraint): def __init__(self, ...
[ { "body": " m,\n z_nuisance,\n thickness=30.0,\n softness=3.0,\n plateau=0.0000000001,\n linear=0.02):\n '''\n input a list of particles, the slope and theta of the sigmoid potential\n theta is t...
19
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ClientToken')", "name": "get_ClientToken(self):CreateAcceleratorRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('Duration')", "name": "get_Duration(self):CreateAcceleratorRequest(RpcRequest):" }, { "body": "\t\...
20
from __future__ import print_function ## @file # Utility functions and classes for BaseTools unit tests # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import base64 import os import os.path import random import shuti...
[ { "body": " tests = []\n for name, item in localItems.items():\n if isinstance(item, type):\n if issubclass(item, unittest.TestCase):\n tests.append(unittest.TestLoader().loadTestsFromTestCase(item))\n elif issubclass(item, unittest.TestSuite):\n ...
21
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):CreateSmartAccessGatewayRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,CreateSmartAccessGatewayRequest(R...
22
import asyncio import pytest import falcon from falcon import testing from falcon.asgi import App from falcon.errors import UnsupportedError, UnsupportedScopeError class CustomCookies: def items(self): return [('foo', 'bar')] def test_missing_asgi_version(): scope = testing.create_scope() del ...
[ { "body": " scope = testing.create_scope()\n scope['http_version'] = http_version\n with pytest.raises(UnsupportedError):\n _call_with_scope(scope)", "name": "test_unsupported_http_version(http_version):CustomCookies:" }, { "body": " scope = {\n 'type': 'lifespan',\n ...
23
# coding: utf-8 """ Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from unittest.mock import patch import urllib3 import typing_extensions import unit_test_api from unit_test_api.paths.response_body_post_enum_with_false_does_not_match0_response_body_...
[ { "body": " # false is valid\n accept_content_type = 'application/json'\n with patch.object(urllib3.PoolManager, 'request') as mock_request:\n payload = (\n False\n )\n mock_request.return_value = self.response(\n self.json_byte...
24
import abc from typing import List, Tuple from boa3.internal import constants from boa3.internal.model.type.classes import classtype from boa3.internal.neo.vm.opcode.Opcode import Opcode from boa3.internal.neo.vm.type.AbiType import AbiType from boa3.internal.neo.vm.type.StackItem import StackItemType class PythonCl...
[ { "body": " instance_variables: dict = None,\n instance_methods: dict = None,\n METHOD_NAME: dict = None,\n class_variables: dict = None,\n class_methods: dict = None,\n static_methods: dict = None):\n self._i...
25
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('Description')", "name": "get_Description(self):AddACLRuleRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('Description', Description)", "name": "METHOD_NAME(self,AddACLRuleRequest(RpcRequest):" }, { "body": "\t\treturn self.g...
26
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "METHOD_NAME(self):CreateRouteEntryRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,CreateRouteEntryRequest(RpcRequest):" }, { ...
27
import unittest import machine_common_sense as mcs class MyEmptyclass: def __init__(self): pass class MySubclass: def __init__(self): self.my_integer = 7 self.my_string = "h" self.my_list = [8, "i"] self.my_dict = { "my_integer": 9, "my_stri...
[ { "body": " pass", "name": "__init__(self):TestStringifier(unittest.TestCase):" }, { "body": " pass", "name": "my_function():TestStringifier(unittest.TestCase):" }, { "body": " object_list = [\n mcs.ObjectMetadata(\n uuid='id1',\n ...
28
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\tself.add_query_param('ResourceOwnerId',ResourceOwnerId)", "name": "set_ResourceOwnerId(self,ResourceOwnerId):CreateUisRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('Description')", "name": "get_Description(self):CreateUisRequest(RpcRequest):" }, { ...
29
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):DescribeDBInstancesRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,DescribeDBInstancesRequest(RpcRequest)...
30
import os.path from typing import Optional from pcs import settings from pcs.common import file_type_codes as code from pcs.common.file import FileMetadata def METHOD_NAME(filename: str) -> FileMetadata: return FileMetadata( # The filename is expected to be complete (i.e. booth.conf) and verified ...
[ { "body": " return FileMetadata(\n # The filename is expected to be complete (i.e. booth.conf) and verified\n # (i.e. no slashes in it). The caller is responsible for doing both.\n file_type_code=code.BOOTH_CONFIG,\n path=os.path.join(settings.booth_config_dir, filename),\n ...
31
""" @file @brief This file manages the optional Sentry SDK @author Jonathan Thomas <jonathan@openshot.org> @author FeRD (Frank Dana) <ferdnyc@gmail.com> @section LICENSE Copyright (c) 2008-2021 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.opens...
[ { "body": " \"\"\"Init all Sentry tracing\"\"\"\n if not sdk:\n log.info('No sentry_sdk module detected (error reporting is disabled)')\n return\n # Determine sample rate for errors & transactions\n sample_rate = 0.0\n traces_sample_rate = 0.0\n if info.VERSION == info.ERROR_REPO...
32
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations import os import pathlib import re import shutil import tempfile from pathlib import Path from typing import Optional from types import TracebackType import torch # File-related constants CHECKPOINT_FOLDER_PREF...
[ { "body": " \"\"\"Calculate the size of an ONNX model.\n This function calculates the size of an ONNX model by reading the size of\n the file on disk.\n Args:\n model_path: The path to the ONNX model on disk.\n Returns:\n The size of the model in megabytes.\n \"\"\"\n size = o...
33
"""Condense HTML. 1. Put short html tags back on one line 2. Put short template tags back on one line """ from functools import partial import regex as re from ..helpers import ( inside_ignored_block, inside_protected_trans_block, is_safe_closing_tag, ) from ..settings import Config def METHOD_NAME(ht...
[ { "body": " \"\"\"Compress back tags that do not need to be expanded.\"\"\"\n # put empty tags on one line\n def strip_space(config: Config, html: str, match: re.Match) -> str:\n \"\"\"Trim leading whitespace.\"\"\"\n # either inside a block, or this is a newline + closing block tag.\n ...
34
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ScriptNameQuery')", "name": "get_ScriptNameQuery(self):SearchTaskRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ScriptNameQuery', ScriptNameQuery)", "name": "set_ScriptNameQuery(self,SearchTaskRequest(RpcRequest):" }, { "b...
35
import pytest from framework.auth.core import Auth from api_tests.utils import disconnected_from_listeners from osf.models import ( DraftNode, Registration, DraftRegistration, NodeLicense, NodeLog, ) from osf.exceptions import NodeStateError from osf.utils.permissions import READ, WRITE, ADMIN from...
[ { "body": " return UserFactory()", "name": "user():" }, { "body": " return ProjectFactory(creator=user)", "name": "project(user):" }, { "body": " return DraftRegistrationFactory(branched_from=project)", "name": "draft_registration(user," }, { "body": " return Auth...
36
"""Tests the xonsh lexer.""" import os import pytest from xonsh.pytest.tools import ON_WINDOWS, skip_if_on_unix, skip_if_on_windows @pytest.fixture def check_eval(xonsh_execer, xonsh_session, monkeypatch): def factory(input): env = { "AUTO_CD": False, "XONSH_ENCODING": "utf-8", ...
[ { "body": " assert check_eval(\"/bin/ls -l\")", "name": "METHOD_NAME(check_eval):" } ]
37
""" This type stub file was generated by pyright. """ from collections import UserDict from celery.utils.serialization import strtobool """Worker remote control command implementations.""" __all__ = ("Panel",) DEFAULT_TASK_INFO_ITEMS = ... logger = ... controller_info_t = ... def ok(value): ... def nok(value): ... ...
[ { "body": " \"\"\"Information about Celery installation for bug reports.\"\"\"\n ...", "name": "report(state):Panel(UserDict):" }, { "body": " \"\"\"Revoke task by task id (or list of ids).\n Keyword Arguments:\n terminate (bool): Also terminate the process if the task is active.\...
38
"""Decorators used by moviepy.""" import inspect import os import decorator from moviepy.tools import convert_to_seconds @decorator.decorator def outplace(func, clip, *args, **kwargs): """Applies ``func(clip.copy(), *args, **kwargs)`` and returns ``clip.copy()``.""" new_clip = clip.copy() func(new_clip,...
[ { "body": " \"\"\"Raises an error if the clip has no duration.\"\"\"\n if clip.duration is None:\n raise ValueError(\"Attribute 'duration' not set\")\n else:\n return func(clip, *args, **kwargs)", "name": "requires_duration(func," }, { "body": " \"\"\"Use an audio function ...
39
# container-service-extension # Copyright (c) 2020 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause from typing import Dict, Optional import container_service_extension.common.utils.pyvcloud_utils as vcd_utils import container_service_extension.common.utils.server_utils as server_utils import...
[ { "body": " self,\n auth_token: str,\n request_id: Optional[str] = None,\n mqtt_publisher=None", "name": "__init__(OperationContext:" }, { "body": " return self.user.client", "name": "client(self):OperationContext:" }, { "body": " ...
40
"""CheckpointHook with validation results for classification task.""" # Copyright (C) 2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # Copyright (c) Open-MMLab. All rights reserved. from pathlib import Path from typing import Optional from mmcv.runner import BaseRunner from mmcv.runner.dist_utils impo...
[ { "body": " self,\n interval=-1,\n by_epoch=True,\n save_optimizer=True,\n out_dir=None,\n max_keep_ckpts=-1,\n sync_buffer=False,\n **kwargs,", "name": "__init__(CheckpointHookWithValResults(Hook):" }, { "body": " \"\"\"Set output direc...
41
import os.path from typing import Optional from pcs import settings from pcs.common import file_type_codes as code from pcs.common.file import FileMetadata def _for_booth_config(filename: str) -> FileMetadata: return FileMetadata( # The filename is expected to be complete (i.e. booth.conf) and verified ...
[ { "body": " return FileMetadata(\n # The filename is expected to be complete (i.e. booth.conf) and verified\n # (i.e. no slashes in it). The caller is responsible for doing both.\n file_type_code=code.BOOTH_CONFIG,\n path=os.path.join(settings.booth_config_dir, filename),\n ...
42
# ************************************************************************** # * # * Authors: Javier Vargas (jvargas@cnb.csic.es) # * # * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GN...
[ { "body": " form.addSection(label='Input')\n form.addParam('inputParticles', params.PointerParam, pointerClass='SetOfParticles', \n label=\"Input particles\", \n help='Select the input projection images .') \n form.addParam('isIsotropic', params.Bo...
43
from base_test import ArkoudaTest from context import arkouda as ak """ Tests basic Arkouda client functionality """ from server_util.test.server_test_util import start_arkouda_server class ClientTest(ArkoudaTest): def test_client_connected(self): """ Tests the following methods: ak.clien...
[ { "body": " \"\"\"\n Tests the following methods:\n ak.client.connected()\n ak.client.disconnect()\n ak.client.connect()\n :return: None\n :raise: AssertionError if an assert* method returns incorrect value or\n if there is a error in connecting or...
44
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('Description')", "name": "get_Description(self):ModifyApiRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('Description', Description)", "name": "METHOD_NAME(self,ModifyApiRequest(RpcRequest):" }, { "body": "\t\treturn self.get...
45
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_body_params().get('worker_system_disk_category')", "name": "METHOD_NAME(self):ScaleOutClusterRequest(RoaRequest):" }, { "body": "\t\tself.add_body_params('worker_system_disk_category', worker_system_disk_category)", "name": "set_worker_system_disk_category(self,wor...
46
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('DefaultDomain')", "name": "get_DefaultDomain(self):ModifyApiGroupRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('DefaultDomain', DefaultDomain)", "name": "set_DefaultDomain(self,ModifyApiGroupRequest(RpcRequest):" }, { "bod...
47
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2021 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """pytest fixtures for UVData tests.""" import os import pytest import pyuvdata.tests as uvtest from pyuvdata import UVData from pyuvdata.data import DATA_PATH from pyuvdata.uvdata.mir_...
[ { "body": " \"\"\"Read in PAPER miriad file.\"\"\"\n pytest.importorskip(\"pyuvdata.uvdata.aipy_extracts\")\n uv_in = UVData()\n uv_in.read(paper_miriad_file, use_future_array_shapes=True)\n yield uv_in\n # cleanup\n del uv_in", "name": "METHOD_NAME():" }, { "body": " \"\"\"M...
48
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):AddSmarttagTemplateRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,AddSmarttagTemplateRequest(RpcRequest)...
49
# coding=utf-8 # Copyright 2023 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ { "body": " \"\"\"Try importing a module, with an informative error message on failure.\"\"\"\n try:\n mod = importlib.import_module(module_name)\n return mod\n except ImportError as e:\n err_msg = (\n \"Failed importing {name}. This likely means that the dataset \"\n \"requires additi...
50
# -*- coding: utf-8 -*- import pytest from django.utils.timezone import now from api.base.settings.defaults import API_BASE from api_tests.registrations.filters.test_filters import RegistrationListFilteringMixin from osf_tests.factories import ( AuthUserFactory, CollectionFactory, ProjectFactory, Regi...
[ { "body": " user_one = AuthUserFactory()\n user_one.social['twitter'] = 'rheisendennis'\n user_one.save()\n return user_one", "name": "user_one(self):TestUserRegistrations:" }, { "body": " return AuthUserFactory()", "name": "user_two(self):TestUserRegistrations...
51
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
[ { "body": " self.function_definition = function_definition or FunctionDefinition()\n self.output_collectors = {\n stream_id: OutputCollector(data_stream)\n for stream_id, data_stream in self.function_definition.output_data_streams.items()\n }", "name": "__init__(se...
52
"""Tests for the natural numbers range data type""" from typing import * import pytest from hypothesis import Phase, given, settings, strategies as st from looper.utils import NatIntervalException, NatIntervalInclusive gen_pos_int = st.integers(min_value=1) gen_opt_int = st.one_of(st.integers(), st.none()) def is_...
[ { "body": " \"\"\"Determine whether the given value is non-positive (and non-null).\"\"\"\n return opt_int is not None and opt_int < 1", "name": "is_non_pos(opt_int:NaturalRangeFromStringTests:" }, { "body": " \"\"\"Generate a pair of values in which first respects given upper bound and sec...
53
#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 import os import os.path import re import string import sys import time from glideinwms.frontend import glideinFrontendConfig, glideinFrontendDowntimeLib def usage(): print("Usage:") pri...
[ { "body": " print(\"Usage:\")\n print(\" manageFrontendDowntimes.py -dir frontend_dir -cmd [command] [options]\")\n print(\"where command is one of:\")\n print(\" add - Add a scheduled downtime period\")\n print(\" down - Put the factory down now(+delay)\")\n print(\" up...
54
#!/usr/bin/env python3 from pathlib import Path import sys import cv2 import depthai as dai import numpy as np # Press WASD to move a manual ROI window for auto-exposure control. # Press N to go back to the region controlled by the NN detections. # Get argument first nnPath = str((Path(__file__).parent / Path('../mo...
[ { "body": " startX, startY = bbox[:2]\n width, height = bbox[2] - startX, bbox[3] - startY\n roi = frameNorm(np.empty(camRgb.getResolutionSize()), (startX, startY, width, height))\n return roi", "name": "METHOD_NAME(bbox):AutoExposureRegion:" } ]
55
# Copyright 2017-2022 EPAM Systems, Inc. (https://www.epam.com/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ { "body": " entity = Entity.load_by_id_or_name(identifier, acl_class)\n return cls.permissions(entity['id'], entity['aclClass']), entity['owner']", "name": "METHOD_NAME(cls,User(API):" }, { "body": " api = cls.instance()\n response_data = api.call('permissions?id={}&aclCl...
56
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_body_params().get('key_pair')", "name": "METHOD_NAME(self):ScaleOutClusterRequest(RoaRequest):" }, { "body": "\t\treturn self.get_body_params().get('worker_system_disk_category')", "name": "get_worker_system_disk_category(self):ScaleOutClusterRequest(RoaRequest):" ...
57
#/############################################################################ # # This module is based on an answer published in: # # http://stackoverflow.com/questions/11513132/embedding-ipython-qt-console-in-a-pyqt-application # # by Tim Rae # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at ...
[ { "body": " return True", "name": "has_binding(*var,Convenience" }, { "body": " super(QIPythonWidget, self).__init__(*args,**kwargs)\n if customBanner != None:\n self.banner = customBanner\n self.setWindowTitle(self.banner)\n self.kernel_manager = ke...
58
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('NonCompliantNotification')", "name": "get_NonCompliantNotification(self):CreateAggregateConfigDeliveryChannelRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('NonCompliantNotification', NonCompliantNotification)", "name": "set_NonCom...
59
from methods.regular.regular_api import * from shared.utils.task.task_update_manager import Task_Update @routes.route('/api/v1/project/<string:project_string_id>' + '/task/next', methods = ['POST']) @limiter.limit("1 per second, 50 per minute, 1000 per day") @Project_permissions.user_has_p...
[ { "body": " log = regular_input.regular_log.default_api_log()\n with sessionMaker.session_scope() as session:\n project = Project.get(session, project_string_id)\n user = User.get(session)\n if not user:\n log['error']['usage'] = \"Designed for human users.\"\n r...
60
""" Models for the Financial Aid App """ from django.contrib.auth.models import User from django.db import ( models, transaction, ) from rest_framework.exceptions import ValidationError from courses.models import Program from financialaid.constants import FinancialAidStatus from micromasters.models import ( ...
[ { "body": " \"\"\"\n Override the save to enforce the existence of only one `current` = True\n per program and tier\n \"\"\"\n if self.current:\n TierProgram.objects.filter(program=self.program, tier=self.tier, current=True).update(current=False)\n return sup...
61
# Copyright cocotb contributors # Licensed under the Revised BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-3-Clause """ Tests of cocotb.test functionality * expect_error * expect_fail * timeout """ from collections.abc import Coroutine import pytest from common import MyBaseException, MyExcepti...
[ { "body": " \"\"\"Test that tests can return immediately\"\"\"\n return", "name": "def" }, { "body": " try:\n await cocotb.triggers.with_timeout(\n Timer(1, \"ns\"), timeout_time=1, timeout_unit=\"ns\"\n )\n except cocotb.result.SimTimeoutError:\n pass\n ...
62
"""Tests for the natural numbers range data type""" from typing import * import pytest from hypothesis import Phase, given, settings, strategies as st from looper.utils import NatIntervalException, NatIntervalInclusive gen_pos_int = st.integers(min_value=1) gen_opt_int = st.one_of(st.integers(), st.none()) def is_...
[ { "body": " \"\"\"Determine whether the given value is non-positive (and non-null).\"\"\"\n return opt_int is not None and opt_int < 1", "name": "is_non_pos(opt_int:NaturalRangeFromStringTests:" }, { "body": " \"\"\"Generate a pair of values in which first respects given upper bound and sec...
63
# Copyright 2019 Camptocamp (http://www.camptocamp.com). # @author Simone Orsi <simone.orsi@camptocamp.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.addons.component.core import Component # TODO: this exception is not handled yet on Locomotive side. # Currently if we raise the error t...
[ { "body": " if self.backend.validate_customers:\n validator = getattr(\n self,\n \"_validate_partner_{}\".format(self.backend.validate_customers_type),\n lambda partner: True,\n )\n # TODO: this should raise an exception if not...
64
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\tself.add_query_param('OriginSiteUserId', OriginSiteUserId)", "name": "METHOD_NAME(self,ListRuleAreaRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('Environment')", "name": "get_Environment(self):ListRuleAreaRequest(RpcRequest):" }, { "body": "\t\...
65
# Drakkar-Software OctoBot-Tentacles # Copyright (c) Drakkar-Software, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or...
[ { "body": " super().__init__()\n self.twitter_api = None\n self._account_url = None", "name": "__init__(self):TwitterService:" }, { "body": " return {\n self.API_KEY: \"Your Twitter API key.\",\n self.API_SECRET: \"Your Twitter API-secret key.\",\n ...
66
################################################################################ # Creme is a free/open-source Customer Relationship Management software # Copyright (C) 2013-2023 Hybird # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
[ { "body": " field_type = cell.custom_field.field_type\n if field_type == CustomField.ENUM:\n # TODO: avoid a JOIN by doing a first query in Enum values ?\n return Q(\n pk__in=cell.custom_field\n .value_class\n .objects\n ...
67
# coding: utf-8 """ Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest from unittest.mock import patch import urllib3 import typing_extensions import unit_test_api from unit_test_api.paths.request_body_post_minitems_validation_request_body.post import op...
[ { "body": " content_type = 'application/json'\n # too short is invalid\n with patch.object(urllib3.PoolManager, 'request') as mock_request:\n payload = (\n [\n ]\n )\n with self.assertRaises((unit_test_api.ApiValueError, unit_te...
68
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\tself.add_query_param('ResourceOwnerId',ResourceOwnerId)", "name": "set_ResourceOwnerId(self,ResourceOwnerId):SmartCallRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('BackgroundSpeed')", "name": "get_BackgroundSpeed(self):SmartCallRequest(RpcRequest):" ...
69
import json from django.conf import settings from django.test import TestCase from django.urls import reverse from parameterized import parameterized from experimenter.legacy.legacy_experiments.api.v1.serializers import ( ExperimentSerializer, ) from experimenter.legacy.legacy_experiments.constants import Experim...
[ { "body": " experiments = []\n for i in range(3):\n experiment = ExperimentFactory.create_with_variants()\n experiments.append(experiment)\n response = self.client.get(reverse(\"experiments-api-list\"))\n self.assertEqual(response.status_code, 200)\n json...
70
# Copyright 2023 EPAM Systems, Inc. (https://www.epam.com/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
[ { "body": " \"\"\"\n Filters files that have GLACIER or DEEP_ARCHIVE storage class and not restored.\n :param inner: Decorating file system client.\n :param pipe: Cloud Pipeline API client.\n :param bucket: Bucket object.\n \"\"\"\n super(ArchivedFilesFilterFileS...
71
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):CreateLoadBalancerRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerId', ResourceOwnerId)", "name": "set_ResourceOwnerId(self,CreateLoadBalancerRequest(RpcRequest):"...
72
from typing import Optional from AnyQt.QtCore import Qt, QSizeF, QRectF, QPointF from AnyQt.QtGui import QPixmap, QTransform, QPainter from AnyQt.QtWidgets import ( QGraphicsWidget, QGraphicsItem, QStyleOptionGraphicsItem, QWidget, ) from Orange.widgets.utils.graphicslayoutitem import scaled class GraphicsPixmap...
[ { "body": " self,\n parent: Optional[QGraphicsItem] = None,\n pixmap: Optional[QPixmap] = None,\n scaleContents=False,\n aspectMode=Qt.KeepAspectRatio,\n **kwargs", "name": "__init__(GraphicsPixmapWidget(QGraphicsWidget):" }, { "body"...
73
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ClusterName')", "name": "get_ClusterName(self):DescribeImageListWithBaselineNameRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ClusterName', ClusterName)", "name": "set_ClusterName(self,DescribeImageListWithBaselineNameRequest(Rpc...
74
# Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause import errno import os import uuid from contextlib import contextmanager from errno import EACCES, ENOENT, EPERM, EROFS from os.path import isfile, join, lexists from shutil import rmtree from stat import ( S_IRGRP, S_IROTH, S_IRUSR,...
[ { "body": " prefix = create_temp_location()\n try:\n os.makedirs(prefix)\n yield prefix\n finally:\n if lexists(prefix):\n rmtree(prefix, ignore_errors=False, onerror=_remove_read_only)", "name": "tempdir():" }, { "body": " try:\n with open(test, \"...
75
""" Copyright (c) 2021, NVIDIA CORPORATION. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
[ { "body": " self._stop = False", "name": "__init__(self):NullStrategy(object):" }, { "body": " self._stop = True\n self._stop_reason = message", "name": "set_stop(self,NullStrategy(object):" }, { "body": " return self._stop_reason", "name": "stop_reason(se...
76
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('RetryTimeoutMs')", "name": "METHOD_NAME(self):UpdateCircuitBreakerRuleRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('MinRequestAmount')", "name": "get_MinRequestAmount(self):UpdateCircuitBreakerRuleRequest(RpcRequest...
77
from __future__ import print_function import IMP import IMP.test import IMP.core import IMP.algebra import IMP.atom linvelkey = IMP.FloatsKey('linvel') class Tests(IMP.test.TestCase): """Test molecular dynamics optimizer states""" def setup_particles(self, coords, copies=1): m = IMP.Model() ...
[ { "body": " \"\"\"Ensure that rigid rotation is removed\"\"\"\n # Create 4 points at the vertices of a tetrahedron centered at origin\n xs = [IMP.algebra.Vector3D(x) for x in [(-10, -10, -10), (10, 10, 10),\n (10, -10, -10), (-10, 10, 10)]]\n ...
78
from argparse import ArgumentParser, Namespace from pathlib import Path from textwrap import dedent from pyrokinetics import Pyro description = "Convert a gyrokinetics input file to a different code." def add_arguments(parser: ArgumentParser) -> None: parser.add_argument( "target", type=str, ...
[ { "body": " parser.add_argument(\n \"target\",\n type=str,\n help=dedent(\n f\"\"\"\\\n The target gyrokinetics code. Options include\n {', '.join(Pyro().supported_gk_inputs)}.\n \"\"\"\n ),\n )\n parser.add_argument(\n \"in...
79
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('HealthCheckEnabled')", "name": "get_HealthCheckEnabled(self):CreateEndpointGroupRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('HealthCheckEnabled', HealthCheckEnabled)", "name": "set_HealthCheckEnabled(self,CreateEndpointGroupRequ...
80
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_body_params().get('OrderCondition')", "name": "get_OrderCondition(self):GetTaskListFilterRequest(RpcRequest):" }, { "body": "\t\tself.add_body_params('OrderCondition', OrderCondition)", "name": "set_OrderCondition(self,GetTaskListFilterRequest(RpcRequest):" }, ...
81
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_body_params().get('PropertyType')", "name": "get_PropertyType(self):CreateQualityRuleRequest(RpcRequest):" }, { "body": "\t\tself.add_body_params('PropertyType', PropertyType)", "name": "set_PropertyType(self,CreateQualityRuleRequest(RpcRequest):" }, { "bod...
82
import datetime import pytest from dateutil.parser import parse from pages.experiment_timeline_and_population import TimelineAndPopulationPage @pytest.mark.skip(reason="superceded by e2e tests") @pytest.mark.nondestructive def test_proposed_start_date_fills_correctly(selenium, base_url, fill_overview): """Test p...
[ { "body": " selenium, base_url, fill_overview", "name": "METHOD_NAME(" }, { "body": " \"\"\"Test Population percentage updates.\"\"\"\n timeline_pop_form = TimelineAndPopulationPage(\n selenium, base_url, experiment_url=f\"{fill_overview.url}\"\n ).open()\n assert timeline_pop_...
83
""" This type stub file was generated by pyright. """ import threading from collections import deque from time import time from typing import Any from sentry_sdk._types import MYPY """ A fork of Python 3.6's stdlib queue with Lock swapped out for RLock to avoid a deadlock while garbage collecting. See https://codew...
[ { "body": " \"\"\"Indicate that a formerly enqueued task is complete.\n Used by Queue consumer threads. For each get() used to fetch a task,\n a subsequent call to task_done() tells the queue that the processing\n on the task is complete.\n If a join() is currently blocking, ...
84
from django.contrib.auth.models import User from django.utils import timezone import pytest from dashboard.models import Passport, PassportStamp from passport_score.gr15_providers import providers from passport_score.models import GR15TrustScore from passport_score.utils import handle_submitted_passport, load_passport...
[ { "body": " self.users = [\n User.objects.create(password=CURRENT_PASSWORD, username=f\"user_{i}\")\n for i in range(NUM_USERS)\n ]\n self.passports = [\n Passport.objects.create(\n user=user, did=user.username, passport={\"type\": user.userna...
85
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_body_params().get('Description')", "name": "get_Description(self):UpdatePrivateAccessPolicyRequest(RpcRequest):" }, { "body": "\t\tself.add_body_params('Description', Description)", "name": "set_Description(self,UpdatePrivateAccessPolicyRequest(RpcRequest):" }, ...
86
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerAccount')", "name": "get_ResourceOwnerAccount(self):ModifyRDSToClickhouseDbRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerAccount', ResourceOwnerAccount)", "name": "set_ResourceOwnerAccount(self,ModifyRDS...
87
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('NetworkInterfaceIds')", "name": "get_NetworkInterfaceIdss(self):ListFullNatEntriesRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('ResourceOwnerAccount')", "name": "get_ResourceOwnerAccount(self):ListFullNatEntriesRequ...
88
# Copyright 2017-2023 Posit Software, PBC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ { "body": " return self._app", "name": "handle(self,RedirectMiddleware:" }, { "body": " def app(env, start_resp):\n env[\"PATH_INFO\"] = \"/index.html\"\n return self._app(env, start_resp)\n return app", "name": "handle_index(self,RedirectMiddleware:" ...
89
# coding=utf-8 # Copyright 2023 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ { "body": " \"\"\"Try importing a module, with an informative error message on failure.\"\"\"\n try:\n mod = importlib.import_module(module_name)\n return mod\n except ImportError as e:\n err_msg = (\n \"Failed importing {name}. This likely means that the dataset \"\n \"requires additi...
90
########################################################################## # # Copyright (c) 2007-2011, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
[ { "body": "\t\tallHashes = set()\n\t\tobjectsCreated = 0\n\t\tfor t in IECore.TypeId.names :\n\t\t\to = None\n\t\t\twith IECore.IgnoredExceptions( RuntimeError ) :\n\t\t\t\to = IECore.Object.create( t )\n\t\t\tif o is not None :\n\t\t\t\tobjectsCreated += 1\n\t\t\t\tallHashes.add( str( o.hash() ) )\n\t\t\t\th =...
91
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceOwnerAccount')", "name": "get_ResourceOwnerAccount(self):CreateRDSToClickhouseDbRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceOwnerAccount', ResourceOwnerAccount)", "name": "set_ResourceOwnerAccount(self,CreateRDS...
92
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('TargetType')", "name": "get_TargetType(self):ModifyReplicationJobAttributeRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('TargetType',TargetType)", "name": "set_TargetType(self,TargetType):ModifyReplicationJobAttributeRequest(RpcRe...
93
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ContactGroup')", "name": "get_ContactGroup(self):CreateServiceInstanceRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ContactGroup', ContactGroup)", "name": "set_ContactGroup(self,CreateServiceInstanceRequest(RpcRequest):" }, {...
94
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('DiskDeviceMapping')", "name": "get_DiskDeviceMappings(self):ImportImageRequest(RpcRequest):" }, { "body": "\t\treturn self.get_query_params().get('ResourceOwnerId')", "name": "get_ResourceOwnerId(self):ImportImageRequest(RpcRequest):" }, { ...
95
# -*- coding: utf-8 -*- ''' Copyright (C) 2021 Gitcoin Core This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later v...
[ { "body": " if \"_send_roundup_email_myself\" in request.POST:\n from marketing.tasks import weekly_roundup\n weekly_roundup.delay(request.user.profile.email)\n self.message_user(request, \"Roundup Email Queued!\")\n if \"_send_roundup_email_everyone\" in request.P...
96
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ResourceGroupId')", "name": "get_ResourceGroupId(self):ListTemplatesRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ResourceGroupId', ResourceGroupId)", "name": "set_ResourceGroupId(self,ListTemplatesRequest(RpcRequest):" }, { ...
97
# coding=utf-8 # Copyright 2023 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ { "body": " \"\"\"Returns the dataset metadata.\"\"\"\n return rlds_base.build_info(self.builder_config, self)", "name": "METHOD_NAME(self)Locomotion(tfds.core.GeneratorBasedBuilder):" }, { "body": " \"\"\"Returns SplitGenerators.\"\"\"\n path = dl_manager.download_and_extract(\n ...
98
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from gen_proto.sdv.databroker.v1 import broker_pb2 as sdv_dot_databroker_dot_v1_dot_broker__pb2 class BrokerStub(object): """Missing associated documentati...
[ { "body": " \"\"\"Request a set of datapoints (values)\n Returns a list of requested data points.\n InvalidArgument is returned if the request is malformed.\n \"\"\"\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n ...
99
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "body": "\t\treturn self.get_query_params().get('ContactEmail')", "name": "get_ContactEmail(self):UpdateMaterialRequest(RpcRequest):" }, { "body": "\t\tself.add_query_param('ContactEmail',ContactEmail)", "name": "set_ContactEmail(self,ContactEmail):UpdateMaterialRequest(RpcRequest):" }, { ...