def METHOD_NAME(path: str, dir_op: bool = True) -> str:
    """Get root directory from local path.
    Args:
        path: Path to parse.
        dir_op: If the path is a directory.
    """
    if dir_op:
        return os.path.abspath(path)
    return os.path.abspath(os.path.dirname(path))