id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
14,000
test ebas nasa ames file update
import sys import numpy as np import pytest from pyaerocom.io.ebas_nasa_ames import EbasColDef, EbasFlagCol, EbasNasaAmesFile, NasaAmesHeader from tests.fixtures.ebas import loaded_nasa_ames_example as filedata @pytest.fixture(scope="module") def head(): return NasaAmesHeader def test_EbasFlagCol(): fc = ...
14,001
create spoofs
import yaml from mil_misc_tools.text_effects import fprint from nav_missions_lib import MissionPlanner from navigator_msgs.msg import PerceptionObject, PerceptionObjectArray from navigator_msgs.srv import ObjectDBQuery, ObjectDBQueryResponse from navigator_test_lib import SpoofGenerator, TestUnit class MissionPlanner...
14,002
storage type
# Copyright 2023 Avaiga Private Limited # # 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 ...
14,003
test include cache not cached dir accessible
# Copyright (C) 2017 Davit Samvelyan davitsamvelyan@gmail.com # Synopsys. # 2021 ycmd contributors # # This file is part of ycmd. # # ycmd 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 F...
14,004
related fields
# Stubs for django.db.models.fields.related (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any from . import Field from django.utils.translation import ugettext_lazy as _ from .related_descriptors import ForwardManyToOneDescriptor as ForwardManyToOneDescri...
14,005
source
from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy, rmdir, save from conan.tools.scm import Version import os import textwrap required_conan_version = ">=1.53.0" class AwsCAuth(ConanFile): name = "aws-c-auth" descr...
14,006
test malformed parse error
import json, requests from cryptoadvance.specter.devices.ledger import Ledger from cryptoadvance.specter.devices.trezor import Trezor def METHOD_NAME(client): client.environ_base["HTTP_ORIGIN"] = "http://127.0.0.1:25441/" req = client.post("http://127.0.0.1:25441/hwi/api/", data=b"{'muh':'meh'}") assert {...
14,007
test suggest correct algo endpoint
from typing import Generator import pytest from graphdatascience import GraphDataScience from graphdatascience.query_runner.neo4j_query_runner import Neo4jQueryRunner GRAPH_NAME = "g" @pytest.fixture(autouse=True) def run_around_tests(runner: Neo4jQueryRunner) -> Generator[None, None, None]: # Runs before each...
14,008
split iri
# https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/util.py from __future__ import annotations import pathlib from typing import IO, TYPE_CHECKING, Any, Optional, TextIO, Tuple, Union if TYPE_CHECKING: import json else: try: import json assert json # workaround f...
14,009
test when caller admin 200
# 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...
14,010
optimise using correlation
import scipy.stats as stats import pandas as pd import numpy as np from sysquant.estimators.correlations import boring_corr_matrix_values from sysquant.optimisation.shared import ( sigma_from_corr_and_std, optimise_from_sigma_and_mean_list, ) def adjust_dataframe_of_weights_for_SR_costs( weights: pd.Data...
14,011
load zcml
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
14,012
create repository
# Copyright The Linux Foundation and each contributor to CommunityBridge. # SPDX-License-Identifier: MIT """ Controller related to repository operations. """ import uuid import cla.hug_types from cla.utils import get_repository_instance, get_supported_repository_providers from cla.models.dynamo_models import Project,...
14,013
fields container a
""" component_wise_divide_fc ======================== Autogenerated DPF operator classes. """ from warnings import warn from ansys.dpf.core.dpf_operator import Operator from ansys.dpf.core.inputs import Input, _Inputs from ansys.dpf.core.outputs import Output, _Outputs from ansys.dpf.core.operators.specification import...
14,014
test cochlea
"""Tests for cochlea module""" import numpy as np import pytest from clarity.evaluator.msbg.cochlea import ( Cochlea, FilterBank, compute_envelope, compute_recruitment_parameters, gammatone_filterbank, recruitment, ) from clarity.utils.audiogram import Audiogram def test_filterbank(): ""...
14,015
needs reboot
""" Manage Linux kernel packages on YUM-based systems """ import functools import logging import salt.modules.yumpkg import salt.utils.data import salt.utils.functools import salt.utils.systemd from salt.exceptions import CommandExecutionError from salt.utils.versions import LooseVersion log = logging.getLogger(__na...
14,016
get mfd
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2023 GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # License a...
14,017
json
from asgiref.sync import async_to_sync from urllib.parse import urlencode import METHOD_NAME # These wrapper classes pre-date the introduction of # datasette.client and httpx to Datasette. They could # be removed if the Datasette tests are modified to # call datasette.client directly. class TestResponse: def __i...
14,018
get pull request files
"""Various GitHub API tools. Based on the gh_api.py library in the IPython repo.""" import requests import json import sys import getpass try: import requests_cache except ImportError: print("no cache", file=sys.stderr) else: requests_cache.install_cache("gh_api", expire_after=3600) # Keyring stores pass...
14,019
is url scheme registered windows
import os import pathlib import subprocess import sys from PySide6.QtCore import QSettings from angrmanagement.utils.env import app_path class AngrUrlScheme: URL_SCHEME = "angr" WIN_REG_PATH = "HKEY_CURRENT_USER\\Software\\Classes\\{}" """ Registers and handlers URL schemes to the operating system....
14,020
layout
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, ...
14,021
make quantizer fn
# Copyright 2019 Xilinx Inc. # # 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, ...
14,022
test stratified splitter
# Copyright (c) Recommenders contributors. # Licensed under the MIT License. import numpy as np import pandas as pd import pytest from recommenders.utils.constants import ( DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL, ) try: from recommenders.datasets.split_utils ...
14,023
test delete public metadata for item without
import base64 import graphene from .....core.error_codes import MetadataErrorCode from .....core.models import ModelWithMetadata from ....tests.utils import get_graphql_content from . import PUBLIC_KEY, PUBLIC_KEY2, PUBLIC_VALUE, PUBLIC_VALUE2 from .test_update_metadata import item_contains_proper_public_metadata DE...
14,024
is nonlocal
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) import weakref __all__ = ["symtable", "SymbolTa...
14,025
get artifact
from gettext import gettext as _ from django.conf import settings from drf_spectacular.utils import extend_schema_field from drf_spectacular.types import OpenApiTypes from rest_framework.reverse import reverse from rest_framework import serializers from pulpcore.plugin.models import Artifact from pulp_ansible.app.mod...
14,026
handle match
# ContentDB # Copyright (C) rubenwardy # # 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. # # This program is dist...
14,027
user id
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-variable import asyncio from typing import Final from unittest.mock import MagicMock import pytest from attr import dataclass from faker import Faker from fastapi import FastAPI from models_library.users import UserID fr...
14,028
create gmail account
from django.conf import settings from django.utils import timezone from django.utils.crypto import get_random_string from googleapiclient.discovery import build from googleapiclient.errors import HttpError from httplib2 import Http from oauth2client.service_account import ServiceAccountCredentials from core.models imp...
14,029
multi glob
""" Sandbox functions used in the job wrapper script on the worker node. The text of this module is sourced into the job wrapper script. It therefore may use ###TAGS### which are expanded in the wrapper script. """ INPUT_TARBALL_NAME = '_input_sandbox.tgz' OUTPUT_TARBALL_NAME = '_output_sandbox.tgz' PYTHON_DIR = '_py...
14,030
test 4d data compute
# -*- coding: utf-8 -*- # Copyright 2016-2023 The pyXem developers # # This file is part of pyXem. # # pyXem 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 optio...
14,031
open
# 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 applic...
14,032
add file
# Copyright 2021 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, ...
14,033
build model
# 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. import os from typing import Any, Dict from fairseq import checkpoint_utils from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDict...
14,034
from addr
""" A simple library for managing the availability of ports. """ import time import socket import argparse import sys import itertools import contextlib import platform from collections import abc import urllib.parse from tempora import timing def client_host(server_host): """ Return the host on which a cli...
14,035
reset
import sys from _typeshed import ProfileFunction, TraceFunction from collections.abc import Callable, Iterable, Mapping from types import TracebackType from typing import Any, TypeVar _T = TypeVar("_T") __all__ = [ "get_ident", "active_count", "Condition", "current_thread", "enumerate", "main_...
14,036
setup location types
from collections import namedtuple from django.test import TestCase from corehq.apps.commtrack.tests.util import bootstrap_domain from corehq.apps.users.models import HqPermissions, UserRole from corehq.util.test_utils import unit_testing_only from ..models import LocationType, SQLLocation, make_location TEST_DOMAI...
14,037
setup
# flet_gallery_window.py # Flet imports import flet as ft # utils imports from scripts import flet_utils class GalleryWindow(ft.AlertDialog): def METHOD_NAME(self): self.refresh_galleries() def refresh_galleries(self): self.refresh_gallery("uploads") self.refresh_gallery("outputs") ...
14,038
validate license header
# (C) Datadog, Inc. 2022-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pathlib import re from collections import namedtuple from typing import Callable, Iterable, List, Optional from pathspec.gitignore import GitIgnoreSpec from ..errors import SubprocessError from ....
14,039
test span properties
# Copyright 2020, OpenTelemetry 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 i...
14,040
image meta key
import logging import warnings from typing import Callable, Dict, List, Optional, Union import numpy as np import PIL from PIL import ImageFile from torch import nn from ..constants import COLUMN, IMAGE, IMAGE_META, IMAGE_VALID_NUM, PROMPT, TEXT from .collator import ListCollator, PadCollator from .utils import is_ro...
14,041
test dataverse fetch
import json import os import re from io import BytesIO from tempfile import TemporaryDirectory from unittest.mock import patch from urllib.parse import urlsplit from urllib.request import Request, urlopen import pytest from repo2docker.contentproviders import Dataverse test_dv = Dataverse() harvard_dv = next(_ for _...
14,042
print header
#!/usr/bin/env python3 # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Benchmark all API calls and print them from fastest to slowest. $ make print_api_speed SYSTEM APIS NUM CALLS ...
14,043
test finite diff lda hess high cost
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
14,044
observer requesting control
# -*- coding: utf-8 -*- from datetime import datetime import gevent from flask import ( Blueprint, jsonify, Response, request, make_response, copy_current_request_context, ) from flask_socketio import join_room, leave_room from flask_login import current_user DISCONNECT_HANDLED = True def i...
14,045
get elastic mappings
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2023 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 later version. # # This ...
14,046
event
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*- # # $Id$ from __future__ import absolute_import, division, print_function import logging, os from xfel.cxi.cspad_ana import cspad_tbx from xfel.cxi.cspad_ana import skip_event_flag from scitbx.array_family import flex from six.moves impor...
14,047
type
# 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...
14,048
bufferize
from _typeshed import Incomplete, Unused from collections import defaultdict from logging import Logger from typing_extensions import Final from .annotations import AnnotationDict from .encryption import StandardSecurityHandler from .syntax import Name, PDFArray, PDFContentStream, PDFObject, PDFString LOGGER: Logger ...
14,049
login
import re from urllib.parse import urljoin from requests.utils import dict_from_cookiejar from sickchill import logger from sickchill.helper.common import convert_size, try_int from sickchill.helper.exceptions import AuthException from sickchill.oldbeard import tvcache from sickchill.oldbeard.bs4_parser import BS4Par...
14,050
test create and add and create new
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
14,051
test indexed sum2
#!/usr/bin/env py.test # -*- coding: utf-8 -*- import pytest from ufl import * # from ufl.indexutils import * from ufl.algorithms import * from ufl.classes import IndexSum # TODO: add more expressions to test as many possible combinations of index notation as feasible... def xtest_index_utils(self): ii = indic...
14,052
list accelerators
"""Lambda Cloud Catalog. This module loads the service catalog file and can be used to query instance types and pricing information for Lambda. """ import typing from typing import Dict, List, Optional, Tuple from sky.clouds.service_catalog import common from sky.utils import ux_utils if typing.TYPE_CHECKING: fr...
14,053
b64encode for pkce
import base64 import hashlib import json import random import time from urllib.parse import urlencode from django.core.exceptions import SuspiciousOperation import requests from josepy.jwk import JWK from josepy.jws import JWS, Header try: random = random.SystemRandom() except NotImplementedError: print('No s...
14,054
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 # --------------------------------...
14,055
test casepriority list redirect
import urllib.parse from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_main.models import Casepriority class CasepriorityViewTestCase(TestCase): """casepriority view tests""" @classmethod def setUpTestData(cls): # create object Casepriority.objec...
14,056
handle data
"""Diagnostic functions, mainly for use when doing tech support.""" import cProfile from StringIO import StringIO from HTMLParser import HTMLParser import bs4 from bs4 import BeautifulSoup, __version__ from bs4.builder import builder_registry import os import pstats import random import tempfile import time import tra...
14,057
set up
# -*- coding: utf-8 -*- # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
14,058
test it removes admin with specific authority
from unittest import mock import pytest from h.cli.commands import user as user_cli from h.models import User class TestAddCommand: def test_it_adds_user_with_default_authority(self, invoke_cli, user_signup_service): result = invoke_cli( user_cli.add, [ "--usernam...
14,059
test nhwc filter3x3 pad
################################################################################ # # Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
14,060
register lookup handler
"""CFNgin lookup registry.""" from __future__ import annotations import logging from typing import Dict, Type, Union, cast from ...lookups.handlers.base import LookupHandler from ...lookups.handlers.cfn import CfnLookup from ...lookups.handlers.ecr import EcrLookup from ...lookups.handlers.env import EnvLookup from ....
14,061
main
""" Platformer Game python -m arcade.examples.platform_tutorial.09_load_map """ from __future__ import annotations import arcade # Constants SCREEN_WIDTH = 1000 SCREEN_HEIGHT = 650 SCREEN_TITLE = "Platformer" # Constants used to scale our sprites from their original size CHARACTER_SCALING = 1 TILE_SCALING = 0.5 COI...
14,062
urllib log warning setup
import logging import ssl import sys import requests from requests.adapters import HTTPAdapter from urllib3.util import Retry from urllib3 import PoolManager import six from .session.defs import ENV_HOST_VERIFY_CERT if six.PY3: from functools import lru_cache elif six.PY2: # python 2 support from backpor...
14,063
peering service prefix key
# 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__ =...
14,064
event validation cache
from typing import Optional, List from tracardi.domain.event_reshaping_schema import EventReshapingSchema from tracardi.domain.event_source import EventSource from tracardi.domain.session import Session from tracardi.domain.storage_record import StorageRecords from tracardi.event_server.utils.memory_cache import Memor...
14,065
get simulated wf
import tarfile from pathlib import Path from fireworks import FWorker from fireworks.core.rocket_launcher import rapidfire from pymatgen.core import Structure from atomate.utils.testing import AtomateTest from atomate.utils.utils import get_a_unique_id from atomate.vasp.powerups import use_fake_vasp, use_potcar_spec ...
14,066
calculate gas extend memory
""" Ethereum Virtual Machine (EVM) Gas ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ EVM gas constants and calculators. """ from dataclasses import dataclass from typing import List, Tuple from ethereum.base_types import U256, Uint from...
14,067
write css
''' Copyright (c) 2020 ETH Zurich SPDX-License-Identifier: BSL-1.0 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' import contextlib import os import pathlib from lxml import etree as et from pyutils import log _CS...
14,068
row count
########################################################################## # # Copyright (c) 2020, Cinesite VFX Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions ...
14,069
test datahub emitter resource failure
import datahub.emitter.mce_builder as builder import pytest import responses from dagster import DagsterResourceFunctionError, OpExecutionContext, build_op_context, op from dagster_datahub import ( DatahubConnection, DatahubKafkaEmitterResource, DatahubRESTEmitterResource, datahub_kafka_emitter, dat...
14,070
set signer for claim
# Code generated by moonworm : https://github.com/bugout-dev/moonworm # Moonworm version : 0.2.4 import json import os from typing import Any, Dict, Union from eth_typing.evm import Address, ChecksumAddress from web3 import Web3 from web3.contract import ContractFunction from .web3_util import * abi_path = os.path.j...
14,071
close
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from typi...
14,072
emit metrics
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # or in the "license" file...
14,073
actual decorator
import types import warnings from collections.abc import Iterator from contextlib import contextmanager from typing import Any, Callable, Optional, cast import wrapt class QCoDeSDeprecationWarning(RuntimeWarning): """ A DeprecationWarning used internally in QCoDeS. This fixes `DeprecationWarning` being s...
14,074
get last import sha from ssm
import re import subprocess from pathlib import Path import boto3 import botocore from django.apps import apps from django.core.management import BaseCommand, call_command def get_paths_changed(from_sha, to_sha): args = ["git", "diff", "--name-only", from_sha, to_sha] output = subprocess.check_output(args) ...
14,075
url report command
import demistomock as demisto from CommonServerPython import * class Client(BaseClient): def __init__(self, server_url, verify, proxy, headers, auth): super().__init__(base_url=server_url, verify=verify, proxy=proxy, headers=headers, auth=auth) def url_report_request(self, resource): params =...
14,076
test bad commit
#!/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...
14,077
recommend
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
14,078
test constitutive stress
import unittest import numpy as np from tacs import TACS, constitutive, elements class ConstitutiveTest(unittest.TestCase): def setUp(self): # fd/cs step size if TACS.dtype is complex: self.dh = 1e-200 self.rtol = 1e-11 else: self.dh = 1e-8 ...
14,079
attach disk iothread two
import logging import os import time from virttest import data_dir from virttest import utils_disk from virttest import utils_misc from virttest import virsh from virttest.libvirt_xml import vm_xml from virttest.utils_test import libvirt def run(test, params, env): """ Test disk IOThread. 1.Prepare test ...
14,080
test stops updated
# (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...
14,081
test option parent
import os from unittest import mock import pytest from reactpy._option import DeprecatedOption, Option def test_option_repr(): opt = Option("A_FAKE_OPTION", "some-value") assert opt.name == "A_FAKE_OPTION" assert repr(opt) == "Option(A_FAKE_OPTION='some-value')" @mock.patch.dict(os.environ, {"A_FAKE_O...
14,082
test property interpolation
import pytest import pyvista as pv from pyvista.plotting._property import _check_range @pytest.fixture() def prop(): return pv.Property() def test_check_range(): with pytest.raises(ValueError, match="outside the acceptable"): _check_range(-1, (0, 1), 'parm') with pytest.raises(ValueError, match...
14,083
get neighbour devices
# -*- coding: utf-8 -*- """ Moler's device has 2 main responsibilities: - be the factory that returns commands of that device - be the state machine that controls which commands may run in given state """ __author__ = 'Marcin Usielski' __copyright__ = 'Copyright (C) 2019-2020, Nokia' __email__ = 'marcin.usielski@nokia....
14,084
embed sequence
# Copyright 2016 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...
14,085
almost equal
import pytest import rpy2.robjects as robjects rinterface = robjects.rinterface import array # TODO: move to common module for testing def METHOD_NAME(x, y, epsilon = 0.00001): return abs(y - x) <= epsilon def test_init_invalid(): with pytest.raises(TypeError): robjects.vectors.IntArray(3) def tes...
14,086
img click
""" Script to manually test the panels custom bokeh models. - Models are those defined in index.ts - Optional installs: - ipywidgets - ipywidgets_bokeh - plotly - altair """ from io import StringIO import numpy as np import param from bokeh.sampledata.autompg import autompg import panel as pn _b...
14,087
get value
"""Configuration base classes.""" from abc import ABC, abstractmethod from typing import Any, Iterator, Mapping, Optional, Type, TypeVar from ..core.error import BaseError InjectType = TypeVar("InjectType") class ConfigError(BaseError): """A base exception for all configuration errors.""" class SettingsError...
14,088
list categories
# -*- coding: utf-8 -*- # Copyright: (c) JUL1EN094, SPM, SylvainCecchetto # Copyright: (c) 2016, SylvainCecchetto # GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt) # This file is part of Catch-up TV & More from __future__ import unicode_literals from builtins import str ...
14,089
df wide to long
import csv from fold_to_ascii import fold import os import pandas as pd from pathlib import Path from openclimate import Client # pip install from openclimate-pyclient repo from typing import List from typing import Dict from utils import make_dir def simple_write_csv( output_dir: str = None, name: str = None, r...
14,090
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 # --------------------------------...
14,091
iterate
from portality.models.harvester import HarvesterPlugin from portality.tasks.harvester_helpers.epmc import client, queries from portality.lib import dates from portality.api.current.client import models as doaj from portality.core import app from datetime import datetime import time class DefaultLogger(): def __in...
14,092
tx buf
#!/usr/bin/env python2 # This file is part of the OpenMV project. # # Copyright (c) 2013-2021 Ibrahim Abdelkader <iabdalkader@openmv.io> # Copyright (c) 2013-2021 Kwabena W. Agyeman <kwagyeman@openmv.io> # # This work is licensed under the MIT license, see the file LICENSE for details. # # Openmv module. import struct...
14,093
components
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
14,094
pre eval hook
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel Corporation # # 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 # # Unl...
14,095
test riemann 0
#!/usr/bin/env python3 import unittest from typing import List import torch from captum.attr._utils.approximation_methods import Riemann, riemann_builders from tests.helpers.basic import assertTensorAlmostEqual class Test(unittest.TestCase): def __init__(self, methodName: str = "runTest") -> None: super...
14,096
delete
from marshmallow import fields from lms.services import ExternalRequestError, OAuth2TokenError from lms.validation import RequestsResponseSchema from lms.validation.authentication import OAuthTokenResponseSchema class _OAuthAccessTokenErrorResponseSchema(RequestsResponseSchema): """Schema for parsing OAuth 2 acc...
14,097
show alphas
##################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019.01 # ###################################################################################### # One-Shot Neural Architecture Search via Self-Evaluated Template Network, ICCV 2019 # ######################################...
14,098
set up class
import os import glob import shutil import tempfile import unittest from medcat.cdb import CDB from medcat.cat import CAT from medcat.vocab import Vocab from medcat.utils.saving.serializer import JsonSetSerializer, CDBSerializer, SPECIALITY_NAMES, ONE2MANY import medcat.utils.saving.coding as _ class JSONSerializ...
14,099
test publish with error handler
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...