from pathlib import Path


def separate_refpath(refpath: Path):
    """ Separate the ref from path """
    parts = refpath.parts
    if len(parts) == 0:
        return None, None

    if not parts[0].startswith('@'):
        return None, refpath

    return parts[0], Path(*parts[1:])