def _make_attribute(self, prefix: tuple[str, ...], name: str) -> ast.expr:
        """Helper to generate a new Attribute or Name node.

        Args:
            prefix: List of prefixes.
            name: Attribute name.

        Returns:
            Name node if prefix == (), (possibly nested) Attribute node otherwise.
        """
        if not prefix:
            return ast_utils.make_name(name)

        parent = self._make_attribute(prefix[:-1], prefix[-1])
        return ast_utils.make_attribute(parent, name)
Helper to generate a new Attribute or Name node.

        Args:
            prefix: List of prefixes.
            name: Attribute name.

        Returns:
            Name node if prefix == (), (possibly nested) Attribute node otherwise.
        
src/latexify/transformers/prefix_trimmer.py