(text: str, *, chars: str, maxn: int = 1)
return re.sub(r"({}){{{},}}".format(re.escape(chars), maxn + 1), chars * maxn, text)
Normalize repeating characters in ``text`` by truncating their number of consecutive
    repetitions to ``maxn``.

    Args:
        text
        chars: One or more characters whose consecutive repetitions are to be normalized,
            e.g. "." or "?!".
        maxn: Maximum number of consecutive repetitions of ``chars`` to which
            longer repetitions will be truncated.

    Returns:
        str
Normalize repeating characters in ``text`` by truncating their number of consecutive
    repetitions to ``maxn``.
Normalize repeating characters in text by truncating their number of consecutive repetitions to maxn .
def repeating_chars(text: str, *, chars: str, maxn: int = 1) -> str:
    """
    Normalize repeating characters in ``text`` by truncating their number of consecutive
    repetitions to ``maxn``.

    Args:
        text
        chars: One or more characters whose consecutive repetitions are to be normalized,
            e.g. "." or "?!".
        maxn: Maximum number of consecutive repetitions of ``chars`` to which
            longer repetitions will be truncated.

    Returns:
        str
    """
    return re.sub(r"({}){{{},}}".format(re.escape(chars), maxn + 1), chars * maxn, text)
def repeating_chars ( text : str , * , chars : str , maxn : int = 1 ) -> str : return re . sub ( r"({}){{{},}}" . format ( re . escape ( chars ) , maxn + 1 ) , chars * maxn , text )