code: def env2bool(var, undefined=False):
      """
      undefined: return value if env var is unset
      """
      var = os.getenv(var, None)
      if var is None:
          return undefined
      return bool(re.search("1|y|yes|true", var, flags=re.I))
  
imports: import hashlib
  import json
  import os
  import re
  import sys
  from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Tuple
  import colorama
label_desc: Use image node_id 15 for calling a global function with example usage: env2bool(var, undefined) and returns: bool, undefined