id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
18,900
iter extra graphs
# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
18,901
check scenario correctness
import pytest from dbt.tests.util import run_dbt, check_relations_equal from collections import namedtuple models__delete_insert_incremental_predicates_sql = """ {{ config( materialized = 'incremental', unique_key = 'id' ) }} {% if not is_incremental() %} select 1 as id, 'hello' as msg, 'blue' as color unio...
18,902
normalize pressure
''' Touch Tracer Line Drawing Demonstration ======================================= This demonstrates tracking each touch registered to a device. You should see a basic background image. When you press and hold the mouse, you should see cross-hairs with the coordinates written next to them. As you drag, it leaves a tr...
18,903
tear down class
import numpy as np import importlib import unittest import os class TestCoupledStatic(unittest.TestCase): """ """ @classmethod def setUpClass(cls): # run all the cases generators case = 'smith_nog_2deg' mod = importlib.import_module('tests.coupled.static.' + case + '.generate_...
18,904
set up
import logging # from pprint import pformat from followthemoney import model from aleph.core import db from aleph.authz import Authz from aleph.model import EntitySet, EntitySetItem, Judgement from aleph.logic.entitysets import save_entityset_item from aleph.index.entities import index_entity from aleph.tests.util im...
18,905
reset
import os import platform from configparser import ConfigParser from tkinter import * from simba.roi_tools.ROI_define import ROI_definitions from simba.roi_tools.ROI_multiply import multiply_ROIs from simba.roi_tools.ROI_reset import reset_video_ROIs from simba.ui.tkinter_functions import CreateLabelFrameWithIcon from...
18,906
generate
""" Provides a helper to access the legacy keyring which was supported up to version 1.6.1 of chia-blockchain. To use this helper it's required to install the `legacy_keyring` extra dependency which can be done via the install-option `-l`. """ from __future__ import annotations import sys from typing import Callable,...
18,907
prepare move
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, models class AccountPaymentOrder(models.Model): _inherit = "account.payment.order" grouped_move_ids = fields.One2many( comodel_name="account.move", inverse_name="grouped_payment_order_id", ...
18,908
put
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import json import logging from pathlib import Path from types import TracebackType from typing import Any, Self, Type import numpy as np import pandas as pd from tabulate import t...
18,909
create
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import functools import numpy as np from ...util import logger from functools import wraps def arg_to_array(func): """ ...
18,910
make key
""" RedisCache with a fallback cache to prevent denial of service if Redis is down Freely inspired by django-cache-fallback Credits: - https://github.com/Kub-AT/django-cache-fallback/ """ import logging from django.conf import settings from django.core.cache import caches from django.core.cache.backe...
18,911
test rbind
import pytest import rpy2.robjects as robjects rinterface = robjects.rinterface import rpy2.rlike.container as rlc import array import csv import os import tempfile def test_init_from_taggedlist(): letters = robjects.r.letters numbers = robjects.r('1:26') df = robjects.DataFrame(rlc.TaggedList((l...
18,912
handler
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from libmozdata.bugzilla import Bugzilla from bugbot import utils from bugbot.bzcleaner import BzCleaner class CopyDu...
18,913
add cellcensus metadata obs
import sys import os import cellxgene_census import mudata as mu ## VIASH START par = { "input_database": "CellxGene", "modality": "rna", "cellxgene_release": "2023-05-15", "species": "homo_sapiens", "cell_query": "is_primary_data == True and cell_type_ontology_term_id in ['CL:0000136', 'CL:1000311...
18,914
kill python
# Common utility functions used by various script execution tests # e.g. test_cmd_line, test_cmd_line_script and test_runpy import sys import os import re import os.path import tempfile import subprocess import py_compile import contextlib import shutil try: import zipfile except ImportError: # If Python is b...
18,915
main
#!/usr/bin/env python3 # Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved # # 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...
18,916
add vectors
import logging from pathlib import Path from gensim.models import Word2Vec from medcat.vocab import Vocab from medcat.pipe import Pipe from medcat.preprocessing.tokenizers import spacy_split_all from medcat.preprocessing.iterators import SimpleIter from medcat.preprocessing.taggers import tag_skip_and_punct logger = ...
18,917
display text impl
import pya from pya import * from SiEPIC.utils import get_technology, get_technology_by_name from SiEPIC.utils import arc, arc_wg, arc_to_waveguide, points_per_circle#,layout import math class phc_L3c(pya.PCellDeclarationHelper): """ Input: length, width """ import numpy def __init__(self): # Importa...
18,918
test wrong out min max type
import copy import numpy as np import pytest import torch import torchio as tio from ...utils import TorchioTestCase class TestRescaleIntensity(TorchioTestCase): def test_rescale_to_same_intentisy(self): min_t1 = float(self.sample_subject.t1.data.min()) max_t1 = float(self.sample_subject.t1.data...
18,919
tags
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
18,920
run time
# # See top-level LICENSE.rst file for Copyright information # # -*- coding: utf-8 -*- """ desispec.pipeline.tasks.psfnight ================================ """ from __future__ import absolute_import, division, print_function from collections import OrderedDict from ..defs import (task_name_sep, task_state_to_int, ...
18,921
test context binding
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
18,922
print dict
# Copyright (c) 2020 Intel 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 ...
18,923
forward
""" This script trains and tests a GraphSAGE model based on the information of a full graph. This flowchart describes the main functional sequence of the provided example. main │ ├───> Load and preprocess full dataset │ ├───> Instantiate SAGE model │ ├───> train │ │ │ └───> Training loop │ │ │ ...
18,924
clean entry
#!/usr/bin/env python """ LogDBBackend Interface to LogDB persistent storage """ from builtins import object, bytes from Utils.PythonVersion import PY3 from Utils.Utilities import encodeUnicodeToBytes, encodeUnicodeToBytesConditional # system modules import datetime import hashlib import time # WMCore modules from...
18,925
test seexclude
import os import unittest from pyNastran.bdf.bdf import BDF from pyNastran.bdf.cards.test.utils import save_load_deck, _run_mass_properties, _run_loads, _run_hdf5 class TestSuperelements(unittest.TestCase): def test_superelements_1(self): """SEMPLN/SELOC/SEBULK test""" model = BDF(debug=False) ...
18,926
path desc
import io import uuid from contextlib import contextmanager import dagster._check as check from dagster._core.storage.file_manager import ( FileHandle, FileManager, TempfileManager, check_file_like_obj, ) class ADLS2FileHandle(FileHandle): """A reference to a file on ADLS2.""" def __init__(s...
18,927
external docs description
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
18,928
copy mutate arch
import collections import numbers from deephyper.search.nas._base import NeuralArchitectureSearch class RegularizedEvolution(NeuralArchitectureSearch): """`Regularized evolution <https://arxiv.org/abs/1802.01548>`_ neural architecture search. This search is only compatible with a ``NaProblem`` that has fixed hyp...
18,929
grover circuit
import quantumsim as qsim import numpy as np import qutip def METHOD_NAME(base_t1_flux: int=np.inf, base_t2_flux: int=np.inf, detun_t1_flux: int=np.inf, detun_t2_flux: int=np.inf, t1_idle: int=np.inf, t2_idle: int=np.inf, CZ_duration: int=240, ...
18,930
test create address validation request
import unittest from unittest.mock import patch import karrio from karrio.core.utils import DP from karrio.core.models import AddressValidationRequest from .fixture import gateway class TestPurolatorAddressValidation(unittest.TestCase): def setUp(self): self.maxDiff = None self.AddressValidationRe...
18,931
test prediction proba linear confidence
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import as...
18,932
test ecs example tort
from math import pi import pytest from testutils import compare_data, tol @pytest.fixture def ecs_example(neuron_instance): """A model where something is created in one cell and diffuses to another. This model makes use of parameters, multicompartment reactions, an NMODL and the extracellular space. A ...
18,933
insert triple
from bioservices import ChEBI from pubchemagent.kgoperations.querykg import kg_operations from pubchemagent.kgoperations.addkgdata import create_uuid from pubchemagent.kgoperations.getkgdata import get_uuid from pubchemagent.kgoperations.querytemplates import * from pubchemagent.utils.default_configs import UPDATE_ENDP...
18,934
get image id
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from dataclasses import InitVar, dataclass, field from typing import Dict, List, Optional from dataclasses_json import dataclass_json from marshmallow import validate from lisa import schema from lisa.environment import Environment from lisa.no...
18,935
get channel id
import logging from typing import Dict, List, Optional, Tuple from robusta.core.model.env_vars import ROBUSTA_LOGO_URL from robusta.integrations.common.requests import HttpMethod, check_response_succeed, process_request _API_PREFIX = "api/v4" class MattermostClient: channel_id: str bot_id: str team_id: O...
18,936
get source definition
from collections import deque from html import escape as html_escape from itertools import chain from typing import Callable, Deque, List, Optional, Tuple, Union import lxml.html ElementReplacement = Optional[ Union[str, lxml.html.HtmlElement, List[lxml.html.HtmlElement]] ] # https://developer.mozilla.org/en-US/...
18,937
update gui
import json import cv2 import base64 import threading import time from datetime import datetime from websocket_server import WebsocketServer import logging import os import rclpy from interfaces.pose3d import ListenerPose3d from map import Map from interfaces.laser import ListenerLaser # Graphical User Interface Clas...
18,938
main
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # 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 ...
18,939
load session order idx
#!/usr/bin/env python # @Author: Niccolò Bonacchi # @Creation_Date: Tuesday, February 5th 2019, 3:13:18 pm # Editor: Michele Fabbri # @Edit_Date: 2022-02-01 """ Saving, loading, and zip functionality """ import json import logging import os import shutil import zipfile from pathlib import Path import numpy as np impo...
18,940
detect nanopb
''' Scons Builder for nanopb .proto definitions. This tool will locate the nanopb generator and use it to generate .pb.c and .pb.h files from the .proto files. Basic example ------------- # Build myproto.pb.c and myproto.pb.h from myproto.proto myproto = env.NanopbProto("myproto") # Link nanopb core to the program e...
18,941
build arguments schema
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
18,942
parse markdown
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import dote...
18,943
test 02 ldmsctl
#!/usr/bin/env python3 # Copyright (c) 2018 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # Copyright (c) 2018 Open Grid Computing, Inc. All rights reserved. # # This software is ...
18,944
load secret
import logging from pathlib import Path from typing import TYPE_CHECKING, Optional import pytest from tests.selfsigned import TLSCerts from tests.utils import ( assert_valid_envoy_config, econf_foreach_cluster, module_and_mapping_manifests, ) logging.basicConfig( level=logging.INFO, format="%(asc...
18,945
deploy
""" Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. """ import wlsdeploy.util.dictionary_utils as dictionary_utils from wlsdeploy.aliases.model_constants import SHUTDOWN_CLASS...
18,946
repr html class
# stdlib from typing import Optional # third party from IPython.display import display from rich.prompt import Confirm from typing_extensions import Self # relative from ..abstract_node import AbstractNode from ..abstract_node import NodeSideType from ..node.credentials import SyftCredentials from ..serde.serializabl...
18,947
get definitions records
# coding: utf-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import csv import unittest from typing import List from unittest.mock import patch from bugbot.people ...
18,948
finder containers
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
18,949
transform
"""Symbolic Aggregate approXimation (SAX) transformer.""" import sys import numpy as np import pandas as pd import scipy.stats from sktime.transformations.base import BaseTransformer from sktime.transformations.panel.dictionary_based import PAA # TO DO: verify this returned pandas is consistent with sktime # ...
18,950
remove
import os import sys import warnings from collections.abc import Callable from pathlib import Path from more_itertools import always_iterable from yt.utilities.configuration_tree import ConfigLeaf, ConfigNode configuration_callbacks: list[Callable[["YTConfig"], None]] = [] def config_dir(): config_root = os.en...
18,951
test docker version strips unwanted
# pylint: disable=redefined-outer-name import contextlib from pathlib import Path from typing import AsyncIterator import pytest from aiodocker import Docker, DockerError from aiodocker.volumes import DockerVolume from faker import Faker from models_library.services import RunID from pydantic import parse_obj_as from...
18,952
test discover
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import json import logging from copy import deepcopy from unittest.mock import PropertyMock import jsonschema import pytest from airbyte_cdk.models import ( AirbyteConnectionStatus, AirbyteMessage, AirbyteStream, ConfiguredAirbyteCatalog, ...
18,953
stream rows
# Copyright 2021 Google Inc. All rights reserved. # # 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 ...
18,954
init
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # Copyright (c) 2018-2023 www.open3d.org # SPDX-License-Identifier: MIT # ---------...
18,955
dist2 d
# # Copyright (c) The acados authors. # # This file is part of acados. # # The 2-Clause BSD License # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright n...
18,956
string from root
# -*- mode:python; coding:utf-8 -*- # Copyright (c) 2022 IBM Corp. All rights reserved. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # ...
18,957
on draw
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------------...
18,958
write lineno
""" pygments.formatters.groff ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for groff output. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import math from pygments.formatter import Formatter from pygments.util import get_bool_opt, get_int_o...
18,959
test glean targets
from multiprocessing.pool import ThreadPool from google.cloud import bigquery from bigquery_etl.shredder.config import DeleteSource, DeleteTarget, find_glean_targets class FakeClient: def list_datasets(self, project): return [ bigquery.DatasetReference(project, f"{app}_{suffix}") ...
18,960
test suppress class
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for warning suppression features of Trial. """ import unittest as pyunit from twisted.python.reflect import namedAny from twisted.trial import unittest from twisted.trial.test import suppression class SuppressionMixin: """ T...
18,961
test fix super
from __future__ import annotations import pytest from pyupgrade._main import _fix_plugins from pyupgrade._main import Settings @pytest.mark.parametrize( 's', ( # syntax error 'x(', 'class C(Base):\n' ' def f(self):\n' ' super().f()\n', # super clas...
18,962
test sized strings
import unittest from ctypes import * from ctypes.test import need_symbol class StringArrayTestCase(unittest.TestCase): def test(self): BUF = c_char * 4 buf = BUF(b"a", b"b", b"c") self.assertEqual(buf.value, b"abc") self.assertEqual(buf.raw, b"abc\000") buf.value = b"ABCD"...
18,963
get software sheet
# -*- coding: utf-8; -*- # # This file is part of Mandriva Management Console (MMC). # # MMC is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later ver...
18,964
emit
from typing import Any, Protocol, TypeVar from yaml.error import YAMLError _T_contra = TypeVar("_T_contra", str, bytes, contravariant=True) class _WriteStream(Protocol[_T_contra]): def write(self, __data: _T_contra) -> object: ... # Optional fields: # encoding: str # def flush(self) -> object: ... c...
18,965
test communication token credential with proactive refresh
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import py...
18,966
value list
import os import logging from hashlib import sha1 from babel import Locale from gettext import translation from threading import local from typing import cast, Dict, Any, List, Optional, TypeVar, Union, Sequence from normality import stringify from normality.cleaning import compose_nfc from normality.cleaning import r...
18,967
check
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import json import logging import os import pkgutil from abc import ABC, abstractmethod from typing import Any, Generic, List, Mapping, Optional, Protocol, TypeVar, Union import yaml from airbyte_cdk.models import AirbyteConnectionStatus, ConnectorSpecific...
18,968
test ticket48312
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2022 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # import pytest from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st from lib3...
18,969
fix files
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # 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 requi...
18,970
do return
import signal import sys from bdb import Bdb from cmd import Cmd from collections.abc import Callable, Iterable, Mapping, Sequence from inspect import _SourceObjectType from types import CodeType, FrameType, TracebackType from typing import IO, Any, ClassVar, TypeVar from typing_extensions import ParamSpec, Self __all...
18,971
tear down
# ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Gene...
18,972
get site output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
18,973
parse json string or file
""" Utility functions for strings, paths and URL. """ import re import json from .constants import REGEX_FILE_ID __all__ = [ 'assert_file_grp_cardinality', 'concat_padded', 'get_local_filename', 'is_local_filename', 'is_string', 'make_file_id', 'nth_url_segment', 'parse_json_string_or_...
18,974
resource guid
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
18,975
test insert
import os import unittest try: import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk except ImportError: import sys # If we're on Linux, Gtk *should* be available. If it isn't, make # Gtk an object... but in such a way that every test will fail, # because the object isn...
18,976
parse args
#!/usr/bin/env python # Copyright 2015-2019 Yelp Inc. # # 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 ...
18,977
read header
from __future__ import absolute_import, division, print_function import re import struct from libtbx.test_utils import approx_equal from scitbx.array_family import flex from iotbx.detectors.detectorbase import DetectorImageBase from iotbx.detectors import ReadDTrek verbose=False class DTREKImage(DetectorImageBase): ...
18,978
build schema on 200
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
18,979
kubernetes bearer token
import json import yaml import os import stat import tempfile from django.conf import settings from awx.main.utils.execution_environments import to_container_path def aws(cred, env, private_data_dir): env['AWS_ACCESS_KEY_ID'] = cred.get_input('username', default='') env['AWS_SECRET_ACCESS_KEY'] = cred.get_i...
18,980
resolver
import logging from typing import Any, Callable, Optional, Type, TypeVar from aws_lambda_powertools.utilities.data_classes import AppSyncResolverEvent from aws_lambda_powertools.utilities.typing import LambdaContext logger = logging.getLogger(__name__) AppSyncResolverEventT = TypeVar("AppSyncResolverEventT", bound=A...
18,981
test omps
# Copyright 2021-2022 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 ...
18,982
get current process
from _typeshed import Incomplete import _win32typing from win32.lib.pywintypes import error as error def STARTUPINFO() -> _win32typing.PySTARTUPINFO: ... def beginthreadex(sa: _win32typing.PySECURITY_ATTRIBUTES, stackSize, entryPoint, args, flags) -> tuple[int, Incomplete]: ... def CreateRemoteThread( hprocess: i...
18,983
start qsort
#!/usr/bin/env python3 """ sorting_animation.py A minimal sorting algorithm animation: Sorts a shelf of 10 blocks using insertion sort, selection sort and quicksort. Shelfs are implemented using builtin lists. Blocks are turtles with shape "square", but stretched to rectangles by shapesize() -------------...
18,984
test help targets
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import json import re import textwrap from pants.testutil.pants_integration_test import run_pants from pants.util.docutil import doc_url def test_help() -> None: pants_run = run_pan...
18,985
test make list of op
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
18,986
can view application
from portality.lib.argvalidate import argvalidate from portality import models, constants from portality.bll import exceptions class AuthorisationService(object): """ ~~AuthNZ:Service->AuthNZ:Feature~~ """ def can_create_update_request(self, account, journal): """ Is the given account ...
18,987
grouping pattern changed
"""Print items in order from a sheet index. This tool looks for project parameters (on Sheets) that are Instance, of type Integer, and have "Order" in their names. """ # pylint: disable=W0613,E0401,C0103 # pylint: disable=missing-class-docstring,missing-function-docstring,broad-except import re from pyrevit import fo...
18,988
wrap
""" QEMU development and testing utilities This package provides a small handful of utilities for performing various tasks not directly related to the launching of a VM. """ # Copyright (C) 2021 Red Hat Inc. # # Authors: # John Snow <jsnow@redhat.com> # Cleber Rosa <crosa@redhat.com> # # This work is licensed under...
18,989
selected slices
import warnings import numpy as np from scipy import stats from dipy.utils.optpkg import optional_package fury, has_fury, setup_module = optional_package('fury') if has_fury: from fury import actor from fury.utils import apply_affine class SlicesVisualizer: def __init__( self, interactor, scen...
18,990
test injecting an existing database database config
import inspect from pathlib import Path import pytest import sqlalchemy as sa from prefect.server.database import dependencies from prefect.server.database.configurations import ( AioSqliteConfiguration, AsyncPostgresConfiguration, BaseDatabaseConfiguration, ) from prefect.server.database.dependencies imp...
18,991
upgrade db specifics
#!/usr/bin/env python """ Module to upgrade DB schemes ============================ Upgrade the scheme of the databases """ import argparse import logging import sys from orion.core.io import experiment_builder from orion.core.io.config import ConfigurationError from orion.core.io.database.ephemeraldb import Ephemer...
18,992
merge
import types import unittest from _typeshed import ExcInfo from collections.abc import Callable from typing import Any, NamedTuple from typing_extensions import TypeAlias __all__ = [ "register_optionflag", "DONT_ACCEPT_TRUE_FOR_1", "DONT_ACCEPT_BLANKLINE", "NORMALIZE_WHITESPACE", "ELLIPSIS", "S...
18,993
disabled train
# based on https://github.com/isl-org/MiDaS import cv2 import torch import torch.nn as nn from torchvision.transforms import Compose from ldm.modules.midas.midas.dpt_depth import DPTDepthModel from ldm.modules.midas.midas.midas_net import MidasNet from ldm.modules.midas.midas.midas_net_custom import MidasNet_small fr...
18,994
line hash
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """LCOV reporting for coverage.py.""" from __future__ import annotations import base64 import hashlib import sys from typing import IO, Iterable, Optional, TYPE_...
18,995
typed dump
import os import base64 import dataclasses from datetime import date, datetime, time # noqa: I251 from typing import Any, Callable, List, Protocol, IO, Union from uuid import UUID from hexbytes import HexBytes try: from pydantic import BaseModel as PydanticBaseModel except ImportError: PydanticBaseModel = Non...
18,996
ledoux excess
#!/usr/bin/env python import yt from yt import derived_field import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument('infile', type=str, help='Name of input plotfile.') parser.add_argument('-adiabatic', '--adiabatic', action='store_true', help='If supplied, plot adiabatic excess.') pa...
18,997
test endplus hitting first line
"""tests tools\\uniform_snippet.py , use py.test to run""" from __future__ import division, print_function, unicode_literals import six # make the test find the script in tools directory import sys, os tools_path = '../tools' tools_abspath = os.path.abspath(tools_path) sys.path.insert(0, tools_abspath) from uniform_...
18,998
type
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
18,999
localize
""" Classes for calling functions a schedule. Has time zone support. For example, to run a job at 08:00 every morning in 'Asia/Calcutta': >>> job = lambda: print("time is now", datetime.datetime()) >>> time = datetime.time(8, tzinfo=pytz.timezone('Asia/Calcutta')) >>> cmd = PeriodicCommandFixedDelay.daily_at(time, jo...