code: def parse_bool(v):
      """CPLTestBool equivalent"""
      if isinstance(v, bool):
          return v
      if isinstance(v, str):
          return not (v.lower() in ("no", "false", "off", "0"))
      return bool(v)
  
imports: import logging
  import os
  from types import SimpleNamespace
  from rasterio._path import _parse_path, _UnparsedPath
label_desc: Use image node_id 1 for calling a global function with example usage: parse_bool(v) and returns: bool, v, unknown