code: def get_longest_subsequence_candidates(
      doc: Doc,
      match_func: Callable[[Token], bool],
  ) -> Iterable[tuple[Token, ...]]:
      """
      Get candidate keyterms from ``doc``, where candidates are longest consecutive
      subsequences of tokens for which all ``match_func(token)`` is True.
  
      Args:
          doc
          match_func: Function applied sequentially to each ``Token`` in ``doc``
              that returns True for matching ("good") tokens, False otherwise.
  
      Yields:
          Next longest consecutive subsequence candidate, as a tuple of constituent tokens.
      """
      for key, words_grp in itertools.groupby(doc, key=match_func):
          if key is True:
              yield tuple(words_grp)
  
file_path: textacy/src/textacy/extract/utils.py
imports: from __future__ import annotations
  import itertools
  import operator
  import re
  from typing import Callable, Collection, Iterable, Optional
  from cytoolz import itertoolz
  from spacy.tokens import Doc, Token
  from ..None import constants, errors, types, utils
  from .None import matches
label_desc: Use image node_id 4 for calling a global function with example usage: get_longest_subsequence_candidates(doc, match_func) without return types