code: def test_component_similarity(doc):
      s2v = Sense2VecComponent(doc.vocab, shape=(4, 4))
      s2v.first_run = False
      vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)
      s2v.s2v.add("hello|INTJ", vector)
      s2v.s2v.add("world|NOUN", vector)
      doc = s2v(doc)
      assert doc[0]._.s2v_similarity(doc[1]) == 1.0
      assert doc[1:3]._.s2v_similarity(doc[1:3]) == 1.0
  
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 4 for calling a global function with example usage: test_component_similarity(doc) without return types