code: def parse_config(config_strings):
      temp_file = tempfile.NamedTemporaryFile()
      config_path = f"{temp_file.name}.py"
      with open(config_path, "w") as f:
          f.write(config_strings)
  
      config = Config.fromfile(config_path)
      is_two_stage = True
      is_ssd = False
      is_retina = False
      reg_cls_agnostic = False
      if "rpn_head" not in config.model:
          is_two_stage = False
          # check whether it is SSD
          if config.model.bbox_head.type == "SSDHead":
              is_ssd = True
          elif config.model.bbox_head.type == "RetinaHead":
              is_retina = True
      elif isinstance(config.model["bbox_head"], list):
          reg_cls_agnostic = True
      elif "reg_class_agnostic" in config.model.bbox_head:
          reg_cls_agnostic = config.model.bbox_head.reg_class_agnostic
      temp_file.close()
      return is_two_stage, is_ssd, is_retina, reg_cls_agnostic
  
file_path: mmdetection/tools/model_converters/upgrade_model_version.py
imports: import argparse
  import re
  import tempfile
  from collections import OrderedDict
  import torch
  from mmengine import Config
label_desc: Use image node_id 2 for calling a global function with example usage: parse_config(config_strings) and returns: is_two_stage,  is_ssd,  is_retina,  reg_cls_agnostic