code: def scale_boxes(
      boxes: Union[Tensor, BaseBoxes], scale_factor: Tuple[float, float]
  ) -> Union[Tensor, BaseBoxes]:
      """Scale boxes with type of tensor or box type.
  
      Args:
          boxes (Tensor or :obj:`BaseBoxes`): boxes need to be scaled. Its type
              can be a tensor or a box type.
          scale_factor (Tuple[float, float]): factors for scaling boxes.
              The length should be 2.
  
      Returns:
          Union[Tensor, :obj:`BaseBoxes`]: Scaled boxes.
      """
      if isinstance(boxes, BaseBoxes):
          boxes.rescale_(scale_factor)
          return boxes
      else:
          # Tensor boxes will be treated as horizontal boxes
          repeat_num = int(boxes.size(-1) / 2)
          scale_factor = boxes.new_tensor(scale_factor).repeat(
              (1, repeat_num)
          )
          return boxes * scale_factor
  
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 18 for calling a global function with example usage: scale_boxes(boxes, scale_factor) and returns: boxes, unknown