code: def test_displacy_parse_ents(en_vocab):
      """Test that named entities on a Doc are converted into displaCy's format."""
      doc = Doc(
          en_vocab,
          words=["But", "Google", "is", "starting", "from", "behind"],
      )
      doc.ents = [Span(doc, 1, 2, label=doc.vocab.strings["ORG"])]
      ents = displacy.parse_ents(doc)
      assert isinstance(ents, dict)
      assert ents["text"] == "But Google is starting from behind "
      assert ents["ents"] == [
          {
              "start": 4,
              "end": 10,
              "label": "ORG",
              "kb_id": "",
              "kb_url": "#",
          }
      ]
  
      doc.ents = [
          Span(doc, 1, 2, label=doc.vocab.strings["ORG"], kb_id="Q95")
      ]
      ents = displacy.parse_ents(doc)
      assert isinstance(ents, dict)
      assert ents["text"] == "But Google is starting from behind "
      assert ents["ents"] == [
          {
              "start": 4,
              "end": 10,
              "label": "ORG",
              "kb_id": "Q95",
              "kb_url": "#",
          }
      ]
  
imports: import numpy
  import pytest
  from spacy import displacy
  from spacy.displacy.render import DependencyRenderer, EntityRenderer, SpanRenderer
  from spacy.lang.en import English
  from spacy.lang.fa import Persian
  from spacy.tokens import Doc, Span
label_desc: Use image node_id 12 for calling a global function with example usage: test_displacy_parse_ents(en_vocab) without return types