(s: str | Sequence[str])
return " ".join(sorted(tokens))
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.
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.
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 .
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))
def _to_prepared_str ( s : str | Sequence [ str ] ) -> str : tokens = ( constants . RE_ALNUM . findall ( s . lower ( ) ) if isinstance ( s , str ) else [ tok . lower ( ) . strip ( ) for tok in s ] ) return " " . join ( sorted ( tokens ) )