id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
5,600
preprocess
# Copyright (c) Alibaba, Inc. and its affiliates. import math import os.path as osp from typing import Any, Dict import cv2 import numpy as np import PIL import torch from modelscope.metainfo import Pipelines from modelscope.outputs import OutputKeys from modelscope.pipelines.base import Input, Pipeline from modelsco...
5,601
absent strategy
#!/usr/bin/python # -*- coding: utf-8 -*- # # Scaleway Security Group Rule management module # # Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com). # # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later...
5,602
info check
import re from virttest import error_context from virttest import utils_misc @error_context.context_aware def run(test, params, env): """ KVM Seabios test: 1) Start guest with sga bios 2) Check the sga bios messages(optional) 3) Restart the vm, verify it's reset(optional) 4) Display and check...
5,603
import texture source
"""This script contains helper methods for texture pathing.""" # ***** BEGIN LICENSE BLOCK ***** # # Copyright © 2020, NIF File Format Library and Tools contributors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
5,604
require
__all__ = ['require'] import subprocess, os, codecs, glob from .evaljs import translate_js, DEFAULT_HEADER from .translators.friendly_nodes import is_valid_py_name import six import tempfile import hashlib import random DID_INIT = False DIRNAME = tempfile.mkdtemp() PY_NODE_MODULES_PATH = os.path.join(os.path.dirname(...
5,605
set env vars
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import json import os from base64 import urlsafe_b64decode, urlsafe_b64encode from six import iteritems DDTRACE_OPTIONS_LIST = [ 'DD_TAGS', 'DD_TRACE*', 'DD_PROFILING*', 'DD_SERVICE', ...
5,606
dedupe
# Copyright (c) Meta Platforms, Inc. and affiliates. import vpdq import json import typing as t import pathlib from dataclasses import dataclass from threatexchange.signal_type.pdq.pdq_utils import PDQ_HEX_STR_LEN QUALITY = "quality" HASH = "hash" TIMESTAMP = "timestamp" VPDQ_TIMESTAMP_PRECISION = 3 VPDQ_QUALITY_THR...
5,607
update
# Copyright (C) 2021-2022 Intel Corporation # Copyright (C) 2023 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import os from tempfile import TemporaryDirectory import rq from typing import Any, Callable, List, Mapping, Tuple from datumaro.components.errors import DatasetError, DatasetImportError, DatasetNotFou...
5,608
eval basic multisum identity
import contextlib import concurrent.futures as futures from itertools import chain import json import os from tempfile import gettempdir import pytest from stress_tests.experiment import ( ExperimentConditions, Experiment, Encoder, Replication ) from stress_tests import read_mlir from stress_tests.utils import CO...
5,609
to dict
# coding: utf-8 """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import s...
5,610
test nc pseudos
from __future__ import annotations import collections import os.path import pytest from pytest import approx from pymatgen.io.abinit.pseudos import Pseudo, PseudoTable from pymatgen.util.testing import TEST_FILES_DIR, PymatgenTest _test_dir = f"{TEST_FILES_DIR}/abinit" def ref_file(filename): return os.path.j...
5,611
test type configs
# -*- coding: utf-8 -*- import unittest from lxml import etree import sys sys.path.append('.') from androguard.core import apk, axml from operator import itemgetter TEST_APP_NAME = "TestsAndroguardApplication" TEST_ICONS = { 120: "res/drawable-ldpi/icon.png", 160: "res/drawable-mdpi/icon.png", 240: "res/...
5,612
test getregion
import unittest2 as unittest # import unittest from libagent import error, playground, grassland import grass.script as grass from grass.script import array as garray class TestGrassland(unittest.TestCase): def setUp(self): # TODO check if there is a nicer way to do this.. self.rastlayername = N...
5,613
check params
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020 # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the # r...
5,614
test invalid subpolicy base types
import pytest from aerospike import exception as e import aerospike class TestInvalidClientConfig(object): def test_no_config(self): with pytest.raises(e.ParamError) as err: aerospike.client() assert "No config argument" in err.value.msg def test_config_not_dict(self): wi...
5,615
run constant climate with bias
import numpy as np from oggm.core.flowline import ( flowline_model_run, FileModel, ) from oggm.core.massbalance import ( ConstantMassBalance, MassBalanceModel, ) from oggm import entity_task # Module logger import logging log = logging.getLogger(__name__) class BiasedConstantMassBalance(MassBalanceM...
5,616
handle gesture complete
''' Multistroke Recognition Database Demonstration ============================================== This application records gestures and attempts to match them. You should see a black drawing surface with some buttons across the bottom. As you make a gesture on the drawing surface, the gesture will be added to the hist...
5,617
wrapper
""" Simulation of ADF z-test critical values. Closely follows MacKinnon (2010). Running this files requires an IPython cluster, which is assumed to be on the local machine. This can be started using a command similar to ipcluster start -n 4 Remote clusters can be used by modifying the Client initiation. This v...
5,618
visualize
import fcntl import os import time import threading from binaryninja import PluginCommand, HighlightStandardColor, log, BackgroundTaskThread from binaryninja.interaction import ( get_open_filename_input, get_directory_name_input, get_choice_input, ) import binaryninja.enums as enums blue = HighlightStanda...
5,619
items
# Copyright (c) 2005 The Regents of The University of Michigan # 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 ...
5,620
test time freq resolution
# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) # SPDX-License-Identifier: GPL-3.0-or-later import pytest import shutil import os import sys import uuid from subprocess import check_call # Append current directory to system path in order to import testconfig sys.path.append(".") import testco...
5,621
resource path summary provider
# 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, ...
5,622
test evaluation runs
# Copyright (c) Recommenders contributors. # Licensed under the MIT License. import sys import pytest try: import papermill as pm except ImportError: pass # disable error while collecting tests for non-notebook environments from recommenders.utils.constants import ( DEFAULT_RATING_COL, DEFAULT_USER_...
5,623
test sb rules
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
5,624
test metric is computed correctly partial episode
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
5,625
test kv2 raise on deleted
import pytest from unittest import TestCase from unittest import mock from unittest.mock import MagicMock, Mock from parameterized import parameterized from hvac.api.secrets_engines.kv import Kv from hvac.api.secrets_engines.kv_v1 import KvV1 from hvac.api.secrets_engines.kv_v2 import KvV2 from hvac import exceptio...
5,626
get constraints
from collections.abc import Collection, Iterable, Sequence from typing import Any, ClassVar, Final, TypeVar from django.core.checks.messages import CheckMessage from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned from django.core.exceptions import ObjectDoesNotExist, ValidationErr...
5,627
parse forum list page
# Copyright (c) 2016 Andrew "rubenwardy" Ward # License: MIT # Source: https://github.com/rubenwardy/python_phpbb_parser import re import urllib import urllib.parse as urlparse import urllib.request from datetime import datetime from urllib.parse import urlencode from bs4 import BeautifulSoup def url_encode_non_as...
5,628
on new role
from __future__ import annotations import random import re from typing import Optional from src import status from src.cats import All from src.containers import UserSet, UserDict from src.decorators import command from src.events import Event, event_listener from src.functions import get_all_players, get_target from...
5,629
visit ancestorof
# Generated from ECLsubset.g4 by ANTLR 4.10.1 from antlr4 import * if __name__ is not None and "." in __name__: from .ECLsubsetParser import ECLsubsetParser else: from ECLsubsetParser import ECLsubsetParser # This class defines a complete generic visitor for a parse tree produced by ECLsubsetParser. class E...
5,630
set up
# ========================================================================== # # Copyright NumFOCUS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org...
5,631
saved keys
import ConfigSpace as CS from deephyper.problem import HpProblem from deephyper.search.nas._regevo import RegularizedEvolution class RegularizedEvolutionMixed(RegularizedEvolution): """Extention of the `Regularized evolution <https://arxiv.org/abs/1802.01548>`_ neural architecture search to the case of joint hype...
5,632
decode boolean
"""IC wrapper module, based on Internet Config 1.3""" from warnings import warnpy3k warnpy3k("In 3.x, the ic module is removed.", stacklevel=2) import icglue import string import sys import os from Carbon import Res import Carbon.File import macostools error=icglue.error # From ictypes.h: icPrefNotFoundErr = -666 ...
5,633
add xform resource overrides
""" ResourceOverrideHelper ---------------------- This is dead code. It supports a legacy feature, multi-master linked applications. The actual flag has been removed, but a lot of related code still exists. """ from collections import Counter from django.db import models from corehq.apps.app_manager.exceptions impor...
5,634
write run
import json import os from pathlib import Path from typing import Optional from biosimulations_pipeline.datamodels import ( BiosimulationsProject, SourceOmex, SimulationRun, SimulatorComparison ) def _get_project_name(omex_file: Path) -> str: return str(omex_file.name).split(".")[0] class DataM...
5,635
test applies correctly for sentry apps
from unittest.mock import patch import pytest from rest_framework import serializers from sentry.rules.actions.sentry_apps import NotifyEventSentryAppAction from sentry.silo import SiloMode from sentry.tasks.sentry_apps import notify_sentry_app from sentry.testutils.cases import RuleTestCase from sentry.testutils.sil...
5,636
model
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-2023 by the software own...
5,637
test check if key in list of
import pytest from chemistry_and_robots.kg_operations import dict_and_list as dal @pytest.mark.parametrize( "list_of_dict,key,value,expected_list_of_dict", [ ([], "key", "value", []), ([{"key": "value", "key2": "value"}, {"key": "value_", "key2": "value_"}], "key", "value", [{"key": "value", "...
5,638
put container
""" Swift utility class =================== Author: Anthony Stanton <anthony.stanton@gmail.com> """ import logging import sys from errno import EEXIST from os import makedirs from os.path import dirname, isdir import salt.utils.files # Get logging started log = logging.getLogger(__name__) HAS_SWIFT = False try: ...
5,639
get file sys for file
import builtins import os class AntFileSystem(object): def __init__(self, uri): raise NotImplementedError def exists(self, filename): raise NotImplementedError def remove(self, filename): raise NotImplementedError def stat(self, filename): raise NotImplementedError ...
5,640
generator factory
# Copyright (c) 2021 The Regents of the University of California # 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 lis...
5,641
test unique identifier
import re from typing import Sequence import pytest from dagster import ( DagsterInvalidDefinitionError, DagsterInvalidInvocationError, DailyPartitionsDefinition, DynamicPartitionsDefinition, HourlyPartitionsDefinition, MultiPartitionsDefinition, PartitionKeyRange, StaticPartitionsDefin...
5,642
minutes parse links
import datetime import dateutil.parser from city_scrapers_core.constants import COMMISSION from city_scrapers_core.items import Meeting from city_scrapers_core.spiders import CityScrapersSpider class ChiNorthRiverMentalHealthSpider(CityScrapersSpider): name = "chi_north_river_mental_health" agency = ( ...
5,643
size hint
from PySide6.QtCore import QSize, Qt from PySide6.QtGui import QPainter, QPen from PySide6.QtWidgets import QFrame, QHBoxLayout, QLabel, QLineEdit, QScrollArea, QVBoxLayout, QWidget from angrmanagement.config import Conf from .qast_viewer import QASTViewer class AddressPiece: __slots__ = ["address"] def __...
5,644
generate image
import numpy as np import pandas as pd import pytest from datasets import load_dataset from datasets.arrow_dataset import Dataset from PIL import Image from sklearn.neighbors import NearestNeighbors from cleanlab.datalab.datalab import Datalab SEED = 42 LABEL_NAME = "star" @pytest.fixture def dataset(): data_di...
5,645
create rule
import json class Trace(object): """ An llbuild build system trace """ # Get a cached trace. @classmethod def frompath(cls, path): db = cls._traces.get(path) if db is None: cls._traces[path] = db = Trace(path) return db _traces = {} def __init__...
5,646
arg names
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Code for generating hooks. """ import os import subprocess import sys from dataclasses import dataclass from operator import attrgetter from typing import Optional sys.path.append("pylib...
5,647
update bnf map
import csv from matrixstore.build.import_practice_stats import ( parse_practice_statistics_csv, write_practice_stats, ) from matrixstore.build.import_prescribing import ( parse_prescribing_csv, write_prescribing, ) from matrixstore.build.init_db import SCHEMA_SQL, generate_dates, import_dates from matr...
5,648
check port free
import logging import os import shutil from urllib3.exceptions import NewConnectionError from requests.exceptions import ConnectionError from cryptoadvance.specter.specter_error import SpecterError from ...config import BaseConfig from ..specter_migrator import SpecterMigration from ...helpers import load_jsons from ...
5,649
get tags
from functools import partial from i18nfield.rest_framework import I18nAwareModelSerializer from rest_framework.serializers import ( ModelSerializer, SerializerMethodField, SlugRelatedField, ) from pretalx.api.serializers.question import AnswerSerializer from pretalx.api.serializers.speaker import Submitt...
5,650
is blacklisted tool
#!/usr/bin/env python3 import argparse import json import logging import sys from pathlib import Path from typing import Dict, Generator, Iterable, List, Optional, Tuple, Union, NamedTuple from jsoncomparison import NO_DIFF, Compare from aqt.exceptions import ArchiveConnectionError, ArchiveDownloadError from aqt.hel...
5,651
test basic system connection
#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/common/pywrap", sys.argv) # This file is part of Cockpit. # # Copyright (C) 2021 Red Hat, Inc. # # Cockpit is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by...
5,652
prepare request
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
5,653
verify registration response
# 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, software # distributed under the Li...
5,654
test msmarco passage tct colbert v2 encoded
# # Pyserini: Reproducible IR research with sparse and dense representations # # 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...
5,655
test path isin case sensitive
import os import pytest import dvc from dvc.fs import system from dvc.utils import relpath from dvc.utils.fs import ( BasePathNotInCheckedPathException, contains_symlink_up_to, path_isin, remove, ) def test_should_raise_exception_on_base_path_not_in_path(): with pytest.raises(BasePathNotInChecke...
5,656
handle result
############################################################################# # Copyright (C) 2020-2021 German Aerospace Center (DLR-SC) # # Authors: # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
5,657
url
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
5,658
get options label
# tool_rotate.py # # Copyright 2018-2023 Romain F. T. # # 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 program...
5,659
test mean variance
# 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...
5,660
assert equal hash
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. """Test Image widget""" import io import os from ipywidgets import Image import hashlib import pkgutil import tempfile from contextlib import contextmanager # Data @contextmanager def get_logo_png(): # Once t...
5,661
mockingjay origin
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # FileName [ upstream/mockingjay/hubconf.py ] # Synopsis [ the mockingjay torch hubconf ] # Author [ S3PRL ] # Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ] """****...
5,662
get generator object code
# Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
5,663
test columns queries
from __future__ import annotations from datetime import timedelta from typing import TYPE_CHECKING from urllib.parse import quote import pytest from api import utils from tests.helper import create_invoice, create_product, create_token, create_user if TYPE_CHECKING: from httpx import AsyncClient as TestClient ...
5,664
upload
""" Generate CSV files for submission and assessment data, then upload to S3. """ import datetime import os import os.path import shutil import sys import tarfile import tempfile from django.core.management.base import BaseCommand, CommandError from openassessment.data import CsvWriter from openassessment.fileuploa...
5,665
callback manager
from __future__ import annotations from typing import Any, Optional, Tuple, cast from llama_index.bridge.pydantic import PrivateAttr from llama_index.prompts import BasePromptTemplate from llama_index.callbacks import CallbackManager from llama_index.callbacks.schema import CBEventType, EventPayload from llama_index...
5,666
test directory radius server bad auth protocol
from unittest import mock from prowler.providers.aws.services.directoryservice.directoryservice_service import ( AuthenticationProtocol, Directory, DirectoryType, RadiusSettings, RadiusStatus, ) AWS_REGION = "eu-west-1" AWS_ACCOUNT_NUMBER = "123456789012" class Test_directoryservice_radius_serve...
5,667
submit request to change email
import logging from aiohttp import web from aiohttp.web import RouteTableDef from models_library.emails import LowerCaseEmailStr from pydantic import SecretStr, validator from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from se...
5,668
is null
import numbers from pyrsistent import pmap import attr from jsonschema.compat import int_types, str_types from jsonschema.exceptions import UndefinedTypeCheck def is_array(checker, instance): return isinstance(instance, list) def is_bool(checker, instance): return isinstance(instance, bool) def is_integ...
5,669
parameterized test elman
# Copyright 2018 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...
5,670
test array cast
# *************************************************************** # Copyright (c) 2023 Jittor. All Rights Reserved. # Maintainers: Dun Liang <randonlang@gmail.com>. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # ************************...
5,671
invalidate pages cache
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) # # 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 appl...
5,672
weight prune
import os import os.path as osp import sys import time import argparse from pdb import set_trace as st import json import random import time import pickle import torch import numpy as np import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchcontrib from torc...
5,673
set parameters
# Copyright (c) 2017 The University of Manchester # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
5,674
augment
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from botocore.exceptions import ClientError import json from c7n.actions import RemovePolicyBase from c7n.filters import CrossAccountAccessFilter from c7n.query import QueryResourceManager, TypeInfo from c7n.manager import resources from c...
5,675
banner
# -*- coding: utf-8 -*- """ The Sage ZMQ Kernel Version of the Jupyter kernel when running Sage inside the Jupyter notebook or remote Jupyter sessions. """ # *************************************************************************** # Copyright (C) 2015 Volker Braun <vbraun.name@gmail.com> # # Distributed und...
5,676
test gridspec stretch with replacement pane
import pytest from bokeh.models import Div from panel.depends import depends from panel.layout import GridBox, GridSpec, Spacer from panel.widgets import IntSlider def test_gridspec_cleanup(document, comm): spacer = Spacer() gspec = GridSpec() gspec[0, 0] = spacer model = gspec.get_root(document, c...
5,677
build fake yaml2
"""Tests for neural_compressor quantization.""" import importlib import os import shutil import unittest import numpy as np import yaml def build_fake_yaml(): fake_yaml = """ model: name: fake_yaml framework: tensorflow inputs: x outputs: identity quantizat...
5,678
test unsigned max
""" Test functions for limits module. """ import warnings import numpy as np from numpy.core import finfo, iinfo from numpy import half, single, double, longdouble from numpy.testing import assert_equal, assert_, assert_raises from numpy.core.getlimits import _discovered_machar, _float_ma ############################...
5,679
wait until available
#!/usr/bin/env python3 # Spins up four nodes, and alternates [test1, test2] and [test3, test4] as block producers every epoch # Makes sure that before the epoch switch each block is signed by all four import sys, time, base58, random, datetime import pathlib sys.path.append(str(pathlib.Path(__file__).resolve().parent...
5,680
parse sdf to dataframe
""" Utiles for data parsing""" import os import warnings import numpy as np import pandas as pd import datamol as dm from functools import partial from copy import copy import fsspec from loguru import logger from rdkit import Chem from rdkit.Chem.Descriptors import ExactMolWt from graphium.utils.tensor import parse_...
5,681
get firebase credential errors
import json from json import JSONDecodeError from firebase_admin import (delete_app as delete_firebase_instance, get_app as get_firebase_app, initialize_app as initialize_firebase_app) from firebase_admin.credentials import Certificate as FirebaseCertificate from constants.celery_constants import (ANDROID_FIREBAS...
5,682
network to pergeos
import logging import numpy as np from openpnm.io import _parse_filename from openpnm.network import Network logger = logging.getLogger(__name__) def METHOD_NAME(network, filename=''): # avoid printing truncated array np.set_printoptions(threshold=np.inf) # Ensure network has PerGeos' expected propert...
5,683
shapes
"""$ rio shapes""" from __future__ import division import logging import click import cligj import rasterio from rasterio.rio import options from rasterio.features import dataset_features from rasterio.rio.helpers import write_features logger = logging.getLogger(__name__) @click.command(short_help="Write shapes...
5,684
watch
# 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...
5,685
estimate performance
# 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...
5,686
validate after
from typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union from typing_extensions import Self from pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator from pydantic.dataclasses import dataclass class Model(BaseModel): x: float y: str mo...
5,687
test roundtrip merged
import filecmp import tempfile from os.path import exists import gemmi import pytest from pandas.testing import assert_frame_equal import reciprocalspaceship as rs from reciprocalspaceship.utils import in_asu def test_read_merged(IOtest_mtz): """Test rs.read_mtz() with merged MTZ file""" dataset = rs.read_m...
5,688
installation cancelled or errored
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Status widget for Kite completions. """ # Standard library imports import logging # Third party imports from qtpy.QtCore import Slot # Local imports from spyde...
5,689
test mplex stream reset
import pytest import trio from trio.testing import wait_all_tasks_blocked from libp2p.stream_muxer.mplex.exceptions import ( MplexStreamClosed, MplexStreamEOF, MplexStreamReset, ) from libp2p.stream_muxer.mplex.mplex import MPLEX_MESSAGE_CHANNEL_SIZE from libp2p.tools.constants import MAX_READ_LEN DATA = ...
5,690
title
# 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__ ...
5,691
running
#!/usr/bin/env python3 '''Copied from m61-test''' import linuxcnc import os from time import sleep # this is how long we wait for linuxcnc to do our bidding class LinuxcncError(Exception): pass # def __init__(self, value): # self.value = value # def __str__(self): # return repr(self.value) ...
5,692
has headers
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from distutils.cmd import Command from re import Pattern from typing import IO, Any, ClassVar, TypeVar, overload from typing_extensions import TypeAlias command_re: Pattern[str] _OptionsList: TypeAlias ...
5,693
test get input arguments set text method
import vsg import vsg.interfaces.notepad_pp import os import re import unittest from vsg.tests import utils lFile = [] utils.read_file(os.path.join(os.path.dirname(__file__),'test_input.vhd'), lFile) sFile = '\n'.join(lFile) lFileSyntaxError = [] utils.read_file(os.path.join(os.path.dirname(__file__),'test_inpu...
5,694
test sed returns proper command string with
# -*- coding: utf-8 -*- """ Testing of sed command. """ __author__ = 'Agnieszka Bylica' __copyright__ = 'Copyright (C) 2018, Nokia' __email__ = 'agnieszka.bylica@nokia.com' import pytest from moler.cmd.unix.sed import Sed from moler.exceptions import CommandFailure def test_sed_returns_proper_command_string(buffer...
5,695
get re org limit
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from typing import Optional from qrl.core import config from qrl.core.misc import logger, db from qrl.generated import qrl_pb2, qrlstateinfo_pb2 class State: def...
5,696
storage remove
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
5,697
to balancer
# 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 use ...
5,698
test hash v2 partition key definition
# The MIT License (MIT) # Copyright (c) 2014 Microsoft Corporation # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
5,699
test not queued outside request response cycle
import datetime import importlib import time from datetime import timedelta from unittest import mock from django.conf import settings from django.core.signals import request_finished, request_started from django.test.testcases import TransactionTestCase from celery import group from post_request_task.task import _di...