def _update_widget_tree_node(self, node, widget, is_open=False):
        tree = self.ids.widgettree
        update_nodes = []
        nodes = {}
        for cnode in node.nodes[:]:
            try:
                nodes[cnode.widget] = cnode
            except ReferenceError:
                # widget no longer exists, just remove it
                pass
            tree.remove_node(cnode)
        for child in widget.children:
            if isinstance(child, Console):
                continue
            if child in nodes:
                cnode = tree.add_node(nodes[child], node)
            else:
                cnode = tree.add_node(
                    TreeViewWidget(text=child.__class__.__name__,
                                   widget=child.proxy_ref,
                                   is_open=is_open), node)
            update_nodes.append((cnode, child))
        return update_nodes
dataset/ETHPy150Open kivy/kivy/kivy/modules/console.py/ConsoleAddonWidgetTreeView._update_widget_tree_node/original