code: def test_lexicon_from_training_data(tmp_path):
      """
      Test a couple aspects of building a lexicon from training data
  
      expected number of words eliminated for being too long
      duplicate words counted once
      numbers eliminated
      """
      conllu_file = str(tmp_path / "train.conllu")
      with open(conllu_file, "w", encoding="utf-8") as fout:
          fout.write(TRAIN_DATA)
  
      lexicon, num_dict_feat = utils.create_lexicon(
          "en_test", conllu_file
      )
      lexicon = sorted(lexicon)
      expected_lexicon = [
          "'d",
          "announced",
          "baghdad",
          "being",
          "busted",
          "by",
          "cells",
          "dpa",
          "in",
          "interior",
          "iraqi",
          "ministry",
          "of",
          "officials",
          "operating",
          "run",
          "terrorist",
          "that",
          "the",
          "them",
          "they",
          "they'd",
          "three",
          "two",
          "up",
          "were",
      ]
      assert lexicon == expected_lexicon
      assert num_dict_feat == max(len(x) for x in lexicon)
  
file_path: stanza/stanza/tests/tokenization/test_tokenize_utils.py
imports: import pytest
  import stanza
  from stanza import Pipeline
  from stanza.tests import *
  from stanza.models.common import doc
  from stanza.models.tokenization import data
  from stanza.models.tokenization import utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_lexicon_from_training_data(tmp_path) without return types