def get_submodule_by_path(module, path):
    """
    Return a sub-module by its name.
    The path may refer to any nested node using '/' as the path delimiter.
    """
    # Separate out the next module's name
    parts = path.split('/', 1)
    name = parts[0]
    sub_path = parts[1] if len(parts) == 2 else None

    if hasattr(module, name):
        submodule = getattr(module, name)
        if sub_path is None:
            return submodule
        return get_submodule_by_path(module=submodule, path=sub_path)

    raise KeyError(f'No module named "{name}" found.')