code: def c2_preprocess(box_lists):
      assert all(isinstance(x, Boxes) for x in box_lists)
      if all(isinstance(x, Caffe2Boxes) for x in box_lists):
          # input is pure-tensor based
          assert len(box_lists) == 1
          pooler_fmt_boxes = box_lists[0].tensor
      else:
          pooler_fmt_boxes = poolers.convert_boxes_to_pooler_format(
              box_lists
          )
      return pooler_fmt_boxes
  
imports: import math
  from typing import Dict
  import torch
  import torch.nn.functional
  from detectron2.layers import ShapeSpec, cat
  from detectron2.layers.roi_align_rotated import ROIAlignRotated
  from detectron2.modeling import poolers
  from detectron2.modeling.proposal_generator import rpn
  from detectron2.modeling.roi_heads.mask_head import mask_rcnn_inference
  from detectron2.structures import Boxes, ImageList, Instances, Keypoints, RotatedBoxes
  from .shared import alias, to_device
label_desc: Use image node_id 1 for calling the Caffe2ROIPooler obj's underlying member method code with example usage: obj.c2_preprocess(box_lists) and returns: pooler_fmt_boxes