code: def scale_box(
      xmin: float,
      ymin: float,
      w: float,
      h: float,
      scale_ratio: Tuple[float, float],
  ):
      """根据传入的h、w缩放因子scale_ratio，重新计算xmin，ymin，w，h"""
      s_h = h * scale_ratio[0]
      s_w = w * scale_ratio[1]
      xmin = xmin - (s_w - w) / 2.0
      ymin = ymin - (s_h - h) / 2.0
      return xmin, ymin, s_w, s_h
  
imports: import math
  import random
  from typing import Tuple
  import cv2
  import numpy
  import torch
  from torchvision.transforms import functional
  import matplotlib.pyplot
label_desc: Use image node_id 9 for calling a global function with example usage: scale_box(xmin, ymin, w, h, scale_ratio) and returns: xmin,  ymin,  s_w,  s_h