import posixpath


def norm_eo_path(eo_path: str) -> str:
    """Normalize an eo object path.

    Parameters
    ----------
    eo_path: str

    Returns
    -------
    str
    """
    if eo_path == "":
        raise KeyError("Invalid empty eo_path")
    eo_path = posixpath.normpath(eo_path)  # Do not use pathlib (does not remove ..)
    if eo_path.startswith("//"):  # text is a special path so it's not normalised by normpath
        eo_path = eo_path[1:]
    return eo_path