code: def hdfs_path(ctx, path):
      """Convenience function to create a Tensorflow-compatible absolute HDFS path from relative paths
  
      Args:
        :ctx: TFNodeContext containing the metadata specific to this node in the cluster.
        :path: path to convert
  
      Returns:
        An absolute path prefixed with the correct filesystem scheme.
      """
      #  All Hadoop-Compatible File System Schemes (as of Hadoop 3.0.x):
      HADOOP_SCHEMES = [
          "adl://",
          "file://",
          "hdfs://",
          "oss://",
          "s3://",
          "s3a://",
          "s3n://",
          "swift://",
          "viewfs://",
          "wasb://",
      ]
      if any(path.startswith(scheme) for scheme in HADOOP_SCHEMES):
          # absolute path w/ scheme, just return as-is
          return path
      elif path.startswith("/"):
          # absolute path w/o scheme, just prepend w/ defaultFS
          return ctx.defaultFS + path
      else:
          # relative path, prepend defaultFS + standard working dir
          if ctx.defaultFS.startswith(
              "hdfs://"
          ) or ctx.defaultFS.startswith("viewfs://"):
              return "{0}/user/{1}/{2}".format(
                  ctx.defaultFS, getpass.getuser(), path
              )
          elif ctx.defaultFS.startswith("file://"):
              return "{0}/{1}/{2}".format(
                  ctx.defaultFS, ctx.working_dir[1:], path
              )
          else:
              logger.warn(
                  "Unknown scheme {0} with relative path: {1}".format(
                      ctx.defaultFS, path
                  )
              )
              return "{0}/{1}".format(ctx.defaultFS, path)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import nested_scopes
  from __future__ import print_function
  import getpass
  import logging
  import pkg_resources
  from packaging import version
  from six.moves.queue import Empty
  from .None import compat, marker
label_desc: Use image node_id 1 for calling a global function with example usage: hdfs_path(ctx, path) and returns: path, unknown, str, str, str