code: def images_to_levels(target, num_levels):
      """Convert targets by image to targets by feature level.
  
      [target_img0, target_img1] -> [target_level0, target_level1, ...]
      """
      target = stack_boxes(target, 0)
      level_targets = []
      start = 0
      for n in num_levels:
          end = start + n
          # level_targets.append(target[:, start:end].squeeze(0))
          level_targets.append(target[:, start:end])
          start = end
      return level_targets
  
imports: from functools import partial
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmengine.utils import digit_version
  from six.moves import map, zip
  from torch import Tensor
  from torch.autograd import Function
  from torch.nn import functional
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import BaseBoxes, get_box_type, stack_boxes
  from mmdet.structures.mask import BitmapMasks, PolygonMasks
  from mmdet.utils import OptInstanceList
label_desc: Use image node_id 13 for calling a global function with example usage: images_to_levels(target, num_levels) and returns: level_targets