code: def bbox_transpose(
      bbox: KeypointInternalType, axis: int, rows: int, cols: int
  ) -> KeypointInternalType:  # skipcq: PYL-W0613
      """Transposes a bounding box along given axis.
  
      Args:
          bbox: A bounding box `(x_min, y_min, x_max, y_max)`.
          axis: 0 - main axis, 1 - secondary axis.
          rows: Image rows.
          cols: Image cols.
  
      Returns:
          A bounding box tuple `(x_min, y_min, x_max, y_max)`.
  
      Raises:
          ValueError: If axis not equal to 0 or 1.
  
      """
      x_min, y_min, x_max, y_max = bbox[:4]
      if axis not in {0, 1}:
          raise ValueError("Axis must be either 0 or 1.")
      if axis == 0:
          bbox = (y_min, x_min, y_max, x_max)
      if axis == 1:
          bbox = (1 - y_max, 1 - x_max, 1 - y_min, 1 - x_min)
      return bbox
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import cv2
  import numpy
  import skimage.transform
  from scipy.ndimage import gaussian_filter
  from albumentations.augmentations.utils import _maybe_process_in_chunks, angle_2pi_range, clipped, preserve_channel_dim, preserve_shape
  from ...None import random_utils
  from ...core.bbox_utils import denormalize_bbox, normalize_bbox
  from ...core.transforms_interface import BoxInternalType, FillValueType, ImageColorType, KeypointInternalType
label_desc: Use image node_id 42 for calling a global function with example usage: bbox_transpose(bbox, axis, rows, cols) and returns: bbox