def __init__(self, prefixes: set[str]) -> None:
        """Initializer.

        Args:
            prefixes: Set of prefixes to be trimmed. Nested prefix is allowed too.
                Each value must follow one of the following formats:
                - A Python identifier, e.g., "math"
                - Python identifiers joined by periods, e.g., "numpy.random"
        """
        for p in prefixes:
            if not _PREFIX_PATTERN.match(p):
                raise ValueError(f"Invalid prefix: {p}")

        self._prefixes = [tuple(p.split(".")) for p in prefixes]
Initializer.

        Args:
            prefixes: Set of prefixes to be trimmed. Nested prefix is allowed too.
                Each value must follow one of the following formats:
                - A Python identifier, e.g., "math"
                - Python identifiers joined by periods, e.g., "numpy.random"
        
src/latexify/transformers/prefix_trimmer.py