id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
17,300
probably kernel config
from __future__ import annotations import re from typing import TYPE_CHECKING from analysis.PluginBase import AnalysisBasePlugin from plugins.analysis.kernel_config.internal.checksec_check_kernel import check_kernel_config, CHECKSEC_PATH from plugins.analysis.kernel_config.internal.decomp import decompress from plugi...
17,301
test median
""" Name: v.vect.stats test Purpose: Tests v.vect.stats and its flags/options. Author: Sunveer Singh, Google Code-in 2017 Copyright: (C) 2017 by Sunveer Singh and the GRASS Development Team Licence: This program is free software under the GNU General Public License (>=v2). Read the file C...
17,302
online read
from __future__ import absolute_import from datetime import datetime from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple import pymysql import pytz from pydantic import StrictStr from pymysql.connections import Connection from pymysql.cursors import Cursor from feast import Entity, FeatureView, R...
17,303
remove instance
""" Basic avalon integration """ import os import contextlib from pyblish import api as pyblish from openpype.lib import Logger from openpype.pipeline import ( register_loader_plugin_path, register_creator_plugin_path, deregister_loader_plugin_path, deregister_creator_plugin_path, AVALON_CONTAINER_...
17,304
infer prop name
"""Storage plugin that reading/writing CSV files.""" from __future__ import annotations import warnings import hashlib import ast from pathlib import Path from typing import TYPE_CHECKING import pandas as pd import dlite from dlite.options import Options if TYPE_CHECKING: # pragma: no cover from typing import ...
17,305
get info from trn line
import argparse import glob import json import os import re from typing import Callable, List from linguistic_tree import LanguageTree from espnet2.utils.types import str2bool """ Global Settings """ RESERVE_LANG = [ "dan", "lit", "tur", "srp", "vie", "kaz", "zul", "tsn", "epo", ...
17,306
query parameters
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
17,307
error format
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
17,308
test module exists only as stub
import os import pytest from parso.utils import PythonVersionInfo from jedi.inference.gradual import typeshed from jedi.inference.value import TreeInstance, BoundMethod, FunctionValue, \ MethodValue, ClassValue from jedi.inference.names import StubName TYPESHED_PYTHON3 = os.path.join(typeshed.TYPESHED_PATH, 'std...
17,309
test title
from recipe_scrapers.reishunger import Reishunger from tests import ScraperTest class TestReishungerScraper(ScraperTest): scraper_class = Reishunger test_file_name = "reishunger_2" def test_host(self): self.assertEqual("reishunger.de", self.harvester_class.host()) def test_author(self): ...
17,310
update views
"""Switchboard class. This class is used to coordinate updates among all Viewers. Every Viewer must conform to the following interface: - it must include a method called update_yourself() which takes three arguments; the red, green, and blue values of the selected color. - When a Viewer selects a colo...
17,311
on keycall power
############################ # **** IMPORT SECTION **** # ############################ from PyQt5 import QtCore, QtWidgets from qtvcp.widgets.origin_offsetview import OriginOffsetView as OFFVIEW_WIDGET from qtvcp.widgets.dialog_widget import CamViewDialog as CAMVIEW from qtvcp.widgets.dialog_widget import MacroTabDial...
17,312
rmatvec centered
__all__ = ["SecondDerivative"] from typing import Callable, Union import numpy as np from numpy.core.multiarray import normalize_axis_index from pylops import LinearOperator from pylops.utils._internal import _value_or_sized_to_tuple from pylops.utils.backend import get_array_module from pylops.utils.decorators impo...
17,313
lineno
import sys from _tracemalloc import * from collections.abc import Sequence from typing import Any, overload from typing_extensions import SupportsIndex, TypeAlias def get_object_traceback(obj: object) -> Traceback | None: ... def take_snapshot() -> Snapshot: ... class BaseFilter: inclusive: bool def __init__(...
17,314
test shallow relative package import
import contextlib import imp import importlib import sys import unittest @contextlib.contextmanager def uncache(*names): """Uncache a module from sys.modules. A basic sanity check is performed to prevent uncaching modules that either cannot/shouldn't be uncached. """ for name in names: i...
17,315
test platform config
import tempfile import time from pathlib import Path import anndata import pytest import tiledb import tiledbsoma import tiledbsoma.io import tiledbsoma.options._tiledb_create_options as tco HERE = Path(__file__).parent @pytest.fixture def h5ad_file(request): # pbmc-small is faster for automated unit-test / CI...
17,316
ok
# # ABOUT # Artisan Sampling Dialog # LICENSE # This program or module 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 # version 3 of the License, or (at your option) any l...
17,317
collect annotations
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp import xml.etree.ElementTree as ET import mmcv import mmengine from mmocr.utils import dump_ocr_data def collect_files(img_dir, gt_dir): """Collect all images and their corresponding groundtruth files. Args: ...
17,318
perform calculations
import pandas as pd import numpy as np from syscore.pandas.pdutils import ( apply_with_min_periods, ) from syscore.pandas.find_data import get_max_index_before_datetime from syscore.pandas.frequency import how_many_times_a_year_is_pd_frequency from sysquant.fitting_dates import fitDates from sysquant.estimators.g...
17,319
plugin shutdown
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: https://foglamp-foglamp-documentation.readthedocs-hosted.com # FOGLAMP_END """ Plugin module which adds a square block of specific monochrome shade on images """ import os import logging import datetime import filter_ingest import traceback import copy import json impor...
17,320
check if valid postal code
import networkx as nx from app.common.db_utils import create_sqlalchemy_engine from app.models import Scores from app.network_x_tools.network_x_local_graph import ( make_acyclic, local_graph, ) # TODO Figure out how to remove these duplicate methods without breaking things def get_iri(full_iri): """Node ...
17,321
set color
# NanoVNASaver # # A python program to view and export Touchstone data from a NanoVNA # Copyright (C) 2019, 2020 Rune B. Broberg # Copyright (C) 2020,2021 NanoVNA-Saver Authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
17,322
on toggle ontop
import re from PyQt5.QtCore import Qt from PyQt5.QtGui import ( QCursor, QFont, ) from PyQt5.QtWidgets import ( QAction, QFontDialog, QMenu, ) from plover import _ from plover.suggestions import Suggestion from plover.formatting import RetroFormatter from plover.gui_qt.suggestions_dialog_ui impo...
17,323
dispatch
from __future__ import absolute_import, division, print_function # This is an example of how a 3rd-party program with Python embedded, such # as Coot or PyMOL, can be interfaced with CCTBX-based software. Something # much like this is used for the Phenix GUI extensions to those programs. # I haven't tried this with a...
17,324
rsa verify
from __future__ import unicode_literals import json import traceback import hashlib import os import subprocess import sys from zipimport import zipimporter from .compat import ( compat_open as open, compat_realpath, ) from .utils import encode_compat_str from .version import __version__ def METHOD_NAME(me...
17,325
main
#!/usr/bin/env python # /*########################################################################## # # Copyright (c) 2016-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software")...
17,326
parse
""" Faraday Penetration Test IDE Copyright (C) 2018 Infobyte LLC (http://www.infobytesec.com/) See the file 'doc/LICENSE' for the license information """ import re from faraday_plugins.plugins.plugin import PluginXMLFormat from faraday_plugins.plugins.plugins_utils import get_vulnweb_url_fields import xml.etree.Eleme...
17,327
test toffoli gate
"""Test gates acting on density matrices.""" import numpy as np import pytest from qibo import Circuit, gates from qibo.config import PRECISION_TOL from qibo.quantum_info import random_density_matrix, random_statevector def apply_gates(backend, gatelist, nqubits=None, initial_state=None): state = backend.cast(np...
17,328
complete ssm intersect
# # Licensed under the GNU General Public License Version 3 # # This program 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 version. # # This p...
17,329
compile
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
17,330
standard image
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. These are the base tools ...
17,331
create parser
#!/usr/bin/env python3 ############################################################ # Program is part of MintPy # # Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi # # Author: Antonio Valentino, Zhang Yunjun, Aug 2022 # #####################################################...
17,332
should create array
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. """ Strategies using Zarr as an underlying format. """ import os from functools import partial from pathlib import Path from typing import List import numpy as np import torch import zarr from ..core import CheckpointingException from ..dict_utils ...
17,333
validate private key
# stdlib import argparse import json import os from typing import Callable from typing import Dict from typing import Optional from typing import Union import uuid # third party from nacl.encoding import HexEncoder from nacl.signing import SigningKey # we want to bootstrap nodes with persistent uids and keys and allo...
17,334
config dut
import os, sys import unittest from trex_scenario import CTRexScenario from stateful_tests.trex_general_test import CTRexGeneral_Test from trex_stl_lib.api import * import time from nose.tools import nottest class CStlGeneral_Test(CTRexGeneral_Test): """This class defines the general stateless testcase of the TRe...
17,335
predict and update pseudorange
#!/usr/bin/env python3 import sys from typing import List import numpy as np from openpilot.selfdrive.locationd.models.constants import ObservationKind from openpilot.selfdrive.locationd.models.gnss_helpers import parse_pr, parse_prr if __name__ == '__main__': # Generating sympy import sympy as sp from rednose....
17,336
system slots info
import logging import re import warnings from functools import wraps from typing import Any, Callable, Optional, TypeVar from qcodes import validators as vals from qcodes.instrument import VisaInstrument from .keysight_34934a import Keysight34934A from .keysight_34980a_submodules import Keysight34980ASwitchMatrixSubM...
17,337
update
# -*- coding: utf-8 -*- # # LinOTP - the open source solution for two factor authentication # Copyright (C) 2010-2019 KeyIdentity GmbH # Copyright (C) 2019- netgo software GmbH # # This file is part of LinOTP server. # # This program is free software: you can redistribute it and/or # modify it und...
17,338
id to name
import os import pickle import joblib import torch import torch.nn as nn import numpy as np import sys from typing import List, Dict, Set, Union, Optional import logging import collections import argparse from torch.autograd import Variable import graph_tool.all as gt pathlist = os.path.realpath(__file__).split(os.path...
17,339
test load fileobj
import io from unittest.mock import patch import torch from parameterized import parameterized from torchaudio._backend.utils import ( FFmpegBackend, get_info_func, get_load_func, get_save_func, SoundfileBackend, SoXBackend, ) from torchaudio_unittest.common_utils import PytorchTestCase clas...
17,340
test kissgp gp mean abs error cuda
#!/usr/bin/env python3 import os import random import unittest import warnings from math import exp, pi import torch from torch import optim import gpytorch from gpytorch.distributions import MultivariateNormal from gpytorch.kernels import GridInterpolationKernel, RBFKernel, ScaleKernel from gpytorch.likelihoods imp...
17,341
address exclude
import sys from collections.abc import Container, Iterable, Iterator from typing import Any, Generic, SupportsInt, TypeVar, overload from typing_extensions import Literal, Self, TypeAlias # Undocumented length constants IPV4LENGTH: Literal[32] IPV6LENGTH: Literal[128] _A = TypeVar("_A", IPv4Address, IPv6Address) _N =...
17,342
test field search
# -*- coding: utf-8 -*- from lmfdb.tests import LmfdbTest class BelyiTest(LmfdbTest): def test_stats(self): L = self.tc.get("/Belyi/stats") assert "Galois orbits of Belyi maps" in L.get_data(as_text=True) and "proportion" in L.get_data(as_text=True) def test_random(self): self.check_a...
17,343
required on load
# Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 # Copyright 2022 MosaicML. All Rights Reserved. from __future__ import annotations import logging import warnings from typing import Dict, Optional, Sequence, Type, Union import torch try: from apex.normalization.fused_layer_norm ...
17,344
stream log
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
17,345
parse
import argparse from shutil import rmtree from textwrap import dedent import pytest from pyscaffold import api, cli, info, templates from pyscaffold.extensions import config from ..helpers import ArgumentParser from .helpers import make_extension # ---- "Isolated" tests ---- @pytest.fixture def default_file(fake_...
17,346
test fanout 3
import unittest import warnings from unittest import TestCase from contextlib import contextmanager import numpy as np import llvmlite.binding as llvm from numba import types from numba.core.errors import NumbaInvalidConfigWarning from numba.core.compiler import compile_isolated from numba.core.codegen import _parse...
17,347
module parameters
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.module_utils.common.parameters import _list_no_log...
17,348
prepare slave
# Copyright 2017 PerfKitBenchmarker 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 appli...
17,349
tasks availability
from typing import Any, Optional from uuid import UUID from fastapi import APIRouter, Depends from fastapi.security.api_key import APIKey from loguru import logger from oasst_backend.api import deps from oasst_backend.config import settings from oasst_backend.prompt_repository import PromptRepository, TaskRepository f...
17,350
deploy contract low level via geth
#!/bin/env python3 # Send a raw transaction from web3 import Web3 from web3.middleware import geth_poa_middleware from eth_account import Account import os, sys import json import requests def getFileContent(file_name): file = open(file_name, "r") data = file.read() file.close() return data.replace("\...
17,351
gpg list
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import argparse import os import spack.binary_distribution import spack.cmd.common.arguments as arguments import spack.mi...
17,352
test that wait for motion detects a
import time from contextlib import contextmanager import numpy import pytest import stbt_core as stbt def test_motionresult_repr(): assert repr(stbt.MotionResult( time=1466002032.335607, motion=True, region=stbt.Region(x=321, y=32, right=334, bottom=42), frame=stbt.Frame(numpy.zeros((720...
17,353
setup provider
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2018-2019 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
17,354
multi content entry linear gradient
from enigma import GRADIENT_VERTICAL, RT_HALIGN_LEFT, RT_VALIGN_TOP, eListboxPythonMultiContent from skin import parseColor from Tools.Directories import SCOPE_GUISKIN, resolveFilename from Tools.LoadPixmap import LoadPixmap def __resolveColor(color): if isinstance(color, str): try: return parseColor(color).ar...
17,355
chunk op keys
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
17,356
permanova
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE.txt, distributed with this software. # --------------------------------------------...
17,357
get trainer name
from typing import cast import numpy as np from mlagents_envs.logging_util import get_logger from mlagents.trainers.buffer import BufferKey from mlagents.trainers.policy.torch_policy import TorchPolicy from mlagents.trainers.trainer.off_policy_trainer import OffPolicyTrainer from mlagents.trainers.optimizer.torch_opti...
17,358
async added to hass
from __future__ import annotations import logging import homeassistant.helpers.device_registry as dr import homeassistant.helpers.entity_registry as er from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant, callback f...
17,359
gas limit
#!/usr/bin/python3 import warnings from typing import Optional, Tuple, Union from brownie import project from brownie._config import CONFIG from brownie.convert import Wei from brownie.exceptions import BrownieEnvironmentWarning from .account import Accounts from .gas.bases import GasABC from .rpc import Rpc from .s...
17,360
split
# -*- coding: utf-8 -*- """ pygments.token ~~~~~~~~~~~~~~ Basic token types and the standard tokens. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ class _TokenType(tuple): parent = None def METHOD_NAME(self): buf = ...
17,361
get header text
""" Stdout renderers for assertion/entry objects. Unlike exporters, stdout renderers receive native entry objects, instead of their serialized (dict) versions. """ import os import re import pprint from terminaltables import AsciiTable from testplan.common.utils.registry import Registry from .. import base # Will...
17,362
test if3
#!/usr/bin/python3 def test_if1(evmtester, branch_results): evmtester.ifBranches(1, True, False, False, False) assert [175, 176] in branch_results()[True] evmtester.ifBranches(1, False, False, False, False) results = branch_results() assert [175, 176] in results[False] assert [208, 209] in re...
17,363
get ufunc
import ast from typing import Any, Callable, Mapping, Optional, Tuple, Type import numpy import numpy.typing as npt import operator import cupy from cupy._logic import ops from cupy._math import arithmetic from cupy._logic import comparison from cupy._binary import elementwise from cupy import _core from cupyx.jit i...
17,364
set up mustc de fbank
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from argparse import Namespace import os import re import unittest from pathlib import Path from tqdm import tqdm from typing import List, Dic...
17,365
name
# 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...
17,366
init
import nymea from bimmer_connected.account import ConnectedDriveAccount from bimmer_connected.country_selector import Regions from bimmer_connected.vehicle_status import ChargingState accountsMap = {} pollTimer = None regions = { "Rest of world": Regions.REST_OF_WORLD, "North America": Regions.NORTH_AMERICA, ...
17,367
train eval train test
import unittest import functools as ft import itertools as it from apex import amp from apex.amp import _amp_state import torch from torch import nn import torch.nn.functional as F from utils import common_init, HALF, FLOAT,\ ALWAYS_HALF, ALWAYS_FLOAT, MATCH_INPUT def get_reference_grad(i, w, ops): # Creati...
17,368
get pair sym table
from __future__ import absolute_import, division, print_function from libtbx.test_utils import approx_equal from smtbx.refinement.restraints import adp_restraints from smtbx import development from cctbx.array_family import flex from cctbx import crystal from six.moves import range def METHOD_NAME(xray_structure): ...
17,369
decorator
import functools from django import http from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.shortcuts import redirect from olympia import amo from olympia.access import acl from olympia.addons.decorators import addon_view_factory from olympia.addons.models import Addon from olympia....
17,370
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 # --------------------------------...
17,371
test invalid id
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE.txt, distributed with this software. # --------------------------------------------...
17,372
test utf8
# -*- coding: utf-8 -*- """ Tests for the surrogateescape codec From https://github.com/PythonCharmers/python-future/blob/master/tests/test_future/test_surrogateescape.py Copyright (c) 2013-2018 Python Charmers Pty Ltd, Australia Permission is hereby granted, free of charge, to any person obtaining a copy of this sof...
17,373
test lpt k2pk types
import numpy as np import pyccl as ccl import pytest COSMO = ccl.Cosmology( Omega_c=0.27, Omega_b=0.045, h=0.67, sigma8=0.8, n_s=0.96, transfer_function='bbks', matter_power_spectrum='linear') TRS = {'TG': ccl.nl_pt.PTNumberCountsTracer(b1=2.0, b2=2.0, bs=2.0, bk2=2.0), 'TM': ccl.nl_pt.PTMatterTracer()...
17,374
get
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # pylint: disable=protected-access from typing import Dict, Iterable, Optional from azure.ai.ml._restclient.v2023_06_01_preview import Az...
17,375
browse
import fnmatch import logging import os import re from pyaerocom import const from pyaerocom._lowlevel_helpers import BrowseDict from pyaerocom.exceptions import DataSearchError logger = logging.getLogger(__name__) class AerocomBrowser(BrowseDict): """Interface for browsing all Aerocom data direcories Note...
17,376
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 . im...
17,377
test bottomup
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import numpy as np from mmpose.datasets.datasets.hand import CocoWholeBodyHandDataset class TestCocoWholeBodyHandDataset(TestCase): def build_coco_wholebody_hand_dataset(self, **kwargs): cfg = dict( ann_file='tes...
17,378
enum services status
from _typeshed import Incomplete from collections.abc import Iterable import _win32typing from win32.lib.pywintypes import error as error def GetThreadDesktop(ThreadId) -> _win32typing.PyHDESK: ... def EnumWindowStations() -> tuple[tuple[str, Incomplete], ...]: ... def GetUserObjectInformation(Handle: int, _type) -> ...
17,379
workbench vuln filters
''' Filters ======= The following methods allow for interaction into the Tenable Vulnerability Management :devportal:`filters <filters-1>` API endpoints. Methods available on ``tio.filters``: .. rst-class:: hide-signature .. autoclass:: FiltersAPI :members: ''' from tenable.io.base import TIOEndpoint class Filt...
17,380
test deprecated for class method
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
17,381
show
#!/usr/bin/env python ''' This module contains some common routines used by other samples. ''' import numpy as np import cv2 as cv # built-in modules import os import itertools as it from contextlib import contextmanager image_extensions = ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.pbm', '.pgm', '.ppm'] ...
17,382
safe import
""" This module provides decorator functions which can be applied to test objects in order to skip those objects when certain conditions occur. A sample use case is to detect if the platform is missing ``matplotlib``. If so, any test objects which require ``matplotlib`` and decorated with ``@td.skip_if_no_mpl`` will be...
17,383
exe template
# Copyright 2019 The Meson development team # 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 ...
17,384
test import
#!/usr/bin/env python #ckwg +28 # Copyright 2011-2020 by Kitware, 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: # # * Redistributions of source code must retain the above copyright notice,...
17,385
load nc info
import os import os.path as osp import sys import time import argparse from pdb import set_trace as st import json import random import torch import numpy as np import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchcontrib from torchvision import transforms f...
17,386
event state
# Copyright © 2021 United States Government as represented by the Administrator of the # National Aeronautics and Space Administration. All Rights Reserved. """ This example shows the use of the LinearModel class, a subclass of PrognosticsModel for models that can be described as a linear time series. The model is ...
17,387
maybe rotate to new file
import logging import os.path import sys from collections.abc import Sequence from datetime import datetime from functools import lru_cache from pathlib import Path from typing import Literal from typing import Optional import mitmproxy.types from mitmproxy import command from mitmproxy import ctx from mitmproxy impor...
17,388
filter queryset
from django.db.models import Q from django_filters.rest_framework import BooleanFilter from django_filters.rest_framework import Filter from django_filters.rest_framework import FilterSet from rest_framework_guardian.filters import ObjectPermissionsFilter from .models import Correspondent from .models import Document ...
17,389
local cache needs update
# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** # * * # * Copyright (c) 2022-2023 FreeCAD Project Association * # * ...
17,390
environment dir
from __future__ import annotations import contextlib import os import random import re import shlex from typing import Any from typing import ContextManager from typing import Generator from typing import NoReturn from typing import Protocol from typing import Sequence import pre_commit.constants as C from pre_commit...
17,391
check optimize result
""" Our own implementation of the Newton algorithm Unlike the scipy.optimize version, this version of the Newton conjugate gradient solver uses only one function call to retrieve the func value, the gradient value and a callable for the Hessian matvec product. If the function call is very expensive (e.g. for logistic ...
17,392
test deposit create permissions
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016 CERN. # # Invenio 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...
17,393
get enabled user biases
from enum import Enum from typing import Any, Dict, List, Literal, Optional, Set, Tuple, TypedDict, Union from django.conf import settings from sentry.utils import json, redis BOOSTED_RELEASES_LIMIT = 10 LATEST_RELEASES_BOOST_FACTOR = 1.5 LATEST_RELEASES_BOOST_DECAYED_FACTOR = 1.0 IGNORE_HEALTH_CHECKS_FACTOR = 5 ...
17,394
slot document changed
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2013 - 2014 by Wilbert Berendsen # # This program 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 ...
17,395
serial write to zigate
# !/usr/bin/env python3 # coding: utf-8 -*- # # Author: pipiche38 # import time import serial from Classes.ZigateTransport.readDecoder import decode_and_split_message from Classes.ZigateTransport.tools import (handle_thread_error, stop_waiting_on_queues) # Manage Serial Li...
17,396
secondary connection string
# 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__ =...
17,397
test read init
# Copyright 2022 The HuggingFace Team. 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 applicabl...
17,398
progress
# Copyright (C) 2020 Adek Maulana # # SPDX-License-Identifier: GPL-3.0-or-later # This program 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 v...
17,399
setup user particle handler
"""Configuration Helper for ParticleHandler""" from DDSim.Helper.ConfigHelper import ConfigHelper from g4units import MeV, mm import logging logger = logging.getLogger(__name__) class ParticleHandler(ConfigHelper): """Configuration for the Particle Handler/ MCTruth treatment""" def __init__(self): super(Par...