code: def test_issue4120(en_vocab):
      """Test that matches without a final {OP: ?} token are returned."""
      matcher = Matcher(en_vocab)
      matcher.add("TEST", [[{"ORTH": "a"}, {"OP": "?"}]])
      doc1 = Doc(en_vocab, words=["a"])
      assert len(matcher(doc1)) == 1  # works
      doc2 = Doc(en_vocab, words=["a", "b", "c"])
      assert len(matcher(doc2)) == 2  # fixed
      matcher = Matcher(en_vocab)
      matcher.add("TEST", [[{"ORTH": "a"}, {"OP": "?"}, {"ORTH": "b"}]])
      doc3 = Doc(en_vocab, words=["a", "b", "b", "c"])
      assert len(matcher(doc3)) == 2  # works
      matcher = Matcher(en_vocab)
      matcher.add(
          "TEST",
          [[{"ORTH": "a"}, {"OP": "?"}, {"ORTH": "b", "OP": "?"}]],
      )
      doc4 = Doc(en_vocab, words=["a", "b", "b", "c"])
      assert len(matcher(doc4)) == 3
  
imports: import re
  import pytest
  from spacy.attrs import IS_PUNCT, LOWER, ORTH
  from spacy.errors import MatchPatternError
  from spacy.lang.en import English
  from spacy.lang.lex_attrs import LEX_ATTRS
  from spacy.matcher import Matcher
  from spacy.tokens import Doc, Span, Token
  from spacy.vocab import Vocab
label_desc: Use image node_id 29 for calling a global function with example usage: test_issue4120(en_vocab) without return types