from typing import Callable


def custom_splitter(separator: str) -> Callable:
    """Custom splitter for :py:meth:`flatten_dict.flatten_dict.unflatten()` accepting a separator."""

    def _inner_custom_splitter(flat_key) -> tuple[str, ...]:
        keys = tuple(flat_key.split(separator))
        return keys

    return _inner_custom_splitter