code: def coco_api_from_records(records, show_pbar: bool = False) -> COCO:
      """Create pycocotools COCO dataset from records"""
      coco_records = convert_records_to_coco_style(
          records, show_pbar=show_pbar
      )
      return create_coco_api(coco_records=coco_records)
  
file_path: icevision/icevision/data/convert_records_to_coco_style.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  import json
  import numpy
  import PIL
label_desc: Use image node_id 4 for calling a global function with example usage: coco_api_from_records(records, show_pbar) and returns: create_coco_api