code: def test_average_precision_thresholds(coco_visiondata_test):
      res = calculate_metrics(
          {
              "ap": ObjectDetectionAveragePrecision(
                  iou_range=(0.4, 0.8, 5), average="macro"
              )
          },
          coco_visiondata_test,
      )
      assert_that(res["ap"], close_to(0.514, 0.001))
  
imports: from typing import Dict
  import numpy
  from hamcrest import assert_that, close_to, has_items, has_length
  from ignite.engine import Engine
  from ignite.metrics import Metric
  from numpy import nanmean
  from sklearn.metrics import jaccard_score, make_scorer
  from deepchecks.vision import VisionData
  from deepchecks.vision.metrics_utils import get_scorers_dict
  from deepchecks.vision.metrics_utils.detection_precision_recall import ObjectDetectionAveragePrecision
  from deepchecks.vision.metrics_utils.semantic_segmentation_metrics import MeanDice, MeanIoU, per_sample_dice
  from deepchecks.vision.vision_data.utils import sequence_to_numpy
label_desc: Use image node_id 6 for calling a global function with example usage: test_average_precision_thresholds(coco_visiondata_test) without return types