code: def crop_and_pad_bbox(
      bbox: BoxInternalType,
      crop_params: Optional[Sequence[int]],
      pad_params: Optional[Sequence[int]],
      rows,
      cols,
      result_rows,
      result_cols,
  ) -> BoxInternalType:
      x1, y1, x2, y2 = denormalize_bbox(bbox, rows, cols)[:4]
  
      if crop_params is not None:
          crop_x, crop_y = crop_params[:2]
          x1, y1, x2, y2 = (
              x1 - crop_x,
              y1 - crop_y,
              x2 - crop_x,
              y2 - crop_y,
          )
      if pad_params is not None:
          top, bottom, left, right = pad_params
          x1, y1, x2, y2 = x1 + left, y1 + top, x2 + left, y2 + top
  
      return normalize_bbox((x1, y1, x2, y2), result_rows, result_cols)
  
imports: from typing import Optional, Sequence, Tuple
  import cv2
  import numpy
  from albumentations.augmentations.utils import _maybe_process_in_chunks, preserve_channel_dim
  from ...core.bbox_utils import denormalize_bbox, normalize_bbox
  from ...core.transforms_interface import BoxInternalType, KeypointInternalType
  from ..geometric import functional
label_desc: Use image node_id 15 for calling a global function with example usage: crop_and_pad_bbox(bbox, crop_params, pad_params, rows, cols, result_rows, result_cols) and returns: normalize_bbox