code: def _get_candidates(
      doc: Doc,
      normalize: Optional[str | Callable[[Token], str]],
      include_pos: Optional[set[str]],
  ) -> set[tuple[str, ...]]:
      """
      Get a set of candidate terms to be scored by joining the longest
      subsequences of valid words -- non-stopword and non-punct, filtered to
      nouns, proper nouns, and adjectives if ``doc`` is POS-tagged -- then
      normalized into strings.
      """
  
      def _is_valid_tok(tok):
          return not (tok.is_stop or tok.is_punct or tok.is_space) and (
              not include_pos or tok.pos_ in include_pos
          )
  
      candidates = ext_utils.get_longest_subsequence_candidates(
          doc, _is_valid_tok
      )
      return {
          tuple(ext_utils.terms_to_strings(candidate, normalize))
          for candidate in candidates
      }
  
file_path: textacy/src/textacy/extract/keyterms/scake.py
imports: from __future__ import annotations
  import collections
  import itertools
  from operator import itemgetter
  from typing import Callable, Collection, Counter, Iterable, Optional
  import networkx
  from cytoolz import itertoolz
  from spacy.tokens import Doc, Token
  from ...None import utils
  from ..None import utils
label_desc: Use image node_id 3 for calling a global function with example usage: _get_candidates(doc, normalize, include_pos) and returns: unknown, unknown