code: def convert_cfg_to_dict(cfg_node, key_list=[]):
      """Convert a config node to dictionary"""
      if not isinstance(cfg_node, CfgNode):
          if type(cfg_node) not in _VALID_TYPES:
              print(
                  "Key {} with value {} is not a valid type; valid types: {}".format(
                      ".".join(key_list), type(cfg_node), _VALID_TYPES
                  ),
              )
          return cfg_node
      else:
          cfg_dict = dict(cfg_node)
          for k, v in cfg_dict.items():
              cfg_dict[k] = convert_cfg_to_dict(v, key_list + [k])
          return cfg_dict
  
file_path: OpenPrompt/openprompt/config.py
imports: import argparse
  from yacs.config import CfgNode
  import sys
  from openprompt.utils.utils import check_config_conflicts
  from .default_config import get_default_config
  from openprompt.utils.logging import logger
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: convert_cfg_to_dict(cfg_node, key_list) and returns: cfg_node, cfg_dict