code: def _stringify_path(path):
      """
      Convert *path* to a string or unicode path if possible.
      """
      if isinstance(path, str):
          return path
  
      # checking whether path implements the filesystem protocol
      try:
          return path.__fspath__()
      except AttributeError:
          pass
  
      raise TypeError("not a path-like object")
  
imports: import pathlib
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _stringify_path(path) and returns: path, path