code: def _term_frequency(X):
      """
      Count the number of occurrences of each term in X.
      """
      term_freq = (
          X[["token", "count"]].groupby(["token"], sort=True).sum()
      )
      return term_freq["count"].values
  
imports: from cuml.internals.safe_imports import cpu_only_import
  import cuml.internals.logger
  from cudf.utils.dtypes import min_signed_type
  from cuml.internals.type_utils import CUPY_SPARSE_DTYPES
  import numbers
  from cuml.internals.safe_imports import gpu_only_import
  from functools import partial
  from cuml.common.sparsefuncs import create_csr_matrix_from_count_df
  from cuml.common.sparsefuncs import csr_row_normalize_l1, csr_row_normalize_l2
  from cuml.feature_extraction._stop_words import ENGLISH_STOP_WORDS
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 3 for calling a global function with example usage: _term_frequency(X) and returns: term_freq