docs: def abspath(hdfs_path, user=None, local=False):
      """
      Return an absolute path for ``hdfs_path``.
  
      The ``user`` arg is passed to :func:`split`. The ``local`` argument
      forces ``hdfs_path`` to be interpreted as an ordinary local path:
  
      .. code-block:: python
  
        >>> import os
        >>> os.chdir('/tmp')
        >>> import pydoop.hdfs.path as hpath
        >>> hpath.abspath('file:/tmp')
        'file:/tmp'
        >>> hpath.abspath('file:/tmp', local=True)
        'file:/tmp/file:/tmp'
  
      Note that this function always return a full URI:
  
      .. code-block:: python
  
        >>> import pydoop.hdfs.path as hpath
        >>> hpath.abspath('/tmp')
        'hdfs://localhost:9000/tmp'
      """
      if local:
          return 'file:%s' % os.path.abspath(hdfs_path)
      if isfull(hdfs_path):
          return hdfs_path
      hostname, port, path = split(hdfs_path, user=user)
      if hostname:
          fs = hdfs_fs.hdfs(hostname, port)
          apath = join("hdfs://%s:%s" % (fs.host, fs.port), path)
          fs.close()
      else:
          apath = "file:%s" % os.path.abspath(path)
      return apath