code: def compute_ious_for_image(
      boxes1: np.ndarray, boxes2: np.ndarray
  ) -> np.ndarray:
      """Computes pairwise ious for two lists of boxes.
  
      Args:
       boxes1: numpy array, containing a list of bounding boxes in 'corners' format.
       boxes2: numpy array, containing a list of bounding boxes in 'corners' format.
         Bounding boxes are expected to be in the corners format of [LEFT, TOP,
         RIGHT, BOTTOM]  For example, the bounding box with it's left bound at 20,
         right bound at 100, TOP_bound at 110, BOTTOM bound at 300 is be represented
         as [20, 110, 100, 300]
  
      Returns:
         iou_lookup_table: a vector containing the pairwise ious of boxes1 and
         boxes2. The (i,j) element of the table is the iou of the i th box of
         boxes1 and the j th element of boxes2.
      """
  
      # Sanity check of the dimension and shape of inputs
      if (
          boxes1.ndim != 2
          or boxes1.shape[1] != 4
          or boxes2.ndim != 2
          or boxes2.shape[1] != 4
      ):
          raise ValueError(
              "Input boxes lists should be a 2d array of shape "
              f"(<batch_size>, 4), Input shapes are {boxes1.shape},"
              f" {boxes2.shape}"
          )
  
      # Split each dimension
      boxes1_xmin, boxes1_ymin, boxes1_xmax, boxes1_ymax = np.split(
          boxes1, 4, axis=1
      )
      boxes2_xmin, boxes2_ymin, boxes2_xmax, boxes2_ymax = np.split(
          boxes2, 4, axis=1
      )
  
      # Calculate the area of each box
      boxes1_area = bounding_box.bounding_box_area(boxes1)
      boxes2_area = bounding_box.bounding_box_area(boxes2)
  
      # Calculate the intersection area for each boxes pair
      intersect_ymin = np.maximum(boxes1_ymin, boxes2_ymin.transpose())
      intersect_xmin = np.maximum(boxes1_xmin, boxes2_xmin.transpose())
      intersect_ymax = np.minimum(boxes1_ymax, boxes2_ymax.transpose())
      intersect_xmax = np.minimum(boxes1_xmax, boxes2_xmax.transpose())
  
      intersect_width = np.maximum(intersect_xmax - intersect_xmin, 0)
      intersect_height = np.maximum(intersect_ymax - intersect_ymin, 0)
      intersect_area = intersect_width * intersect_height
  
      # Calculate the union area of each boxes pair
      union_area = (
          boxes1_area[..., np.newaxis]
          + boxes2_area[np.newaxis, ...]
          - intersect_area
      )
      # Return with a out arg to avoid divide by zero
      return np.divide(
          intersect_area,
          union_area,
          out=np.zeros_like(intersect_area, dtype=float),
          where=union_area != 0,
      )
  
imports: from typing import Callable, Iterable, Union, Tuple, Optional
  import numpy
  from tensorflow_model_analysis.metrics.preprocessors.utils import bounding_box
label_desc: Use image node_id 2 for calling a global function with example usage: compute_ious_for_image(boxes1, boxes2) and returns: np