def _get_prefix(self, node: ast.expr) -> tuple[str, ...] | None:
        """Helper to obtain nested prefix.

        Args:
            node: Node to investigate.

        Returns:
            The prefix tuple, or None if the node has unsupported syntax.
        """
        if isinstance(node, ast.Name):
            return (node.id,)

        if isinstance(node, ast.Attribute):
            parent = self._get_prefix(node.value)
            return parent + (node.attr,) if parent is not None else None

        return None
Helper to obtain nested prefix.

        Args:
            node: Node to investigate.

        Returns:
            The prefix tuple, or None if the node has unsupported syntax.
        
src/latexify/transformers/prefix_trimmer.py