id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
5,200
drop
# stash.py # Copyright (C) 2018 Jelmer Vernooij <jelmer@samba.org> # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it and/or # modify it under the ...
5,201
fluence
"""Calculate.""" # --- import ------------------------------------------------------------- import numpy as np from .. import units as wt_units # --- define ------------------------------------------------------------- __all__ = ["fluence", "mono_resolution", "nm_width", "symmetric_sqrt"] # --- functions ----...
5,202
connection
# Copyright © 2012-2023 Forschungszentrum Jülich GmbH # SPDX-License-Identifier: LGPL-3.0-or-later import sqlite3 from pathlib import Path from jupedsim.native.simulation import Simulation from jupedsim.serialization import TrajectoryWriter class SqliteTrajectoryWriter(TrajectoryWriter): """Write trajectory data...
5,203
test order line remove by app
from unittest.mock import patch import graphene import pytest from django.db.models import Sum from .....order import OrderStatus from .....order import events as order_events from .....order.models import OrderEvent from .....warehouse.models import Stock from ....tests.utils import assert_no_permission, get_graphql...
5,204
graph
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
5,205
create thing
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
5,206
test remove composite map
""" Test Composite Map """ import numpy as np import pytest import astropy.units as u from astropy.tests.helper import assert_quantity_allclose import sunpy.data.test import sunpy.map from sunpy.tests.helpers import figure_test # Ignore missing metadata warnings pytestmark = [pytest.mark.filterwarnings('ignore:Missi...
5,207
trigger
from __future__ import annotations import weakref from functools import wraps from typing import Callable, TypeVar, cast # See https://mypy.readthedocs.io/en/stable/generics.html#declaring-decorators TCallable = TypeVar("TCallable", bound=Callable) __events = {} __disabled_events = set() __all__ = ["Callables", "d...
5,208
test train scores
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import ass...
5,209
apply fn
# Copyright (c) Facebook, Inc. and its affiliates. import collections import collections.abc import copy import warnings from collections import OrderedDict from typing import Any, Callable, Dict, List, Optional, Union import torch from mmf.common.sample import detach_tensor, SampleList class Report(OrderedDict): ...
5,210
write all
import os import logging import ruamel.yaml from a2ml.api.utils.config_yaml import ConfigYaml from a2ml.api.utils import fsclient log = logging.getLogger("a2ml") '''Config to serialize pass to server side deserialize, then pass back and save on CLI side''' class SerializableConfigYaml(ConfigYaml): #For pickle se...
5,211
add update
############################################################## # Copyright 2023 Lawrence Livermore National Security, LLC # (c.f. AUTHORS, NOTICE.LLNS, COPYING) # # This file is part of the Flux resource manager framework. # For details, see https://github.com/flux-framework. # # SPDX-License-Identifier: LGPL-3.0 #####...
5,212
pair info
"light-weight, simple source_path, target_path dependency management" from __future__ import absolute_import, division, print_function from libtbx import easy_pickle from libtbx.utils import Sorry import hashlib import time import sys, os def try_loading_db(file_name): ''' This function tries to load an existing ...
5,213
kernel version
"""Mock of hostname dbus service.""" from json import dumps from dbus_fast.service import PropertyAccess, dbus_property from .base import DBusServiceMock, dbus_method BUS_NAME = "org.freedesktop.hostname1" def setup(object_path: str | None = None) -> DBusServiceMock: """Create dbus mock object.""" return ...
5,214
test poll recap servers no matches
from unittest.mock import call, patch import pytest import responses from sentry import eventstore from sentry.tasks.recap_servers import ( RECAP_SERVER_LATEST_ID, RECAP_SERVER_TOKEN_OPTION, RECAP_SERVER_URL_OPTION, poll_project_recap_server, poll_recap_servers, ) from sentry.testutils.cases impor...
5,215
run
#!/usr/bin/python3 -W ignore::DeprecationWarning # -*- 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 y...
5,216
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...
5,217
set test params
#!/usr/bin/env python3 # Copyright (c) 2018-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC help output.""" from test_framework.test_framework import BitcoinTestFramework from test_fram...
5,218
method
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
5,219
get hwid device
#!/usr/bin/python3 # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2021 Norbert Kamiński <norbert.kaminski@3mdeb.com> # # SPDX-License-Identifier: LGPL-2.1+ # import subprocess import tempfile import os import shutil import xml.etree.ElementTree as ET from packaging.version import Version from qu...
5,220
test eq
"""Tests F beta metrics.""" # original code taken from # https://github.com/tensorflow/addons/blob/master/tensorflow_addons/metrics/tests/f_scores_test.py # (modified to our neeeds) import numpy as np import pytest import tensorflow as tf from rasa.utils.tensorflow.metrics import FBetaScore, F1Score def test_config...
5,221
unregister
# 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 hope that it will be useful, but ...
5,222
test incremental new
#!/usr/bin/env python3 # Copyright 2017 The Kubernetes Authors. # # 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 appl...
5,223
test beam schema survives roundtrip
# # 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 us...
5,224
validate
# # # Copyright 2013-2023 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
5,225
test set exc info
# Copyright (c) 2018, 2023, 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...
5,226
test type singleton2
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
5,227
test clear with unicode str
import unittest from unittest import mock from ZEO.runzeo import ZEOServer class TestStorageServer: def __init__(self, fail_create_server): self.called = [] if fail_create_server: raise RuntimeError() def close(self): self.called.append("close") class TestZEOServer(ZEO...
5,228
test wf record with submitter source read
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
5,229
decrypt plaq
# -*- coding: utf-8 -*- import base64 from Crypto import Random from Crypto.Cipher import XOR from Crypto.Cipher import AES import hashlib import logging from multiprocessing import Pool import sys, os, re import traceback import struct from datetime import datetime from dateutil.relativedelta import relativedelta imp...
5,230
get exc inh matrix
# -*- coding: utf-8 -*- # # network_params.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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,...
5,231
test recallscore
#!/usr/bin/env python """Tests for `octis` package.""" import pytest from click.testing import CliRunner from octis.evaluation_metrics.topic_significance_metrics import * from octis.evaluation_metrics.classification_metrics import F1Score, PrecisionScore from octis.evaluation_metrics.classification_metrics import Ac...
5,232
get scope value
# -*- coding: utf-8 -*- from django.utils import translation from django.utils.translation import ugettext_lazy as _ from pipeline.core.flow.io import ObjectItemSchema, StringItemSchema from api.collections.monitor import BKMonitorClient from pipeline_plugins.base.utils.inject import supplier_account_for_business from...
5,233
wrapper
from __future__ import annotations import contextvars import functools import logging import typing as t from timeit import default_timer from typing import TYPE_CHECKING from simple_di import Provide from simple_di import inject from bentoml._internal.configuration.containers import BentoMLContainer from bentoml._i...
5,234
set up
from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode from homeassistant.components.number.const import NumberDeviceClass from homeassistant.const import PRECISION_TENTHS, UnitOfTemperature from ..const import BEOK_T...
5,235
process
from maya import cmds import pyblish.api import openpype.hosts.maya.api.action from openpype.hosts.maya.api.lib import ( maintained_selection, delete_after, undo_chunk, get_attribute, set_attribute ) from openpype.pipeline.publish import ( OptionalPyblishPluginMixin, RepairAction, Valid...
5,236
decompress
from django import forms from django.core.exceptions import ValidationError from parties.models import Party from people.forms.fields import BallotInputWidget from utils.widgets import SelectWithAttrs def party_and_description_dict_from_string(value): """ Given an input string in the form of "party" or "party...
5,237
mapping file provider
# Copyright 2023 The Bazel 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 la...
5,238
get async driver
# Copyright (c) "Neo4j" # Neo4j Sweden AB [https://neo4j.com] # # This file is part of Neo4j. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2...
5,239
n
# # GPT - Grid Python Toolkit # Copyright (C) 2020 Christoph Lehner (christoph.lehner@ur.de, https://github.com/lehner/gpt) # # 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; eith...
5,240
test databricks notebook run context in context
from unittest import mock from mlflow.entities import SourceType from mlflow.tracking.context.databricks_notebook_context import DatabricksNotebookRunContext from mlflow.utils.mlflow_tags import ( MLFLOW_DATABRICKS_NOTEBOOK_ID, MLFLOW_DATABRICKS_NOTEBOOK_PATH, MLFLOW_DATABRICKS_WEBAPP_URL, MLFLOW_DATAB...
5,241
test phase started draft no email
from datetime import timedelta import pytest from dateutil.parser import parse from django.contrib.contenttypes.models import ContentType from django.core import mail from django.core.management import call_command from freezegun import freeze_time from adhocracy4.actions.models import Action from adhocracy4.actions....
5,242
exit code
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
5,243
update ok
#!/usr/bin/python # -*- coding: latin-1 -*- # Copyright 2016 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker 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 Fr...
5,244
missing callback
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
5,245
run slow
import pytest import time import numpy as np import pandas as pd from deephyper.evaluator import RunningJob from deephyper.problem import HpProblem from deephyper.search.hps import CBO from deephyper.stopper import SuccessiveHalvingStopper def run(job: RunningJob) -> dict: assert isinstance(job.stopper, Success...
5,246
kafka consumer
from __future__ import absolute_import import uuid import pytest from test.testutil import env_kafka_version, random_string from test.fixtures import KafkaFixture, ZookeeperFixture @pytest.fixture(scope="module") def zookeeper(): """Return a Zookeeper fixture""" zk_instance = ZookeeperFixture.instance() ...
5,247
test merge sub dicts
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Will Thames <will.thames@xvt.com.au> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from ansible.module_utils.common.dict_...
5,248
set max evals
"""The callback module contains sub-classes of the ``Callback`` class used to trigger custom actions on the start and completion of jobs by the ``Evaluator``. Callbacks can be used with any Evaluator implementation. """ import deephyper.core.exceptions import numpy as np import pandas as pd from deephyper.evaluator._ev...
5,249
test get enabled initial
import unittest from django.test import RequestFactory, TestCase, override_settings from django.urls import reverse from wagtail.admin.views.home import WhatsNewInWagtailVersionPanel from wagtail.test.utils import WagtailTestUtils from wagtail.users.models import UserProfile class TestWhatsNewInWagtailVersionPanel(...
5,250
sign
import pytest from eth_account import Account from eth_account.messages import encode_defunct from eth_keys import KeyAPI from eth_utils import is_same_address @pytest.fixture def c(w3, get_contract): a0, a1, a2, a3, a4, a5, a6 = w3.eth.accounts[:7] with open("examples/wallet/wallet.vy") as f: code = ...
5,251
check daemon status
""" Check daemon status inside PMON container. Each daemon status is checked under the conditions below in this script: * Daemon Running Status * Daemon Stop status * Daemon Restart status This script is to cover the test case in the SONiC platform daemon and service test plan: https://github.com/sonic-net/sonic-mgmt/...
5,252
configure
# 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 it will be useful, # bu...
5,253
main
#!/usr/bin/env python3 # Copyright 2020 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 require...
5,254
test get weight
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo.tests.common import TransactionCase class TestGetWeight(TransactionCase): """Test get_weight functions.""" # some helpers def _create_order(self, customer): return self.env["sale.order"].create({"partner_id": customer.id}...
5,255
test sub component sc 2uu
# -*- coding: utf-8 -*- # # Copyright 2009-2023 NTESS. Under the terms # of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Copyright (c) 2009-2023, NTESS # All rights reserved. # # This file is part of the SST software package. For license # information, see the LIC...
5,256
node has no consumers
# Copyright 2021 Collate # 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, software...
5,257
get group output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
5,258
is authenticated
# Stubs for paramiko.transport (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any import threading from paramiko.util import ClosingContextManager class Transport(threading.Thread, ClosingContextManager): active = ... # type: Any sock = ... # type...
5,259
init2 ack
# SPDX-License-Identifier: MIT import struct from ..utils import * from .asc import StandardASC from .asc.base import * class PMPMessage(Register64): TYPE = 56, 44 class PMP_Startup(PMPMessage): TYPE = 56, 44, Constant(0x00) class PMP_Configure(PMPMessage): TYPE = 56, 44, Constant(0x10) DVA = 47, 0...
5,260
list edge module provisioning token 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__ =...
5,261
event monitor thread async
"""Module holding utility and convenience functions for zmq event monitoring. example import sys import zmq # import zmq.asyncio # from zmq_monitor_class import event_monitor_async from zmq_monitor_class import event_monitor context = zmq.Context() socket = context.socket(zmq.SUB) socket.setsockopt(zmq.SUBSCRIBE, ...
5,262
inject
import functools import socket import struct from time import sleep from . import const def METHOD_NAME(control_type: int): """ Inject control code, with this inject, we will be able to do unit test Args: control_type: event to send, TYPE_* """ def wrapper(f): @functools.wraps(f)...
5,263
plugin configuration
import jwt import pytest from ...manager import get_plugins_manager from ..plugin import OpenIDConnectPlugin @pytest.fixture() def METHOD_NAME(): def fun( client_id=None, client_secret=None, enable_refresh_token=True, oauth_authorization_url=None, oauth_token_url=None, ...
5,264
flatten
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
5,265
test write font 4
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2023, John McNamara, jmcnamara@cpan.org # import unittest from io import StringIO from ...styles import Styles from ...format import Format class T...
5,266
get tracking pixel
from __future__ import print_function import os import fnmatch import re import sys import urllib.parse import argparse HOSTNAME = 'https://azure-sdk-impressions.azurewebsites.net' README_PATTERNS = ['*/readme.md', '*/readme.rst'] MARKDOWN_REGEX = r'!\[Impressions\]\([^\)]+\)' RST_REGEX = r'\.\. image:: ' + HOSTNAM...
5,267
test display publisher creation
""" Tests for zmq shell / display publisher. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os import unittest import warnings from queue import Queue from threading import Thread from unittest.mock import MagicMock import pytest import zmq from jupyte...
5,268
define a c specs
# -*- coding: utf-8 """ This module is designed to hold functions for calculating absorption chillers. This file is part of project oemof (github.com/oemof/oemof-thermal). It's copyrighted by the contributors recorded in the version control history of the file, available from its original location: oemof-thermal/src/...
5,269
render created by
import django_filters import django_tables2 from django.contrib.auth.mixins import PermissionRequiredMixin, LoginRequiredMixin from django.db import transaction from django.db.models import Q from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _ from dj...
5,270
list
# 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 ...
5,271
test new attr
import importlib from importlib import abc from importlib import util import sys import types import unittest from . import util as test_util class CollectInit: def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs def exec_module(self, module): return self cl...
5,272
check rst data
"""distutils.command.check Implements the Distutils 'check' command. """ __revision__ = "$Id$" from distutils.core import Command from distutils.dist import PKG_INFO_ENCODING from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docutils.pa...
5,273
test sync streaming response
"""A large part of the tests in this file were adapted from: https://github.com/encode/starlette/blob/master/tests/test_responses.py And are meant to ensure our compatibility with their API. """ from itertools import cycle from typing import TYPE_CHECKING, AsyncIterator, Iterator import anyio from httpx_sse import ac...
5,274
optout email
from __future__ import annotations from collections import defaultdict from typing import Any, Sequence from django.utils import timezone from sentry.models.user import User from .base import Newsletter class NewsletterSubscription: def __init__( self, user, list_id, list_name=...
5,275
exists
# -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # 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-...
5,276
hdx send mail members
import logging import ckan.logic.auth.create as create import ckan.logic.auth.update as update import ckan.plugins.toolkit as tk from ckanext.hdx_users.helpers.permissions import Permissions log = logging.getLogger(__name__) get_action = tk.get_action auth_allow_anonymous_access = tk.auth_allow_anonymous_access _ = tk...
5,277
test repo locale checkout path
import os from unittest.mock import call, patch, Mock from urllib.parse import urlparse import pytest from django.core.exceptions import ValidationError from pontoon.base.models import repository_url_validator from pontoon.test.factories import ProjectLocaleFactory @pytest.mark.django_db def test_repo_checkout_pat...
5,278
sample program configs
# 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 appli...
5,279
test add torrent success
import pytest from ddt import ddt from mock import patch, Mock, MagicMock from requests import Response from monitorrent.plugins.clients.utorrent import UTorrentClientPlugin from tests import DbTestCase, use_vcr @ddt class UTorrentPluginTest(DbTestCase): real_host = "http://localhost" real_port = 8080 re...
5,280
remove prefix
# The GPEN implementation is also open-sourced by the authors, # and available at https://github.com/yangxy/GPEN/blob/main/face_detect/retinaface_detection.py import os import cv2 import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn.functional as F from .models.retinaface import Retina...
5,281
test initialize
from unittest import mock from xsdata.codegen.container import ClassContainer from xsdata.codegen.container import Steps from xsdata.codegen.models import Class from xsdata.codegen.models import Status from xsdata.models.config import GeneratorConfig from xsdata.models.enums import Tag from xsdata.utils.testing import...
5,282
test three conditions alert message
import urllib from zerver.lib.test_classes import WebhookTestCase class LibratoHookTests(WebhookTestCase): STREAM_NAME = "librato" URL_TEMPLATE = "/api/v1/external/librato?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "librato" IS_ATTACHMENT = False def get_body(self, fixture_name: str) ...
5,283
quote c
# Copyright (c) 2021 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Quoting helpers for Windows This contains code to help with quoting values for use in the variable Windows shell. Right now it should only be used in ansible.windows as the interface is...
5,284
get delta controls
# 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...
5,285
get search status
from .guard_utils import GuardApiClient import json import base64 class ClientResponse: message = None def read(self): return self._content def __repr__(self): return self.message class APIClient(): def __init__(self, connection, configuration): # Placeholder client to allow...
5,286
test cc 003
#!/usr/bin/env python # # Copyright 2005,2007,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, filter, blocks class test_single_pole_iir_filter(gr_unittest.TestCase): def setUp(self): self...
5,287
set up
from unittest import skip from django.test import TestCase from django.test.utils import override_settings from people.forms.forms import BasePersonForm, UpdatePersonForm from people.tests.factories import PersonFactory from .uk_examples import UK2015ExamplesMixin @override_settings(TWITTER_APP_ONLY_BEARER_TOKEN=No...
5,288
test init
import os import tempfile from subprocess import CompletedProcess from pytest_mock import MockerFixture from reconcile.utils import lean_terraform_client def METHOD_NAME(mocker: MockerFixture) -> None: mocker.patch( "reconcile.utils.lean_terraform_client.os" ).environ.copy.return_value = {} mock...
5,289
get credentials interactive
# -*- coding: utf-8 -*- # # Copyright (c) 2014 SUSE # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have rec...
5,290
test update runtime choices
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY import pandas as pd import pytest # IMPORTATION INTERNAL from openbb_terminal.core.session.current_user import ( PreferencesModel, copy_user, ) from openbb_terminal.econometrics.econometrics_controller import EconometricsController # pylint: disable=W0621 @p...
5,291
test patch with pass target context manager
import pytest from localstack.utils.patch import Patch, get_defining_object, patch def echo(arg): return f"echo: {arg}" class MyEchoer: def do_echo(self, arg): return f"do_echo: {arg}" @classmethod def do_class_echo(cls, arg): return f"do_class_echo: {arg}" @staticmethod d...
5,292
send
"""Base class for a Comm""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import uuid from traitlets.config import LoggingConfigurable from ipykernel.kernelbase import Kernel from ipykernel.jsonutil import json_clean from traitlets import Instance, Unicode, Byt...
5,293
test signup passes through privacy acceptance
import datetime from unittest.mock import sentinel import pytest from sqlalchemy.exc import IntegrityError from h.models import Activation, User from h.services.exceptions import ConflictError from h.services.user_signup import UserSignupService, user_signup_service_factory class TestUserSignupService: def test...
5,294
test slot behaviour
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2023 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
5,295
resolve tar file or dir
"""Utilities for extracting common archive formats""" import zipfile import tarfile import os import shutil import posixpath import contextlib from distutils.errors import DistutilsError from ._path import ensure_directory __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "U...
5,296
reset a lead
from common.numpy_fast import mean from common.kalman.simple_kalman import KF1D # Default lead acceleration decay set to 50% at 1s _LEAD_ACCEL_TAU = 1.5 # radar tracks SPEED, ACCEL = 0, 1 # Kalman filter states enum # stationary qualification parameters v_ego_stationary = 4. # no stationary object flag below th...
5,297
to str
# coding: utf-8 """ OpenPerf API REST API interface for OpenPerf # noqa: E501 OpenAPI spec version: 1 Contact: support@spirent.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class PacketAnalyzerFlowCountersLatency(ob...
5,298
get column text
from typing import TYPE_CHECKING, Any, Optional from PySide6.QtCore import QAbstractTableModel, QSize, Qt from PySide6.QtGui import QBrush, QFont from PySide6.QtWidgets import QAbstractItemView, QHeaderView, QTableView, QVBoxLayout from angrmanagement.config import Conf from angrmanagement.logic.debugger import Debug...
5,299
scalars route
# Copyright 2017 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...