code: def test_component_attributes_ents(doc):
      s2v = Sense2VecComponent(doc.vocab, shape=(10, 4))
      s2v.first_run = False
      vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)
      s2v.s2v.add("world|NOUN", vector)
      s2v.s2v.add("world|GPE", vector)
      doc = s2v(doc)
      assert len(doc._.s2v_phrases) == 0
      doc.ents = [Span(doc, 1, 2, label="GPE")]
      assert len(doc._.s2v_phrases) == 1
      phrase = doc._.s2v_phrases[0]
      assert phrase._.s2v_key == "world|GPE"
      assert phrase[0]._.s2v_key == "world|NOUN"
      assert phrase._.in_s2v is True
      assert phrase[0]._.in_s2v is True
  
file_path: sense2vec/sense2vec/tests/test_component.py
imports: import pytest
  import numpy
  import spacy
  from spacy.vocab import Vocab
  from spacy.tokens import Doc, Span
  from sense2vec import Sense2VecComponent
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: test_component_attributes_ents(doc) without return types