code: def to_aug_toks(doclike: types.DocLike) -> list[types.AugTok]:
      """
      Transform a spaCy ``Doc`` or ``Span`` into a list of ``AugTok`` objects,
      suitable for use in data augmentation transform functions.
      """
      if not isinstance(doclike, (Doc, Span)):
          raise TypeError(
              errors.type_invalid_msg(
                  "spacy_obj", type(doclike), types.DocLike
              )
          )
      lang = doclike.vocab.lang
      toks_syns: Iterable[list[str]]
      if (
          concept_net.filepath is None
          or lang not in concept_net.synonyms
      ):
          toks_syns = ([] for _ in doclike)
      else:
          toks_syns = (
              concept_net.get_synonyms(
                  tok.text, lang=lang, sense=tok.pos_
              )
              if not (tok.is_punct or tok.is_space)
              else []
              for tok in doclike
          )
      return [
          types.AugTok(
              text=tok.text,
              ws=tok.whitespace_,
              pos=tok.pos_,
              is_word=(not (tok.is_punct or tok.is_space)),
              syns=syns,
          )
          for tok, syns in zip(doclike, toks_syns)
      ]
  
file_path: textacy/src/textacy/augmentation/utils.py
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import string
  from typing import Iterable
  from cachetools import cached
  from cachetools.keys import hashkey
  from spacy.tokens import Doc, Span
  from ..None import cache, datasets, errors, resources, types
label_desc: Use image node_id 1 for calling a global function with example usage: to_aug_toks(doclike) and returns: unknown