# Path: sciunit/base.py
# PLATFORM = sys.platform
# PYTHON_MAJOR_VERSION = sys.version_info.major
# class Config(dict):
# class Versioned(object):
# class SciUnit(Versioned):
# class TestWeighted(object):
# class SciUnitHandler(BaseHandler):
# class QuantitiesHandler(BaseHandler):
# class UnitQuantitiesHandler(BaseHandler):
#     def __init__(self, *args, **kwargs):
#     def path(self):
#     def path(self, val):
#     def __getitem__(self, key):
#     def get(self, key, default=None, update_from_disk=True):
#     def set(self, key, val):
#     def __setitem__(self, key, val):
#     def get_from_disk(self):
#     def create(self, data: dict = None) -> bool:
#     def load(self):
#     def save(self):
#     def get_repo(self, cached: bool = True) -> Repo:
#     def get_version(self, cached: bool = True) -> str:
#     def get_remote(self, remote_name: str = "origin", **kwargs) -> Remote:
#     def get_remote_url(self, remote: str = "origin", cached: bool = True) -> str:
#     def __init__(self):
#     def __getstate__(self) -> dict:
#     def properties(self, keys: list = None, exclude: list = None) -> dict:
#     def property_names(self) -> list:
#     def json(
#         self, add_props: bool = True, string: bool = True, unpicklable: bool = False, make_refs: bool = False) -> str:
#     def diff(self, other, add_props=False):
#     def hash(self, serialization: str = None) -> str:
#     def _class(self) -> dict:
#     def url(self) -> str:
#     def get_list_attr_with_bases(self, attr: str) -> list:
#     def weights(self) -> List[float]:
# def deep_exclude(state: dict, exclude: list) -> dict:
# def log(*args, **kwargs):
# def strip_html(html):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def simplify(self, d):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def flatten(self, obj, data):
#     def restore(self, data):


import inspect
import pickle
import shelve
import tempfile
from pathlib import Path
from typing import Any, Union
from sciunit.base import SciUnit, config
"""Base class for simulator backends for SciUnit models."""



available_backends = {}


def register_backends(vars: dict) -> None:
    """Register backends for use with models.

    Args:
        vars (dict): a dictionary of variables obtained from e.g. `locals()`,
                     at least some of which are Backend classes, e.g. from imports.
    """
    new_backends = {
        x if x is None else x.replace("Backend", ""): cls
        for x, cls in vars.items()
        if inspect.isclass(cls) and issubclass(cls, Backend)
    }
    available_backends.update(new_backends)



# Path: sciunit/base.py
# PLATFORM = sys.platform
# PYTHON_MAJOR_VERSION = sys.version_info.major
# class Config(dict):
# class Versioned(object):
# class SciUnit(Versioned):
# class TestWeighted(object):
# class SciUnitHandler(BaseHandler):
# class QuantitiesHandler(BaseHandler):
# class UnitQuantitiesHandler(BaseHandler):
#     def __init__(self, *args, **kwargs):
#     def path(self):
#     def path(self, val):
#     def __getitem__(self, key):
#     def get(self, key, default=None, update_from_disk=True):
#     def set(self, key, val):
#     def __setitem__(self, key, val):
#     def get_from_disk(self):
#     def create(self, data: dict = None) -> bool:
#     def load(self):
#     def save(self):
#     def get_repo(self, cached: bool = True) -> Repo:
#     def get_version(self, cached: bool = True) -> str:
#     def get_remote(self, remote_name: str = "origin", **kwargs) -> Remote:
#     def get_remote_url(self, remote: str = "origin", cached: bool = True) -> str:
#     def __init__(self):
#     def __getstate__(self) -> dict:
#     def properties(self, keys: list = None, exclude: list = None) -> dict:
#     def property_names(self) -> list:
#     def json(
#         self, add_props: bool = True, string: bool = True, unpicklable: bool = False, make_refs: bool = False) -> str:
#     def diff(self, other, add_props=False):
#     def hash(self, serialization: str = None) -> str:
#     def _class(self) -> dict:
#     def url(self) -> str:
#     def get_list_attr_with_bases(self, attr: str) -> list:
#     def weights(self) -> List[float]:
# def deep_exclude(state: dict, exclude: list) -> dict:
# def log(*args, **kwargs):
# def strip_html(html):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def simplify(self, d):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def flatten(self, obj, data):
#     def restore(self, data):


# Path: sciunit/models/backends.py
import inspect
import pickle
import shelve
import tempfile
from pathlib import Path
from typing import Any, Union
from sciunit.base import SciUnit, config

"""Base class for simulator backends for SciUnit models."""



available_backends = {}


def register_backends(vars: dict) -> None:
    """Register backends for use with models.

    Args:
        vars (dict): a dictionary of variables obtained from e.g. `locals()`,
                     at least some of which are Backend classes, e.g. from imports.
    """
    new_backends = {
        x if x is None else x.replace("Backend", ""): cls
        for x, cls in vars.items()
        if inspect.isclass(cls) and issubclass(cls, Backend)
    }
    available_backends.update(new_backends)



class Backend(SciUnit):