code: def _get_category_id_to_continuous_id(
      things: Set[int], stuffs: Set[int]
  ) -> Dict[int, int]:
      """Convert original IDs to continuous IDs.
  
      Args:
          things: All unique IDs for things classes.
          stuffs: All unique IDs for stuff classes.
  
      Returns:
          A mapping from the original category IDs to continuous IDs (i.e., 0, 1, 2, ...).
  
      """
      # things metrics are stored with a continuous id in [0, len(things)[,
      thing_id_to_continuous_id = {
          thing_id: idx for idx, thing_id in enumerate(things)
      }
      # stuff metrics are stored with a continuous id in [len(things), len(things) + len(stuffs)[
      stuff_id_to_continuous_id = {
          stuff_id: idx + len(things)
          for idx, stuff_id in enumerate(stuffs)
      }
      cat_id_to_continuous_id = {}
      cat_id_to_continuous_id.update(thing_id_to_continuous_id)
      cat_id_to_continuous_id.update(stuff_id_to_continuous_id)
      return cat_id_to_continuous_id
  
file_path: torchmetrics/src/torchmetrics/functional/detection/_panoptic_quality_common.py
imports: from typing import Collection, Dict, Iterator, List, Optional, Set, Tuple, cast
  import torch
  from torch import Tensor
  from torchmetrics.utilities import rank_zero_warn
label_desc: Use image node_id 7 for calling a global function with example usage: _get_category_id_to_continuous_id(things, stuffs) and returns: cat_id_to_continuous_id