id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
11,200
test address query as not owner
import graphene from ....tests.utils import ( assert_no_permission, get_graphql_content, get_graphql_content_from_response, ) ADDRESS_QUERY = """ query address($id: ID!) { address(id: $id) { postalCode lastName firstName city country { code } ...
11,201
get scene
# # Copyright 2018-2022 GoPro Inc. # # 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...
11,202
finalize response
import math import time import threading import uuid from pprint import pformat # noqa from banal import hash_data from datetime import datetime from flask_babel import get_locale from flask import request, Response, Blueprint from werkzeug.exceptions import TooManyRequests import structlog from structlog.contextvars ...
11,203
cell
''' Copyright (c) 2020 ETH Zurich SPDX-License-Identifier: BSL-1.0 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' import contextlib import os import pathlib from lxml import etree as et from pyutils import log _CS...
11,204
check docstring
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt """Docstring checker from the basic checker.""" from __future__ import annotations imp...
11,205
tmp to org
# -*- coding: utf-8 -*- # import uuid from contextlib import contextmanager from functools import wraps from inspect import signature from werkzeug.local import LocalProxy from common.local import thread_local from .models import Organization def get_org_from_request(request): # query中优先级最高 oid = request.GE...
11,206
test path set
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Test Spack's environment utility functions.""" import os import sys import pytest import spack.util.environment as en...
11,207
test
import unittest from unittest import mock import sys import importlib import numpy from qupulse.pulses import ConstantPT from qupulse.plotting import PlottingNotPossibleException, render, plot from qupulse.pulses.table_pulse_template import TablePulseTemplate from qupulse.pulses.sequence_pulse_template import Sequenc...
11,208
new storage
#!/usr/bin/env python3 # 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 sys import time import traceback import urllib.parse from contextlib import contextmanager from enum import au...
11,209
populate table
#!/usr/bin/env python # Copyright 2014-2016 RethinkDB, all rights reserved. import os, multiprocessing, sys, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir, 'common')) import driver, scenario_common, utils, vcoptparse op = vcoptparse.OptParser() scenario_common.prepare_...
11,210
test wheel async disabled
import pytest import salt.netapi from salt.exceptions import EauthAuthenticationError, SaltInvocationError from tests.support.mock import patch @pytest.fixture def client(salt_minion, salt_sub_minion, client_config): return salt.netapi.NetapiClient(client_config) @pytest.mark.slow_test def test_local(client, a...
11,211
test common blacklist
"""Helpers: Information: get_repository.""" # pylint: disable=missing-docstring import json import pytest from custom_components.hacs.exceptions import HacsException from tests.sample_data import ( release_data, repository_data, repository_data_archived, response_rate_limit_header, response_rate_...
11,212
get feature fields
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
11,213
test motif n glycosylation
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE.txt, distributed with this software. # --------------------------------------------...
11,214
set gauge callback
#!/usr/bin/env python """Common logic for objects used to track monitoring-related metrics. GRR has a notion of statistic metrics. These metrics reflect GRR's state at any given moment. There are three types of metrics available: 1. Counter. This is an integer metric that can only be incremented and never decremented...
11,215
format for prediction
# Copyright (c) Facebook, Inc. and its affiliates. import logging import torch import tqdm from mmf.common.sample import Sample from mmf.datasets.mmf_dataset import MMFDataset from mmf.utils.distributed import is_main logger = logging.getLogger(__name__) class VQA2Dataset(MMFDataset): def __init__(self, config...
11,216
get all named entities
# Copyright (c) Microsoft Corporation # Licensed under the MIT License. import pkg_resources from negspacy.negation import Negex # noqa: F401 from raiutils.dataset import fetch_dataset POSITIVE_NEGATIVE_FILE = 'positive-negative.csv' resource_package = __name__ nlp_url = 'https://publictestdatasets.blob.core.windo...
11,217
id bool
"""Check that the generic Ada API works as expected.""" from langkit.dsl import ( ASTNode, AbstractField, Field, MetadataField, NullField, Struct, T, UserField, abstract, env_metadata ) from langkit.expressions import ( AbstractKind, ArrayLiteral, BigIntLiteral, ...
11,218
main
#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
11,219
arm power cycle
#!/usr/bin/env python3 # Software License Agreement (BSD License) # Copyright © 2021-2023 belongs to Shadow Robot Company Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributio...
11,220
handle tags exceptions
import functools import re from aiohttp import web from aiopg.sa.engine import Engine from models_library.users import UserID from pydantic import BaseModel, ConstrainedStr, Extra, Field, PositiveInt from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY from servicelib.aiohttp.requests_validation import ( ...
11,221
ensure fqdn
import functools import ipaddress import socket from urllib.parse import urlparse from django.conf import settings from django.utils.encoding import force_str from urllib3.exceptions import LocationParseError from urllib3.util.connection import _set_socket_options, allowed_gai_family from sentry.exceptions import Res...
11,222
get prediction from predict scores
from typing import List, Dict, Any from datasets import Dataset import numpy as np import logging from transformers import EvalPrediction from primeqa.mrc.processors.postprocessors.abstract import AbstractPostProcessor from primeqa.mrc.data_models.eval_prediction_with_processing import EvalPredictionWithProcessing ...
11,223
mkd
import sys from _typeshed import SupportsRead, SupportsReadline from collections.abc import Callable, Iterable, Iterator from socket import socket from ssl import SSLContext from types import TracebackType from typing import Any, TextIO from typing_extensions import Literal, Self __all__ = ["FTP", "error_reply", "erro...
11,224
write paraview file unst trimesh
import numpy as np def write_paraview_file_structmesh(fname,xp,yp,ccdata,ncdata): outfile=open(fname,'w') Npx=xp.shape[1] Npy=xp.shape[0] zero=0 one=1 outfile.write("<?xml version=\"1.0\"?>\n") outfile.write("<VTKFile type=\"StructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n...
11,225
test add reviewer
from pyquery import PyQuery as pq from kitsune.sumo.tests import LocalizingClient, TestCase from kitsune.sumo.urlresolvers import reverse from kitsune.users.tests import UserFactory, add_permission from kitsune.wiki.models import Locale from kitsune.wiki.tests import LocaleFactory class LocaleListTests(TestCase): ...
11,226
dd environment
# (C) Datadog, Inc. 2023-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import copy import os from contextlib import contextmanager import pytest from datadog_checks.dev import EnvVars, TempDir, docker_run, get_here from datadog_checks.dev._env import get_state, save_state f...
11,227
get shared client connection
from __future__ import annotations import contextlib import logging import os import warnings from typing_extensions import Self import dagger from dagger.client._session import ( ConnectConfig, ConnectParams, SharedConnection, SingleConnection, ) from ._version import CLI_VERSION from .download imp...
11,228
draw boxes
import argparse import json import sys import tempfile from enum import Enum from pathlib import Path from typing import List, Optional import requests from PIL import Image, ImageDraw from robotoff.prediction.ocr import OCRResult from robotoff.prediction.ocr.dataclass import BoundingPoly class FeatureType(Enum): ...
11,229
get extension ids
from django.apps import apps from django.conf import settings # For the most part this is copypasted from # https://github.com/6aika/issue-reporting/blob/master/issues/extensions.py # original author @akx (Aarni Koskela) class EventExtension(object): #: The identifier for the extension (as referred to in the `ex...
11,230
list
# 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...
11,231
total seconds
#-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2011-2016 ## ## ...
11,232
visit member expr
"""Find all subexpressions of an AST node.""" from __future__ import annotations from mypy.nodes import ( AssertTypeExpr, AssignmentExpr, AwaitExpr, CallExpr, CastExpr, ComparisonExpr, ConditionalExpr, DictExpr, DictionaryComprehension, Expression, GeneratorExpr, IndexE...
11,233
test pinnacle cli list
# Copyright (C) 2020 South Western Sydney Local Health District, # University of New South Wales # 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...
11,234
upsample flow
# The implementation is adopted from RAFT, # made publicly available under the BSD-3-Clause license at https://github.com/princeton-vl/RAFT import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from modelscope.models.cv.video_frame_interpolation.flow_model.corr import ( AlternateCo...
11,235
specific heat
#------------------------------------------------------------------------------- # LinearPolynomialEquationOfState #------------------------------------------------------------------------------- from PYB11Generator import * from SolidEquationOfState import * from EOSAbstractMethods import * @PYB11template("Dimension"...
11,236
run call back
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from cctbx import miller from cctbx.development import make_cns_input from cctbx.development import random_structure from cctbx.regression.tst_miller import generate_random_hl from iotbx.cns import reflection_reader fro...
11,237
tostring
import numpy as np from . OtherQuantity import OtherQuantity from . OtherFluidQuantity import OtherFluidQuantity from . OtherKineticQuantity import OtherKineticQuantity from . OtherScalarQuantity import OtherScalarQuantity from . AvalancheGrowthRate import AvalancheGrowthRate class OtherQuantities: SPECI...
11,238
get formatted data
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import json from itertools import groupby import frappe from frappe import _ from frappe.utils import flt from erpnext.setup.utils import get_exchange_rate def execute(filters=None): return Opport...
11,239
iterate ring read
# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditio...
11,240
init is supported
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
11,241
test av from variable wind
# from future import standard_library # standard_library.install_aliases() # from builtins import * import os from datetime import datetime import pytest from pytest import raises import numpy as np from gnome.utilities.time_utils import (zero_time, sec_to_date) from gno...
11,242
method
# pylint: disable=W0621 import base64 import json from io import StringIO from pprint import pprint import pytest from ansible_runner.utils import OutputEventFilter MAX_WIDTH = 78 EXAMPLE_UUID = '890773f5-fe6d-4091-8faf-bdc8021d65dd' def write_encoded_event_data(fileobj, data): b64data = base64.b64encode(json...
11,243
emit
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
11,244
abort
import enum import sys from _typeshed import Unused from collections import deque from collections.abc import Callable, Generator from types import TracebackType from typing import Any, TypeVar from typing_extensions import Literal, Self from .events import AbstractEventLoop from .futures import Future if sys.version...
11,245
sign
# coding=utf-8 # # This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2019 David R. MacIver # (david@drmaciver.com), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold cop...
11,246
signout
import os import base64 from flask import redirect, request, render_template, jsonify, make_response, Flask from flask_wtf.csrf import CSRFProtect from urllib.parse import urlencode app = Flask(__name__) csrf = CSRFProtect() csrf.init_app(app) SECRET_KEY = os.urandom(32) app.config['SECRET_KEY'] = SECRET_KEY signe...
11,247
test test execution statuses can be deleted
# -*- coding: utf-8 -*- # pylint: disable=invalid-name from django.urls import reverse from django.utils.translation import gettext_lazy as _ from parameterized import parameterized from tcms.testruns.models import TestExecutionStatus, TestRun from tcms.tests import LoggedInTestCase from tcms.tests.factories import Te...
11,248
get custom attributes
from datetime import datetime from resotolib.logger import log from resotolib.config import Config from resotolib.baseplugin import BaseCollectorPlugin from resotolib.baseresources import InstanceStatus from .vsphere_client import get_vsphere_client from .resources import ( VSphereCluster, VSphereInstance, ...
11,249
destroy
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,250
file
from __future__ import annotations import os import tempfile from contextlib import suppress from email.message import Message from pathlib import Path from urllib.parse import urlparse import requests.exceptions as requests_exceptions from requests import Response from briefcase.exceptions import ( BadNetworkRe...
11,251
test scalar add
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
11,252
set up module
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
11,253
iter resources
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import logging from boto3.dynamodb import conditions from c7n.utils import format_event log = logging.getLogger('sphere11.db') class LockDb: STATE_LOCKED = "locked" STATE_UNLOCKED = "unlocked" STATE_PENDING = "pending" d...
11,254
test no hook
# Copyright (c) 2012-2023, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions an...
11,255
test without authorization
from unittest.mock import patch import pytest import responses from sentry.services.hybrid_cloud.usersocialauth.serial import serialize_usersocialauth from sentry.shared_integrations.exceptions import ( ApiError, ApiHostError, ApiUnauthorized, UnsupportedResponseType, ) from sentry.shared_integrations...
11,256
pyinit
#------------------------------------------------------------------------------- # SolidCRKSPHHydroBase #------------------------------------------------------------------------------- from PYB11Generator import * from CRKSPHHydroBase import * from RestartMethods import * @PYB11template("Dimension") @PYB11module("Sphe...
11,257
test writed is readed
# /*########################################################################## # Copyright (C) 2016 European Synchrotron Radiation Facility # # 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 w...
11,258
get firewall rule 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__ =...
11,259
find fk
# 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. """ Utility functions for use in Alembic migration scripts. """ from ...
11,260
ping
""" This is the a dummy proxy-minion designed for testing the proxy minion subsystem. """ import copy import logging import os import pprint from contextlib import contextmanager import salt.utils.files import salt.utils.msgpack from salt.exceptions import CommandExecutionError, MinionError # This must be present or...
11,261
is gpfdist connected
try: import time import os import platform from gppylib.commands.base import Command, LOCAL, REMOTE, WorkerPool except ImportError as import_exception: sys.exit('Cannot import modules. Please check that you have sourced' \ ' greenplum_path.sh. Detail: %s' % str(import_exception)) impo...
11,262
get goal codes
import datetime as dt import json import os import tempfile from collections import defaultdict from io import BytesIO from pathlib import Path from typing import Any, Dict, List import numpy as np import pandas as pd import requests import yaml from structlog import get_logger from owid.walden import add_to_catalog ...
11,263
calculate modified attributes
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, ...
11,264
generate replay video
import os import cv2 import numpy as np from huggingface_hub import HfApi, Repository, repocard, upload_folder from sample_factory.utils.typing import Config from sample_factory.utils.utils import log, project_tmp_dir MIN_FRAME_SIZE = 180 def METHOD_NAME(dir_path: str, frames: list, fps: int, cfg: Config): vid...
11,265
test features extractor no features
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
11,266
rank
from typing import Optional, Union import torch class _remote_device: """ Represents a device on a remote worker. Args: remote_device (str or torch.device): Represents a device on a remote worker. The string format should be one of the following: 1. "<workername>/<de...
11,267
determine lib name
from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.errors import ConanInvalidConfiguration from conan.tools.files import collect_libs, copy, get fro...
11,268
test erase screen
"""redirect tests.""" import os import re import sys import time import numpy as np import pytest import tqdm import wandb impls = [wandb.wandb_sdk.lib.redirect.StreamWrapper] if os.name != "nt": impls.append(wandb.wandb_sdk.lib.redirect.Redirect) class CapList(list): def append(self, x): if not x:...
11,269
scrub uri
"""logging utilities""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import json import logging import traceback from functools import partial from http.cookies import SimpleCookie from urllib.parse import urlparse, urlunparse from tornado.log import LogFormatter...
11,270
set up
# SPDX-License-Identifier: LGPL-3.0-or-later import os import unittest import numpy as np from common import ( tests_path, ) from deepmd.env import ( GLOBAL_NP_FLOAT_PRECISION, ) from deepmd.infer import ( DipoleChargeModifier, ) from deepmd.utils.convert import ( convert_pbtxt_to_pb, ) if GLOBAL_NP_...
11,271
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...
11,272
get test file
"""Test the ability of openbabel to roundtrip various properties (protonation, hybridization, aromaticity...) through various file formats (sdf,pdb,mol2). On Windows or Linux, you can run these tests at the commandline in the build folder with: "C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake ...
11,273
mutate irmodule
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
11,274
test
import awkward as ak def delta_r2(a, b): return (a.eta - b.eta) ** 2 + (a.phi - b.phi) ** 2 def METHOD_NAME(): form = ak.forms.from_dict( { "class": "RecordArray", "fields": ["muon", "jet"], "contents": [ { "class": "ListOffsetA...
11,275
execute
# *************************************************************************** # * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> * # * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
11,276
get expected num thermals
import json import pytest from tests.common.helpers.assertions import pytest_assert from tests.platform_tests.cli.util import get_skip_mod_list pytestmark = [ pytest.mark.topology('t2') ] def get_chassis_db_ip(duthost): out = duthost.command("cat /etc/sonic/chassisdb.conf")['stdout_lines'] for line in o...
11,277
hexl
#!/usr/bin/env python # Impacket - Collection of Python classes for working with network protocols. # # Copyright (C) 2023 Fortra. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # from __fut...
11,278
release
#!/usr/bin/python # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals from optparse import OptionParser import sys import dbus import dbus.service import dbus.mainloop.glib try: from gi.repository import GObject except ImportError: import gobject a...
11,279
initialize
# -*- coding: utf-8 -*- # # This file is part of SENAITE.CORE. # # SENAITE.CORE 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, version 2. # # This program is distributed in the hope that it will be useful, bu...
11,280
test channels
# Copyright 2013 Christoph Reiter # # 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. import os import shutil from io imp...
11,281
string to version
#!/usr/bin/python # findpackages.py - Generate Yum'able trees from the sat package store # Copyright (C) 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # 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 # ...
11,282
run
from collections.abc import Callable, Iterable, Mapping, Sequence from logging import Logger from socket import socket from threading import Condition, Event, Lock, Thread from types import ModuleType from typing import Any, Protocol from typing_extensions import TypeAlias from paramiko.auth_handler import AuthHandler...
11,283
validate
"""JSON serializers for plugin app.""" import subprocess from django.conf import settings from django.core.exceptions import ValidationError from django.utils import timezone from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from common.serializers import GenericReference...
11,284
get password
import enum from hashlib import sha256 import os from sqlalchemy import Boolean from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy import Enum from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Sequence from sqlalchemy import Unicode from sqlalchemy.orm im...
11,285
test device state no media
"""Unit tests for pyatv.protocols.dmap.daap.""" import pytest from pyatv import exceptions from pyatv.const import DeviceState, MediaType from pyatv.protocols.dmap.daap import media_kind, ms_to_s, playstate # These are extracted from iTunes, see for instance: # http://www.blooming.no/wp-content/uploads/2013/03/ITLib...
11,286
test query public meta for attribute as
import graphene from ....tests.utils import assert_no_permission, get_graphql_content from .utils import PRIVATE_KEY, PRIVATE_VALUE, PUBLIC_KEY, PUBLIC_VALUE QUERY_ATTRIBUTE_PUBLIC_META = """ query attributeMeta($id: ID!){ attribute(id: $id){ metadata{ key value...
11,287
config reload
import time import logging from tests.common.helpers.assertions import pytest_assert from tests.common.plugins.loganalyzer.utils import ignore_loganalyzer from tests.common.platform.processes_utils import wait_critical_processes from tests.common.utilities import wait_until from tests.configlet.util.common import chk_...
11,288
carbonates in seawater
# Reaktoro is a unified framework for modeling chemically reactive systems. # # Copyright © 2014-2022 Allan Leal # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of ...
11,289
add system event trigger
# Copyright Buildbot Team Members # Portions copyright 2015-2016 ClusterHQ Inc. # # 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 right...
11,290
hpy abi
import pytest from test.support import SUPPORTS_SYS_EXECUTABLE, SUPPORTS_MEM_PROTECTION @pytest.fixture def METHOD_NAME(): return "debug" @pytest.mark.skipif(not SUPPORTS_SYS_EXECUTABLE, reason="needs subprocess") def test_use_invalid_as_struct(compiler, python_subprocess): mod = compiler.compile_module(""" ...
11,291
check required format
# -*- coding: utf-8 -*- """Text parser plugin for ZSH extended_history files. References: https://zsh.sourceforge.io/Doc/Release/Options.html#index-EXTENDEDHISTORY """ import pyparsing from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.lib import errors from ...
11,292
to str
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.28 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
11,293
match for duplicate
from typing import Tuple import imagehash from pydantic import BaseModel, HttpUrl from tortoise import fields import config from constants import SSType from core import Context from models import BaseDbModel from models.helpers import * from utils import emote class ImageResponse(BaseModel): url: HttpUrl d...
11,294
create slauth
#!/usr/bin/env python """ Script to trigger Backfill from CSV of installation IDs. Takes an installations.csv with installation_id. Keeps track of processed entries in a separate file, so that script can be stopped and resumed without having to change the input file. Input file format: installation_id 12345...
11,295
step
import logging from enum import Enum from gymnasium import spaces from freqtrade.freqai.RL.BaseEnvironment import BaseEnvironment, Positions logger = logging.getLogger(__name__) class Actions(Enum): Neutral = 0 Exit = 1 Long_enter = 2 Short_enter = 3 class Base4ActionRLEnv(BaseEnvironment): ...
11,296
add option
import os import re import time import aexpect from avocado.utils import download from virttest import error_context from virttest import utils_misc from virttest import data_dir @error_context.context_aware def run(test, params, env): """ KVM guest stop test: 1) Log into a guest 2) Check is HeavyLoa...
11,297
execute operations
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
11,298
test do tagging
import os from contextlib import nullcontext as does_not_raise from dataclasses import dataclass from unittest.mock import MagicMock import pytest from git import Actor, PushInfo from scriptworker_client.utils import makedirs from treescript import git from treescript.exceptions import PushError from treescript.scrip...
11,299
consolidate input
__all__ = [ 'OasisManager' ] import re from oasislmf.computation.generate.files import (GenerateDummyModelFiles, GenerateDummyOasisFiles, GenerateFiles) from oasislmf.computation.generate.keys import (GenerateKeys, ...