code: def test_Example_from_dict_with_spans(annots):
      vocab = Vocab()
      predicted = Doc(vocab, words=annots["words"])
      example = Example.from_dict(predicted, annots)
      assert len(list(example.reference.ents)) == 0
      assert len(list(example.reference.spans["cities"])) == 2
      assert len(list(example.reference.spans["people"])) == 1
      for span in example.reference.spans["cities"]:
          assert span.label_ == "LOC"
      for span in example.reference.spans["people"]:
          assert span.label_ == "PERSON"
  
imports: import pytest
  from spacy.tokens import Doc
  from spacy.training.example import Example
  from spacy.util import to_ternary_int
  from spacy.vocab import Vocab
label_desc: Use image node_id 15 for calling a global function with example usage: test_Example_from_dict_with_spans(annots) without return types