code: def check_json_file(
      doc, raw_text, expected_sentences, expected_tokens
  ):
      raw_sentences = raw_text.strip().split("\n\n")
      assert len(raw_sentences) == expected_sentences
      if isinstance(expected_tokens, int):
          expected_tokens = [expected_tokens]
      for raw_sentence, expected_len in zip(
          raw_sentences, expected_tokens
      ):
          assert len(raw_sentence.strip().split("\n")) == expected_len
  
      assert len(doc.sentences) == expected_sentences
      for sentence, expected_len in zip(doc.sentences, expected_tokens):
          assert len(sentence.tokens) == expected_len
      for sentence, raw_sentence in zip(doc.sentences, raw_sentences):
          for token, line in zip(
              sentence.tokens, raw_sentence.strip().split("\n")
          ):
              word, tag = line.strip().split()
              assert token.text == word
              assert token.ner == tag
  
file_path: stanza/stanza/tests/datasets/ner/test_prepare_ner_file.py
imports: import pytest
  import json
  from stanza.models.common.doc import Document
  from stanza.utils.datasets.ner.prepare_ner_file import process_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: check_json_file(doc, raw_text, expected_sentences, expected_tokens) without return types