id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
2,300
tear down
# Copyright 2011 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...
2,301
test process empty filing
# Copyright © 2019 Province of British Columbia # # 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 agr...
2,302
update loaded pyrevit referenced modules
"""Manage information about pyRevit sessions.""" import sys from collections import namedtuple from pyrevit import HOST_APP, HOME_DIR from pyrevit import versionmgr from pyrevit.compat import safe_strtype from pyrevit.versionmgr import about from pyrevit import coreutils from pyrevit.coreutils.logger import get_logge...
2,303
read eventfile
# Copyright (c) 2023, 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.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,304
raw concepts
import pytest from coding_systems.ctv3.coding_system import CodingSystem from coding_systems.ctv3.models import ( RawConcept, RawConceptTermMapping, RawTerm, TPPConcept, TPPRelationship, ) @pytest.fixture def coding_system(): yield CodingSystem(database_alias="ctv3_test_20200101") @pytest.f...
2,305
fit
"""Baseline classifier.""" import numpy as np import pandas as pd from evalml.model_family import ModelFamily from evalml.pipelines.components.estimators import Estimator from evalml.problem_types import ProblemTypes from evalml.utils import get_random_state, infer_feature_types class BaselineClassifier(Estimator): ...
2,306
test checkout shipping address update both token
from unittest import mock import graphene from .....checkout.error_codes import CheckoutErrorCode from .....checkout.fetch import fetch_checkout_info, fetch_checkout_lines from .....plugins.manager import get_plugins_manager from ....tests.utils import get_graphql_content from ...mutations.utils import update_checkou...
2,307
run
# # -*- coding: utf-8 -*- # # Copyright (c) 2023 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 app...
2,308
test 2022
# python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2...
2,309
build local cluster
# Copyright (c) 2023 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 w...
2,310
roles
# SPDX-License-Identifier: MIT from __future__ import annotations import asyncio from typing import TYPE_CHECKING, Callable, Generic, List, Optional, Tuple, TypeVar from ...components import MentionableSelectMenu from ...enums import ComponentType from ...interactions import ClientT from ...member import Member from...
2,311
on prerelease state change
# noinspection PyPackageRequirements import wx from gui.preferenceView import PreferenceView from gui.bitmap_loader import BitmapLoader from service.settings import UpdateSettings _t = wx.GetTranslation class PFUpdatePref(PreferenceView): def populatePanel(self, panel): self.title = _t("Updates") ...
2,312
test hash
# Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # The Universal Permissive License (UPL), Version 1.0 # # Subject to the condition set forth below, permission is hereby granted to any # person obtaining a copy of this softw...
2,313
check formhandler
import gramex.cache from . import TestGramex from nose.tools import eq_, ok_ class TestOpenAPIHandler(TestGramex): expected = gramex.cache.open('openapiresponse.yaml', rel=True) def has_param(self, params, **kwargs): items = kwargs.items() return any(items <= param.items() for param in params...
2,314
connection made
# twisted is optional and self-contained in this module. # We don't want to force it as a dependency but that means we also can't test it with type-checkers given the current setup. from _typeshed import Incomplete from typing import Generic, NamedTuple, TypeVar import pika.connection from pika.adapters.utils import ...
2,315
test mongo fetch with filter
from typing import Optional import pandas as pd import pytest from aqueduct.error import AqueductError from aqueduct.resources.mongodb import MongoDBResource from aqueduct import LoadUpdateMode, op from sdk.data_resource_tests.flow_manager import FlowManager from sdk.data_resource_tests.mongo_db_data_validator import...
2,316
run rez bind
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project """ Entry points. """ import os import os.path import sys ### Utility functions def get_specifications(): """Get entry point specifications See: * https://pythonhosted.org/distlib/reference.html#distlib.scripts.ScriptMak...
2,317
create hyperpipe
import types import unittest from functools import reduce import operator from inspect import signature from photonai.base import PipelineElement, Switch, Branch, Hyperpipe from photonai.optimization import GridSearchOptimizer, RandomGridSearchOptimizer, IntegerRange from photonai.optimization.base_optimizer import Ph...
2,318
shutup
from http.server import HTTPServer, SimpleHTTPRequestHandler import unittest import os import tempfile from pykickstart import load from pykickstart.errors import KickstartError from signal import SIGTERM class LoadTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(se...
2,319
get mfr id
# # psuutil.py # Platform-specific PSU status interface for SONiC # import logging import os.path try: from sonic_psu.psu_base import PsuBase except ImportError as e: raise ImportError(str(e) + "- required module not found") class PsuUtil(PsuBase): """Platform-specific PSUutil class""" HWMON_PATH =...
2,320
clean text data
# Generated by Django 3.2.16 on 2022-10-18 13:16 import re import warnings from typing import Dict, Optional from django.db import migrations from django.template.defaultfilters import truncatechars from django.utils.html import strip_tags from urllib3.util import parse_url # Start copy of /saleor/core/utils/editorj...
2,321
async set preset mode
""" Setup for different kinds of Tuya fan devices """ import logging from homeassistant.components.fan import FanEntity, FanEntityFeature from .device import TuyaLocalDevice from .helpers.config import async_tuya_setup_platform from .helpers.device_config import TuyaEntityConfig from .helpers.mixin import TuyaLocalEn...
2,322
test missing eof
import unittest from drake.tools.lint.formatter import FormatterBase, IncludeFormatter class TestFormatterBase(unittest.TestCase): def test_essentials(self): original_lines = [ '// Line 1\n', '/* Line 2 */\n', '\n', ] dut = FormatterBase('filename.cc',...
2,323
gradrhofunc
import os, shutil, mpi from Spheral2d import * from SpheralTestUtilities import * from centroidalRelaxNodes import * from GenerateNodeDistribution2d import * from siloPointmeshDump import * from fieldStatistics import * title("2-D test of centroidal relaxation.") #-----------------------------------------------------...
2,324
update settings
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Main function and startup utilities for vimiv. Module Attributes: _tmpdir: TemporaryDirectory when running with ``--temp-basedir``. The object must exist until vimiv exits. """ import argparse import os import sys import tempfile from typing import cas...
2,325
test call kwargs single
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for the :func:`iris.common.lenient._lenient_client`. """ # Import iris.tests first so that some things can be ...
2,326
directional index
# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors. # See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md from collections import defaultdict class CouplingGraph: """Manages coupling relationships""" def __init__(self, couplings): ...
2,327
test scaleway remove absent nic
# Copyright (c) 2019, Ansible Project # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytes...
2,328
pack results2
# -*- coding: utf-8 -*- """ Created on Sat Apr 12 17:58:51 2014 @author: david """ import numpy as np try: import copy_reg except ImportError: import copyreg as copy_reg def pickleSlice(slice): return unpickleSlice, (slice.start, slice.stop, slice.step) def unpickleSlice(start, stop, step): ...
2,329
min
"""paddle backend implementation""" from packaging.version import Version import paddle if Version(paddle.__version__) != Version("0.0.0"): raise RuntimeError("DeepXDE requires PaddlePaddle==0.0.0(develop).") if paddle.device.is_compiled_with_cuda(): paddle.device.set_device("gpu") lib = paddle def data_t...
2,330
kill podman container by name
from pathlib import Path from typing import Callable, Optional from paramiko import SSHException from scp import SCPException import consts from assisted_test_infra.test_infra.controllers.node_controllers import ssh from assisted_test_infra.test_infra.controllers.node_controllers.disk import Disk from service_client ...
2,331
test categories children
import graphene import pytest from .....product.models import Category from ....tests.utils import get_graphql_content @pytest.mark.django_db @pytest.mark.count_queries(autouse=False) def test_category_view(api_client, category_with_products, count_queries, channel_USD): query = """ fragment BasicProduct...
2,332
test add providers
import pytest from mimesis import BaseProvider, Generic class TestGeneric: def test_reseed(self, generic): generic.reseed(0xFFF) number_1 = generic.random.uniform(0, 1000) address_1 = generic.address.address() generic.reseed(0xFFF) number_2 = generic.random.uniform(0, 1000...
2,333
generate
from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir ) f...
2,334
test read submodule resource by name
import sys import unittest from . import data01 from . import zipdata01, zipdata02 from . import util from importlib import resources, import_module class ResourceTests: # Subclasses are expected to set the `data` attribute. def test_is_resource_good_path(self): self.assertTrue(resources.is_resource...
2,335
build start state
# Copyright © 2012-2023 Forschungszentrum Jülich GmbH # SPDX-License-Identifier: LGPL-3.0-or-later import math from pathlib import Path from jupedsim_visualizer.geometry import Geometry from jupedsim_visualizer.replay_widget import ReplayWidget from jupedsim_visualizer.trajectory import Trajectory from jupedsim_visual...
2,336
path prettify
# -*- coding: utf-8 -*- # # This file is part of OpenMediaVault. # # @license http://www.gnu.org/licenses/gpl.html GPL Version 3 # @author Volker Theile <volker.theile@openmediavault.org> # @copyright Copyright (c) 2009-2023 Volker Theile # # OpenMediaVault is free software: you can redistribute it and/or modify #...
2,337
best effort removal
# -*- coding: utf-8 -*- # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0: import errno import os import os.path import shutil import stat import subprocess import time from . import exception from .trace_decorator import getLog, traceLog @traceLog() def mkdirIfAbsent(*args): for dirN...
2,338
read stdin lines
from pathlib import Path from sys import stdin from typing import Any, Dict, Iterator, List, Optional, Tuple, Union PathLike = Union[str, Path] RawDoc = Union[str, bytes] try: from ruamel.yaml import YAML _YAML_C = YAML(typ="safe", pure=False) except ImportError: _YAML_C = None def _parse_yaml_yaml(s: ...
2,339
test encrypt
import sys from pathlib import Path import aiofiles import pytest import unpaddedbase64 from Crypto import Random # nosec from nio import EncryptionError from nio.crypto import async_encrypt_attachment, decrypt_attachment FILEPATH = "tests/data/test_bytes" @pytest.mark.skipif( sys.version_info < (3, 5), r...
2,340
xml decl handler
from _typeshed import Incomplete, ReadableBuffer, SupportsRead from typing import Any, NoReturn from xml.dom.minidom import Document, DOMImplementation, Node, TypeInfo from xml.dom.xmlbuilder import DOMBuilderFilter, Options TEXT_NODE = Node.TEXT_NODE CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE DOCUMENT_NODE = Node.D...
2,341
test s3 data auto flush one table
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from typing import Any, Union from unittest.mock import ANY, MagicMock, call, patch from destination_firebolt.writer import FireboltS3Writer, FireboltSQLWriter from pytest import fixture, mark @fixture def connection() -> MagicMock: return MagicMock()...
2,342
test controlchars
# Copyright © Michal Čihař <michal@weblate.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Tests for automatix fixups.""" from django.test import TestCase from weblate.checks.tests.test_checks import MockUnit from weblate.trans.autofixes import fix_target from weblate.trans.autofixes.chars import ( Devanag...
2,343
exists
import logging import slugify from flask_mongoengine import Document from mongoengine.fields import StringField from mongoengine.signals import pre_save, post_delete from .queryset import UDataQuerySet from udata.utils import is_uuid log = logging.getLogger(__name__) class SlugField(StringField): ''' A fie...
2,344
test full random misc balances
from random import Random from eth2spec.test.context import ( with_altair_and_later, spec_test, spec_state_test, with_custom_state, single_phase, low_balances, misc_balances, ) from eth2spec.test.helpers.inactivity_scores import randomize_inactivity_scores from eth2spec.test.helpers.rewards imp...
2,345
create init cells
"""Cell factory for Otter Assign""" import nbformat from .assignment import Assignment from .feature_toggle import FeatureToggle from .utils import lock class CellFactory: """ A factory for cells that make use of Otter's client package (e.g. init cell, check cell). All (non-static cell-generating) meth...
2,346
process end
from udapi.core.block import Block from collections import Counter class Stats(Block): """Block corefud.Stats prints various coreference-related statistics.""" def __init__(self, m_len_max=5, c_len_max=5, report_mentions=True, report_entities=True, report_details=True, selected_upos='NOUN PRO...
2,347
save
import csv import gzip import json import logging import os import traceback from io import StringIO from typing import ClassVar, List, Optional import pendulum from calitp_data_infra.storage import ( GTFSDownloadConfig, PartitionedGCSArtifact, ProcessingOutcome, get_fs, ) from utils import GTFSSchedul...
2,348
test undefined occupancy
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
2,349
update ckpt
# Copyright 2022 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...
2,350
connectiondatahelper
from selenium import webdriver from bs4 import BeautifulSoup import json import time from selenium.webdriver.common.by import By import csv browser = webdriver.Chrome() pageurl = "https://www.linkedin.com/uas/login?session_redirect=https%3A%2F%2Fwww%2Elinkedin%2Ecom%2Fsearch%2Fresults%2Fpeople%2F%3Fnetwork%3D%255B%25...
2,351
monotone fn inverter
""" Empirical CDF Functions """ import numpy as np from scipy.interpolate import interp1d def _conf_set(F, alpha=.05): r""" Constructs a Dvoretzky-Kiefer-Wolfowitz confidence band for the eCDF. Parameters ---------- F : array_like The empirical distributions alpha : float Set ...
2,352
compute center
import os, os.path import socket import lbann import lbann.launcher from lbann.util import make_iterable, nvprof_command # ============================================== # Detect the current compute center # ============================================== def is_lc_center(): """Current system is operated by Liver...
2,353
test recursive inst
import cPickle import unittest from cStringIO import StringIO from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests from test import test_support class ApproxFloat(unittest.TestCase): # FIXME for Jython: remove this class - and its use from bases in # subsequent test classes - when we c...
2,354
id
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 fr...
2,355
test check events warnings null duration
""" Test the design_matrix utilities. Note that the tests just look whether the data produced has correct dimension, not whether it is exact. """ import os import numpy as np import pandas as pd import pytest from numpy.testing import assert_array_equal from nilearn._utils.data_gen import basic_paradigm from nilear...
2,356
decode
#!/usr/bin/env python3 import argparse import os import re import shlex import sys from subprocess import run, SubprocessError, DEVNULL, PIPE from tempfile import NamedTemporaryFile DESC = """ A `csmith` fuzzing driver for `bindgen`. Generates random C source files with `csmith` and then passes them to `bindgen` (v...
2,357
split
from typing import * from typing_extensions import Literal import pandas as pd pi: float def array(x: Union[Sequence[Any], Iterable[Any], ndarray], **kwargs) -> ndarray: ... class int32: ... class float32: ... class ndarray(List): shape: Sequence[int] T: 'ndarray'...
2,358
test instance of operation
from __future__ import annotations from typing import Optional import pytest import ibis import ibis.expr.datashape as ds import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.rules as rlz import ibis.expr.types as ir from ibis.common.annotations import ValidationError from ibis.common...
2,359
checkpoint
# Copyright 2022 The DLRover 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 applicable law o...
2,360
is packed layout
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2,361
save cognition data
import os from fastapi import UploadFile, File, Security, APIRouter from starlette.responses import FileResponse from kairon.api.models import Response, TextData, CognitiveDataRequest from kairon.events.definitions.faq_importer import FaqDataImporterEvent from kairon.shared.auth import Authentication from kairon.shar...
2,362
teardown module
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-2023 by the software own...
2,363
get prs
import requests, json, datetime, os from enum import Enum from github import Github ORG_NAME = 'kubevirt' REPO_NAME = 'hyperconverged-cluster-operator' GITHUB_BASE_API = 'https://api.github.com/repos' class Result(Enum): Success = 0 Overridden = 1 Failure = 2 Pending = 3 Error = 4 ...
2,364
assert pixels equal
"""Test the final, drawn results and compare PNG images pixel per pixel.""" import io import os from itertools import zip_longest from PIL import Image from ..testing_utils import FakeHTML, resource_filename # NOTE: "r" is not half red on purpose. In the pixel strings it has # better contrast with "B" than does "R"...
2,365
main
# Copyright © 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. from io import StringIO from os.path import dirname, join from numpy import array from numpy.testing import assert_array_equal import pandas as pd import sys impor...
2,366
test is url in portal
from Acquisition import aq_parent from plone.base.interfaces import ILoginSchema from plone.registry.interfaces import IRegistry from Products.CMFCore.tests.base.dummy import DummyContent from Products.CMFCore.tests.base.dummy import DummyFolder from Products.CMFCore.tests.base.dummy import DummySite from zope.componen...
2,367
test simple
#!/usr/bin/env python import os import re import stat import subprocess import pytest from subprocess import Popen from pathlib import Path import lief from lief.ELF import Segment from utils import get_sample, has_recent_glibc, is_linux, is_x86_64, is_aarch64 is_updated_linux = pytest.mark.skipif(not (is_linux() and...
2,368
real np types
import numpy as np from numba.core.compiler import compile_isolated from numba import jit from numba.core import types from numba.tests.support import TestCase, tag import unittest def dobool(a): return bool(a) def doint(a): return int(a) def dofloat(a): return float(a) def docomplex(a): retur...
2,369
drop block2d
import torch import torch.fx import torch.nn.functional as F from torch import nn, Tensor from ..utils import _log_api_usage_once def METHOD_NAME( input: Tensor, p: float, block_size: int, inplace: bool = False, eps: float = 1e-06, training: bool = True ) -> Tensor: """ Implements DropBlock2d from `"Drop...
2,370
schedule registration reminder
from django.conf import settings from django.db.models.signals import post_delete, post_save from django.utils import timezone from events.models import Event, EventRegistration from members.models import Member from utils.models.signals import suspendingreceiver from ..models import Category, EventStartReminderMessa...
2,371
resnet calibration reader
# # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: MIT # # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -----------------------------------------...
2,372
merge candidates
# 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...
2,373
test is ipaddress false
from __future__ import annotations import ssl import typing from unittest import mock import pytest from urllib3.exceptions import ProxySchemeUnsupported, SSLError from urllib3.util import ssl_ class TestSSL: @pytest.mark.parametrize( "addr", [ # IPv6 "::1", ...
2,374
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...
2,375
parse simple
from __future__ import annotations import contextlib import os import re import urllib.parse from pathlib import Path from typing import TYPE_CHECKING from typing import Dict from typing import List from typing import TypeVar from typing import Union from typing import cast from poetry.core.packages.dependency impor...
2,376
test traffic violation max statute
""" Rules for 800 Level charges are as follows: 800 level misdemeanors and felonies are eligible Only If the case was dismissed 800 level cases of any kind that are convicted are not eligible 800 level infractions do not block other cases 800 level misdemeanor and felony convictions do block 800 level misdemeanor and ...
2,377
fieldvalue test1
import os import sys from shapeworks import * import numpy as np success = True def METHOD_NAME(): dist = Mesh(os.environ["DATA"] + "/meshdistance2.vtk") a = dist.getFieldValue("distance", 0) b = dist.getFieldValue("distance", 1000) c = dist.getFieldValue("distance", dist.numPoints()-1) return abs(a - 0.37...
2,378
selected repositories
############################ Copyrights and license ############################ # # # Copyright 2023 Mauricio Martinez <mauricio.martinez@premise.com> # # ...
2,379
save image
# This file is part of Trackma. # # 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 program is distributed in the...
2,380
outputs format
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use thi...
2,381
get node config
import h5py import json from nndct_shared.nndct_graph.base_tensor import Tensor def save_graph(nndct_graph, hdf5_path='graph.hdf5'): GraphHDF5Saver(nndct_graph).save(hdf5_path) class GraphHDF5Saver(): def __init__(self, nndct_graph): self.graph = nndct_graph def METHOD_NAME(self, node): node_info = d...
2,382
setup model loss criterion
# 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 argparse import random import unittest from multiprocessing import Manager import torch import torch.nn as nn from fairseq import dist...
2,383
normalize analyzer type
import logging import re from pathlib import Path from pprint import pformat from typing import Union, Sequence import cpyMSpec try: from typing import Literal except ImportError: from typing_extensions import Literal logger = logging.getLogger(__name__) PolarityType = Literal['positive', 'negative'] ANALYZ...
2,384
get insight selectors
"""Handles incoming cloudtrail requests, invokes methods, returns responses.""" import json from typing import Any, Dict from moto.core.responses import BaseResponse from .models import cloudtrail_backends, CloudTrailBackend from .exceptions import InvalidParameterCombinationException class CloudTrailResponse(BaseRes...
2,385
generate arguments
# Copyright 2019 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 required by applicable law or agreed to in writing, ...
2,386
test half
################################################################################ # # Copyright (C) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
2,387
test get weight channel axis
# Copyright (c) 2023 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 writ...
2,388
handle old salt host resource
""" Dynamic roster from terraform current state =========================================== This roster module allows you dynamically generate the roster from the terraform resources defined with the `Terraform Salt`_ provider. It exposes all salt_host resources with the same attributes to the salt-ssh roster, making...
2,389
get token
import json from rest_framework.exceptions import APIException from django.conf import settings from users.utils import construct_user_email from common.utils.common import get_logger from common.sdk.im.utils import digest from common.sdk.im.mixin import RequestMixin, BaseRequest logger = get_logger(__name__) clas...
2,390
getcalculate sigma
#------------------------------------------------------------------------------- # ArtificialViscosity base class #------------------------------------------------------------------------------- from PYB11Generator import * from ArtificialViscosityAbstractMethods import * from RestartMethods import * @PYB11template("D...
2,391
test property diffuse color
import pytest import pyvista as pv from pyvista.plotting._property import _check_range @pytest.fixture() def prop(): return pv.Property() def test_check_range(): with pytest.raises(ValueError, match="outside the acceptable"): _check_range(-1, (0, 1), 'parm') with pytest.raises(ValueError, match...
2,392
test perturb real volatility below
import numpy import pytest from base import RNGStub, TrialStub from orion.algo.pbt.explore import PerturbExplore, PipelineExplore, ResampleExplore from orion.algo.space import Categorical, Dimension from orion.core.utils.flatten import flatten class TestPipelineExplore: def test_no_explore(self): params ...
2,393
id
# 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...
2,394
get
# 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...
2,395
cla
#import sys;sys.path.insert(0,'/home/ccsmm/workdir/ccsmmutils');import img_utils as myiu import cv2 import numpy as np import matplotlib.pyplot as plt from ipdb import set_trace as BP from PIL import Image def image_crop( infilename , save_path): """ image file 와 crop한이미지를 저장할 path 을 입력받아 crop_img를 저장한다. ...
2,396
error
#!/usr/bin/env python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 """ gperf C file post-processor We use gperf to build up a perfect hashtable of pointer values. The way gperf does this is to create a table 'wordlist' indexed by a string representation of a pointer address, and t...
2,397
id for
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import infra.e2e_args import infra.network import infra.proc import infra.commit import http import cimetrics.upload from concurrent import futures from infra.log_capture import flush_info from infra.snp import IS_SNP i...
2,398
set up
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp from copy import deepcopy from unittest import TestCase from unittest.mock import MagicMock from mmengine.registry import init_default_scope from mmocr.datasets import ConcatDataset, OCRDataset from mmocr.registry import TRANSFORMS class TestConc...
2,399
worker
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" import atexit from concurrent.futures import _base import itertools import Queue as queue import threading import weakref import sys try: from multiprocessing import cpu_coun...