code: def swapaxes_boxes(
      boxes: NdarrayTensor, axis1: int, axis2: int
  ) -> NdarrayTensor:
      """
      Interchange two axes of boxes.
  
      Args:
          boxes: bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``
          axis1: First axis.
          axis2: Second axis.
  
      Returns:
          boxes with two axes interchanged.
  
      """
      spatial_dims: int = get_spatial_dims(boxes=boxes)
  
      if isinstance(boxes, torch.Tensor):
          boxes_swap = boxes.clone()
      else:
          boxes_swap = deepcopy(boxes)  # type: ignore
      boxes_swap[:, [axis1, axis2]] = boxes_swap[:, [axis2, axis1]]
  
      boxes_swap[
          :, [spatial_dims + axis1, spatial_dims + axis2]
      ] = boxes_swap[:, [spatial_dims + axis2, spatial_dims + axis1]]
      return boxes_swap
  
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 9 for calling a global function with example usage: swapaxes_boxes(boxes, axis1, axis2) and returns: boxes_swap