<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnUpView(self, event):
 """Request to move up the hierarchy to highest-weight parent"""

        node = self.activated_node
        parents = []
        selected_parent = None
        
        if node:
            if hasattr( self.adapter, 'best_parent' ):
                selected_parent = self.adapter.best_parent( node )
            else:
                parents = self.adapter.parents( node )
            if parents:
                if not selected_parent:
                    parents.sort(key = lambda a: self.adapter.value(node, a))
                    selected_parent = parents[-1]
                class event:
                    node = selected_parent
                self.OnNodeActivated(event)
            else:
                self.SetStatusText(_('No parents for the currently selected node: %(node_name)s')
                                   % dict(node_name=self.adapter.label(node)))
        else:
            self.SetStatusText(_('No currently selected node'))