code: def _fspath(path):
      """Return the path representation of a path-like object.
  
      If str or bytes is passed in, it is returned unchanged. Otherwise the
      os.PathLike interface is used to get the path representation. If the
      path representation is not str or bytes, TypeError is raised. If the
      provided path is not str, bytes, or os.PathLike, TypeError is raised.
      """
      if isinstance(path, (str, bytes)):
          return path
  
      if not hasattr(path, "__fspath__") and isinstance(
          path, pathlib.Path
      ):
          # workaround for Python 3.5
          return str(path)
  
      # Work from the object's type to match method resolution of other magic
      # methods.
      path_type = type(path)
      try:
          path_repr = path_type.__fspath__(path)
      except AttributeError:
          if hasattr(path_type, "__fspath__"):
              raise
          else:
              raise TypeError(
                  "expected str, bytes or os.PathLike object, "
                  "not " + path_type.__name__
              )
      if isinstance(path_repr, (str, bytes)):
          return path_repr
      else:
          raise TypeError(
              "expected {}.__fspath__() to return str or bytes, "
              "not {}".format(
                  path_type.__name__, type(path_repr).__name__
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import abc
  import os
  from io import open
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _fspath(path) and returns: path, str, path_repr