code: def test_coco_metric(records, preds, expected_coco_output):
      coco_metric = COCOMetric(print_summary=True)
      preds = [Prediction(pred, gt) for pred, gt in zip(preds, records)]
      coco_metric.accumulate(preds)
  
      with CaptureStdout() as output:
          coco_metric.finalize()
  
      assert output == expected_coco_output
  
imports: import pytest
  from icevision.all import *
label_desc: Use image node_id 3 for calling a global function with example usage: test_coco_metric(records, preds, expected_coco_output) without return types