def _copy_node(
        self, inherit: bool, deep: bool = False, memo: dict[int, Any] | None = None
    ) -> Self:
        """Copy just one node of a tree"""
        new_node = super()._copy_node(inherit=inherit, deep=deep, memo=memo)
        new_node._name = self.name
        return new_node
Copy just one node of a tree
xarray/core/treenode.py