def METHOD_NAME(cls, path: str, dir_op: bool = True) -> str:
    """Parse path to extract the root directory.
    Args:
        path: Path to parse.
        dir_op: If the path is a directory.
    """
    if path.startswith("s3://"):
        return cls._parse_rootdir_s3(path, dir_op)
    return cls._parse_rootdir_local(path, dir_op)