code: def _extract_max_ious(ious, labels1, labels2):
      if labels1 is None and labels2 is None:
          return None, None, None, None
  
      m, n = ious.shape
  
      if labels2:
          inds1 = ious.argmax(axis=1)
          max1 = list(ious[range(m), inds1])
          ids1 = [labels2[i].id for i in inds1]
      else:
          max1 = [None] * m
          ids1 = [None] * m
  
      if labels1:
          inds2 = ious.argmax(axis=0)
          max2 = list(ious[inds2, range(n)])
          ids2 = [labels1[i].id for i in inds2]
      else:
          max2 = [None] * n
          ids2 = [None] * n
  
      return max1, max2, ids1, ids2
  
imports: import contextlib
  import itertools
  import logging
  import numpy
  import scipy.spatial
  import eta.core.numutils
  import eta.core.utils
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.core.validation
  from .utils3d import compute_cuboid_iou
label_desc: Use image node_id 7 for calling a global function with example usage: _extract_max_ious(ious, labels1, labels2) and returns: max1,  max2,  ids1,  ids2, None,  None,  None,  None