code: def check_entities_equal(doc, expected):
      """
      Checks that the entities of a doc are equal to the given list of maps
      """
      assert len(doc.ents) == len(expected)
      for doc_entity, expected_entity in zip(doc.ents, expected):
          for k in expected_entity:
              assert getattr(doc_entity, k) == expected_entity[k]
  
file_path: stanza/stanza/tests/pipeline/test_pipeline_ner_processor.py
imports: import pytest
  import stanza
  from stanza.utils.conll import CoNLL
  from stanza.models.common.doc import Document
  from stanza.tests import *
label_desc: Use image node_id 1 for calling a global function with example usage: check_entities_equal(doc, expected) without return types