id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
2,800
from str
# SPDX-License-Identifier: MIT from __future__ import annotations import re from typing import TYPE_CHECKING, Any, Dict, Optional, Union from . import utils from .asset import Asset, AssetMixin from .errors import InvalidArgument __all__ = ("PartialEmoji",) if TYPE_CHECKING: from datetime import datetime ...
2,801
region
# 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,802
create bias correction command
# 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,803
product repository
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-variable # pylint: disable=too-many-arguments from typing import Any import pytest import sqlalchemy as sa from aiohttp import web from aiohttp.test_utils import TestClient from aiopg.sa.result import RowProxy from pyte...
2,804
sign
"""JWS Linked Data class.""" import json from datetime import datetime from typing import Union from pyld.jsonld import JsonLdProcessor from ....wallet.util import b64_to_bytes, bytes_to_b64, str_to_b64, b64_to_str from ..crypto import _KeyPair as KeyPair from ..document_loader import DocumentLoaderMethod from ..e...
2,805
reset
import numpy as np import os import sys import ntpath import time from . import util, html from subprocess import Popen, PIPE import torch if sys.version_info[0] == 2: VisdomExceptionBase = Exception else: VisdomExceptionBase = ConnectionError def save_images(webpage, visuals, image_path, aspect_ratio=1.0, ...
2,806
start
# Copyright (c) 2022, 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,807
test scene ex by name
import sys import unittest from sickchill import settings from sickchill.oldbeard import common, db, name_cache, scene_exceptions, show_name_helpers from sickchill.tv import TVShow as Show from tests import conftest class SceneTests(conftest.SickChillTestDBCase): """ Test Scene """ def _test_all_pos...
2,808
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 # --------------------------------...
2,809
parse op
#!/usr/bin/env python # 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that i...
2,810
name
from __future__ import annotations import typing from river import base, stats __all__ = ["PreviousImputer", "StatImputer"] class PreviousImputer(base.Transformer): """Imputes missing values by using the most recent value. Examples -------- >>> from river import preprocessing >>> imputer = p...
2,811
get workload network dns zone output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
2,812
system data
# 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,813
test construct
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
2,814
test ok
from unittest import TestCase from zentral.contrib.inventory.conf import (is_apple_os, macos_version_from_build, os_version_display, os_version_version_display) class MacOSBuildTestCase(TestCase): def test_wrong_errors(self): for build in ("A", "", "9"): ...
2,815
test scanning empty sr
import testlib import unittest import unittest.mock as mock import SRCommand import HBASR import xmlrpc.client import devscan def create_hba_sr(): command = SRCommand.SRCommand(driver_info=None) command_parameter = ( { 'device_config': {}, 'command': 'irrelevant_some_command'...
2,816
do get
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. import os from . import command from . import completers from . import utils from . import corosync from . import parallax from . import bootstrap from . import log logger = log.setup_logger(__name__) def _push_com...
2,817
test no project with connected account
import unittest import os import json from unittest.mock import patch import threading from test.support.os_helper import EnvironmentVarGuard from urllib.parse import urlparse from http.server import BaseHTTPRequestHandler, HTTPServer from google.cloud import bigquery from google.auth.exceptions import DefaultCredent...
2,818
print gh commands
""" Script to create issue for every unsupported command. To run this: - Install pygithub: pip install pygithub - Set environment variable `GITHUB_TOKEN` to a github token with permissions to create issues. - Another option is to create `.env` file with `GITHUB_TOKEN`. """ import os from dotenv import load_dotenv fr...
2,819
test run
from __future__ import unicode_literals # Copyright (C) 2019 Xin Liang <XLiang@suse.com> # See COPYING for license information. # # unit tests for parallax.py import unittest from unittest import mock import crmsh.parallax import crmsh.prun.prun class TestParallax(unittest.TestCase): def setUp(self): "...
2,820
pad image
""" Copyright (C) 2020-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 i...
2,821
parse
from __future__ import absolute_import, division, unicode_literals from future.builtins import str """ robotparser.py Copyright (C) 2000 Bastian Kleineidam You can choose between two licenses when using this package: 1) GNU GPLv2 2) PSF license for Python 2.2 The robots.txt Exclusion Protocol is...
2,822
set soft kill
#!/usr/bin/python3 import rospy from mil_usb_to_can.sub8 import SimulatedCANDevice from std_srvs.srv import SetBool, SetBoolRequest, SetBoolResponse from .packets import ( KILL_SEND_ID, THRUST_SEND_ID, HeartbeatMessage, KillMessage, StatusMessage, ThrustPacket, ) class ThrusterAndKillBoardSim...
2,823
test enum attribute
# -*- coding: utf-8 -*- """Test attribute descriptors. """ import enum import pytest from pyvisa import constants from pyvisa.attributes import ( Attribute, AttrVI_ATTR_ASRL_BAUD, AttrVI_ATTR_INTF_INST_NAME, BooleanAttribute, CharAttribute, EnumAttribute, IntAttribute, RangeAttribute,...
2,824
on del player
from __future__ import annotations from collections import Counter from src.containers import UserDict from src.functions import get_players, get_main_role, change_role from src.messages import messages from src.events import Event, event_listener from src.cats import Wolf, Category from src.gamestate import GameStat...
2,825
imports
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from enum ...
2,826
get setup
""" Copyright 2018 Grid Singularity This file is part of Grid Singularity Exchange. 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 vers...
2,827
device
# Copyright (c) Facebook, Inc. and its affiliates. from __future__ import division from typing import Any, Dict, List, Optional, Tuple import torch from torch import METHOD_NAME from torch.nn import functional as F from annotator.oneformer.detectron2.layers.wrappers import move_device_like, shapes_to_tensor class Im...
2,828
main function
# """Sorting components: clustering""" from pathlib import Path import shutil import numpy as np try: import hdbscan HAVE_HDBSCAN = True except: HAVE_HDBSCAN = False import random, string, os from spikeinterface.core import get_global_tmp_folder, get_noise_levels, get_channel_distances from sklearn.prep...
2,829
function at time t
"""Animations related to movement.""" from __future__ import annotations __all__ = [ "Homotopy", "SmoothedVectorizedHomotopy", "ComplexHomotopy", "PhaseFlow", "MoveAlongPath", ] from typing import TYPE_CHECKING, Any, Callable import numpy as np from ..animation.animation import Animation from ....
2,830
method test
from future import standard_library standard_library.install_aliases() from future.utils import viewitems import hashlib import hmac import urllib.parse from http.client import HTTPConnection from Utils.Utilities import decodeBytesToUnicodeConditional, encodeUnicodeToBytesConditional from Utils.PythonVersion import...
2,831
set up class
import logging import platform import sys import tempfile from pathlib import Path from unittest import mock from unittest import TestCase from click.testing import CliRunner from tests import fixtures_dir from xsdata import __version__ from xsdata.cli import cli from xsdata.cli import resolve_source from xsdata.code...
2,832
works not in py
import re import tempfile import shutil import logging import sys import os import pytest import yatest.common import parso from parso import cache from parso.utils import parse_version_string collect_ignore = ["setup.py"] VERSIONS_2 = '2.7', VERSIONS_3 = '3.4', '3.5', '3.6', '3.7', '3.8' @pytest.fixture(scope='s...
2,833
zip choices
from collections import namedtuple from django.forms import TypedChoiceField from django.template import Library from django.utils.translation import gettext_lazy as _ from evap.evaluation.models import BASE_UNIPOLAR_CHOICES, Contribution, Evaluation from evap.rewards.tools import can_reward_points_be_used_by from ev...
2,834
test logout redirect url
from unittest.mock import patch from django.http import HttpResponse from django.test import Client, TestCase from django.urls import reverse from .common import less_console_noise @patch("djangooidc.views.CLIENT", autospec=True) class ViewsTest(TestCase): def setUp(self): self.client = Client() de...
2,835
check connection
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import logging from datetime import datetime from typing import Any, Iterator, List, Mapping, MutableMapping, Optional, Tuple, Union import requests from airbyte_cdk import AirbyteLogger from airbyte_cdk.models import AirbyteMessage, AirbyteStateMessage, Co...
2,836
test component recreate with long path
import functools import io import os.path from typing import Callable import mock import pytest from devtools_testutils import AzureRecordedTestCase from test_utilities.utils import build_temp_folder from azure.ai.ml import MLClient, load_component from azure.ai.ml.entities import CommandComponent from .._util impor...
2,837
write to repo
# Copyright 2016 Battelle Energy Alliance, 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 agr...
2,838
test awaiting retry without scheduled time defaults
from uuid import UUID, uuid4 import pendulum import pydantic import pytest from prefect.deprecated.data_documents import DataDocument from prefect.server.schemas.states import ( AwaitingRetry, Completed, Failed, Late, Pending, Retrying, Running, Scheduled, State, StateDetails, ...
2,839
poetry
from __future__ import annotations import os from typing import TYPE_CHECKING import pytest from cleo.io.null_io import NullIO from cleo.testers.application_tester import ApplicationTester from cleo.testers.command_tester import CommandTester from METHOD_NAME.installation import Installer from METHOD_NAME.utils.en...
2,840
bert embeddings from file
import numpy as np from sentence_transformers import SentenceTransformer import scipy.sparse import warnings from octis.models.contextualized_topic_models.datasets.dataset import CTMDataset import os import pickle as pkl def get_bag_of_words(data, min_length): """ Creates the bag of words """ vect = [n...
2,841
test uniq grid3d
from unittest import TestCase import numpy as np from aspire.basis.basis_utils import ( all_besselj_zeros, besselj_zeros, lgwt, norm_assoc_legendre, real_sph_harmonic, sph_bessel, unique_coords_nd, ) class BesselTestCase(TestCase): def setUp(self): pass def tearDown(self...
2,842
unregister
#********************************************************************** # Copyright 2020 Advanced Micro Devices, 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.o...
2,843
get counter update
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of perseo-fe # # perseo-fe is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 ...
2,844
get
import re import os from codalab.common import precondition, UsageError INSTANCE_SEPARATOR = "::" WORKSHEET_SEPARATOR = "//" TARGET_KEY_REGEX = r"(?<=^)(?:([^:]*?)\:(?!:))?(.*(?=$))" TARGET_REGEX = r"(?<=^)(?:(.*?)\:\:)?(?:(.*?)\/\/)?(.+?)(?:\/(.*?))?(?=$)" # Formatting Constants ADDRESS_SPEC_FORMAT = "(<alias>|<ad...
2,845
test basic execution group
"""Unit tests for the testplan.testing.multitest.suite module.""" import re import pytest from testplan.common.utils.exceptions import should_raise from testplan.common.utils.interface import MethodSignatureMismatch from testplan.common.utils.strings import format_description from testplan.testing.multitest import s...
2,846
from 3 points
# bluemira is an integrated inter-disciplinary design tool for future fusion # reactors. It incorporates several modules, some of which rely on other # codes, to carry out a range of typical conceptual fusion reactor design # activities. # # Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto...
2,847
create context menu
from PyQt5.QtCore import QItemSelection, pyqtSlot from PyQt5.QtCore import pyqtSignal, QItemSelectionModel, Qt from PyQt5.QtGui import QContextMenuEvent, QDropEvent, QIcon from PyQt5.QtWidgets import QTreeView, QAbstractItemView, QMenu from urh.models.ProtocolTreeModel import ProtocolTreeModel class ProtocolTreeVie...
2,848
test initial view
import pytest import os import numpy as np from PySide6.QtWidgets import QPushButton from PySide6.QtGui import QColor from src.constants import DEFAULT_WINDOW_SIZE from src.Model.PTCTDictContainer import PTCTDictContainer from src.Model.CalculateImages import convert_pt_to_heatmap from src.Controller.GUIController i...
2,849
extend with default
#!/usr/bin/env python # # Copyright (C) 2016 GNS3 Technologies Inc. # # 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. # ...
2,850
test slowfast backbone
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import pytest import torch from mmaction.models import FeatureHead from mmaction.registry import MODELS from mmaction.structures import ActionDataSample from mmaction.testing import get_recognizer_cfg from mmaction.utils import register_all...
2,851
theme changed
# share_window.py # # Change the look of Adwaita, with ease # Copyright (C) 2022 Gradience Team # # 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 o...
2,852
wait for pgbench status
""" ScalePodPGSQL workload class for scale """ import logging from ocs_ci.framework import config from ocs_ci.helpers import helpers from ocs_ci.ocs import constants, machine, node from ocs_ci.ocs.exceptions import UnsupportedPlatformError from ocs_ci.ocs.pgsql import Postgresql from ocs_ci.utility import templating f...
2,853
type
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
2,854
process request parameters
import time from pyderivationagent import DerivationAgent from pyderivationagent import DerivationInputs from pyderivationagent import DerivationOutputs from rxnoptgoaliteragent.kg_operations import * from rxnoptgoaliteragent.data_model import * class RxnOptGoalIterAgent(DerivationAgent): def __init__( ...
2,855
create ui commands
from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams # CAN bus layout with relay # 0 = ACC-CAN - radar side # 1 = F-CAN B - powertrain # 2 = ACC-CAN - camera side # 3 = F-CAN A - OBDII port ...
2,856
test allowed methods list is returned for
from unittest.mock import Mock import pytest from ariadne.constants import ( CONTENT_TYPE_TEXT_PLAIN, HTTP_STATUS_200_OK, HTTP_STATUS_405_METHOD_NOT_ALLOWED, ) from ariadne.wsgi import GraphQL, GraphQLMiddleware def test_request_to_app_root_path_is_forwarded(app_mock, middleware): middleware({"PATH_...
2,857
send
from test import test_support as support # If we end up with a significant number of tests that don't require # threading, this test module should be split. Right now we skip # them all if we don't have threading. threading = support.import_module('threading') from contextlib import contextmanager import imaplib impo...
2,858
resolve command
import configparser import os import click class Config: """The config in this example only holds aliases.""" def __init__(self): self.path = os.getcwd() self.aliases = {} def add_alias(self, alias, cmd): self.aliases.update({alias: cmd}) def read_config(self, filename): ...
2,859
add network route
# -- coding: utf-8 -- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
2,860
test single lock
from __future__ import annotations import asyncio from time import sleep import pytest from distributed import MultiLock, get_client from distributed.metrics import time from distributed.utils import wait_for from distributed.utils_test import gen_cluster @gen_cluster(client=True, nthreads=[("127.0.0.1", 8)] * 2) ...
2,861
test binary ew ops
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # Copyright (c) 2018-2023 www.open3d.org # SPDX-License-Identifier: MIT # ---------...
2,862
build model
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from collections import O...
2,863
test categorical1
# *************************************************************** # Copyright (c) 2023 Jittor. All Rights Reserved. # Maintainers: # Wenyang Zhou <576825820@qq.com> # Dun Liang <randonlang@gmail.com>. # # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this...
2,864
test log iteration
# ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2022 # National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and # Engineering Solutions of ...
2,865
prepare request
# 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,866
critical
""" This type stub file was generated by pyright. """ """ Logger implementation loosely modeled on PEP 282. We don't use the PEP 282 logger implementation in the stdlib ('logging') because it's idiosyncratic and a bit slow for our purposes (we don't use threads). """ class LevelsByName: CRIT = ... ERRO = ... ...
2,867
convert test
# -*- coding: utf-8 -*- # flake8: noqa T001 import argparse import os import glob from ruamel.yaml.comments import CommentedSeq from openfisca_core.scripts import ( add_tax_benefit_system_arguments, build_tax_benefit_system, ) from ruamel.yaml import YAML yaml = YAML() yaml.default_flow_style = False yaml....
2,868
get private link scope
# 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,869
build sep conv
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import tensorflow as tf from tensorflow.keras import Model, Sequential from tensorflow.keras.layers import ( AveragePooling2D, BatchNormalization, Conv2D, Dense, Dropout, GlobalAveragePooling2D, MaxPool2D, ReLU, ...
2,870
add
import datetime from pathlib import Path from sqlalchemy import Column, event, Integer, String from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.sql.sqltypes import DateTime, JSON from pbench.server.database.database import Database from pbench.server.database.models import decode_sql_error class TemplateE...
2,871
makedirs
# type: ignore import posixpath import shutil from pathlib import Path from unittest.mock import patch import fsspec import pytest from fsspec.implementations.local import ( AbstractFileSystem, LocalFileSystem, stringify_path, ) class MockFileSystem(AbstractFileSystem): protocol = "mock" def __i...
2,872
build arguments schema
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
2,873
inject or
"""Injection context implementation.""" from collections import namedtuple import copy from typing import Mapping, Optional, Type from .base import BaseInjector, InjectionError from .injector import Injector, InjectType from .settings import Settings Scope = namedtuple("Scope", "name injector") class InjectionCont...
2,874
test 1d
import unittest import numpy import cupy from cupy import testing from cupy.lib import stride_tricks import pytest class TestAsStrided(unittest.TestCase): def test_as_strided(self): a = cupy.array([1, 2, 3, 4]) a_view = stride_tricks.as_strided( a, shape=(2,), strides=(2 * a.itemsiz...
2,875
check file
from __future__ import annotations import argparse import concurrent.futures import json import logging import os import re import subprocess import sys import time from enum import Enum from typing import Any, BinaryIO, List, NamedTuple, Optional, Pattern IS_WINDOWS: bool = os.name == "nt" def eprint(*args: Any, ...
2,876
app
import io import json import uuid from contextlib import redirect_stdout from datetime import datetime from pathlib import Path import boltons.urlutils import jwt import pytest import yaml from decouple import config from psycopg2 import IntegrityError from sqlalchemy.exc import ProgrammingError from ereuse_devicehub...
2,877
invoices search results line
from django.template import Library from django.conf import settings from tendenci.apps.site_settings.utils import get_setting register = Library() @register.inclusion_tag("invoices/nav.html", takes_context=True) def invoice_nav(context, invoice=None): context.update({ "nav_object": invoice, }) ...
2,878
visit function def
""" Patch Hygiene Lint ^^^^^^^^^^^^^^^^^^ Ensures that the order of identifiers between each hardfork is consistent. """ import ast from typing import List, Optional, OrderedDict, Sequence from ethereum_spec_tools.forks import Hardfork from ethereum_spec_tools.lint import Diagnostic, Lint, walk_sources class PatchH...
2,879
register elementwise op
import torch import torch.nn.functional as F from torch import Tensor from colossalai.tensor import ColoTensor, ColoTensorSpec from colossalai.tensor.op_wrapper import colo_op_impl from ._utils import GeneralTensor, convert_to_colo_tensor def METHOD_NAME(op): @colo_op_impl(op) def elementwise_op(input_tens...
2,880
test get
# SPDX-License-Identifier: GPL-2.0-or-later import unittest import openrazer_daemon.device DEVICE1_SERIAL = 'XX000000' DEVICE1_ID = '0000:0000:0000.0000' DEVICE2_SERIAL = 'XX000001' DEVICE2_ID = '0000:0000:0000.0001' class DummyDBusObject(object): def __init__(self): self.notify_msg = None sel...
2,881
patch redis client
from __future__ import absolute_import from sentry_sdk import Hub from sentry_sdk.consts import OP, SPANDATA from sentry_sdk.hub import _should_send_default_pii from sentry_sdk.utils import ( SENSITIVE_DATA_SUBSTITUTE, capture_internal_exceptions, logger, ) from sentry_sdk.integrations import Integration, ...
2,882
list by invoice
# 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,883
callback
#!/usr/bin/env python3 import enum import os from math import nan import numpy as np from matplotlib import pyplot as plt from rospy.impl.tcpros_base import DEFAULT_BUFF_SIZE if "ROS_NAMESPACE" not in os.environ: os.environ["ROS_NAMESPACE"] = "/robot1" from argparse import ArgumentParser import cv2 import rosp...
2,884
test check post table version
import pytest from fontTools.ttLib import TTFont from fontbakery.status import WARN, FAIL, PASS from fontbakery.codetesting import ( assert_PASS, assert_results_contain, CheckTester, TEST_FILE, ) from fontbakery.profiles import opentype as opentype_profile mada_fonts = [ TEST_FILE("mada/Mada-Bla...
2,885
pending
import sys import traceback import types import warnings from eventlet.support import greenlets as greenlet import six from eventlet.hubs.hub import BaseHub, READ, WRITE try: import event except ImportError: event = None def is_available(): return event is not None class event_wrapper(object): de...
2,886
test create invited user without auth type
import json import pytest from app.models import EMAIL_AUTH_TYPE, Notification from tests import create_authorization_header from tests.app.conftest import create_sample_invited_user @pytest.mark.parametrize( "extra_args, expected_start_of_invite_url", [ ({}, "http://localhost:6012/invitation/"), ...
2,887
loss fn
"""Training algorithm track submission functions for LibriSpeech.""" import functools from typing import Dict, Iterator, List, Tuple from absl import logging from flax import jax_utils import jax from jax import lax import jax.numpy as jnp import numpy as np import optax from algorithmic_efficiency import spec _GRAD...
2,888
handle message receive model from client
import logging from .message_define import MyMessage from .utils import transform_tensor_to_list, post_complete_message_to_sweep_process from ....core.distributed.fedml_comm_manager import FedMLCommManager from ....core.distributed.communication.message import Message class FedProxServerManager(FedMLCommManager): ...
2,889
resolve schema reference
import json from urllib.parse import urlsplit import requests import yaml from loguru import logger from oasst_shared.schemas import inference def fetch_openapi_spec(url): response = requests.get(url) if response.status_code != 200: raise Exception(f"Failed to fetch data from URL: {url}. Status code:...
2,890
test bilinear cell integral
import pytest import numpy as np from firedrake import * @pytest.fixture(params=[False, True]) def f(request): quadrilateral = request.param m = UnitSquareMesh(1, 1, quadrilateral=quadrilateral) fs = FunctionSpace(m, "CG", 1) f = Function(fs) x = SpatialCoordinate(m) f.interpolate(x[0]) re...
2,891
test not ii
#!/usr/bin/env python # # Copyright 2004,2007,2008,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, blocks class test_boolean_operators (gr_unittest.TestCase): def setUp(self): self.tb = g...
2,892
product
""" JBoss version ============= Provide information about the versions of all running Jboss on a system. """ import json from collections import namedtuple from insights import Parser, parser from insights.specs import Specs # define namedtuple to store the property of version _VersionNameTuple = namedtuple("_Version...
2,893
test ds length is ceil num epochs
# 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,894
parse args
# Copyright (c) OpenMMLab. All rights reserved. import argparse import math import os import os.path as osp import mmcv import mmengine from mmocr.utils import crop_img, dump_ocr_data def collect_files(img_dir, gt_dir, ratio): """Collect all images and their corresponding groundtruth files. Args: im...
2,895
get base submission message address
# Copyright The IETF Trust 2015-2023, All Rights Reserved from collections import namedtuple import debug # pyflakes:ignore from ietf.mailtrigger.models import MailTrigger, Recipient from ietf.submit.models import Submission from ietf.utils.mail import excludeaddrs class AddrLists(namedtu...
2,896
playback url
import os from io import StringIO try: import re2 as re except ImportError: import re from collections import OrderedDict from uuid import NAMESPACE_DNS, uuid3 from django.template.defaultfilters import register from django.utils.html import escape from django.utils.safestring import mark_safe @register.fi...
2,897
location
# 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...
2,898
time array 1
from .common import Benchmark import numpy as np class Core(Benchmark): def setup(self): self.l100 = range(100) self.l50 = range(50) self.float_l1000 = [float(i) for i in range(1000)] self.float64_l1000 = [np.float64(i) for i in range(1000)] self.int_l1000 = list(range(100...
2,899
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...