code: def cocoeval_pycocotools(
      outputs: List,
      data: pd.DataFrame,
      anno_file: str,
      cache_path: str,
  ):
      """
      Evaluate predictor's output using pycocotool's mAP implementation: https://github.com/cocodataset/cocoapi
      Pycocotool's implementation takes COCO format prediction result file as input.
      So here requires a cache_path to store the prediction result file.
  
      Parameters
      ----------
      outputs
          The predictor's output. It is a list with length equals number of images.
      data
          The input data.
      anno_file
          The path to COCO format json annotation file.
      cache_path
          The cache path to store prediction result in COCO format.
  
      Returns
      -------
      The mAP result.
      """
      try_import_pycocotools()
      from pycocotools.coco import COCO
      from pycocotools.cocoeval import COCOeval
  
      from ..constants import BBOX
      from . import extract_from_output
  
      coco_dataset = COCODataset(anno_file)
  
      ret = extract_from_output(ret_type=BBOX, outputs=outputs)
  
      coco_dataset.save_result(ret, data, cache_path)
  
      cocoGt = COCO(anno_file)
      cocoDt = cocoGt.loadRes(cache_path)
      annType = "bbox"
  
      cocoEval = COCOeval(cocoGt, cocoDt, annType)
      cocoEval.evaluate()
      cocoEval.accumulate()
      cocoEval.summarize()
  
      return cocoEval.stats
  
imports: import json
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Union
  import defusedxml.ElementTree
  import numpy
  import pandas
  import PIL
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from ..constants import BBOX, LABEL, MAP, MAP_50, MAP_75, MAP_LARGE, MAP_MEDIUM, MAP_SMALL, MAR_1, MAR_10, MAR_100, MAR_LARGE, MAR_MEDIUM, MAR_SMALL, MEAN_AVERAGE_PRECISION
  from .download import download, is_url
label_desc: Use image node_id 20 for calling a global function with example usage: cocoeval_pycocotools(outputs, data, anno_file, cache_path) and returns: cocoEval