code: def test_matcher_callback(en_vocab):
      mock = Mock()
      matcher = Matcher(en_vocab)
      pattern = [{"ORTH": "test"}]
      matcher.add("Rule", [pattern], on_match=mock)
      doc = Doc(en_vocab, words=["This", "is", "a", "test", "."])
      matches = matcher(doc)
      mock.assert_called_once_with(matcher, doc, 0, matches)
  
imports: import pytest
  from mock import Mock
  from spacy.matcher import Matcher
  from spacy.tokens import Doc, Span, Token
  from ..doc.test_underscore import clean_underscore
label_desc: Use image node_id 43 for calling a global function with example usage: test_matcher_callback(en_vocab) without return types