id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
17,600 | test group update redirect | from functools import reduce
import operator
from django.contrib.auth.models import Group, Permission
from django.db.models import Q
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils.crypto import get_random_string
from accounts.models import User
@override_settings... |
17,601 | extract if need be | import re
import tempfile
import subprocess
from pathlib import Path
import tarfile
import gzip
import shutil
## VIASH START
par = {
'genome_fasta': 'resources_test/cellranger_tiny_fastq/cellranger_tiny_ref/fasta/genome.fa',
'transcriptome_gtf': 'resources_test/cellranger_tiny_fastq/cellranger_tiny_ref/genes/g... |
17,602 | test rebuild search indexes command topic model | """Module for the testing custom Django rebuild_search_indexes command."""
from os.path import join, dirname
from django.conf import settings
from django.test import override_settings
from django.core import management
from django.test import tag
from django.template.exceptions import TemplateSyntaxError
from tests.Ba... |
17,603 | get country | import locale
import logging
from typing import Optional
from pycountry import countries, languages # type: ignore[import]
DEFAULT_LANGUAGE = "en"
DEFAULT_COUNTRY = "US"
DEFAULT_LANGUAGE_CODE = f"{DEFAULT_LANGUAGE}_{DEFAULT_COUNTRY}"
log = logging.getLogger(__name__)
class Country:
def __init__(self, alpha2,... |
17,604 | daylight saving ta | # NOTE: t must be INT!!!
import time
import datetime
import warnings
try:
from tzlocal import get_localzone
LOCAL_ZONE = get_localzone()
except: # except all problems...
warnings.warn(
'Please install or fix tzlocal library (pip install tzlocal) in order to make Date object work better. Otherwise ... |
17,605 | test nan | """Test to check the extrapolation module."""
import unittest
import numpy as np
from skfda import FDataBasis, FDataGrid
from skfda.datasets import make_sinusoidal_process
from skfda.representation.basis import FourierBasis
from skfda.representation.extrapolation import (
BoundaryExtrapolation,
ExceptionExtr... |
17,606 | test ethosu unary elementwise matcher | # 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... |
17,607 | test random 2d seed | import numpy as np
import pytest
import mbuild as mb
from mbuild.tests.base_test import BaseTest
class TestPattern(BaseTest):
def test_apply_to_compound(self, betacristobalite, propyl, ch3):
pattern = mb.Random2DPattern(90)
chains, backfills = pattern.apply_to_compound(
guest=propyl, ... |
17,608 | test user provided masses | # -*- coding: utf-8 -*-
#
# Copyright (c) 2023, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test the Moments method in cclib"""
import unittest
from unittest import mock
import numpy as np
from numpy.testing i... |
17,609 | requires | # Copyright 2023 Canonical Ltd.
# Licensed under the Apache V2, see LICENCE file for details.
import logging
from . import model
from .errors import JujuEntityNotFoundError
log = logging.getLogger(__name__)
class Endpoint:
def __init__(self, model, data):
self.model = model
self.data = data
... |
17,610 | get mesh id for id | __author__ = 'Finn Womack'
__copyright__ = 'Oregon State University'
__credits__ = ['Finn Womack']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = ''
__email__ = ''
__status__ = 'Prototype'
import _mysql
import pandas as pd
import _mysql_exceptions
class QueryUMLSSQL():
def __init__(self, host, port, us... |
17,611 | handler | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
17,612 | test context manager | from test import support
from test.support import import_helper, cpython_only
gdbm = import_helper.import_module("dbm.gnu") #skip if not supported
import unittest
import os
from test.support.os_helper import TESTFN, TESTFN_NONASCII, unlink, FakePath
filename = TESTFN
class TestGdbm(unittest.TestCase):
@staticmet... |
17,613 | test grad drop f prop twice raises | # 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... |
17,614 | run | #! python3
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
# [Released under MIT License. Please refer to license.txt for details]
# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams
# ====... |
17,615 | historical instance | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import datetime as dt
import pytest
from mock import MagicMock, Mock, patch
from pyVmomi import vim
from datadog_checks.vsphere.legacy.vsphere_legacy import DEFAULT_MAX_HIST_METRICS
from .common import (
... |
17,616 | gen fixed cube | # Copyright (c) MONAI Consortium
# 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, so... |
17,617 | get online deployment logs | # 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 ._enu... |
17,618 | test constructor | import asyncio
from typing import Hashable
from unittest.mock import Mock
import pytest
from faust.types import TP
from tests.helpers import AsyncMock
class Test_AgentManager:
def create_agent(self, name, topic_names=None):
agent = Mock(
name=name,
maybe_start=AsyncMock(),
... |
17,619 | test repr | import pytest
import rpy2.robjects as robjects
rinterface = robjects.rinterface
import rpy2.rlike.container as rlc
import array
import csv
import os
import tempfile
def test_init_from_taggedlist():
letters = robjects.r.letters
numbers = robjects.r('1:26')
df = robjects.DataFrame(rlc.TaggedList((l... |
17,620 | get schema | """
Interface to the config_files.xml file. This class inherits from EntryID.py
"""
import re
import os
from CIME.XML.standard_module_setup import *
from CIME.XML.entry_id import EntryID
from CIME.utils import (
expect,
get_cime_root,
get_config_path,
get_schema_path,
get_model,
)
logger = loggin... |
17,621 | get reg | # coding=utf-8
import copy
import time
from flask_babel import lazy_gettext
from mycodo.inputs.base_input import AbstractInput
# Measurements
measurements_dict = {
0: {
'measurement': 'light',
'unit': 'lux'
},
1: {
'measurement': 'moisture',
'unit': 'unitless'
},
2... |
17,622 | test feature processor | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... |
17,623 | perform request | # -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Kite completions HTTP client."""
# Standard library imports
import logging
from urllib.parse import quote
# Third party imports
from qtpy.QtCore import QObject, Q... |
17,624 | get uncertainties names | # /*##########################################################################
#
# Copyright (c) 2017-2023 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 Sof... |
17,625 | export | # Copyright (c) 2016 Charles University in Prague, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2016 Tomas Machalek <tomas.machalek@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
#... |
17,626 | floor | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# Copyright (c) 2018-2023 www.open3d.org
# SPDX-License-Identifier: MIT
# ---------... |
17,627 | load arguments | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
17,628 | get stats keys | # -*- coding: utf-8 -*-
#
# 2018-06-26 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# provide first interface to handle monitoring statistics
#
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the... |
17,629 | create order | import uuid
import logging
import datetime
import collections
from enum import Enum
from typing import Union, Type
from betfairlightweight.resources.bettingresources import CurrentOrder
from ..strategy.strategy import BaseStrategy
from .order import BetfairOrder
from .ordertype import LimitOrder, LimitOnCloseOrder, Ma... |
17,630 | test fit insufficient train series length | import random
import numpy as np
import pytest
from darts.metrics import mape
from darts.models import FourTheta, Theta
from darts.utils.timeseries_generation import linear_timeseries as lt
from darts.utils.timeseries_generation import random_walk_timeseries as rt
from darts.utils.timeseries_generation import sine_ti... |
17,631 | register sub | import select
from .message import SubscriptionRequest, PubSubMessage, SubscriptionCancelation
from ..logger import get_queue_logger
import os
import logging
class PubSubBroker:
"""A Message Broker in a PubSub.
Receives all PubSubMessages from Publishers, and has to filter and forward to subscribed Subscribe... |
17,632 | check for credential file | from __future__ import print_function
import os
import urlparse
import boto
import boto.connection
import boto.jsonresponse
import boto.exception
from boto.roboto import awsqueryrequest
class NoCredentialsError(boto.exception.BotoClientError):
def __init__(self):
s = 'Unable to find credentials'
s... |
17,633 | test iterate | from __future__ import annotations
import pytest
from deezer import Album, Artist, PaginatedList
pytestmark = pytest.mark.vcr
class TestPaginatedList:
"""Tests for the PaginatedList class."""
@pytest.fixture()
def daft_punk_albums(self, client):
parent = Artist(client, {"id": 27, "type": "arti... |
17,634 | test cleanup | """Test runway.cfngin.hooks.awslambda._python_hooks."""
# pylint: disable=redefined-outer-name
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from mock import Mock
from pydantic import ValidationError
from runway.cfngin.hooks.awslambda import PythonFunction, PythonLayer
from runway... |
17,635 | migrate2manifest | # Generated by Django 3.1.1 on 2021-02-20 08:36
import glob
import itertools
import os
from re import search
from django.conf import settings
from django.db import migrations
from cvat.apps.engine.log import get_logger
from cvat.apps.engine.models import (DimensionType, StorageChoice,
... |
17,636 | error window function in group by | from testflows.core import *
from window_functions.requirements import *
from window_functions.tests.common import *
@TestScenario
def error_using_non_window_function(self):
"""Check that trying to use non window or aggregate function over a window
returns an error.
"""
exitcode = 63
message = "DB... |
17,637 | upload docker manifest prerequisites | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import os
import json
from io import BytesIO
from azure.containerregistry import ContainerRegistryClient
from azure.containerregistry._hel... |
17,638 | get slice | # 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... |
17,639 | test company id external project id empty | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import datetime
import time
from unittest.mock import Mock
import pytest
from cla.models import event_types
from cla.models.dynamo_models import Event, User, Project, Company
@pytest.fixture()
def mock_event():... |
17,640 | optimize | # SPDX-License-Identifier: Apache-2.0
"""Merge Duplicated Nodes Optimizer.
Remove duplicate nodes except identity nodes which should be handled by identity optimizer.
for example, node a is input of node b and node c, and computation of node b, c are same such as "abs" op.
then b and c can be merged into one... |
17,641 | test remove experiments by rev | import pytest
from funcy import first
from dvc.exceptions import InvalidArgumentError
from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
from dvc.repo.experiments.utils import exp_refs_by_rev
def test_remove_experiments_by_ref(tmp_dir, scm, dvc, exp_stage, caplog):
queue_length = 3
ref_info_... |
17,642 | load spark df | # Copyright (c) Recommenders contributors.
# Licensed under the MIT License.
import pandas as pd
import os
import tarfile
try:
from pyspark.sql.types import StructType, StructField, IntegerType, StringType
except ImportError:
pass # so the environment without spark doesn't break
from recommenders.datasets.... |
17,643 | get test content | #!/usr/bin/env python
# Copyright (c) 2020 Satpy developers
#
# This file is part of satpy.
#
# satpy 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 la... |
17,644 | status | # 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... |
17,645 | to str | # Copyright 2023 The KServe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
17,646 | callback func | import threading
from typing import List, MutableSequence, Optional, Tuple, Union
from unittest.mock import ANY, Mock, call
import pytest
from snuba.attribution import get_app_id
from snuba.attribution.attribution_info import AttributionInfo
from snuba.clickhouse.query import Query
from snuba.clickhouse.translators.s... |
17,647 | test cylinder shape | import pytest
# Skip these tests if we can't import bullet.
bullet = pytest.importorskip("panda3d.bullet")
from panda3d import core
def reconstruct(object):
# Create a temporary buffer, which we first write the object into, and
# subsequently read it from again.
buffer = core.DatagramBuffer()
writer... |
17,648 | create | # -*- coding: utf-8 -*-
#
# Copyright (C) 2022-2023 Graz University of Technology.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""OAI-PMH service."""
import re
from flask import current_app
from flask_sqla... |
17,649 | is set | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
17,650 | handler | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
17,651 | test hernquist angular2phys | __author__ = "sibirrer"
import numpy as np
import numpy.testing as npt
import pytest
from lenstronomy.Cosmo.lens_cosmo import LensCosmo
from lenstronomy.Util import util
class TestLensCosmo(object):
"""Tests the UnitManager class routines."""
def setup_method(self):
z_L = 0.8
z_S = 3.0
... |
17,652 | test exceptions and warnings | # Copyright (c) OpenMMLab. All rights reserved.
from unittest import TestCase
import numpy as np
from mmpose.datasets.datasets.hand import FreiHandDataset
class TestFreiHandDataset(TestCase):
def build_freihand_dataset(self, **kwargs):
cfg = dict(
ann_file='test_freihand.json',
... |
17,653 | delete instance | from __future__ import annotations
import os
from collections import defaultdict
from sentry import eventstore, eventstream, models, nodestore
from sentry.eventstore.models import Event
from sentry.models.rulefirehistory import RuleFireHistory
from ..base import BaseDeletionTask, BaseRelation, ModelDeletionTask, Mod... |
17,654 | update ref docs | import json
import os
from typing import Any, List, Literal
from llama_index.vector_stores.docarray.base import DocArrayVectorStore
class DocArrayHnswVectorStore(DocArrayVectorStore):
"""Class representing a DocArray HNSW vector store.
This class is a lightweight Document Index implementation provided by Do... |
17,655 | test prints help with full flag | #!/usr/bin/env python
#
# Copyright 2009, 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... |
17,656 | parse advisory data | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... |
17,657 | rotations circuit | from functools import lru_cache
import numpy as np
from qaml_scripts.evolution import generate_schedule
from scipy.integrate import quad
import qibo
from qibo.noise import DepolarizingError, NoiseModel
class rotational_circuit:
def __init__(self, best_p, finalT, nqubits=1, q=0):
"""
Class contai... |
17,658 | dns use | #!/usr/bin/env python
"""
Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import re
import time
from lib.core.agent import agent
from lib.core.common import Backend
from lib.core.common import calculateDeltaSeconds
from lib.core.common import dataToSt... |
17,659 | draw points | # (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... |
17,660 | test negative bin width | # The Hazard Library
# Copyright (C) 2012-2020 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... |
17,661 | demo setup | from __future__ import annotations
from subprocess import CalledProcessError
from typing import TYPE_CHECKING
import pytest
from poetry.inspection.info import PackageInfo
from poetry.inspection.info import PackageInfoError
from poetry.utils.env import EnvCommandError
from poetry.utils.env import VirtualEnv
if TYPE... |
17,662 | test get metadata | # -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2022-2023, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... |
17,663 | 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... |
17,664 | test regular gg grib2 | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Integration tests for grib2 file loading.
These tests load various files from iris-test-data, and compare the cu... |
17,665 | test veclen conversion | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import argparse
import dace
import numpy as np
from dace.fpga_testing import intel_fpga_test
SIZE = dace.symbol("N")
VECTOR_LENGTH = dace.symbol("W")
DTYPE = dace.float64
def make_copy_to_fpga_state(sdfg):
state = sdfg.add_state("copy_t... |
17,666 | num cpus | # encoding: utf-8
"""
Utilities for getting information about IPython and the system it's running in.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
... |
17,667 | prepare request | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
17,668 | split at | # helper functions for WOQLCore
import re
def METHOD_NAME(op, tokens):
results = []
stack = []
paren_depth = 0
brace_depth = 0
for token in tokens:
if token == ")":
paren_depth -= 1
stack.append(token)
elif token == "(":
paren_depth += 1
... |
17,669 | before filter | import os
import json
import pprint
import time
from numpy import base_repr
from sdkit.filter import apply_filters
from sdkit.models import load_model
from sdkit.utils import img_to_base64_str, get_image, log, save_images
from easydiffusion import model_manager, runtime
from easydiffusion.types import (
FilterIm... |
17,670 | new era | #!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
"""
gp_era.py, based on gp_dbid.py
Copyright (c) EMC/Greenplum Inc 2011. All Rights Reserved.
"""
import sys, os, stat, re
import hashlib
ERA_RE = re.compile(r"era\s*=\s*(\w+)")
def INFO(msg):
self = sys._... |
17,671 | calculate image empirical pdf | import numpy as np
import pytest
from numpy.testing import (assert_almost_equal, assert_array_almost_equal)
from skimage import data
from skimage import exposure
from skimage._shared.utils import _supported_float_type
from skimage.exposure import histogram_matching
@pytest.mark.parametrize('array, template, expected... |
17,672 | test branin2 | #
# Copyright (C) 2019, 2020, 2021 Smithsonian Astrophysical Observatory
#
#
# 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 late... |
17,673 | test single arg dict | from typing import Dict
from django.test import override_settings
from django_q.models import Schedule
from akvo.rsr.tests.base import BaseTestCase
from akvo.rsr.usecases.django_q.schedules import (
ScheduleSerializer, calc_sync, get_setting_schedules,
sync_with_settings,
)
@override_settings(AKVO_JOBS={})
... |
17,674 | make layer | '''Pre-activation ResNet in PyTorch.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Identity Mappings in Deep Residual Networks. arXiv:1603.05027
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class PreActBlock(nn.Module):
'''Pre-activation version of the BasicBlock.... |
17,675 | test load config error | from os import environ
from pathlib import Path
from typing import List, Union
from unittest import mock
from pydantic import AnyHttpUrl, BaseModel, Field
from pytest import mark, raises
from typing_extensions import Annotated
from libretime_shared.config import (
BaseConfig,
DatabaseConfig,
IcecastOutput... |
17,676 | configure subsystems | """
Test suite that verifies the deployment of Ceph NVMeoF Gateway
with supported entities like subsystems , etc.,
"""
import json
import paramiko
from ceph.ceph import Ceph
from ceph.ceph_admin import CephAdmin
from ceph.nvmeof.gateway import Gateway, configure_spdk, fetch_gateway_log
from ceph.utils import get_no... |
17,677 | list users | # Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
17,678 | cluster id | # -*- 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... |
17,679 | get basic timestamp embeddings | import torch
from .models.passt import get_model as get_model_passt
from .models.preprocess import AugmentMelSTFT
from .wrapper import PasstBasicWrapper
def load_model(model_path=""):
model = get_concat_2levelmel_model()
if torch.cuda.is_available():
model.cuda()
return model
def get_scene_embe... |
17,680 | get boost factor | """
Provides functions to temporary boost autoscaler results
Useful during big service bounce or failovers to preemptively increase capacity.
This works by setting a temporary multiplier on the initial measured load.
The resulting increased capacity is guaranteed until the end of the boost.
If usage gets higher the po... |
17,681 | test backend no custom attributes | import pytest
import pyhf
import numpy as np
import pathlib
@pytest.fixture(scope='function')
def model_setup(backend):
np.random.seed(0)
n_bins = 100
model = pyhf.simplemodels.uncorrelated_background(
[10] * n_bins, [50] * n_bins, [1] * n_bins
)
init_pars = model.config.suggested_init()
... |
17,682 | loop3 | import unittest
import sys
import numpy
from numba.core.compiler import compile_isolated
from numba import jit, njit
from numba.core import types, utils
from numba.tests.support import tag
from numba.cpython.rangeobj import length_of_iterator
def loop1(n):
s = 0
for i in range(n):
s += i
return ... |
17,683 | reduction loop only 0 | # 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... |
17,684 | test experiment chunk split | # 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.
# pylint: disable=wrong-import-position, wrong-import-order
from .__main__ import repeated_launch
import sys
import warnings
import tempfile... |
17,685 | directory browser closed | from Components.FileList import FileList
from Components.Sources.StaticText import StaticText
from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigText, ConfigYesNo, ConfigDirectory
from Components.ConfigList import ConfigListScreen
from Components.ActionMap import ActionMap
from Components... |
17,686 | test auto sched cycle trigger | # coding: utf-8
# Copyright (C) 1994-2021 Altair Engineering, Inc.
# For more information, contact Altair at www.altair.com.
#
# This file is part of both the OpenPBS software ("OpenPBS")
# and the PBS Professional ("PBS Pro") software.
#
# Open Source License Information:
#
# OpenPBS is free software. You can redistr... |
17,687 | test trailing digits | from django.test import TestCase
from nautobot.dcim import models
from nautobot.extras import models as extras_models
class NaturalOrderByManagerTest(TestCase):
"""
Ensure consistent natural ordering given myriad sample data. We use dcim.Rack as our guinea pig because it's simple.
"""
def setUp(self... |
17,688 | get readers |
import zipfile
from zipfile import ZipFile
import io
import json
from tempfile import TemporaryDirectory
from tempfile import NamedTemporaryFile
import struct
import os
import os.path
from jamovi.core import DataType
from jamovi.core import MeasureType
def METHOD_NAME():
return [ ( 'jasp', read ) ]
def write(... |
17,689 | setup | # Copyright 2023 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
17,690 | update | #!/usr/bin/python3
#
# SYNOPSIS
# --------
# server:
# ./test.py -s -l XPRT:HOST:PORT
# client:
# ./test.py -c XPRT:HOST:PORT
#
# DESCRIPTIONS
# ------------
# Immediately update after lookup completed.
import os
import io
import pdb
import sys
import time
import socket
import logging
import argparse as ap
import ... |
17,691 | remove environment | """
Usage::
hammer location [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
add-compute-resource Associate a compute resource
add-domain Associate a domain
add-e... |
17,692 | convolve point sampled | import numba
@numba.njit(cache=True)
def METHOD_NAME(Nin, xin, yin, Np, xp, yp, xo, dx, _in):
# Walk the theory spline and the resolution spline together, computing
# the integral of the pairs of line segments. Since the spline knots
# do not necessarily correspond, we need to treat each individual segme... |
17,693 | test bad import | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
17,694 | read run id | import json
import logging
import os
from abc import ABC, abstractmethod
import mlflow
from mlflow.recipes.utils.execution import get_step_output_path
from mlflow.tracking import MlflowClient
from mlflow.tracking._tracking_service.utils import _use_tracking_uri
from mlflow.utils.file_utils import chdir
_logger = logg... |
17,695 | dac | import json
import numpy
import pytest
from qcodes.dataset.measurements import Measurement
from qcodes.parameters import ManualParameter
from qcodes.station import Station
from qcodes.tests.instrument_mocks import DummyInstrument
@pytest.fixture # scope is "function" per default
def METHOD_NAME():
METHOD_NAME ... |
17,696 | register external rich text link | # RichTextEditor customization:
# See https://docs.wagtail.io/en/v2.7/advanced_topics/customisation/extending_draftail.html
# And https://medium.com/@timlwhite/custom-in-line-styles-with-draftail-939201c2bbda
from django.core.cache import cache
# The real code runs "instance.sync_trees()" here, but we want this t... |
17,697 | housing | from copy import deepcopy
import os
from typing import cast
import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
import pytest
from statsmodels.tools.tools import add_constant
from linearmodels.iv import IV2SLS, IVGMM, IVLIML
from linearmodels.tests.iv.results.read_stata_results import pro... |
17,698 | test pow peer counts | #!/usr/bin/env python3
# encoding: utf-8
import unittest as ut
from SEEDBlockchain import Wallet
from web3 import Web3
from seedemu import *
class MultipleChainsTestCase(ut.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.wallet1 = Wallet(chain_id=1337)
cls.wallet2 = Wallet(chain_id=13... |
17,699 | disable all plugins | # Released under the MIT License. See LICENSE for details.
#
"""Plugin Settings UI."""
from __future__ import annotations
import bauiv1 as bui
from bauiv1lib.confirm import ConfirmWindow
class PluginSettingsWindow(bui.Window):
"""Plugin Settings Window"""
def __init__(self, transition: str = 'in_right'):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.