code: def _str_to_bool(v):
      if isinstance(v, bool):
          return v
      if v.lower() in ("yes", "true", "t", "y", "1"):
          return True
      elif v.lower() in ("no", "false", "f", "n", "0"):
          return False
      else:
          raise argparse.ArgumentTypeError("Boolean value expected.")
  
file_path: insightface/reconstruction/ostec/external/stylegan2/run_training.py
imports: import argparse
  import copy
  import os
  import sys
  import dnnlib
  from dnnlib import EasyDict
  from metrics.metric_defaults import metric_defaults
label_desc: Use image node_id 2 for calling a global function with example usage: _str_to_bool(v) and returns: v, True, False