docstr: Utility method for getting the counts of categories for each categorical variable.
code: def _get_counts(
      self, x: np.ndarray, categories: Dict[int, List[int]]
  ) -> Dict[int, List[int]]:
      """
      Utility method for getting the counts of categories for each categorical variable.
      """
      return {
          f: [(x[:, f] == v).sum() for v in vals]
          for f, vals in categories.items()
      }
  
file_path: alibi-detect/alibi_detect/cd/chisquare.py
imports: import numpy
  from scipy.stats import chi2_contingency
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from alibi_detect.cd.base import BaseUnivariateDrift
  from alibi_detect.utils.warnings import deprecated_alias
label_desc: Use image node_id 3 for calling the ChiSquareDrift obj's underlying member method code with example usage: obj._get_counts(x, categories) and returns: unknown