code: def get_roi_head_cfg(fname):
      """Grab configs necessary to create a roi_head.
  
      These are deep copied to allow for safe modification of parameters without
      influencing other tests.
      """
      config = _get_config_module(fname)
      model = copy.deepcopy(config.model)
  
      roi_head = model.roi_head
      train_cfg = (
          None if model.train_cfg is None else model.train_cfg.rcnn
      )
      test_cfg = None if model.test_cfg is None else model.test_cfg.rcnn
      roi_head.update(dict(train_cfg=train_cfg, test_cfg=test_cfg))
      return roi_head
  
imports: import copy
  from os.path import dirname, exists, join
  import numpy
  import torch
  from mmengine.config import Config
  from mmengine.dataset import pseudo_collate
  from mmengine.structures import InstanceData, PixelData
  from mmdet.utils.util_random import ensure_rng
  from ..registry import TASK_UTILS
  from ..structures import DetDataSample, TrackDataSample
  from ..structures.bbox import HorizontalBoxes
label_desc: Use image node_id 4 for calling a global function with example usage: get_roi_head_cfg(fname) and returns: roi_head