code: def flip_boxes(
      boxes: NdarrayTensor,
      spatial_size: Sequence[int] | int,
      flip_axes: Sequence[int] | int | None = None,
  ) -> NdarrayTensor:
      """
      Flip boxes when the corresponding image is flipped
  
      Args:
          boxes: bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``
          spatial_size: image spatial size.
          flip_axes: spatial axes along which to flip over. Default is None.
              The default `axis=None` will flip over all of the axes of the input array.
              If axis is negative it counts from the last to the first axis.
              If axis is a tuple of ints, flipping is performed on all of the axes
              specified in the tuple.
  
      Returns:
          flipped boxes, with same data type as ``boxes``, does not share memory with ``boxes``
      """
      spatial_dims: int = get_spatial_dims(boxes=boxes)
      spatial_size = ensure_tuple_rep(spatial_size, spatial_dims)
      if flip_axes is None:
          flip_axes = tuple(range(0, spatial_dims))
      flip_axes = ensure_tuple(flip_axes)
  
      # flip box
      _flip_boxes: NdarrayTensor = boxes.clone() if isinstance(boxes, torch.Tensor) else deepcopy(boxes)  # type: ignore[assignment]
  
      for axis in flip_axes:
          _flip_boxes[:, axis + spatial_dims] = (
              spatial_size[axis] - boxes[:, axis] - TO_REMOVE
          )
          _flip_boxes[:, axis] = (
              spatial_size[axis]
              - boxes[:, axis + spatial_dims]
              - TO_REMOVE
          )
  
      return _flip_boxes
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from copy import deepcopy
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike, NdarrayOrTensor, NdarrayTensor
  from monai.data.box_utils import COMPUTE_DTYPE, TO_REMOVE, get_spatial_dims
  from monai.transforms import Resize
  from monai.transforms.utils import create_scale
  from monai.utils import look_up_option
  from monai.utils.misc import ensure_tuple, ensure_tuple_rep
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 5 for calling a global function with example usage: flip_boxes(boxes, spatial_size, flip_axes) and returns: _flip_boxes