code: def test_tokens(doc_pb):
      sentence = doc_pb.sentence[0]
      tokens = sentence.token
      assert len(tokens) == 12
      assert isinstance(tokens[0], Token)
  
      # Word
      words = "Chris wrote a simple sentence that he parsed with Stanford CoreNLP .".split()
      words_ = [t.word for t in tokens]
      assert words_ == words
  
      # Lemma
      lemmas = "Chris write a simple sentence that he parse with Stanford CoreNLP .".split()
      lemmas_ = [t.lemma for t in tokens]
      assert lemmas_ == lemmas
  
      # POS
      pos = "NNP VBD DT JJ NN IN PRP VBD IN NNP NNP .".split()
      pos_ = [t.pos for t in tokens]
      assert pos_ == pos
  
      # NER
      ner = "PERSON O O O O O O O O ORGANIZATION O O".split()
      ner_ = [t.ner for t in tokens]
      assert ner_ == ner
  
      # character offsets
      begin = [
          int(i) for i in "0 6 12 14 21 30 35 38 45 50 59 66".split()
      ]
      end = [
          int(i) for i in "5 11 13 20 29 34 37 44 49 58 66 67".split()
      ]
      begin_ = [t.beginChar for t in tokens]
      end_ = [t.endChar for t in tokens]
      assert begin_ == begin
      assert end_ == end
  
file_path: stanza/stanza/tests/server/test_protobuf.py
imports: import os
  from pathlib import Path
  import pytest
  from pytest import fixture
  from stanza.protobuf import Document, Sentence, Token, DependencyGraph, CorefChain
  from stanza.protobuf import parseFromDelimitedString, writeToDelimitedString, to_text
label_desc: Use image node_id 6 for calling a global function with example usage: test_tokens(doc_pb) without return types