code: def _dummy_bbox_sampling(rpn_results_list, batch_gt_instances):
      """Create sample results that can be passed to Head.get_targets."""
      num_imgs = len(rpn_results_list)
      feat = torch.rand(1, 1, 3, 3)
      assign_config = dict(
          type="MaxIoUAssigner",
          pos_iou_thr=0.5,
          neg_iou_thr=0.5,
          min_pos_iou=0.5,
          ignore_iof_thr=-1,
      )
      sampler_config = dict(
          type="RandomSampler",
          num=512,
          pos_fraction=0.25,
          neg_pos_ub=-1,
          add_gt_as_proposals=False,
      )
      bbox_assigner = TASK_UTILS.build(assign_config)
      bbox_sampler = TASK_UTILS.build(sampler_config)
  
      sampling_results = []
      for i in range(num_imgs):
          assign_result = bbox_assigner.assign(
              rpn_results_list[i], batch_gt_instances[i]
          )
          sampling_result = bbox_sampler.sample(
              assign_result,
              rpn_results_list[i],
              batch_gt_instances[i],
              feats=feat,
          )
          sampling_results.append(sampling_result)
  
      return sampling_results
  
file_path: mmdetection/tests/test_models/test_tracking_heads/test_roi_embed_head.py
imports: from unittest import TestCase
  import mmengine
  import torch
  from mmengine.structures import InstanceData
  from mmdet.models.tracking_heads import RoIEmbedHead
  from mmdet.registry import TASK_UTILS
label_desc: Use image node_id 1 for calling a global function with example usage: _dummy_bbox_sampling(rpn_results_list, batch_gt_instances) and returns: sampling_results