code: def _scale_size(size, scale):
      """Rescale a size by a ratio.
  
      Args:
          size (tuple[int]): (w, h).
          scale (float | tuple(float)): Scaling factor.
  
      Returns:
          tuple[int]: scaled size.
      """
      if isinstance(scale, (float, int)):
          scale = (scale, scale)
      w, h = size
      return int(w * float(scale[0]) + 0.5), int(
          h * float(scale[1]) + 0.5
      )
  
imports: import numbers
  import cv2
  import numpy
  from ..utils import to_2tuple
  from .io import imread_backend
label_desc: Use image node_id 1 for calling a global function with example usage: _scale_size(size, scale) and returns: int,  int