code: def _summarize(
      prec,
      rec,
      iou_threshs,
      area_ranges,
      max_detection_list,
      ap=True,
      iou_thresh=None,
      area_range="all",
      max_detection=100,
  ):
      a_idx = area_ranges.index(area_range)
      m_idx = max_detection_list.index(max_detection)
      if ap:
          val_value = prec.copy()  # (T, R, K, A, M)
          if iou_thresh is not None:
              val_value = val_value[iou_thresh == iou_threshs]
          val_value = val_value[:, :, :, a_idx, m_idx]
      else:
          val_value = rec.copy()  # (T, K, A, M)
          if iou_thresh is not None:
              val_value = val_value[iou_thresh == iou_threshs]
          val_value = val_value[:, :, a_idx, m_idx]
  
      val_value[val_value == -1] = np.nan
      val_value = val_value.reshape((-1, val_value.shape[-1]))
      valid_classes = np.any(
          np.logical_not(np.isnan(val_value)), axis=0
      )
      cls_val_value = np.nan * np.ones(
          len(valid_classes), dtype=np.float32
      )
      cls_val_value[valid_classes] = np.nanmean(
          val_value[:, valid_classes], axis=0
      )
  
      if not np.any(valid_classes):
          mean_val_value = np.nan
      else:
          mean_val_value = np.nanmean(cls_val_value)
      return cls_val_value, mean_val_value
  
file_path: chainercv/chainercv/evaluations/eval_detection_coco.py
imports: import contextlib
  import itertools
  import numpy
  import os
  import six
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _summarize(prec, rec, iou_threshs, area_ranges, max_detection_list, ap, iou_thresh, area_range, max_detection) and returns: cls_val_value,  mean_val_value