code: def create_coco_api(coco_records) -> COCO:
      """Create COCO dataset api
  
      Args:
          coco_records: Records in coco style (use convert_records_to_coco_style to convert
          records to coco style.
      """
      coco_ds = COCO()
      coco_ds.dataset = coco_records
      coco_ds.createIndex()
  
      return coco_ds
  
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 2 for calling a global function with example usage: create_coco_api(coco_records) and returns: coco_ds