from collections.abc import Iterator
from typing import Any

ESCAPE_MAPPINGS: Any

class Choice(list[Any]): ...
class Group(list[Any]): ...
class NonCapture(list[Any]): ...

def normalize(pattern: str) -> list[tuple[str, list[str]]]: ...
def next_char(input_iter: Any) -> None: ...
def walk_to_end(ch: str, input_iter: Iterator[Any]) -> None: ...
def get_quantifier(ch: str, input_iter: Iterator[Any]) -> tuple[int, str | None]: ...
def contains(source: Group | NonCapture | str, inst: type[Group]) -> bool: ...
def flatten_result(
    source: list[Choice | Group | str] | Group | NonCapture | None,
) -> tuple[list[str], list[list[str]]]: ...
