code: def test_matcher_compare_length(en_vocab, cmp, bad):
      matcher = Matcher(en_vocab)
      pattern = [{"LENGTH": {cmp: 2}}]
      matcher.add("LENGTH_COMPARE", [pattern])
      doc = Doc(en_vocab, words=["a", "aa", "aaa"])
      matches = matcher(doc)
      assert len(matches) == len(doc) - len(bad)
      doc = Doc(en_vocab, words=bad)
      matches = matcher(doc)
      assert len(matches) == 0
  
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 36 for calling a global function with example usage: test_matcher_compare_length(en_vocab, cmp, bad) without return types