code: def _add_categories_metadata(
      dataset_name: str, categories: List[Dict[str, Any]]
  ):
      meta = MetadataCatalog.get(dataset_name)
      meta.categories = {c["id"]: c["name"] for c in categories}
      logger = logging.getLogger(__name__)
      logger.info(
          "Dataset {} categories: {}".format(
              dataset_name, meta.categories
          )
      )
  
imports: import contextlib
  import io
  import logging
  import os
  from collections import defaultdict
  from dataclasses import dataclass
  from typing import Any, Dict, Iterable, List, Optional
  from fvcore.common.timer import Timer
  from detectron2.data import DatasetCatalog, MetadataCatalog
  from detectron2.structures import BoxMode
  from detectron2.utils.file_io import PathManager
  from ..utils import maybe_prepend_base_path
label_desc: Use image node_id 3 for calling a global function with example usage: _add_categories_metadata(dataset_name, categories) without return types