def Calculate(self):
        tree =self._dag_tree
        if tree is None:
            return

        # get the root node and context
        data = tree.GetPyData(tree.GetRootItem())
        if data is None:
            return
        root_ctx, root_node = data

        self.GetStatusBar().SetStatusText("Calculating...")
        errors = []
        try:
            # evaluate all the direct dependencies
            for node, ctx in root_node.get_dependencies(root_ctx):
                try:
                    ctx[node]
                except:
                    errors.append((node, ctx))
    
            # and mark the root node as clean
            root_ctx[self._root_node] = None
    
            # re-raise any exceptions
            for node, ctx in errors:
                ctx[node]
    
            self.GetStatusBar().SetStatusText("Ready")
        except Exception, e:
            traceback.print_tb(sys.exc_traceback)
            self.GetStatusBar().SetStatusText("An error occurred: %s" % e)
            self.RefreshAll()
            raise

        self.RefreshAll()
dataset/ETHPy150Open manahl/mdf/mdf/viewer/frame.py/MDFViewerFrame.Calculate/original