code: def test_issue10643(en_vocab):
      """Ensure overlapping terms can be removed from PhraseMatcher"""
  
      # fmt: off
      words = ["Only", "save", "out", "the", "binary", "data", "for", "the", "individual", "components", "."]
      # fmt: on
      doc = Doc(en_vocab, words=words)
      terms = {
          "0": Doc(en_vocab, words=["binary"]),
          "1": Doc(en_vocab, words=["binary", "data"]),
      }
      matcher = PhraseMatcher(en_vocab)
      for match_id, term in terms.items():
          matcher.add(match_id, [term])
  
      matches = matcher(doc)
      assert matches == [
          (en_vocab.strings["0"], 4, 5),
          (en_vocab.strings["1"], 4, 6),
      ]
  
      matcher.remove("0")
      assert len(matcher) == 1
      new_matches = matcher(doc)
      assert new_matches == [(en_vocab.strings["1"], 4, 6)]
  
      matcher.remove("1")
      assert len(matcher) == 0
      no_matches = matcher(doc)
      assert not no_matches
  
imports: import warnings
  import pytest
  import srsly
  from mock import Mock
  from spacy.lang.en import English
  from spacy.matcher import Matcher, PhraseMatcher
  from spacy.tokens import Doc, Span
  from spacy.vocab import Vocab
  from ..util import make_tempdir
label_desc: Use image node_id 8 for calling a global function with example usage: test_issue10643(en_vocab) without return types