class_docstr: tests Vocabulary Class
class_docstr_tok: ["tests","Vocabulary","Class"]
code: def test_len_is_constant(self):
      # Given an obviously small and an obviously large vocabulary.
      small_vocab = Vocabulary("abcde")
      from nltk.corpus.europarl_raw import english
  
      large_vocab = Vocabulary(english.words())
  
      # If we time calling `len` on them.
      small_vocab_len_time = timeit(
          "len(small_vocab)", globals=locals()
      )
      large_vocab_len_time = timeit(
          "len(large_vocab)", globals=locals()
      )
  
      # The timing should be the same order of magnitude.
      self.assertAlmostEqual(
          small_vocab_len_time, large_vocab_len_time, places=1
      )
  
imports: import unittest
  from collections import Counter
  from timeit import timeit
  from nltk.lm import Vocabulary
label_desc: Use image node_id 21 for calling the NgramModelVocabularyTests obj's underlying member method code with example usage: obj.test_len_is_constant() without return types