"""A set of utils related to keys management"""

from .....models.h52nx._context import _Key


def keys_to_str_tuple(keys: tuple[_Key]) -> tuple[str]:
    for key in keys:
        if not isinstance(key, _Key):
            raise TypeError(f"key should be an instance of {_Key}. Got {type(key)}")
    return tuple([key.dataset for key in keys])
