

def remove_node(self, node):
    'Removes a node from the tree.\n\n        .. versionadded:: 1.0.7\n\n        :Parameters:\n            `node`: instance of a :class:`TreeViewNode`\n                Node to remove from the tree. If `node` is :attr:`root`, it is\n                not removed.\n        '
    if (not isinstance(node, TreeViewNode)):
        raise TreeViewException('The node must be a subclass of TreeViewNode')
    parent = node.parent_node
    if (parent is not None):
        if (node == self._selected_node):
            node.is_selected = False
            self._selected_node = None
        nodes = parent.nodes
        if (node in nodes):
            nodes.remove(node)
        parent.is_leaf = (not bool(len(nodes)))
        node.parent_node = None
        node.funbind('size', parent._trigger_layout)
        self._trigger_layout()

dataset/ETHPy150Open kivy/kivy/kivy/uix/treeview.py TreeView.remove_node/VarMisuse@124/260 `self`->`parent`