code: def test_count_matrix(self):
      (a, b, c, d, e, f) = self.token_ids
      shift = len(SPECIAL_TOKENS)
      expected_counts = np.zeros_like(self.modality.count_matrix.A)
      expected_counts[0, a - shift] = 1
      expected_counts[0, b - shift] = 1
      expected_counts[0, c - shift] = 1
      expected_counts[1, b - shift] = 1
      expected_counts[1, c - shift] = 1
      expected_counts[1, d - shift] = 2
      expected_counts[2, b - shift] = 1
      expected_counts[2, c - shift] = 2
      expected_counts[2, e - shift] = 1
      expected_counts[2, f - shift] = 1
      npt.assert_array_equal(
          self.modality.count_matrix.A, expected_counts
      )
  
imports: import unittest
  from collections import defaultdict
  import numpy
  import numpy.testing
  from cornac.data import TextModality, ReviewModality
  from cornac.data.text import SPECIAL_TOKENS, DEFAULT_PRE_RULES, BaseTokenizer, Vocabulary, CountVectorizer, TfidfVectorizer
label_desc: Use image node_id 6 for calling the TestTextModality obj's underlying member method code with example usage: obj.test_count_matrix() without return types