class_docstr: mAP evaluation metrics for the VIS task.
  
  Args:
      metric (str | list[str]): Metrics to be evaluated.
          Default value is `youtube_vis_ap`.
      metric_items (List[str], optional): Metric result names to be
          recorded in the evaluation result. Defaults to None.
      outfile_prefix (str | None): The prefix of json files. It includes
          the file path and the prefix of filename, e.g., "a/b/prefix".
          If not specified, a temp file will be created. Defaults to None.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonyms metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Default: None
      format_only (bool): If True, only formatting the results to the
          official format and not performing evaluation. Defaults to False.
docstr: Gather all ground-truth from self.results.
docstr_tok: ["Gather","all","ground-truth","from","self.results","."]
code: def format_gts(self, gts: Tuple[List]) -> dict:
      """Gather all ground-truth from self.results."""
      self.categories = [
          dict(id=id + 1, name=name)
          for id, name in enumerate(self.dataset_meta["classes"])
      ]
      gt_results = dict(
          categories=self.categories,
          videos=self._vis_meta_info["videos"],
          annotations=[],
      )
      for gt_result in gts:
          gt_results["annotations"].extend(gt_result)
      return gt_results
  
imports: import os.path
  import tempfile
  import warnings
  import zipfile
  from collections import OrderedDict, defaultdict
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import mmengine
  import numpy
  from mmengine.dist import all_gather_object, barrier, broadcast_object_list, is_main_process
  from mmengine.logging import MMLogger
  from mmdet.registry import METRICS
  from mmdet.structures.mask import encode_mask_results
  from ..functional import YTVIS, YTVISeval
  from .base_video_metric import BaseVideoMetric, collect_tracking_results
label_desc: Use image node_id 4 for calling the YouTubeVISMetric obj's underlying member method code with example usage: obj.format_gts(gts) and returns: gt_results