code: def test_process_doc():
      nlp = stanza.Pipeline(
          dir=TEST_MODELS_DIR,
          processors="tokenize",
          download_method=None,
      )
  
      def check_results(doc, *expected):
          ner = [x[1] for x in doc[0]]
          assert ner == list(expected)
  
      # test a standard case of all the values lining up
      doc = convert_amt.process_doc(TEXT, fake_labels(2, 4), nlp)
      check_results(
          doc, "B-Person", "I-Person", "O", "O", "B-Appendage", "O"
      )
  
      # test a slightly wrong start index
      doc = convert_amt.process_doc(TEXT, fake_labels(5, 1, 4), nlp)
      check_results(
          doc, "B-Person", "B-Person", "O", "O", "B-Appendage", "O"
      )
  
      # test a slightly wrong end index
      doc = convert_amt.process_doc(TEXT, fake_labels(6, 1, 4), nlp)
      check_results(
          doc, "B-Person", "B-Person", "O", "O", "B-Appendage", "O"
      )
  
      # test a slightly wronger end index
      doc = convert_amt.process_doc(TEXT, fake_labels(7, 4), nlp)
      check_results(doc, "B-Person", "O", "O", "O", "B-Appendage", "O")
  
      # test a period at the end of a text - should not be captured
      doc = convert_amt.process_doc(TEXT, fake_labels(7, 8), nlp)
      check_results(doc, "B-Person", "O", "O", "O", "B-Appendage", "O")
  
file_path: stanza/stanza/tests/ner/test_convert_amt.py
imports: import os
  import pytest
  import stanza
  from stanza.utils.datasets.ner import convert_amt
  from stanza.tests import TEST_MODELS_DIR
label_desc: Use image node_id 5 for calling a global function with example usage: test_process_doc() without return types