code: def test_store_results():
      nlp = stanza.Pipeline(
          **{
              "processors": "tokenize,pos,lemma",
              "dir": TEST_MODELS_DIR,
              "lang": "en",
          },
          lemma_store_results=True,
      )
      lemmatizer = nlp.processors["lemma"]._trainer
  
      az = find_unknown_word(lemmatizer, "a")
      bz = find_unknown_word(lemmatizer, "b")
      cz = find_unknown_word(lemmatizer, "c")
  
      # try sentences with the order long, short
      doc = nlp(
          "I found an " + az + " in my " + bz + ".  It was a " + cz
      )
      stuff = doc.get([TEXT, UPOS, LEMMA])
      assert len(stuff) == 12
      assert stuff[3][0] == az
      assert stuff[6][0] == bz
      assert stuff[11][0] == cz
  
      assert lemmatizer.composite_dict[(az, stuff[3][1])] == stuff[3][2]
      assert lemmatizer.composite_dict[(bz, stuff[6][1])] == stuff[6][2]
      assert (
          lemmatizer.composite_dict[(cz, stuff[11][1])] == stuff[11][2]
      )
  
      doc2 = nlp(
          "I found an " + az + " in my " + bz + ".  It was a " + cz
      )
      stuff2 = doc2.get([TEXT, UPOS, LEMMA])
  
      assert stuff == stuff2
  
      dz = find_unknown_word(lemmatizer, "d")
      ez = find_unknown_word(lemmatizer, "e")
      fz = find_unknown_word(lemmatizer, "f")
  
      # try sentences with the order long, short
      doc = nlp(
          "It was a " + dz + ".  I found an " + ez + " in my " + fz
      )
      stuff = doc.get([TEXT, UPOS, LEMMA])
      assert len(stuff) == 12
      assert stuff[3][0] == dz
      assert stuff[8][0] == ez
      assert stuff[11][0] == fz
  
      assert lemmatizer.composite_dict[(dz, stuff[3][1])] == stuff[3][2]
      assert lemmatizer.composite_dict[(ez, stuff[8][1])] == stuff[8][2]
      assert (
          lemmatizer.composite_dict[(fz, stuff[11][1])] == stuff[11][2]
      )
  
      doc2 = nlp(
          "It was a " + dz + ".  I found an " + ez + " in my " + fz
      )
      stuff2 = doc2.get([TEXT, UPOS, LEMMA])
  
      assert stuff == stuff2
  
      assert az not in lemmatizer.word_dict
  
imports: import pytest
  import stanza
  from stanza.tests import *
  from stanza.models.common.doc import TEXT, UPOS, LEMMA
label_desc: Use image node_id 4 for calling a global function with example usage: test_store_results() without return types