code: def bbox2roi(bbox_list: List[Union[Tensor, BaseBoxes]]) -> Tensor:
      """Convert a list of bboxes to roi format.
  
      Args:
          bbox_list (List[Union[Tensor, :obj:`BaseBoxes`]): a list of bboxes
              corresponding to a batch of images.
  
      Returns:
          Tensor: shape (n, box_dim + 1), where ``box_dim`` depends on the
          different box types. For example, If the box type in ``bbox_list``
          is HorizontalBoxes, the output shape is (n, 5). Each row of data
          indicates [batch_ind, x1, y1, x2, y2].
      """
      rois_list = []
      for img_id, bboxes in enumerate(bbox_list):
          bboxes = get_box_tensor(bboxes)
          img_inds = bboxes.new_full((bboxes.size(0), 1), img_id)
          rois = torch.cat([img_inds, bboxes], dim=-1)
          rois_list.append(rois)
      rois = torch.cat(rois_list, 0)
      return rois
  
imports: from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from mmdet.structures.bbox import BaseBoxes
label_desc: Use image node_id 5 for calling a global function with example usage: bbox2roi(bbox_list) and returns: rois