id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
10,800
clear dmesg
# This program is free software; you can redistribute it and/or modify. # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # b...
10,801
test logout file missing
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2022 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 hope...
10,802
provisioning state
# 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__ =...
10,803
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 # --------------------------------...
10,804
export sources
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm i...
10,805
get audio info
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
10,806
add slack and lines to boundary nodes
# -*- coding: utf-8 -*- # Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. from typing import Union, Dict, List import pandas as pd import pandapower.auxiliary import pandapower as pp import logging import t...
10,807
test get property from dss string
# -*- coding: utf-8 -*- """ test_opendss_writer ---------------------------------- Tests for writing functions of the OpenDSS writer """ import logging import os import six import tempfile import pytest import pytest as pt logger = logging.getLogger(__name__) def test_parse_wire(): from ditto.store import St...
10,808
test update task states
import os import time from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import TaskDataEnvironment from SpiffWorkflow.bpmn.serializer.migration.exceptions import VersionMigrationError from .BaseTestCase i...
10,809
main
import numpy as np import logging import adios2 if __name__ == '__main__': __spec__ = None def METHOD_NAME(): print("====================================") format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S") wri...
10,810
test host with with unprintable ascii rejected
""" Helpers for URI and method injection tests. @see: U{CVE-2019-12387} """ import string UNPRINTABLE_ASCII = frozenset(range(0, 128)) - frozenset( bytearray(string.printable, "ascii") ) NONASCII = frozenset(range(128, 256)) class MethodInjectionTestsMixin: """ A mixin that runs HTTP method injection ...
10,811
gathering responses
import json import logging import re import sentry_sdk from os import getenv from typing import Any import common.dff.integration.context as int_ctx import common.dff.integration.response as int_rsp from common.constants import CAN_NOT_CONTINUE from common.prompts import send_request_to_prompted_generative_service, co...
10,812
delete files and dir
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
10,813
sort widgets
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from typing import ( Any, Dict, Iterable, List, Tuple, ) from databuilder.rest_api.rest_api_query import RestApiQuery class DatabricksSQLVisualizationWidget: """ A visualization widget in a Databricks SQL dashboard. ...
10,814
test adds new field permission
import pytest from cumulusci.core.exceptions import TaskOptionsError from cumulusci.tasks.metadata_etl import AddPermissionSetPermissions from cumulusci.tasks.salesforce.tests.util import create_task from cumulusci.utils.xml import metadata_tree MD = "{%s}" % metadata_tree.METADATA_NAMESPACE PERMSET_XML = b"""<?xml ...
10,815
test add text
from django.test import TestCase from cantusdata.helpers import expandr from itertools import combinations class ExpandrFunctionsTestCase(TestCase): def test_expand_mode(self): # Number and symbol ordering is important numbers = [1, 2, 3, 4, 5, 6, 7, 8] symbol_keys = ["*", "r", "?", "S", "...
10,816
provisioning state
# 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...
10,817
cache
from datetime import datetime, timedelta, timezone from json import JSONDecodeError from pathlib import Path from typing import Type, Union from unittest.mock import Mock, patch import freezegun import pytest from streamlink.METHOD_NAME import Cache @pytest.fixture(autouse=True) def cache_dir(tmp_path: Path): w...
10,818
get avg pool
#!/usr/bin/env python3 -u # 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. """ Translate pre-processed data with a trained model. """ import numpy as np import torch from fairseq import check...
10,819
get code context
from _typeshed import Incomplete from win32com.server.util import ListEnumeratorGateway class EnumDebugCodeContexts(ListEnumeratorGateway): ... class EnumDebugStackFrames(ListEnumeratorGateway): ... class EnumDebugApplicationNodes(ListEnumeratorGateway): ... class EnumRemoteDebugApplications(ListEnumeratorGateway): ....
10,820
test ambient alpha
# (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...
10,821
callbacks default
"""A basic kernel monitor with autorestarting. This watches a kernel's state using KernelManager.is_alive and auto restarts the kernel if it dies. It is an incomplete base class, and must be subclassed. """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import tim...
10,822
test get domain
from contextlib import contextmanager from unittest.mock import patch from django.conf import settings from django.contrib.auth.models import User from django.test import RequestFactory from django.test.utils import override_settings from testil import Config, eq import corehq.apps.auditcare.models as mod from corehq...
10,823
test negative minutes
# These tests are auto-generated with test data from: # https://github.com/exercism/problem-specifications/tree/main/exercises/clock/canonical-data.json # File last updated on 2023-07-20 import unittest from clock import ( Clock, ) class ClockTest(unittest.TestCase): # Create A String Representation def...
10,824
main
#!/usr/bin/env python3 """ Modul zum Auslesen von sonnenBatterie Speichern. """ import logging from typing import Dict, Union, Optional, List from dataclass_utils import dataclass_from_dict from helpermodules.cli import run_using_positional_cli_args from modules.common.abstract_device import AbstractDevice, DeviceDesc...
10,825
velocity point test function
# ISC License # # Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copie...
10,826
switch units
#!/usr/bin/env python3 # qtvcp # # Copyright (c) 2017 Chris Morley <chrisinnanaimo@hotmail.com> # # 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 ...
10,827
relay
import requests import dateutil.parser from datetime import datetime from dateutil.tz import tzutc from flask import Flask, jsonify, abort class Oracle: def __init__(self, baseUrl, token) -> None: self.baseUrl = baseUrl self.token = token def _composableExchangeRateSubquery(self): ret...
10,828
evaluate
""" Central difference approximation algorithms Author:--gairabhi """ import copy from ...utils import mathUtils from .GradientApproximator import GradientApproximator class CentralDifference(GradientApproximator): """ Enables gradient estimation via central differencing """ @classmethod def getInputS...
10,829
main
#!/usr/bin/env python3 ''' This script reads a GFF3 file and FASTA file (or FASTA embedded in the GFF) and checks the ends of CDS features for start/stop codons. This is splice-aware, and works for prokaryotic or eukaryotic models. Example input gene model: AAGK01000001 . gene 128156 128682 . -...
10,830
one
from collections import defaultdict from datetime import timedelta from ichnaea.data.tasks import cleanup_datamap, update_datamap from ichnaea.models.content import DataMap, encode_datamap_grid from ichnaea import util class TestDataMapCleaner(object): @property def today(self): return util.utcnow()....
10,831
get jobs for user
from typing import List, Optional, Type from django.conf import settings from django.contrib.auth.models import AbstractUser from django.core.cache import cache from django.db import transaction from django.db.models import Q, QuerySet from django.utils import timezone from baserow.core.utils import Progress from .c...
10,832
fundamentals
# piker: trading gear for hackers # Copyright (C) 2018-present Tyler Goodlet (in stewardship of piker0) # 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, ...
10,833
validate
""" An API for defining and creating substances. """ import abc import math import typing import numpy as np from openff.evaluator.attributes import UNDEFINED, Attribute, AttributeClass class Amount(AttributeClass, abc.ABC): """A representation of the amount of a given component in a `Substance`. """ ...
10,834
get processor info
# Name: MandelbrotNumpy # ******************************************************************************** # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2023 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted...
10,835
get default filter criterion
# This code is part of a Qiskit project. # # (C) Copyright IBM 2021, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications ...
10,836
get urls
from modeltranslation.admin import ( TranslationAdmin as O_TranslationAdmin, TranslationInlineModelAdmin as O_TranslationInlineModelAdmin, ) from modeltranslation.utils import build_localized_fieldname from modeltranslation.translator import translator from modeltranslation.manager import ( MultilingualQuer...
10,837
process subset
import argparse import os import shutil import librosa import miditoolkit import numpy as np from espnet2.fileio.score_scp import SingingScoreWriter """Generate segments according to structured annotation.""" """Transfer music score into 'score' format.""" def makedir(data_url): if os.path.exists(data_url): ...
10,838
test invalid input shape
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
10,839
test ugates cirq
"""Tests executing Qibo circuits created from OpenQASM code.""" import cirq import numpy as np import pytest from cirq.contrib.qasm_import import circuit_from_qasm, exception from qibo import Circuit, gates # Absolute testing tolerance for cirq-qibo comparison _atol = 1e-7 def test_from_qasm_simple(backend, acceler...
10,840
force clear
# Copyright 2021 Hathor Labs # # 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, s...
10,841
is healthy
import numpy as np from gymnasium import utils from gymnasium.envs.mujoco import MuJocoPyEnv from gymnasium.spaces import Box DEFAULT_CAMERA_CONFIG = { "trackbodyid": 2, "distance": 4.0, "lookat": np.array((0.0, 0.0, 1.15)), "elevation": -20.0, } class Walker2dEnv(MuJocoPyEnv, utils.EzPickle): ...
10,842
random
try: from charm.core.math.elliptic_curve import elliptic_curve,ec_element,ZR,G,init,METHOD_NAME,order,getGenerator,bitsize,serialize,deserialize,hashEC,encode,decode,getXY import charm.core.math.elliptic_curve as ecc except Exception as err: print(err) exit(-1) class ECGroup(): def __init__(self, built...
10,843
check request and op
"""Tests for the CheckMigration Operation""" import functools import pytest from unittest.mock import MagicMock from DIRAC import S_OK from DIRAC.RequestManagementSystem.Client.File import File from DIRAC.RequestManagementSystem.Client.Operation import Operation from DIRAC.RequestManagementSystem.Client.Request impor...
10,844
label names
# Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is # licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
10,845
validate interfaces
import pytest import pandas as pd from tests.conftest import DATADIR, validate_host_shape, _get_table_data from tests.integration.utils import validate_vrfs def _validate_estd_ospf_data(df: pd.DataFrame): '''Validate data for those sessions that are in neighbor output''' valid_bools = [False, True] ass...
10,846
verify request
# Copyright (c) 2008, Thomas Hurst <tom@hur.st> # # Use of this file is unrestricted provided this notice is retained. # If you use it, it'd be nice if you dropped me a note. Also beer. from terminatorlib.util import dbg, err from terminatorlib.version import APP_NAME, APP_VERSION import socket import threading impo...
10,847
remove
################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # #############################################################################...
10,848
get offset
from collections import OrderedDict from rest_framework.response import Response from rest_framework.pagination import BasePagination from django.template import loader from rest_framework.utils.urls import replace_query_param class UsaspendingPagination(BasePagination): # The default page size page_size = 1...
10,849
test no permissions given fails
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2016, 2020 CERN. # # CERN Analysis Preservation Framework 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; ...
10,850
get focus widget
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Main widget to use in plugins that show content that comes from the IPython console, such as the Variable Explorer or Plots. """ # Third party imports from qtpy....
10,851
tear down
import unittest from test import support from test.support import warnings_helper import os import sys import types try: import _multiprocessing except ModuleNotFoundError: _multiprocessing = None if support.check_sanitizer(address=True, memory=True): # bpo-46633: test___all__ is skipped because importin...
10,852
setup network
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test gettxoutproof and verifytxoutproof RPCs.""" from test_framework.messages import CMerkleBlock, Fro...
10,853
read file
# Copyright © 2022 BAAI. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") import sys sys.path.append('/share/project/liuguang/flagai-internal') import torch import os from torch.utils.data import Dataset from flagai.auto_model.auto_loader import AutoLoader from flagai.trainer impo...
10,854
xmlrpc get package qvendor
#!/usr/bin/python # -*- coding: utf-8; -*- # # (c) 2007-2008 Mandriva, http://www.mandriva.com/ # # $Id$ # # This file is part of Pulse 2, http://pulse2.mandriva.org # # Pulse 2 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 Soft...
10,855
is block
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from torch.nn.modules import GroupNorm from torch.nn.modules.batchnorm import _BatchNorm from mmpose.models.backbones import ShuffleNetV2 from mmpose.models.backbones.shufflenet_v2 import InvertedResidual class TestShufflenet...
10,856
assert path ok
from PYME.IO.FileUtils import nameUtils import os import sys from io import BytesIO from contextlib import contextmanager import tempfile import re try: # py3 from urllib.parse import quote, urlencode except ImportError: # py2 from urllib import quote, urlencode import logging logger = logging.getLogger(__nam...
10,857
do commands
import signal import sys from bdb import Bdb from cmd import Cmd from collections.abc import Callable, Iterable, Mapping, Sequence from inspect import _SourceObjectType from types import CodeType, FrameType, TracebackType from typing import IO, Any, ClassVar, TypeVar from typing_extensions import ParamSpec, Self __all...
10,858
save object image crops
import os import numpy import skimage def METHOD_NAME( input_image, input_objects, save_dir, file_format="tiff8", nested_save=False, save_names = {"input_filename": None, "input_objects_name": None}, volumetric=False ): """ For a given input_objects array, save crops for each ...
10,859
test ckpt inputs2 outputs2
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team # TODO: add tests with model parallelism for activation partitioning and other features. import pytest import torch import deepspeed from deepspeed.accelerator import get_accelerator from copy import deepcopy from unit.comm...
10,860
test can drop cache tables
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -*- coding: utf-8 -*- """ Test for the database roles. The database has three different roles: * `flowdb`: datab...
10,861
state
__all__ = ("choice_point",) from snakeoil import klass from snakeoil.sequences import iter_stable_unique class choice_point: __slots__ = ( "__weakref__", "atom", "matches", "matches_cur", "solution_filters", "_prdeps", "_rdeps", "_deps", "_b...
10,862
compare
from typing import Optional import geohash as gh import pandas as pd from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import PandasExecutionEngine from great_expectations.expectations.expectation import ( ColumnPairMapExpectation, ...
10,863
show
#!/usr/bin/env python r""" RangeRangeRateBinning measurement model example =============================================== :class:`~.RangeRangeRateBinning` is a Cartesian to spherical measurement model. It takes a 6D state of position and velocity in 3D Cartesian space and produces a 4D state of elevation (:math:`\the...
10,864
test dataset from sql keep in memory
import contextlib import os import sqlite3 import pytest from datasets import Dataset, Features, Value from datasets.io.sql import SqlDatasetReader, SqlDatasetWriter from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases, require_sqlalchemy def _check_sql_dataset(dataset, expected_f...
10,865
test func with artifact io
# Copyright 2022 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...
10,866
customise ppmc
import FWCore.ParameterSet.Config as cms def customiseCommon(process): ##################################################################################################### #### #### Top level replaces for handling strange scenarios of early collisions #### ## TRACKING: process.newSeedFr...
10,867
delete
from __future__ import annotations import math import uuid from typing import TYPE_CHECKING, Any, List, Optional, Union if TYPE_CHECKING: from .scene import Scene, SceneObject class Object3D: current_scene: Optional[Scene] = None def __init__(self, type_: str, *args: Any) -> None: self.type = t...
10,868
test supported features
from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode from homeassistant.components.number.const import NumberDeviceClass from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass from homeassistant.const import UnitOfEnergy, UnitOfTemperature from ..const impor...
10,869
is status error
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging import time from datetime import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from django.dispatch import receiver import json f...
10,870
cf restorable mongodb collections
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
10,871
test bucket uncomply policy
from re import search from unittest import mock from boto3 import client, session from moto import mock_s3 from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info from prowler.providers.common.models import Audit_Metadata AWS_ACCOUNT_NUMBER = "123456789012" AWS_ACCOUNT_ARN = f"arn:aws:iam::{AWS_ACCOUN...
10,872
pre 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 # --------------------------------...
10,873
test file
from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import call_module class TestRSeries(TestCase): average = "average" count = "count" median = "median" sum_ = "sum" sum_mapcalc = "sum_mapcalc" elevation = "elevation" @classmethod...
10,874
sure thresh
''' author: im354 ''' from __future__ import division from builtins import zip from builtins import range from past.utils import old_div import numpy as np import matplotlib.pyplot as plt import pywt from scipy.optimize import minimize_scalar def blocks(): N = 2048 t = np.linspace(0,1,N) Tj = [0.1,0.13,0.15,0.23...
10,875
get temp total chunk on cuda
from collections import OrderedDict from copy import copy from typing import Optional, Set import torch import torch.distributed as dist import torch.nn as nn from colossalai.utils import get_current_device from .chunk import Chunk def METHOD_NAME(chunk: Chunk): if chunk.is_gathered: return chunk.cuda_...
10,876
set include file
## @file # This file is used to define a class object to describe a package # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent ''' PackageObject ''' ## # Import Modules # from Object.POM.CommonObject import CommonPropertiesObject from Object.POM...
10,877
initialize job
# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import logging import os import pathlib from typing import Callable import click import requests from tabulate import tabulate from trino.exceptions import TrinoUserError from vdk.api.lineage.model.logger.lineage_logger import ILineageLogger from...
10,878
request
"""Module provider for Infomaniak""" import json import logging from argparse import ArgumentParser from typing import List import requests from lexicon.exceptions import AuthenticationError from lexicon.interfaces import Provider as BaseProvider LOGGER = logging.getLogger(__name__) ENDPOINT = "https://api.infomani...
10,879
create schema for validation
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # pylint: disable=protected-access from os import PathLike from pathlib import Path from typing import Dict, Optional, Union from azure.ai....
10,880
remove project collaborator
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT class CollaboratorApi: def __init__(self, client, base_path = "/v1"): self.client = client self.base_path = base_path def addOrUpdateDatasetCollaborator(self, body=None): __query = { } if body is None: raise Exception("Missing required parameter...
10,881
rodrigues axis angle rotate
# Third-party from astropy.utils.misc import isiterable import numpy as np # Gala from gala.dynamics import Orbit from gala.units import DimensionlessUnitSystem __all__ = ['static_to_constantrotating', 'constantrotating_to_static'] def METHOD_NAME(x, vec, theta): """ Rotated the input vector or set of vecto...
10,882
test can launch
# pylint: disable=protected-access, unused-argument, no-value-for-parameter import os from unittest import mock, TestCase from .test_common import setUp from radical.pilot.agent.launch_method.srun import MIN_NNODES_IN_LIST from radical.pilot.agent.launch_method.srun import MIN_VSLURM_IN_LIST from radical.pilot.agent...
10,883
handle stop
import numpy from lona.html import NumberInput, Button, CLICK, Span, HTML, Div, H1 from lona import LonaView, LonaApp app = LonaApp(__file__) app.add_static_file('lona/style.css', """ body { font-family: sans-serif; } input[type=number] { width: 4em; } button#resize { ma...
10,884
retry if cuda oom
import logging from contextlib import contextmanager from functools import wraps import torch from mmcv.cnn.bricks.wrappers import obsolete_torch_version from torch.nn import functional as F TORCH_VERSION = tuple(int(x) for x in torch.__version__.split('.')[:2]) def is_lower_torch_version(version=(1, 10)): """C...
10,885
entity type
import uuid import copy from abc import ABCMeta, abstractmethod, abstractproperty import six REMOVED_VALUE = object() @six.add_metaclass(ABCMeta) class AbstractOperation(object): """Base operation class. Operation represent a call into database. The call can create, change or remove data. Args: ...
10,886
test sieve bed
import deeptools.estimateReadFiltering as est import deeptools.alignmentSieve as sieve import os.path from os import unlink import hashlib import pysam ROOT = os.path.dirname(os.path.abspath(__file__)) + "/test_data/" BAMFILE_FILTER = ROOT + "test_filtering.bam" BEDFILE_FILTER = ROOT + "test_filtering.blacklist.bed" ...
10,887
delete cached account
import bcrypt from kinto.core import utils ACCOUNT_CACHE_KEY = "accounts:{}:verified" ACCOUNT_POLICY_NAME = "account" ACCOUNT_RESET_PASSWORD_CACHE_KEY = "accounts:{}:reset-password" ACCOUNT_VALIDATION_CACHE_KEY = "accounts:{}:validation-key" DEFAULT_RESET_PASSWORD_CACHE_TTL_SECONDS = 7 * 24 * 60 * 60 DEFAULT_VALIDATI...
10,888
test save files descriptions
""" Test that the student can save a files descriptions. """ import json from unittest import mock from .base import XBlockHandlerTestCase, scenario class SaveFilesDescriptionsTest(XBlockHandlerTestCase): """ Group of tests to check ability to save files descriptions """ @scenario('data/save_scen...
10,889
test build libraries
"""Tests for distutils.command.build_clib.""" import unittest import os import sys from test.support import run_unittest, missing_compiler_executable from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support from distutils.spawn import fin...
10,890
url parameters
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
10,891
test valid config instance from env variables
# coding: utf-8 # Copyright (c) 2001-2022, Hove and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # powered by Hove (www.hove.com). # Help us simplify mobility and open public transport: # a non ending quest to the respo...
10,892
test cli comma separated float
# Copyright 2022 Planet Labs, PBC. # # 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...
10,893
is new existing path
#!/usr/bin/env python ## # Copyright 2016-2023 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish ...
10,894
table
# Licensed under a 3-clause BSD style license - see LICENSE.rst import collections from collections import OrderedDict from operator import index as operator_index import numpy as np class Row: """A class to represent one row of a Table object. A Row object is returned when a Table object is indexed with a...
10,895
from config
from typing import Optional import numpy as np import pytest from numcodecs.abc import Codec from numcodecs.compat import ensure_contiguous_ndarray_like from numcodecs.registry import get_codec, register_codec import zarr.codecs from zarr.core import Array from zarr.creation import array, empty, full, ones, open_arra...
10,896
from bytes
# =================================================================== # # Copyright (c) 2018, Helder Eijs <helderijs@gmail.com> # 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. Redistribut...
10,897
do finalize
# # This file is part of LiteX-Boards. # # Copyright (c) 2018-2019 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.xilinx import Xilinx7SeriesPlatform, VivadoProgrammer from litex.build.openocd import OpenOCD # IOs ------...
10,898
setup tacs problems
import os import numpy as np from pytacs_analysis_base_test import PyTACSTestCase from tacs import pytacs, elements, constitutive, functions """ The nominal case is a 1m x 1m flat plate under three load cases: a 10 kN point force at center, a 100kPa pressure applied to the surface, and a 100G gravity load. The perim...
10,899
test orthogonal procrustes ndim too large
from itertools import product, permutations import numpy as np from numpy.testing import assert_array_less, assert_allclose from pytest import raises as assert_raises from scipy.linalg import inv, eigh, norm from scipy.linalg import orthogonal_procrustes from scipy.sparse.sputils import matrix def METHOD_NAME(): ...