code: def _ensure_path(path):
      if isinstance(path, pathlib.Path):
          return path
      else:
          return pathlib.Path(_stringify_path(path))
  
imports: import pathlib
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: _ensure_path(path) and returns: path, pathlib