code: def test_mask_iou(mask1, mask2, iou, abs_tol):
      iou_mat = metrics.mask_iou(np.asarray(mask1), np.asarray(mask2))
      assert iou_mat.shape == (len(mask1), len(mask2))
      if iou_mat.size > 0:
          assert abs(iou_mat - iou) <= abs_tol
  
      # Incompatible spatial shapes
      with pytest.raises(AssertionError):
          metrics.mask_iou(
              np.zeros((2, 3, 5), dtype=bool),
              np.ones((3, 2, 5), dtype=bool),
          )
  
file_path: doctr/tests/common/test_utils_metrics.py
imports: import numpy
  import pytest
  from doctr.utils import metrics
label_desc: Use image node_id 3 for calling a global function with example usage: test_mask_iou(mask1, mask2, iou, abs_tol) without return types