code: def get_compressed_ids(
      labels, sizes: Shape
  ) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.int64]]:
      """
      Group_index is offsets into cartesian product of all possible labels. This
      space can be huge, so this function compresses it, by computing offsets
      (comp_ids) into the list of unique labels (obs_group_ids).
  
      Parameters
      ----------
      labels : list of label arrays
      sizes : tuple[int] of size of the levels
  
      Returns
      -------
      np.ndarray[np.intp]
          comp_ids
      np.ndarray[np.int64]
          obs_group_ids
      """
      ids = get_group_index(labels, sizes, sort=True, xnull=False)
      return compress_group_index(ids, sort=True)
  
imports: from __future__ import annotations
  from collections import defaultdict
  from typing import TYPE_CHECKING, Callable, DefaultDict, cast
  import numpy
  from pandas._libs import algos, hashtable, lib
  from pandas._libs.hashtable import unique_label_indices
  from pandas.core.dtypes.common import ensure_int64, ensure_platform_int
  from pandas.core.dtypes.generic import ABCMultiIndex, ABCRangeIndex
  from pandas.core.dtypes.missing import isna
  from pandas.core.construction import extract_array
label_desc: Use image node_id 3 for calling a global function with example usage: get_compressed_ids(labels, sizes) and returns: compress_group_index