docs: def expandPath (pathname, prefix=None):
      """Return pathname as an absolute path, either expanded by the users
      home directory ("~") or with prefix prepended.
      """
      if prefix is None:
          prefix = ''
  
      expanded = pathname
  
      if pathname[0] == '~':
          expanded = os.path.expanduser(pathname)
      elif pathname[0] != '/':
          expanded = os.path.join(prefix, pathname)
  
      return os.path.abspath(expanded)