code: def test_equal_pycocotools(coco_visiondata_test):
      metric = ObjectDetectionAveragePrecision(return_option=None)
      for batch in coco_visiondata_test:
          metric.update(
              (
                  sequence_to_numpy(batch["predictions"]),
                  sequence_to_numpy(batch["labels"]),
              )
          )
      res = metric.compute()[0]
  
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], area="all", max_dets=100
          ),
          close_to(0.409, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], iou=0.5, area="all", max_dets=100
          ),
          close_to(0.566, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], iou=0.75, area="all", max_dets=100
          ),
          close_to(0.425, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], area="small", max_dets=100
          ),
          close_to(0.212, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], area="medium", max_dets=100
          ),
          close_to(0.383, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["precision"], area="large", max_dets=100
          ),
          close_to(0.541, 0.001),
      )
  
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="all", max_dets=1
          ),
          close_to(0.330, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="all", max_dets=10
          ),
          close_to(0.423, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="all", max_dets=100
          ),
          close_to(0.429, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="small", max_dets=100
          ),
          close_to(0.220, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="medium", max_dets=100
          ),
          close_to(0.423, 0.001),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], area="large", max_dets=100
          ),
          close_to(0.549, 0.001),
      )
  
      # unrelated to pycoco but needed to check another param
      assert_that(
          metric.get_classes_scores_at(
              res["recall"],
              area="large",
              max_dets=100,
              get_mean_val=False,
              zeroed_negative=False,
          ),
          has_items([-1]),
      )
      assert_that(
          metric.get_classes_scores_at(
              res["recall"], get_mean_val=False, zeroed_negative=False
          ),
          has_items([-1]),
      )
  
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 4 for calling a global function with example usage: test_equal_pycocotools(coco_visiondata_test) without return types