code: def warp_affine(
      image: np.ndarray,
      matrix: skimage.transform.ProjectiveTransform,
      interpolation: int,
      cval: Union[int, float, Sequence[int], Sequence[float]],
      mode: int,
      output_shape: Sequence[int],
  ) -> np.ndarray:
      if _is_identity_matrix(matrix):
          return image
  
      dsize = int(np.round(output_shape[1])), int(
          np.round(output_shape[0])
      )
      warp_fn = _maybe_process_in_chunks(
          cv2.warpAffine,
          M=matrix.params[:2],
          dsize=dsize,
          flags=interpolation,
          borderMode=mode,
          borderValue=cval,
      )
      tmp = warp_fn(image)
      return tmp
  
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 22 for calling a global function with example usage: warp_affine(image, matrix, interpolation, cval, mode, output_shape) and returns: tmp, image