code: def test_vectors_similarity_TD(vocab, vectors):
      [(word1, vec1), (word2, vec2)] = vectors
      doc = Doc(vocab, words=[word1, word2])
      assert isinstance(doc.similarity(doc[0]), float)
      assert isinstance(doc[0].similarity(doc), float)
      assert doc.similarity(doc[0]) == doc[0].similarity(doc)
  
file_path: spaCy/spacy/tests/vocab_vectors/test_similarity.py
imports: import numpy
  import pytest
  from spacy.tokens import Doc
  from spacy.vocab import Vocab
  from ..util import add_vecs_to_vocab, get_cosine
label_desc: Use image node_id 8 for calling a global function with example usage: test_vectors_similarity_TD(vocab, vectors) without return types