code: def doc(vocab):
      return Doc(vocab, words=["a", "b", "c", "d"])
  
file_path: spaCy/spacy/tests/parser/test_state.py
imports: import pytest
  from spacy.pipeline._parser_internals.stateclass import StateClass
  from spacy.tokens.doc import Doc
  from spacy.vocab import Vocab
label_desc: Use image node_id 2 for calling a global function with example usage: doc(vocab) and returns: Doc