id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
19,000
test bool str1
import pytest import datetime from time import sleep from unittest import mock from deepdiff.model import DiffLevel from deepdiff.diff import ( DeepDiff, PROGRESS_MSG, INVALID_VIEW_MSG, VERBOSE_LEVEL_RANGE_MSG, PURGE_LEVEL_RANGE_MSG) class SlowDiffLevel(DiffLevel): is_run = False def __init__(self, *...
19,001
build get request
# coding=utf-8 # -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. # Changes may ...
19,002
forward
# Copyright 2021-2022 The Alibaba DAMO NLP Team Authors. # Copyright (c) 2019, NVIDIA CORPORATION. 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.apa...
19,003
eb login
# Copyright (C) 2015, 2016 GoSecure Inc. """ Telnet Transport and Authentication for the Honeypot @author: Olivier Bilodeau <obilodeau@gosecure.ca> """ from __future__ import annotations import struct from twisted.conch.telnet import ( ECHO, LINEMODE, NAWS, SGA, AuthenticatingTelnetProtocol, ...
19,004
hashpw
# This file is part of Indico. # Copyright (C) 2002 - 2023 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import hashlib import pytest from indico.core import signals from indico.util.passwords import BCryptPas...
19,005
stream to cadence
import os class GdsStreamer: """ This class is used to stream GDS files in and out of the Cadence toolsuite. """ def __init__(self, workingDirectory = "."): self.workingDirectory = os.path.abspath(workingDirectory) def createStreamOutTemplate(self, sourceLibraryName, sourceCellName, gdsDes...
19,006
values decoded
"""Base class for table storage drivers.""" import abc from collections.abc import ItemsView, KeysView, ValuesView from typing import ( Any, Callable, Iterable, Iterator, Mapping, Optional, Set, Tuple, Union, cast, ) from mode import Service from yarl import URL from faust.type...
19,007
dataclass to json
""" Tools for helping make our data models. So far: making dataclasses read/writable as JSON """ def something(val): ''' much like python's "Truthy" and Falsey", but we want some values to not be false like zero, for instance ''' return ((val == 0) or (val is not None) and val) def METH...
19,008
get xrefs by ins addr region
from typing import Set, Dict import logging from collections import defaultdict from ...serializable import Serializable from ...protos import xrefs_pb2 from ..plugin import KnowledgeBasePlugin from .xref import XRef, XRefType l = logging.getLogger(name=__name__) class XRefManager(KnowledgeBasePlugin, Serializable...
19,009
run write
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import argparse import io import logging import sys from abc import ABC, abstractmethod from typing import Any, Iterable, List, Mapping from airbyte_cdk.connector import Connector from airbyte_cdk.exception_handler import init_uncaught_exception_handler fro...
19,010
test get fragment key with named template
import os import unittest import xml.etree.ElementTree as ET import mozpack.path as mozpath import mozunit from mozbuild.action.html_fragment_preprocesor import ( fill_html_fragments_map, generate, get_fragment_key, get_html_fragments_from_file, ) test_data_path = mozpath.abspath(mozpath.dirname(__fi...
19,011
sku
# 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...
19,012
test with invalid nbins
# 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...
19,013
adjust module data
from typing import Optional import torch import torch.distributed as dist from colossalai.legacy.registry import OPHOOKS from colossalai.logging import get_dist_logger from colossalai.utils import get_current_device from colossalai.zero.gemini.memory_tracer import MemStatsCollector from colossalai.zero.legacy.gemini....
19,014
get next
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRe...
19,015
get path
# # Copyright (C) 2012 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 the hope...
19,016
test sidekiq process metrics
import pytest import requests import gitlab @pytest.fixture( scope="session", params=[{"get_all": True}, {"all": True}], ids=["get_all=True", "all=True"], ) def get_all_kwargs(request): """A tiny parametrized fixture to inject both `get_all=True` and `all=True` to ensure they behave the same way ...
19,017
write
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
19,018
keccak
# code modified from https://github.com/zambonin/alice-and-bob # thank you @zambonin for your contributions to the open source code that is used by ccxt! """keccakf1600.py Keccak is a family of hash functions based on the sponge construction. It was chosen by NIST to become the SHA-3 standard. This code implements th...
19,019
is statsmodels installed
import pandas as pd import numpy as np import pytest import pingouin from unittest import TestCase from pingouin.utils import ( print_table, _postprocess_dataframe, _get_round_setting_for, _perm_pval, _check_eftype, _check_dataframe, remove_na, _flatten_list, _is_sklearn_installed,...
19,020
copy field validators
import copy import string from random import choices from typing import ( Any, Callable, Dict, List, Optional, Set, TYPE_CHECKING, Type, Union, cast, ) import pydantic from pydantic.fields import ModelField from ormar.models.mixins.relation_mixin import RelationMixin # noqa: I...
19,021
set up
## @package layer_test_util # Module caffe2.python.layer_test_util from collections import namedtuple from caffe2.python import ( core, layer_model_instantiator, layer_model_helper, schema, test_util, workspace, utils, ) from caffe2.proto import caffe2_pb2 import numpy as np # pyre-f...
19,022
set seq1
import sys from collections.abc import Callable, Iterable, Iterator, Sequence from typing import Any, AnyStr, Generic, NamedTuple, TypeVar, overload if sys.version_info >= (3, 9): from types import GenericAlias __all__ = [ "get_close_matches", "ndiff", "restore", "SequenceMatcher", "Differ", ...
19,023
meshed region get node id of element
#------------------------------------------------------------------------------- # MeshedRegion #------------------------------------------------------------------------------- class MeshedRegionAbstractAPI: @staticmethod def init_meshed_region_environment(object): pass @staticmethod def finish_meshed_region_en...
19,024
test to json
""" Tests for helper functions. """ import json import re from unittest import mock import pytest from django import forms from django.test import TestCase from ..helpers import FormDescription, InvalidFieldError, intercept_errors class FakeInputException(Exception): """Fake exception that should be intercept...
19,025
test attentional rnn decoder first layer
import math import tensorflow as tf from opennmt import decoders from opennmt.layers import bridge def _generate_source_context(batch_size, depth, num_sources=1, dtype=tf.float32): memory_sequence_length = [ tf.random.uniform([batch_size], minval=1, maxval=20, dtype=tf.int32) for _ in range(num_...
19,026
api issue get
from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from .base import BasePage from .global_selection import GlobalSelectionPage class IssueDetailsPage(BasePage): def __init__(self, browser, client): ...
19,027
test dicom dose constancy
# Copyright (C) 2018, 2021 Matthew Jennings # 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 ...
19,028
check learn mode in asicdb
import time import os import pytest from swsscommon import swsscommon class TestPortMacLearn(object): def setup_db(self, dvs): self.pdb = swsscommon.DBConnector(swsscommon.APPL_DB, dvs.redis_sock, 0) self.adb = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) self.cdb = swssc...
19,029
run
import contextlib import itertools import os import time import numpy as np import typing from neo import AnalogSignal from bsb.exceptions import AdapterError, DatasetNotFoundError, TransmitterError from bsb.reporting import report from bsb.services import MPI from bsb.simulation.adapter import SimulatorAdapter from ...
19,030
test astronomer populate daily task metrics defaults
from tests.chart_tests.helm_template_generator import render_chart import pytest import yaml from tests import supported_k8s_versions @pytest.mark.parametrize( "kube_version", supported_k8s_versions, ) class TestAstronomerHoustonTaskMetricsCronjobs: def test_astronomer_cleanup_task_usage_cron_defaults(sel...
19,031
test escaped str to bytes
import pytest from mitmproxy.utils import strutils def test_always_bytes(): assert strutils.always_bytes(bytes(range(256))) == bytes(range(256)) assert strutils.always_bytes("foo") == b"foo" with pytest.raises(ValueError): strutils.always_bytes("\u2605", "ascii") with pytest.raises(TypeError)...
19,032
get real short path
# Copyright (c) 2009-2021, Google LLC # 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, this list of conditions...
19,033
retrieve log content
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
19,034
gen description javadoc
#!/usr/bin/python3 import sys import argparse from collections import OrderedDict from ruamel.yaml import YAML yaml = YAML() HDR_INFO = """/** This file was generated with rest-gen.py, do not modify directly, the chances are high it is useless. **/ """ def print_header(stream, class_name, package, rest_version): ...
19,035
update
"""Home Assistant multicast plugin. Code: https://github.com/home-assistant/plugin-multicast """ import asyncio from contextlib import suppress import logging from awesomeversion import AwesomeVersion from ..coresys import CoreSys from ..docker.const import ContainerState from ..docker.multicast import DockerMultica...
19,036
get first child
from types import ModuleType from typing import Any, List, Optional, Type from digitalpy.core.zmanager.action_mapper import ActionMapper from digitalpy.core.digipy_configuration.configuration import Configuration from digitalpy.core.zmanager.request import Request from digitalpy.core.zmanager.response import Response f...
19,037
test filter logic
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
19,038
supports option
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # Licensed to Elasticsearch B.V. under one ...
19,039
build error matrix
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
19,040
load job config
# Copyright 2019 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 ...
19,041
create constraint
import time from index_utils import * class Constraint(): def __init__(self, ct, et, lbl, attrs, status): self.s = status self.ct = ct self.et = et self.lbl = lbl self.attrs = attrs def __eq__(self, other): return (self.lbl == other.lbl and ...
19,042
test linear solver solve for x
# Copyright 2019 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...
19,043
db connection decorate operation
# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import logging from collections import OrderedDict from typing import List import openai from vdk.api.plugin.hook_markers import hookimpl from vdk.api.plugin.plugin_registry import IPluginRegistry from vdk.internal.builtin_plugins.connection.deco...
19,044
allocate
from numpy import arange, array, dot, zeros, unique, searchsorted, transpose from numpy.linalg import norm # type: ignore from pyNastran.dev.bdf_vectorized.cards.elements.spring.spring_element import SpringElement from pyNastran.bdf.field_writer_8 import print_card_8 from pyNastran.bdf.field_writer_16 import print_c...
19,045
extract deltas
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 from functools import reduce, singledispatch import pyro from pyro.distributions.distribution import COERCIONS from pyro.ops.linalg import ignore_torch_deprecation_warnings from pyro.poutine.util import site_is_subsample from .runtim...
19,046
add ops
## @package concat # Module caffe2.python.layers.concat from caffe2.python import schema from caffe2.python.layers.layers import ( ModelLayer, ) import numpy as np from collections import defaultdict import logging logger = logging.getLogger(__name__) def get_concatenated_feature_to_index(blobs_to_concat): ...
19,047
test no value and mro shape
# Copyright (c) 2021, 2021, Oracle and/or its affiliates. # Copyright (C) 1996-2020 Python Software Foundation # # Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 def test_class_attr_change(): class A(object): counter = 0 for i in range(10): A.counter += 1 assert A.counte...
19,048
validate float or none
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
19,049
gradkernel
#!/usr/bin/python3 '''! @Author: wpx @File Name: success.py @Mail: wpx15673207315@gmail.com @Created Time: 2023年08月20日 星期日 19时23分27秒 @bref @ref ''' import numpy as np import matplotlib.pyplot as plt dx = 0.05 dy = 0.05 rho0 = 1000 H = 0.92*np.sqrt(dx**2+dy**2) dt = 0.001 c0 = 10 h_swl = 2 g = np.array(...
19,050
test default cache type
import os import stat import configobj import pytest from dvc.cachemgr import CacheManager from dvc.cli import main from dvc.utils import relpath from dvc_data.hashfile.hash_info import HashInfo from dvc_objects.errors import ObjectFormatError def test_cache(tmp_dir, dvc): cache1_md5 = "123" cache2_md5 = "2...
19,051
get mongo db resource mongo db collection
# 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...
19,052
anonymize schema
from hashlib import md5 import random from string import ascii_letters from typing import Any, Iterator, Dict, List, cast from .const import INT_MIN_VALUE, INT_MAX_VALUE, LONG_MIN_VALUE, LONG_MAX_VALUE from .schema import extract_record_type, parse_schema from .types import Schema, NamedSchemas from ._schema_common im...
19,053
test with 100 jobs
# coding: utf-8 # Copyright (C) 1994-2021 Altair Engineering, Inc. # For more information, contact Altair at www.altair.com. # # This file is part of both the OpenPBS software ("OpenPBS") # and the PBS Professional ("PBS Pro") software. # # Open Source License Information: # # OpenPBS is free software. You can redistr...
19,054
get next
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRe...
19,055
get state machine tags
from botocore.exceptions import ClientError from base_tags_cache import ( BaseTagsCache, logger, parse_get_resources_response_for_tags_by_arn, resource_tagging_client, sanitize_aws_tag_string, send_forwarder_internal_metrics, should_fetch_step_functions_tags, ) from settings import ( DD...
19,056
create workflow
# Copyright (C) 2023 Sartography # # This file is part of SpiffWorkflow. # # SpiffWorkflow 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 (at your option) any la...
19,057
generator3 data
# Copyright (c) 2021 PaddlePaddle 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 applic...
19,058
interactive running
#!/usr/bin/env python3 # 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. import json import websocket import threading from parlai.core.params import ParlaiParser from parlai.scripts.interactiv...
19,059
test offset2line
"""xdis.bytecode testing""" # Below, we first give some test code to work on. # This code is sensitive to the line number ordering. # By adding test code at the top we reduce line-number # ordering sensistivity. # From 2.7 disassemble # Problem is that "while" loop # has two linestarts in it and # they are in co_lno...
19,060
update secrets
#!/usr/bin/env python3 import argparse import os import re import sys from io import StringIO def METHOD_NAME(file_path): temp_buf = StringIO() updated = False with open(file_path) as fp: for line in fp: if line == "type: ref\n": temp_buf.write("type: base64\n") ...
19,061
download
# -*- 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 gzip import io import logging import os import pickle from contextlib import contextmanag...
19,062
test upsert m2ee config append list
import unittest from buildpack import util class M2EEMock: class ConfigMock: def __init__(self): self._conf = {} def __init__(self): self.config = self.ConfigMock() class TestUtil(unittest.TestCase): def _test_upsert_m2ee_config_equals( self, value1, ...
19,063
parse args
# Copyright (c) OpenMMLab. All rights reserved. import argparse import math import os import os.path as osp import cv2 import mmcv import mmengine from PIL import Image from mmocr.utils import dump_ocr_data def collect_files(img_dir, gt_dir, ratio): """Collect all images and their corresponding groundtruth file...
19,064
test create summary table
# Copyright 2015 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...
19,065
test basic
# Copyright 2018 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...
19,066
set seed
import random import torch from torch.utils.data.datapipes.datapipe import IterDataPipe, MapDataPipe from typing import Iterator, List, Optional, TypeVar __all__ = ["ShufflerIterDataPipe", ] T_co = TypeVar('T_co', covariant=True) # @functional_datapipe('shuffle') class ShufflerIterDataPipe(IterDataPipe[T_co]): ...
19,067
test xyz2rgb
"""Function for testing colormap module.""" import numpy as np import numpy.testing as npt from fury import colormap from fury.optpkg import optional_package cm, have_matplotlib, _ = optional_package('matplotlib.cm') def test_boys2rgb(): expected = np.array( [ [0.23171663, 0.34383397, 0.695...
19,068
filter 404
import abc import datetime import json import logging from pathlib import Path from mitmproxy import flowfilter from mitmproxy.http import HTTPFlow logger = logging.getLogger(__name__) class UrlIndexWriter(abc.ABC): """Abstract Add-on to write seen URLs. For example, these URLs can be injected in a web app...
19,069
test onnx non max suppression forward
# Copyright 2022 Sony 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 wri...
19,070
get transaction node
# 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...
19,071
test enqueue task if config not cached
from unittest.mock import patch, sentinel import pytest from django.urls import reverse from sentry.db.postgres.transactions import in_test_hide_transaction_boundary from sentry.relay.config import ProjectConfig from sentry.tasks.relay import build_project_config from sentry.testutils.hybrid_cloud import simulated_tr...
19,072
matvec
__all__ = ["DWT"] import logging from math import ceil, log from typing import Union import numpy as np from pylops import LinearOperator from pylops.basicoperators import Pad from pylops.utils import deps from pylops.utils._internal import _value_or_sized_to_tuple from pylops.utils.typing import DTypeLike, InputDim...
19,073
tear down
import sys import time from tests.unit import BZTestCase, RESOURCES_DIR, EngineEmul from bzt.engine import Provisioning, ScenarioExecutor from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.console import ConsoleStatusReporter from bzt.modules.provisioning import Local from bzt.utils import is_windo...
19,074
create
# *************************************************************************** # * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
19,075
get backup file
# ----------------------------------------------------------------------- # Copyright (c) 2009 Jendrik Seipp # # RedNotebook 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...
19,076
verify matching signatures
"""Implementation of __array_function__ overrides from NEP-18.""" import collections import functools import os from numpy.core._multiarray_umath import ( add_docstring, implement_array_function, _get_implementing_args) from numpy.compat._inspect import getargspec ENABLE_ARRAY_FUNCTION = bool( int(os.environ...
19,077
test sparkdf
import datetime import os import random from pathlib import Path from typing import List import pandas as pd import pytest from moto import mock_s3 from great_expectations.compatibility import aws, pyspark from great_expectations.compatibility.pyspark import functions as F from great_expectations.core.batch_spec impo...
19,078
factory
import logging import time from typing import MutableMapping, Optional import pytest from confluent_kafka import Consumer, Producer from confluent_kafka.admin import AdminClient _log = logging.getLogger(__name__) MAX_SECONDS_WAITING_FOR_EVENT = 16 @pytest.fixture def kafka_producer(): def inner(settings): ...
19,079
time split
from io import StringIO from benchmarks import snippets from rich.color import Color, ColorSystem from rich.console import Console from rich.pretty import Pretty from rich.segment import Segment from rich.style import Style from rich.syntax import Syntax from rich.table import Table from rich.text import Text class ...
19,080
soft fuse chunk
# # Copyright 2019 Xilinx 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 or agreed to in writi...
19,081
test separable conv2d constraints
# Copyright 2018 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...
19,082
cleanup repo
# SPDX-License-Identifier: Apache-2.0 # Copyright 2022 The HuggingFace Authors. # Adapted from https://github.com/huggingface/datasets/blob/main/tests/fixtures/hub.py import time from contextlib import contextmanager, suppress from typing import ( Any, Callable, Dict, Iterator, Literal, Mappin...
19,083
test cyberark epv 5424
# Copyright 2019 Splunk, Inc. # # Use of this source code is governed by a BSD-2-clause-style # license that can be found in the LICENSE-BSD2 file or at # https://opensource.org/licenses/BSD-2-Clause import shortuuid from jinja2 import Environment, select_autoescape from .sendmessage import sendsingle from .splunkuti...
19,084
test default settings
"""Tests for Validator""" import pytest from delphi_utils.validator.errors import ValidationFailure from delphi_utils.validator.validate import Validator class TestValidatorInitialization: """Tests for proper initialization.""" def METHOD_NAME(self): """Test default initialization.""" params = ...
19,085
send request
# coding=utf-8 # -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. # Changes may ...
19,086
test transform queue more gates
"""Test functions defined in `qibo/models/distcircuit.py`.""" import pytest from qibo import Circuit, gates from qibo.models.distcircuit import DistributedQubits def check_device_queues(queues): """Asserts that global qubits do not collide with the gates to be applied.""" for gate_group in queues.queues: ...
19,087
captcha task
# -*- coding: utf-8 -*- import pycurl from pyload.core.network.http.exceptions import BadHeader from pyload.core.network.request_factory import get_request from ..base.addon import BaseAddon, threaded class BypassCaptchaException(Exception): def __init__(self, err): self.err = err def get_code(sel...
19,088
determine version
# 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 re from spack.package import * class RocmDebugAgent(CMakePackage): """Radeon Open Compute (ROCm) debug agent...
19,089
get test data configuration
import os import sys import collections import dataclasses import subprocess from src.util import read_json, NameSpace, to_iter from src import core, cli @dataclasses.dataclass class DummyMDTFFramework(object): code_root: str = "" pod_list: list = dataclasses.field(default_factory=list) case_list: list = d...
19,090
validate options
""" data_selector.py A node and widget for subselecting from a dataset. """ from typing import List, Tuple, Dict, Any, Sequence, Optional import numpy as np from .node import Node, NodeWidget, updateOption from ..data.datadict import DataDictBase, DataDict from ..gui.data_display import DataSelectionWidget from plot...
19,091
test clean local cache
from functools import cached_property from unittest.mock import patch from uuid import uuid1 import pytest from django.conf import settings from django.core.cache.backends.locmem import LocMemCache from django.test import override_settings from sentry.models import Option from sentry.options.manager import OptionsMan...
19,092
get next
# coding=utf-8 # -------------------------------------------------------------------------- # 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 Microsoft (R) AutoRest Code Generator. # Changes may ...
19,093
populate module pm
from ctypes import c_uint, c_bool from llvmlite.binding import ffi from llvmlite.binding import passmanagers def create_pass_manager_builder(): return PassManagerBuilder() class PassManagerBuilder(ffi.ObjectRef): __slots__ = () def __init__(self, ptr=None): if ptr is None: ptr = ffi...
19,094
resource apply sparse
# Copyright 2020 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...
19,095
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 . imp...
19,096
encode
# This file is a part of Remoulade. # # Copyright (C) 2017,2018 CLEARTYPE SRL <bogdan@cleartype.io> # # Remoulade 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 of the License, or (at ...
19,097
profiles
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os from core.load_modules import load_all_modules, load_all_profiles from core.load_modules import load_all_graphs from core.alert import messages from flask import abort from config import nettacker_paths def structure(status="", msg=""): """ basic JSON ...
19,098
test run command
"""Test runway.mixins.""" # pylint: disable=protected-access,unused-argument from __future__ import annotations import subprocess from typing import TYPE_CHECKING, Any, Dict, List, Optional import pytest from mock import Mock from runway.compat import cached_property from runway.mixins import CliInterfaceMixin, DelC...
19,099
prepare config and inputs
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. 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 r...