code: def test_limit_vocabulary(self):
      # Given
      config = CooccurrenceVectorizerConfig(filter_stop_words=False)
      vectorizer = CooccurrenceVectorizer(config=config)
      train_data = [
          text_to_utterance(t) for t in ("a b", "a c", "a d", "a e")
      ]
  
      data = [text_to_utterance(t) for t in ("a c e", "a d e")]
      vectorizer.fit(train_data, get_empty_dataset("en"))
      x_0 = vectorizer.transform(data)
      pairs = {
          ("a", "b"): 0,
          ("a", "c"): 1,
          ("a", "d"): 2,
          ("a", "e"): 3,
      }
      kept_pairs = [("a", "b"), ("a", "c"), ("a", "d")]
      self.assertDictEqual(pairs, vectorizer.word_pairs)
  
      # When
      kept_pairs_indexes = [pairs[p] for p in kept_pairs]
      vectorizer.limit_word_pairs(kept_pairs)
  
      # Then
      expected_pairs = {("a", "b"): 0, ("a", "c"): 1, ("a", "d"): 2}
      self.assertDictEqual(expected_pairs, vectorizer.word_pairs)
      x_1 = vectorizer.transform(data)
      self.assertListEqual(
          x_0[:, kept_pairs_indexes].todense().tolist(),
          x_1.todense().tolist(),
      )
  
imports: from __future__ import unicode_literals
  import io
  from builtins import str, zip, range
  import numpy
  from checksumdir import dirhash
  from mock import patch, MagicMock
  from snips_nlu.common.io_utils import temp_dir
  from snips_nlu.common.utils import json_string
  from snips_nlu.constants import LANGUAGE_EN, STEMS, WORD_CLUSTERS, STOP_WORDS
  from snips_nlu.dataset import Dataset
  from snips_nlu.entity_parser import BuiltinEntityParser, CustomEntityParser
  from snips_nlu.entity_parser.custom_entity_parser_usage import CustomEntityParserUsage
  from snips_nlu.exceptions import _EmptyDatasetUtterancesError
  from snips_nlu.intent_classifier.featurizer import CooccurrenceVectorizer, Featurizer, TfidfVectorizer
  from snips_nlu.intent_classifier.log_reg_classifier_utils import text_to_utterance
  from snips_nlu.pipeline.configs import FeaturizerConfig
  from snips_nlu.pipeline.configs.intent_classifier import CooccurrenceVectorizerConfig, TfidfVectorizerConfig
  from snips_nlu.tests.utils import FixtureTest, get_empty_dataset, EntityParserMock
label_desc: Use image node_id 8 for calling the CooccurrenceVectorizerTest obj's underlying member method code with example usage: obj.test_limit_vocabulary() without return types