code: def _compute_minimal_resize(
      org_size: Tuple[int, int], target_dim: Tuple[int, int]
  ) -> int:
      # for i in range(10):
      #     i += 1
      #     d = dim*i
      #     if org_dim >= d and dim < dim*(i+1):
      #         if (org_dim - dim*(i+1)) > dim:
      #             continue
      #         else:
      #             return d, i
      # import math
      # mi = math.floor(org_dim/dim)
      # d = dim * mi
      # return d, mi
  
      if not isinstance(org_size, tuple) or not isinstance(
          target_dim, tuple
      ):
          raise ValueError("org_size and target_dim must be a tuple")
  
      if len(org_size) != 2 or len(target_dim) != 2:
          raise ValueError("Size of tuple must be = 2")
  
      oh, ow = org_size[:2]
      targ_w, targ_h = target_dim[:2]
  
      h_factor = math.floor(oh / targ_h)
      w_factor = math.floor(ow / targ_w)
  
      if h_factor <= w_factor:
          return h_factor
      else:
          return w_factor
  
file_path: caer/caer/io/resize.py
imports: import math
  import cv2
  from ..coreten import Tensor, to_tensor
  from .._internal import _check_target_size
  from ..globals import INTER_AREA, INTER_CUBIC, INTER_NEAREST, INTER_LINEAR
  from typing import Tuple, Optional, Union
label_desc: Use image node_id 5 for calling a global function with example usage: _compute_minimal_resize(org_size, target_dim) and returns: h_factor, w_factor