id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
9,000
test recording encoding
import json import pytest import numpy as np from spikeinterface.core.base import BaseExtractor from spikeinterface.core.core_tools import SIJsonEncoder from spikeinterface.core.generate import generate_recording, generate_sorting @pytest.fixture(scope="module") def numpy_generated_recording(): recording = gene...
9,001
reset
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
9,002
get csig
"""scons.Node.Alias Alias nodes. This creates a hash of global Aliases (dummy targets). """ # # Copyright (c) 2001 - 2019 The SCons Foundation # # 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 So...
9,003
transform value
import urllib.parse import json import re from typing import Any, Dict, List, NamedTuple, Optional, Iterable from copy import deepcopy from enum import Enum from pathlib import Path from django.core.management import BaseCommand, CommandError from django.conf import settings from project.common_data import COMMON_DATA...
9,004
authorize my ip
import os import shlex import subprocess from pathlib import Path import boto3 import click from requests import get from ..common.regions import DEFAULT_ZONE, ZONES, get_aws_region_name SECURITY_GROUPS = [ { 'description': 'ssh', 'group_name_pattern': [ '%(zone)s-service-service-sg', ...
9,005
format users
# Do everything properly, and componentize import cgi from zope.interface import Interface, implementer from twisted.application import internet, service, strports from twisted.internet import defer, endpoints, protocol, reactor from twisted.protocols import basic from twisted.python import components from twisted.we...
9,006
test id
import unittest from unittest.test.support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): # "Return the number of tests represented by the this test object. For # TestCase instances, this will always be 1" def test_countTestCases(self): test = unittest.FunctionTestCase(lamb...
9,007
car type
""" If you have two expressions containing unification variables, these expressions can be "unified" if there exists an assignment to all unification variables such that the two expressions are equal. For instance, [5, A, B] and [A, C, 9] can be unified if A=C=5 and B=9, yielding [5, 5, 9]. [5, [A, B]] and [A, [1, 2]]...
9,008
wait for write
import errno import select import sys from functools import partial try: from time import monotonic except ImportError: from time import time as monotonic __all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"] class NoWayToWaitForSocketError(Exception): pass # How should we wait on...
9,009
test init
import pytest import pytorch_lightning as pl import torch from torch.nn import CrossEntropyLoss from kale.embed.mogonet import MogonetGCN from kale.loaddata.multiomics_datasets import SparseMultiomicsDataset from kale.pipeline.multiomics_trainer import MultiomicsTrainer from kale.predict.decode import LinearClassifier...
9,010
test apply fixes to report
from __future__ import annotations import os import unittest from typing import Any, Iterable from checkov.common.bridgecrew.check_type import CheckType from checkov.common.bridgecrew.integration_features.features.fixes_integration import FixesIntegration from checkov.common.bridgecrew.integration_features.features.p...
9,011
test ensure expand dirs defaults true
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name # pylint:disable=too-many-arguments # pylint:disable=no-name-in-module from pathlib import Path from typing import Awaitable, Callable import pytest from aiohttp import web from aiohttp.test_utils import TestClien...
9,012
compact
# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
9,013
create monitored entity
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from ..monitoring import MonitoredEntity_pb2 as monitoring_dot_MonitoredEntity__pb2 class MonitoredEntityServiceStub(object): """Service definitions """ def __init__(self, channel): """Constructor. Args: channel: ...
9,014
test upload video file
import pytest import requests from labelbox import Dataset from labelbox.exceptions import ResourceNotFoundError, MalformedQueryException, InvalidQueryError from labelbox.schema.dataset import MAX_DATAROW_PER_API_OPERATION def test_dataset(client, rand_gen): # confirm dataset can be created name = rand_gen(s...
9,015
compose sequence node
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
9,016
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...
9,017
dns ex
"""Mock of resolved dbus service.""" from dbus_fast.service import PropertyAccess, dbus_property from .base import DBusServiceMock BUS_NAME = "org.freedesktop.resolve1" def setup(object_path: str | None = None) -> DBusServiceMock: """Create dbus mock object.""" return Resolved() # pylint: disable=invalid...
9,018
test diverged
# test_graph.py -- Tests for merge base # Copyright (c) 2020 Kevin B. Hendricks, Stratford Ontario Canada # # 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 redist...
9,019
run and verify
#!/usr/bin/env python # # Copyright 2006, 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...
9,020
default loader
import os import os.path import torch.utils.data as data from PIL import Image def has_file_allowed_extension(filename, extensions): """Checks if a file is an allowed extension. Args: filename (string): path to a file Returns: bool: True if the filename ends with a known image extension...
9,021
df
import numpy as np from numpy.testing import assert_almost_equal, assert_equal import pandas as pd import scipy.stats import pytest from statsmodels.iolib.table import SimpleTable from statsmodels.stats.descriptivestats import ( Description, describe, sign_test, ) pytestmark = pytest.mark.filterwarnings( ...
9,022
get fwhmx
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
9,023
best match
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import itertools import os.path from pex.orderedset import OrderedSet from pex.rank import Rank from pex.third_party.packaging.tags import Tag, par...
9,024
test successful port
"""Test blueprints OCI""" from django.test import TransactionTestCase from requests_mock import Mocker from authentik.blueprints.models import BlueprintInstance, BlueprintRetrievalFailed from authentik.blueprints.v1.oci import OCI_MEDIA_TYPE class TestBlueprintOCI(TransactionTestCase): """Test Blueprints OCI Tas...
9,025
get administrator
# 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...
9,026
wrapper
""" Tests for the salt-run command """ import functools import random import string import tempfile import pytest from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.x509.oid import NameOID from tests.suppor...
9,027
get region
import json import os import subprocess import pytest import tarfile from ruamel.yaml import YAML import random import string import shutil from sagemaker.image_uris import retrieve def METHOD_NAME(): return os.environ.get("AWS_REGION") def get_sagemaker_role_arn(): return os.environ.get("SAGEMAKER_ROLE_AR...
9,028
nuke transport
############################################################################### # # The MIT License (MIT) # # Copyright (c) typedef int GmbH # # 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 ...
9,029
check develop
# 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) import os import shutil import pytest import llnl.util.filesystem as fs import spack.environment as ev import spack.spec...
9,030
putconn
"""Connection pooling for psycopg2 This module implements thread-safe (and not) connection pools. """ # psycopg/pool.py - pooling code for psycopg # # Copyright (C) 2003-2019 Federico Di Gregorio <fog@debian.org> # Copyright (C) 2020-2021 The Psycopg Team # # psycopg2 is free software: you can redistribute it and/or ...
9,031
get pose3d res
# Copyright (c) 2020 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 app...
9,032
test corners at face
"""Test StructuredQuadGraph.""" import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from landlab.graph import DualRadialGraph def test_create(): """Test creating a quad graph.""" graph = DualRadialGraph((1, 4)) assert graph.number_of_nodes == 5 assert graph.num...
9,033
break callback
""" Contains build of a docker image from a git repository. """ import json import os # These methods are synchronous so don't use tornado.queue import queue import subprocess from threading import Thread from tornado.log import app_log from traitlets import default from .build import BuildExecutor, ProgressEvent ...
9,034
extract imports
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import re from dataclasses import dataclass from typing import Iterable from pants.backend.go.util_rules.build_opts import GoBuildOptions from pants.ba...
9,035
basis
# -*- coding: utf-8 -*- """ Below is a re-implementation of Royston and Parmar spline models, Reference: Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment e􏰎ects """ from autograd import numpy as np fr...
9,036
test random only one participant with duplicates
import random from eth2spec.test.helpers.constants import ( MAINNET, MINIMAL, ) from eth2spec.test.helpers.random import ( randomize_state, ) from eth2spec.test.helpers.state import ( has_active_balance_differential, ) from eth2spec.test.helpers.sync_committee import ( compute_committee_indices, run...
9,037
is rolling
import logging import pdnsapi.api from datetime import datetime import json_tricks.nonp as json_tricks from pdnskeyroller import PDNSKEYROLLER_STATE_metadata_kind from pdnskeyroller.keyroll import KeyRoll from pdnskeyroller.prepublishkeyroll import PrePublishKeyRoll DOMAINSTATE_VERSION = 1 logger = logging.getLogger(_...
9,038
set debuglevel
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...
9,039
test eval exception
#!/usr/bin/env python import unittest import sys import os from test import test_support # Skip this test if the _tkinter module wasn't built. _tkinter = test_support.import_module('_tkinter') from Tkinter import Tcl from _tkinter import TclError class TkinterTest(unittest.TestCase): def testFlattenLen(self):...
9,040
test naive datetime
# -*- coding: utf-8 -*- from datetime import date from datetime import datetime import pytest import six from mock import patch from pytz import timezone from bravado_core.exception import SwaggerMappingError from bravado_core.formatter import SwaggerFormat from bravado_core.formatter import to_wire from bravado_core...
9,041
test leakyrelu module
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
9,042
main
#!/usr/bin/env python # Copyright (c) 2016 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 ...
9,043
cursor
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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, t...
9,044
run plotter
from __future__ import annotations import asyncio import contextlib import json import os import signal import subprocess import sys from datetime import datetime from pathlib import Path from typing import Iterator, Optional, TextIO from chia.cmds.init_funcs import chia_full_version_str from chia.util.config import ...
9,045
clean up persistence
import asyncio import logging from pathlib import Path from typing import Optional from typing_extensions import Literal from sqlalchemy.engine import Engine as SQLEngine from anyio import to_thread from fastapi import Depends, status from typing_extensions import Final from server_utils.fastapi_utils.app_state impor...
9,046
get onboarding data
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import ( Optional, Dict, List, Any, Callable, TYPE_CHECKING, ) from mephisto.abstra...
9,047
add one widget
from typing import Callable, Optional, Sequence, Any, Dict from software.thunderscope.constants import TabNames import PyQt6 from PyQt6.QtWebEngineWidgets import QWebEngineView from pyqtgraph.Qt import QtCore from pyqtgraph.Qt.QtWidgets import * from pyqtgraph.dockarea import * class WidgetStretchData: """ D...
9,048
test ccharp struct
from ctypes import * import unittest class SimpleTestCase(unittest.TestCase): def test_cint(self): x = c_int() self.assertEqual(x._objects, None) x.value = 42 self.assertEqual(x._objects, None) x = c_int(99) self.assertEqual(x._objects, None) def test_ccharp(sel...
9,049
create sock
#!/usr/bin/env python """ Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ import re import socket from lib.core.common import filterNone from lib.core.common import getSafeExString from lib.core.compat import LooseVersion from lib.core.compat import x...
9,050
post 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 # --------------------------------...
9,051
function mock
# encoding: utf-8 # ------------------------------------------------------------------------ # Copyright 2022 All Histolab Contributors # # 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 # # ...
9,052
prep text
from typing import Union import torch from PIL import Image from torchvision import transforms as tfms from tqdm.auto import tqdm from transformers import CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, DiffusionPipeline, LMSDiscreteScheduler, PNDMScheduler, ...
9,053
download
"""QM7b dataset for graph property prediction (regression).""" import os from scipy import io from .. import backend as F from ..convert import graph as dgl_graph from .dgl_dataset import DGLDataset from .utils import check_sha1, METHOD_NAME, load_graphs, save_graphs class QM7bDataset(DGLDataset): r"""QM7b dat...
9,054
test layer norm
# Copyright (c) OpenMMLab. All rights reserved. import tempfile import onnx import pytest import torch from mmengine import Config from mmdeploy.core import RewriterContext onnx_file = tempfile.NamedTemporaryFile(suffix='onnx').name @pytest.fixture(autouse=False, scope='function') def prepare_symbolics(): cont...
9,055
display warning
from maya import cmds import xgenm from openpype.pipeline import ( InventoryAction, get_representation_context, get_representation_path ) class ConnectXgen(InventoryAction): """Connect Xgen with an animation or pointcache. """ label = "Connect Xgen" icon = "link" color = "white" def pro...
9,056
test app property
# type: ignore import asyncio import platform import signal from typing import Any from unittest.mock import patch import pytest from aiohttp import web from aiohttp.abc import AbstractAccessLogger from aiohttp.test_utils import get_unused_port_socket @pytest.fixture def app(): return web.Application() @pytes...
9,057
register
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, repeat_last_for_length, ensure_nesting_level from sverchok.utils.field.vector...
9,058
package
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
9,059
check pid
"""Windows-specific implementation of process utilities. This file is only meant to be imported by process.py, not by end-users. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD Licen...
9,060
parse mdtest results
# Copyright 2018 PerfKitBenchmarker 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...
9,061
write cache file
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 l...
9,062
get replication info
# -*- coding: utf-8 -*- import logging from time import sleep LOG = logging.getLogger(__name__) def build_uncomment_skip_slave_script(): return """ sed -e 's/^#skip_slave_start/skip_slave_start/' -i /etc/my.cnf """ def build_comment_skip_slave_script(): return """ sed -e 's/^skip_...
9,063
strip trailing article
import json import sys import xbmc import xbmcaddon import xbmcgui import xbmcplugin from lib.tmdbscraper.tmdb import TMDBMovieScraper from lib.tmdbscraper.fanarttv import get_details as get_fanarttv_artwork from lib.tmdbscraper.imdbratings import get_details as get_imdb_details from lib.tmdbscraper.traktratings impor...
9,064
get rotate crop image
# Copyright (c) 2020 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...
9,065
test analyze package detailed invalid data
import sys import pytest from frictionless import Package pytestmark = pytest.mark.skipif( sys.version_info < (3, 10), reason="Supported on Python3.10+", ) # General def test_analyze_package(): package = Package("data/package-1067.json") analysis = package.analyze() assert len(analysis) == 3 ...
9,066
tensorflow section
""" Outputs diagnostic information to help with debugging SLEAP installation. """ print_to_screen = False output_text = "" def print_(text=""): global output_text if print_to_screen: print(f"{text}") else: output_text += f"{text}\n" def header(text): print_(f"\n=========={text.upper...
9,067
get config
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. 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 r...
9,068
mgm t 4104 4738 4739
""" https://github.com/csesoc/Circles/wiki/Manual-Fixes-to-Course-Prerequisites Copy this into a new file for the relevant faculty's fixes: e.g. COMPFixes.py, ACCTFixes.py, PSYCFixes.py Apply manual [code] fixes to processed conditions in conditionsProcessed.json so that they can be fed into algorithms. If you make ...
9,069
semaphore
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
9,070
get entity num
import random from pymilvus import ( connections, FieldSchema, CollectionSchema, DataType, Collection, utility ) # This example shows how to: # 1. connect to Milvus server # 2. create a collection # 3. insert entities # 4. create index # 5. search _HOST = '127.0.0.1' _PORT = '19530' # Con...
9,071
test q complex int
from unittest import TestCase as _TestCase from tests.testmodels import CharFields, IntFields from tortoise.contrib.test import TestCase from tortoise.exceptions import OperationalError from tortoise.expressions import Q class TestQ(_TestCase): def test_q_basic(self): q = Q(moo="cow") self.assert...
9,072
set http response
from boto.compat import http_client from tests.compat import mock, unittest class AWSMockServiceTestCase(unittest.TestCase): """Base class for mocking aws services.""" # This param is used by the unittest module to display a full # diff when assert*Equal methods produce an error message. maxDiff = Non...
9,073
test pefile
#!/usr/bin/env python # -*- coding: utf-8 -*- import lief import random from utils import get_sample def test_without_imports(): """ By convention if a binary hasn't import, imphash is '0' """ binary = lief.PE.Binary(lief.PE.PE_TYPE.PE32) assert int(lief.PE.get_imphash(binary), 16) == 0 def tes...
9,074
update
# -*- 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...
9,075
etcd client
import logging import pytest import salt.modules.etcd_mod as etcd_mod import salt.states.etcd_mod as etcd_state from salt.utils.etcd_util import get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import docker = pytest.importorskip("docker") log = logging.getLogger(_...
9,076
resource guid
# 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...
9,077
scheduling strategy
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
9,078
go back to issues
from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from .base import BasePage from .global_selection import GlobalSelectionPage class IssueDetailsPage(BasePage): def __init__(self, browser, client): ...
9,079
test update with dest none
""" Test cases for salt.modules.defaults :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> """ import inspect import pytest import salt.modules.defaults as defaults from tests.support.mock import MagicMock, patch @pytest.fixture() def configure_loader_modules(): return {defaults: {}} def test_get_mock(...
9,080
gen cert
from __future__ import print_function import base64 import os import sys import foreign.six as six import core.exceptions as ex from core.objects.data import DataMixin from core.objects.svc import BaseSvc from utilities.converters import print_size from utilities.lazy import lazy from utilities.naming import factory...
9,081
create service callback api
from flask import Blueprint, jsonify, request from sqlalchemy.exc import SQLAlchemyError from app.dao.service_callback_api_dao import ( delete_service_callback_api, get_service_callback_api, reset_service_callback_api, save_service_callback_api, ) from app.dao.service_inbound_api_dao import ( delet...
9,082
propagate inputs to enclave
# stdlib from typing import Dict from typing import Union # relative from ...client.enclave_client import EnclaveClient from ...client.enclave_client import EnclaveMetadata from ...serde.serializable import serializable from ...service.response import SyftError from ...service.response import SyftSuccess from ...servi...
9,083
create node iterator
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from typing import ( Iterator, Optional, Union, ) from amundsen_common.utils.atlas import AtlasCommonParams, AtlasTableTypes from amundsen_rds.models import RDSModel from amundsen_rds.models.table import TableSource as RDSTabl...
9,084
write
#!/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...
9,085
test cwd provided
import platform from pathlib import Path import pytest # Default encoding is platform specific. if platform.platform() == "Windows": CONSOLE_ENCODING = "cp437" else: CONSOLE_ENCODING = "UTF-8" def test_no_overrides(mock_sub): """With no overrides, there are still kwargs.""" assert mock_sub.final_kwa...
9,086
test tuple of tuple
import sys from collections.abc import Sequence from typing import List, Optional, Tuple, Union import pytest import strawberry from strawberry.annotation import StrawberryAnnotation from strawberry.type import StrawberryList def test_basic_list(): annotation = StrawberryAnnotation(List[str]) resolved = ann...
9,087
add child
"""State module: contains State class""" from __future__ import annotations __all__ = ['State'] from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.DirectObject import DirectObject class State(DirectObject): notify = directNotify.newCategory("State") # this 'constant' can ...
9,088
create samples
#!/usr/bin/env python import sys import argparse _SEX = { '0': 'UNKNOWN', '1': 'MALE', '2': 'FEMALE' } _KAR_SEX = { '0': None, '1': 'XY', '2': 'XX' } _VARIABLE_FIELDS = ['Relationship', 'Siblings', 'Second Order', 'Third Order', 'Other Comments'] FNAME_TEMPLATE = 'ALL.chr{}.shapeit2_integra...
9,089
test program not present
"""Tests for Program Certificates management command""" import pytest from itertools import product from courses.management.commands import manage_program_certificates from courses.models import ProgramCertificate from django.core.management.base import CommandError from courses.factories import ( CourseFactory, ...
9,090
module synced repos
# Satellite-maintain fixtures import datetime import pytest from robottelo import constants from robottelo.config import settings from robottelo.constants import SATELLITE_MAINTAIN_YML from robottelo.hosts import Capsule from robottelo.hosts import Satellite from robottelo.hosts import SatelliteHostError from robotte...
9,091
test reset successfully returns indicator to fresh
# ------------------------------------------------------------------------------------------------- # Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved. # https://nautechsystems.io # # Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); # You may not use this file ex...
9,092
softmax
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. import sys from typing import List, Union import numpy as np from util import expand_maps, expand_reduce, fusion import dace import dace.dtypes as dtypes import dace.libraries.standard as stdlib import dace.sdfg.nodes as nodes import dace.tra...
9,093
get api collection 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__ ...
9,094
main
""" ONNX-runtime validation script This script was created to verify accuracy and performance of exported ONNX models running with the onnxruntime. It utilizes the PyTorch dataloader/processing pipeline for a fair comparison against the originals. Copyright 2020 Ross Wightman """ import argparse import numpy as np im...
9,095
load colors
#!/usr/bin/env python2 # 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 "Lice...
9,096
on store opened
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2019 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this ...
9,097
test jsonl append read loop
"""Test the file_io module.""" import numpy as np import pytest from clarity.utils.file_io import read_jsonl, read_signal, write_jsonl, write_signal def test_read_jsonl(): """Test the read_jsonl function.""" expected = [ {"id": 1, "name": "xxx"}, {"id": 2, "name": "yyy"}, {"id": 3, "n...
9,098
test localhost was obfuscated
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
9,099
apiver
###################################################################### # # File: test/unit/conftest.py # # Copyright 2020 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### from __future__ import annotatio...