# Path: il2fb/ds/airbridge/typing.py



from contextlib import contextmanager
from ddict import DotAccessDict
from .typing import StringOrPath
import yaml

class StateLoader(yaml.Loader):
    pass


def _construct_mapping(loader, node):
    loader.flatten_mapping(node)
    return DotAccessDict(loader.construct_pairs(node))


StateLoader.add_constructor(
    yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
    _construct_mapping,
)


class StateDumper(yaml.Dumper):
    pass


def _dict_representer(dumper, data):
    return dumper.represent_mapping(
        yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
        data.items(),
    )


StateDumper.add_representer(DotAccessDict, _dict_representer)



# Path: il2fb/ds/airbridge/typing.py



# Path: il2fb/ds/airbridge/state.py
from contextlib import contextmanager
from ddict import DotAccessDict
from .typing import StringOrPath
import yaml


class StateLoader(yaml.Loader):
    pass


def _construct_mapping(loader, node):
    loader.flatten_mapping(node)
    return DotAccessDict(loader.construct_pairs(node))


StateLoader.add_constructor(
    yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
    _construct_mapping,
)


class StateDumper(yaml.Dumper):
    pass


def _dict_representer(dumper, data):
    return dumper.represent_mapping(
        yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
        data.items(),
    )


StateDumper.add_representer(DotAccessDict, _dict_representer)



def load_state(path: StringOrPath) -> DotAccessDict: