id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
200
get
from collections import defaultdict import logging import re from awxkit.utils import is_list_or_tuple, not_provided log = logging.getLogger(__name__) class URLRegistry(object): def __init__(self): self.store = defaultdict(dict) self.default = {} def url_pattern(self, pattern_str): ...
201
logtx
#!/usr/bin/env python # # Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright...
202
derive time
from matplotlib import rcParams import os rcParams.update({'figure.autolayout': True}) KINDS = ["bar", "hist", "line"] METRICS = {"bandwidth": "bandwidth(GiB/s)", "FLOPS": "GFLOPS", "speedup": "time(s)/time(s)", "throughput": "throughput(GProblemsize/s)", "time/rep": "time/...
203
test mask input shapes
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the mask module. """ import astropy.units as u import numpy as np import pytest from numpy.testing import assert_allclose, assert_almost_equal from regions.core.bounding_box import RegionBoundingBox from regions.core.mask import RegionMask ...
204
construct solidity single data
import os from enum import Enum import json OUTPUT_DIR = os.getenv("OUTPUT_DIR") DATASET_DIR = os.getenv("DATASET") if DATASET_DIR is None: print("Path to the smart-contract-fiesta dataset must be specified (env `DATASET=`)") exit(1) ROOT_CONTRACTS_DIR = os.path.join(DATASET_DIR, "organized_contracts") INDEX...
205
add dep doc
"""Class for recording and reporting deprecations""" from __future__ import annotations import functools import re import typing as ty import warnings if ty.TYPE_CHECKING: # pragma: no cover T = ty.TypeVar('T') P = ty.ParamSpec('P') _LEADING_WHITE = re.compile(r'^(\s*)') TESTSETUP = """ .. testsetup:: ...
206
configure step
## # 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 (F...
207
create ws server
import http.server import socketserver import threading import os import asyncio import websockets import sys import json import tempfile class Server: def __init__(self,port=None,tempname=None): self.connections={} self.wsport=9000 self.httpport=None if (port != None): ...
208
test info
# -*- coding: utf-8 -*- # Copyright (c) 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 json fr...
209
mask replace
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2019-2020) # # This file is part of GWpy. # # GWpy 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)...
210
gen sites
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import json import os import random ...
211
register pyinstrument
import os import typing as t import jinja2.ext import logging import sentry_sdk from flask import ( Flask, current_app, redirect, render_template, request, url_for, g, make_response, Response, ) from flask.typing import ResponseValue, ResponseReturnValue from flask_babel import Babe...
212
test head failure
# # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # 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 ap...
213
register message receive handlers
import logging import numpy as np 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 FedOptServerManager(Fed...
214
overpass request
"""" Large portions of this code were adopted from OSMNx, by Geoff Boeing. Although attempts to use OSMNx were made (including refactoring its entire code base as a contribution to that package), it became clear that its integration with libraries not available with QGIS' Python distribution was too tight, and was the...
215
package info
from conan import ConanFile from conan.tools.files import get, chdir, save, replace_in_file, rmdir, rm from conan.tools.microsoft import is_msvc from conans import AutoToolsBuildEnvironment, MSBuild, tools import os import re required_conan_version = ">=1.52.0" class LibsassConan(ConanFile): name = "libsass" ...
216
test handles multiple models
# coding: utf-8 # # Copyright 2021 The Oppia 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 requi...
217
get address
class Component(object): """ Entity class representing any a sample or sample container """ def __init__(self, container, address, scannable): self.container = container self.address = address self.scannable = scannable self.id = None self.present = False ...
218
test inheritance detection
""" This file contains an initial proposal that can be scrapped and reworked if/when appropriate. Either way, this test file should probably be removed once the actual FastAPI implementation is complete and has integration tests with pydantic v2. However, we are including it here for now to get an early warning if this...
219
application config html
# 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...
220
unmix
""" Takes the analysis part of spltter.py from PYMEAcquire. Functions for unmixing and unsplitting multichannel data that has been acquired using an image splitting device which splits the channels onto a single camera. """ import os import numpy as np def LoadShiftField(filename = None): if not filename: ...
221
test input cells have a value
# These tests are auto-generated with test data from: # https://github.com/exercism/problem-specifications/tree/main/exercises/react/canonical-data.json # File last updated on 2023-07-19 from functools import partial import unittest from react import ( InputCell, ComputeCell, ) class ReactTest(unittest.Test...
222
set parameters
from test import support from test.support import import_helper, warnings_helper import warnings support.requires('audio') from test.support import findfile with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) ossaudiodev = import_helper.import_module('ossaudiodev') audioop = wa...
223
norm
"""Classes to handle overlapping surfaces.""" # Authors: Guillaume Favelier <guillaume.favelier@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: Simplified BSD from collections import OrderedDict import numpy as np from ..utils import logger class _Overlay: def __init__(self, scalars, ...
224
test hard clipping log not expected
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
225
test print
# Copyright HeteroCL authors. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import heterocl as hcl import __test_codegen_harness as harness import pytest target = "vhls" def test_dtype(): harness.test_dtype( target, [ "ap_int<3>", "ap_uint<3>", "i...
226
main
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # 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/LICE...
227
css classes
from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.forms.fields import EmailField from django.forms.forms import DeclarativeFieldsMetaclass from django.utils.safestring import mark_safe from django_file_form.forms import FileFormMixin from wagtail.co...
228
snapshot
# This file is part of Scapy # Copyright (C) 2007, 2008, 2009 Arnaud Ebalard # 2015, 2016, 2017 Maxence Tury # This program is published under a GPLv2 license """ Block ciphers. """ from __future__ import absolute_import from scapy.config import conf from scapy.layers.tls.crypto.common import CipherErro...
229
get total subsampling factor
"""ASR Interface module.""" import argparse from espnet.bin.asr_train import get_parser from espnet.utils.dynamic_import import dynamic_import from espnet.utils.fill_missing_args import fill_missing_args class ASRInterface: """ASR Interface for ESPnet model implementation.""" @staticmethod def add_argum...
230
get device xml
"""PyOhNet: control point device support """ import PyOhNet import ctypes import re import sys import types import xml.etree.ElementTree as ET import _Cp._GenProxy as GenProxy try: # python 2.x from urlparse import urljoin from urllib2 import urlopen except: # python 3.x from urllib.parse import ur...
231
unbind control lora
import torch from contextlib import contextmanager from typing import Union, Tuple _size_2_t = Union[int, Tuple[int, int]] class LinearWithLoRA(torch.nn.Module): def __init__( self, in_features: int, out_features: int, bias: bool = True, device=None, ...
232
add
""" A convenience system to manage reactors Beginning in the 2017.7 release, the reactor runner requires that the reactor system is running. This is accomplished one of two ways, either by having reactors configured or by including ``reactor`` in the engine configuration for the Salt master. .. code-block:: yaml...
233
pass retrieve condition
#!/usr/bin/env python """ _WorkQueueManagerPoller_ Pull work out of the work queue. """ import logging import random import threading import time from Utils.Timers import timeFunction from WMComponent.JobSubmitter.JobSubmitAPI import availableScheddSlots from WMCore.DAOFactory import DAOFactory from WMCore.Services.P...
234
test yaml
# Copyright (c) Alibaba, Inc. and its affiliates. import argparse import copy import tempfile import unittest import json from modelscope.utils.config import Config, check_config obj = {'a': 1, 'b': {'c': [1, 2, 3], 'd': 'dd'}} class ConfigTest(unittest.TestCase): def test_json(self): config_file = 'c...
235
perform call
import logging from ...errors import AngrCallableError, AngrCallableMultistateError from ...calling_conventions import DEFAULT_CC l = logging.getLogger(name=__name__) # l.setLevel("DEBUG") class IdentifierCallable: """ Callable is a representation of a function in the binary that can be interacted with...
236
insert into table
import datetime import random import string from testflows.core import * from clickhouse_backup.tests.common import random_datetime @TestStep def drop_table(self, node, table_name, database="default", sync=True): """Helper function, drops the ClickHouse table from the given node. """ with When(f"droppin...
237
test merge importance dfs base
import numpy as np import pandas as pd import pytest from numpy.core.fromnumeric import sort from autogluon.core.utils.feature_selection import * from autogluon.core.utils.utils import unevaluated_fi_df_template def evaluated_fi_df_template(features, importance=None, n=None): rng = np.random.default_rng(0) i...
238
labels
from __future__ import annotations from functools import cached_property from typing import TYPE_CHECKING, List from .. import errors, helpers if TYPE_CHECKING: from ..schema import Field class Header(List[str]): # type: ignore """Header representation > Constructor of this object is not Public API ...
239
find next version
import logging import re import shutil import tempfile import time from http import HTTPStatus from http.client import HTTPException from pathlib import Path from typing import Callable, NamedTuple from antarest.core.exceptions import StudyValidationError from .upgrader_710 import upgrade_710 from .upgrader_720 impor...
240
is event locked
"""Define class based views for the various API views.""" import json import logging from django.db.models import Model from django.http import Http404 from rest_framework import mixins, viewsets from rest_framework.exceptions import NotFound from rest_framework.response import Response from tracker import logutil fr...
241
test save
# TODO complete tests/add assertions import disnake import pytest from tests.utils import active_character pytestmark = pytest.mark.asyncio @pytest.mark.usefixtures("character") class TestBasicSheetCommands: async def test_attack(self, avrae, dhttp): avrae.message("!a dag") async def test_action(se...
242
main
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os.path as osp from functools import partial from glob import glob import numpy as np from mmengine.utils import (mkdir_or_exist, track_parallel_progress, track_progress) from PIL import Image COCO_LEN = 123287 clsID_t...
243
test enqueue job runs job
# -*- coding: utf-8 -*- import time import pytest from kolibri.core.tasks.job import Job from kolibri.core.tasks.job import Priority from kolibri.core.tasks.job import State from kolibri.core.tasks.test.base import connection from kolibri.core.tasks.test.taskrunner.test_job_running import EventProxy from kolibri.core...
244
encode map
""" The MIT License (MIT) Copyright (c) 2023 Arduino SA Copyright (c) 2018 KPN (Jan Bogaerts) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
245
test capability check
# vim:ts=4:sw=4:et: # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import sys import pywatchman import pywatchman.capabilities from watchman.integration.lib import WatchmanTest...
246
crender colors
#!/usr/bin/env python3 # coding: utf-8 """ Modified from https://raw.githubusercontent.com/YadiraF/PRNet/master/utils/render.py """ import numpy as np import cython from .cython import mesh_core_cython from .params import pncc_code __author__ = 'cleardusk' __all__ = ['cython'] def is_point_in_tri(point, tri_points...
247
clamp
################################################################################ # Copyright (C) 2023 Maxim Integrated Products, 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 d...
248
test read prefix
# Copyright 2010-2023 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public License, # the authors give ...
249
should install
from __future__ import annotations import functools import os import subprocess from datetime import datetime, timedelta from pathlib import Path from typing import Dict, Any from lib.amazon import list_s3_artifacts from lib.installable.installable import Installable from lib.installation_context import InstallationC...
250
process package
# Python Tools for Visual Studio # Copyright(c) Microsoft 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 # # THIS ...
251
phi phi matrix
import numpy as np import sympy as sp class LagrangeFEMSpace: def __init__(self, GD): self.GD = int(GD) t = 'l0' for i in range(1, GD+1): t = t+', l%d'%(i) self.l = sp.symbols(t, real=True) def number_of_dofs(self, p): GD = self.GD val = 1 ...
252
etag
# 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...
253
test piptools works with pyscaffold
import json import os import sys from functools import partial from pathlib import Path from subprocess import CalledProcessError import pytest from pyscaffold import __version__ as pyscaffold_version from pyscaffold.api import create_project from pyscaffold.extensions.venv import Venv from .helpers import find_venv...
254
set params
import numpy as np __all__ = ["PointSourceParam"] from lenstronomy.Sampling.param_group import ModelParamGroup, SingleParam, ArrayParam class SourcePositionParam(SingleParam): """Source position parameter, ra_source and dec_source.""" param_names = ["ra_source", "dec_source"] _kwargs_lower = {"ra_sourc...
255
test sklearn cross validation iterators
# -*- coding: utf-8 -*- """Unit tests for aeon classifier compatability with sklearn interfaces.""" __author__ = ["MatthewMiddlehurst"] __all__ = [ "test_sklearn_cross_validation", "test_sklearn_cross_validation_iterators", "test_sklearn_parameter_tuning", "test_sklearn_composite_classifiers", ] impor...
256
findmatch
"""Mailcap file handling. See RFC 1524.""" import os __all__ = ["getcaps","findmatch"] # Part 1: top-level interface. def getcaps(): """Return a dictionary containing the mailcap database. The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain') to a list of dictionaries corresponding to ...
257
instance
""" Test cases for salt.modules.etcd_mod Note: No functional tests are required as of now, as this is essentially a wrapper around salt.utils.etcd_util. If the contents of this module were to add more logic besides acting as a wrapper, then functional tests would be required. :codeauthor: Jaye...
258
test python op exception
# Owner(s): ["oncall: jit"] from torch.testing._internal.common_utils import TestCase import torch from torch import nn r""" Test TorchScript exception handling. """ class TestException(TestCase): def test_pyop_exception_message(self): class Foo(torch.jit.ScriptModule): def __init__(self): ...
259
decrypt secret
# Note: this module is imported inside settings.py! Make sure to avoid circular imports import logging import os import six from google.cloud import kms from google.cloud.storage import Client from google_crc32c import value as _crc32c ENV_VARS = "ENV_VARS" KMS_GCS = 2 SECRET_STORAGE_GCP_KMS_DEFAULT_LOCATION = "glob...
260
process mapping rule
"""Used by the make system to generate a rules.mk """ from pathlib import Path from dotty_dict import dotty from argcomplete.completers import FilesCompleter from milc import cli from qmk.info import info_json from qmk.json_schema import json_load from qmk.keyboard import keyboard_completer, keyboard_folder from qmk....
261
test check params
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2023 # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the # r...
262
start
#!/usr/bin/python """ PyChess arena tournament script. This script executes a tournament between the engines installed on your system. The script is executed from a terminal with the usual environment. """ import os import sys ##############################################################################...
263
zookeeper container
""" Integration tests for the zookeeper states """ import logging import pytest from saltfactories.utils import random_string pytest.importorskip("kazoo") pytest.importorskip("docker") log = logging.getLogger(__name__) pytestmark = [ pytest.mark.slow_test, pytest.mark.skip_if_binaries_missing("dockerd"), ...
264
run selected tests
from __future__ import absolute_import, division, print_function from mmtbx.validation.clashscore import clashscore import libtbx.load_env import iotbx.pdb import unittest import os from six.moves import map __author__ = 'Youval' test_pdb_str = '''\ CRYST1 77.977 77.977 66.800 90.00 90.00 120.00 P 31 2 1 ...
265
set folder status
# coding=utf-8 from http import HTTPStatus from pyramid.config import Configurator import transaction import typing from tracim_backend.app_models.contents import ContentTypeSlug from tracim_backend.config import CFG # noqa: F401 from tracim_backend.exceptions import ContentFilenameAlreadyUsedInFolder from tracim_bac...
266
ingest waze jsons
import datetime import logging import json import requests from pandas import json_normalize import pandas as pd from google.cloud import storage from anyway.parsers.waze.waze_db_functions import ( insert_waze_alerts, insert_waze_traffic_jams, enrich_waze_alerts_ended_at_timestamp, enrich_waze_traffic_...
267
test getpeerinfo
#!/usr/bin/env python3 # Copyright (c) 2017-2018 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 calls related to net. Tests correspond to code in rpc/net.cpp. """ from decimal import Decim...
268
delete multi
''' s3.py - this file is part of S3QL. Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org> This work can be distributed under the terms of the GNU GPLv3. ''' import hashlib import hmac import logging import re import time import urllib.parse from xml.sax.saxutils import escape as xml_escape from ..logging import Qui...
269
attendee content delete
""" Views for attendees to manage their own content.""" from models.cfp import PYTHON_CFP_TYPES, Proposal, Venue, AGE_RANGE_OPTIONS from sqlalchemy import or_ from flask_login import login_required, current_user from flask import ( current_app as app, render_template, redirect, url_for, request, ...
270
logistic curve
# This code is from https://github.com/automl/pybnn # pybnn authors: Aaron Klein, Moritz Freidank import numpy as np # all the models that we considered at some point all_models = {} model_defaults = {} display_name_mapping = {} def pow3(x, c, a, alpha): return c - a * x ** (-alpha) all_models["pow3"] = pow3 ...
271
test should raise command error if database
# -*- coding: utf-8 -*- from io import StringIO from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from unittest.mock import patch MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase'...
272
port start
# sfputil.py # # Platform-specific SFP transceiver interface for SONiC # try: import time from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_STA...
273
chunk targets
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
274
create token response
""" oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import json import logging from .. import errors, utils from .base import GrantTypeBase log = logging.getLogger(__name__) class RefreshTokenGrant(GrantTypeBase): """`Refresh token grant`_ .. _`Refresh token grant`: https://to...
275
count
import math import os.path import sys import textwrap from test import support def format_duration(seconds): ms = math.ceil(seconds * 1e3) seconds, ms = divmod(ms, 1000) minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) parts = [] if hours: parts.append('%s h...
276
configure loader modules
""" Integration tests for the rabbitmq_plugin states """ import logging import pytest import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_plugin as rabbitmq_plugin from tests.support.mock import patch log = logging.getLogger(__name__) pytest.importorskip("docker") pytestmark = [ pytest.mark.s...
277
test filters aggregation buckets are accessible
# -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # # Licensed to ...
278
build list 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...
279
gen f
import pytest from pybind11_tests import callbacks as m from threading import Thread def test_callbacks(): from functools import partial def func1(): return "func1" def func2(a, b, c, d): return "func2", a, b, c, d def func3(a): return "func3({})".format(a) assert m.tes...
280
create entry
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
281
test count
# -*- coding: utf-8 -*- # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. # # Copyright (c) Pawel Jasinski # ## ## Test str/byte equivalence for built-in string m...
282
test observation validity
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
283
test immutable
#!/usr/bin/env python # UserString is a wrapper around the native builtin string type. # UserString instances should behave similar to builtin string objects. import string from test import test_support, string_tests from UserString import UserString, MutableString import warnings class UserStringTest( string_tes...
284
get measurement
# coding=utf-8 import time import copy from flask_babel import lazy_gettext from mycodo.inputs.base_input import AbstractInput # Measurements measurements_dict = { 0: { 'measurement': 'temperature', 'unit': 'C' } } # Input information INPUT_INFORMATION = { 'input_name_unique': 'DS18B20',...
285
apply
# Copyright (c) 2023 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...
286
all nodes down
import random import socket import time from pathlib import Path import requests from flask import Response from nucypher_core import MetadataRequest, FleetStateChecksum from nucypher.characters.lawful import Ursula from nucypher.network.middleware import NucypherMiddlewareClient, RestMiddleware from tests.constants ...
287
suite
# # @file TestCVTerms.py # @brief CVTerms unit tests # # @author Akiya Jouraku (Python conversion) # @author Sarah Keating # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the file located at # s...
288
get dp seed
# Copyright (c) 2023 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...
289
set env var
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
290
get user email
# -*- 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 ...
291
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...
292
test less than 3 edges
import pytest import networkx as nx def test_directed_edge_swap(): graph = nx.path_graph(200, create_using=nx.DiGraph) in_degrees = sorted((n, d) for n, d in graph.in_degree()) out_degrees = sorted((n, d) for n, d in graph.out_degree()) G = nx.directed_edge_swap(graph, nswap=40, max_tries=500, seed=1...
293
stub list document classification jobs
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Stub functions that are used by the Amazon Comprehend unit tests. """ import datetime from test_tools.example_stubber import ExampleStubber class ComprehendStubber(ExampleStubber): """ A class that...
294
fully qualified table name
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import structlog import warnings from typing import List, Optional, Tuple from ...core import Query from ...core.contex...
295
i rule
# ___________________________________________________________________________ # # 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 ...
296
weixin oauth login
# -*- coding: utf-8 -*- import uuid import urllib import logging import requests from django.http import HttpResponseRedirect from django.urls import reverse from django.core.files.base import ContentFile from django.utils.translation import gettext as _ from seahub.api2.utils import get_api_token from seahub impor...
297
test cross layer scaling equalize params
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2019, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
298
test add peer
from unittest.mock import MagicMock, patch import os from bgpcfgd.directory import Directory from bgpcfgd.template import TemplateFabric from . import swsscommon_test from .util import load_constants from swsscommon import swsscommon import bgpcfgd.managers_bgp TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fp...
299
wrap exceptions
# -*- coding: utf-8 -*- import os import sys import traceback from functools import wraps from http import HTTPStatus from xmlrpc.client import Fault import django.core.exceptions import django.db.models import django.db.utils from django.conf import settings __filters__ = ("wrap_exceptions",) def _validate_config...