def parent_dir(location, abspath=False):
    """
    Args:
      location: current directory or file

    Returns:
        parent directory absolute or relative path
    """
    _path = os.path.abspath if abspath else os.path.relpath
    return _path(f_join(location, os.pardir))

    Args:
      location: current directory or file

    Returns:
        parent directory absolute or relative path
    
surreal/utils/filesys.py