code: def _getpath(p):
      if (3, 6) <= sys.version_info:
          import os
  
          return os.fspath(p)
      if _detect_pathlib_path(p):
          return str(p)
      return p
  
imports: import datetime
  import io
  from os import linesep
  import re
  import sys
  from toml.tz import TomlTz
label_desc: Use image node_id 3 for calling a global function with example usage: _getpath(p) and returns: p, os, str