code: def get_words(doc_or_tokens: types.DocOrTokens) -> Iterable[Token]:
      """
      Get all non-punct, non-space tokens -- "words" as we commonly understand them --
      from input ``Doc`` or ``Iterable[Token]`` object.
      """
      words = (
          tok
          for tok in doc_or_tokens
          if not (tok.is_punct or tok.is_space)
      )
      yield from words
  
file_path: textacy/src/textacy/text_stats/utils.py
imports: import functools
  import logging
  from typing import Iterable
  import pyphen
  from cachetools import cached
  from cachetools.keys import hashkey
  from spacy.tokens import Token
  from toolz import itertoolz
  from ..None import cache, types
label_desc: Use image node_id 1 for calling a global function with example usage: get_words(doc_or_tokens) without return types