code: def _ner_example(ner):
      doc = Doc(
          ner.vocab,
          words=[
              "Joe",
              "loves",
              "visiting",
              "London",
              "during",
              "the",
              "weekend",
          ],
      )
      gold = {"entities": [(0, 3, "PERSON"), (19, 25, "LOC")]}
      return Example.from_dict(doc, gold)
  
file_path: spaCy/spacy/tests/doc/test_add_entities.py
imports: import pytest
  from spacy import registry
  from spacy.pipeline import EntityRecognizer
  from spacy.pipeline.ner import DEFAULT_NER_MODEL
  from spacy.tokens import Doc, Span
  from spacy.training import Example
label_desc: Use image node_id 1 for calling a global function with example usage: _ner_example(ner) and returns: Example