class_docstr: Resize the input boxes when the corresponding image is
  resized to given spatial size (with scaling, not cropping/padding).
  
  Args:
      spatial_size: expected shape of spatial dimensions after resize operation.
          if some components of the `spatial_size` are non-positive values, the transform will use the
          corresponding components of img size. For example, `spatial_size=(32, -1)` will be adapted
          to `(32, 64)` if the second spatial dimension size of img is `64`.
      size_mode: should be "all" or "longest", if "all", will use `spatial_size` for all the spatial dims,
          if "longest", rescale the image so that only the longest side is equal to specified `spatial_size`,
          which must be an int number in this case, keeping the aspect ratio of the initial image, refer to:
          https://albumentations.ai/docs/api_reference/augmentations/geometric/resize/
          #albumentations.augmentations.geometric.resize.LongestMaxSize.
      kwargs: other arguments for the `np.pad` or `torch.pad` function.
          note that `np.pad` treats channel dimension as the first dimension.
class_docstr_tok: ["Resize","the","input","boxes","when","the","corresponding","image","is","resized","to","given","spatial","size","(","with","scaling",",","not","cropping\/padding",")",".","Args",":","spatial_size",":","expected","shape","of","spatial","dimensions","after","resize","operation",".","if","some","components","of","the","`","spatial_size","`","are","non-positive","values",",","the","transform","will","use","the","corresponding","components","of","img","size",".","For","example",",","`","spatial_size=","(","32",",","-1",")","`","will","be","adapted","to","`","(","32",",","64",")","`","if","the","second","spatial","dimension","size","of","img","is","`","64","`",".","size_mode",":","should","be","``","all","''","or","``","longest","''",",","if","``","all","''",",","will","use","`","spatial_size","`","for","all","the","spatial","dims",",","if","``","longest","''",",","rescale","the","image","so","that","only","the","longest","side","is","equal","to","specified","`","spatial_size","`",",","which","must","be","an","int","number","in","this","case",",","keeping","the","aspect","ratio","of","the","initial","image",",","refer","to",":","https",":","\/\/albumentations.ai\/docs\/api_reference\/augmentations\/geometric\/resize\/","#","albumentations.augmentations.geometric.resize.LongestMaxSize",".","kwargs",":","other","arguments","for","the","`","np.pad","`","or","`","torch.pad","`","function",".","note","that","`","np.pad","`","treats","channel","dimension","as","the","first","dimension","."]
docstr: Args:
      boxes: source bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``
      src_spatial_size: original image spatial size before resizing.
  
  Raises:
      ValueError: When ``self.spatial_size`` length is less than ``boxes`` spatial dimensions.
docstr_tok: ["Args",":","boxes",":","source","bounding","boxes",",","Nx4","or","Nx6","torch","tensor","or","ndarray",".","The","box","mode","is","assumed","to","be","``","StandardMode","``","src_spatial_size",":","original","image","spatial","size","before","resizing",".","Raises",":","ValueError",":","When","``","self.spatial_size","``","length","is","less","than","``","boxes","``","spatial","dimensions","."]
code: def __call__(self, boxes: NdarrayOrTensor, src_spatial_size: Sequence[int] | int) -> NdarrayOrTensor:  # type: ignore[override]
      """
      Args:
          boxes: source bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``
          src_spatial_size: original image spatial size before resizing.
  
      Raises:
          ValueError: When ``self.spatial_size`` length is less than ``boxes`` spatial dimensions.
      """
      input_ndim = get_spatial_dims(boxes=boxes)  # spatial ndim
      src_spatial_size_ = ensure_tuple_rep(src_spatial_size, input_ndim)
  
      if self.size_mode == "all":
          # spatial_size must be a Sequence if size_mode is 'all'
          output_ndim = len(ensure_tuple(self.spatial_size))
          if output_ndim != input_ndim:
              raise ValueError(
                  "len(spatial_size) must be greater or equal to img spatial dimensions, "
                  f"got spatial_size={output_ndim} img={input_ndim}."
              )
          spatial_size_ = fall_back_tuple(
              self.spatial_size, src_spatial_size_
          )
      else:  # for the "longest" mode
          if not isinstance(self.spatial_size, int):
              raise ValueError(
                  "spatial_size must be an int number if size_mode is 'longest'."
              )
          scale = self.spatial_size / max(src_spatial_size_)
          spatial_size_ = tuple(
              int(round(s * scale)) for s in src_spatial_size_
          )
  
      return resize_boxes(boxes, src_spatial_size_, spatial_size_)
  
imports: from __future__ import annotations
  from typing import Any, Sequence
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike, NdarrayOrTensor, NdarrayTensor
  from monai.data.box_utils import BoxMode, clip_boxes_to_image, convert_box_mode, convert_box_to_standard_mode, get_spatial_dims, spatial_crop_boxes, standardize_empty_box
  from monai.transforms import Rotate90, SpatialCrop
  from monai.transforms.transform import Transform
  from monai.utils import ensure_tuple, ensure_tuple_rep, fall_back_tuple, look_up_option
  from monai.utils.enums import TransformBackends
  from .box_ops import apply_affine_to_boxes, convert_box_to_mask, convert_mask_to_box, flip_boxes, resize_boxes, rot90_boxes, select_labels, zoom_boxes
label_desc: Use image node_id 2 for calling the ResizeBox obj's underlying member method code with example usage: obj.__call__(boxes, src_spatial_size) and returns: resize_boxes