code: def analyse(
      dataset_json_path: str,
      result_json_path: str,
      out_dir: str = None,
      type: str = "bbox",
      no_extraplots: bool = False,
      areas: List[int] = [1024, 9216, 10000000000],
      max_detections: int = 500,
      return_dict: bool = False,
  ):
      """
      Args:
          dataset_json_path (str): file path for the coco dataset json file
          result_json_paths (str): file path for the coco result json file
          out_dir (str): dir to save analyse result images
          no_extraplots (bool): dont export export extra bar/stat plots
          type (str): 'bbox' or 'mask'
          areas (List[int]): area regions for coco evaluation calculations
          max_detections (int): Maximum number of detections to consider for AP alculation. Default: 500
          return_dict (bool): If True, returns a dict export paths.
      """
      try:
          from pycocotools.coco import COCO
          from pycocotools.cocoeval import COCOeval
      except ModuleNotFoundError:
          raise ModuleNotFoundError(
              'Please run "pip install -U pycocotools" '
              "to install pycocotools first for coco evaluation."
          )
      try:
          import matplotlib.pyplot as plt
      except ModuleNotFoundError:
          raise ModuleNotFoundError(
              'Please run "pip install -U matplotlib" '
              "to install matplotlib first for visualization."
          )
  
      result = _analyse_results(
          result_json_path,
          dataset_json_path,
          res_types=[type],
          out_dir=out_dir,
          extraplots=not no_extraplots,
          areas=areas,
          max_detections=max_detections,
          COCO=COCO,
          COCOeval=COCOeval,
      )
      if return_dict:
          return result
  
file_path: sahi/sahi/scripts/coco_error_analysis.py
imports: import copy
  import os
  from multiprocessing import Pool
  from pathlib import Path
  from typing import List
  import fire
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: analyse(dataset_json_path, result_json_path, out_dir, type, no_extraplots, areas, max_detections, return_dict) and returns: result