code: def _to_prepared_str(s: str | Sequence[str]) -> str:
      """
      Remove all characters from ``s`` except letters and numbers, strip whitespace,
      and force everything to lower-case; then sort tokens before re-joining into
      a single string.
      """
      tokens = (
          constants.RE_ALNUM.findall(s.lower())
          if isinstance(s, str)
          else [tok.lower().strip() for tok in s]
      )
      return " ".join(sorted(tokens))
  
imports: from __future__ import annotations
  from typing import Callable, Sequence
  from .None import edits
  from ..None import constants
label_desc: Use image node_id 2 for calling a global function with example usage: _to_prepared_str(s) and returns: str