code: def scale_boxes(bboxes: Tensor, scale: float) -> Tensor:
      """Expand an array of boxes by a given scale.
  
      Args:
          bboxes (Tensor): Shape (m, 4)
          scale (float): The scale factor of bboxes
  
      Returns:
          Tensor: Shape (m, 4). Scaled bboxes
      """
      assert bboxes.size(1) == 4
      w_half = (bboxes[:, 2] - bboxes[:, 0]) * 0.5
      h_half = (bboxes[:, 3] - bboxes[:, 1]) * 0.5
      x_c = (bboxes[:, 2] + bboxes[:, 0]) * 0.5
      y_c = (bboxes[:, 3] + bboxes[:, 1]) * 0.5
  
      w_half *= scale
      h_half *= scale
  
      boxes_scaled = torch.zeros_like(bboxes)
      boxes_scaled[:, 0] = x_c - w_half
      boxes_scaled[:, 2] = x_c + w_half
      boxes_scaled[:, 1] = y_c - h_half
      boxes_scaled[:, 3] = y_c + h_half
      return boxes_scaled
  
file_path: mmdetection/mmdet/models/task_modules/assigners/center_region_assigner.py
imports: from typing import Optional, Tuple
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.utils import ConfigType
  from .assign_result import AssignResult
  from .base_assigner import BaseAssigner
label_desc: Use image node_id 1 for calling a global function with example usage: scale_boxes(bboxes, scale) and returns: boxes_scaled