<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def redo(self):
 """ Performs the top group on the redo stack, if present. Creates an undo group with the same name. Raises RuntimeError if called while undoing. """

        if self._undoing or self._redoing:
            raise RuntimeError
        if not self._redo:
            return
        group = self._redo.pop()

        self._redoing = True

        self.begin_grouping()
        group.perform()
        self.set_action_name(group.name)
        self.end_grouping()

        self._redoing = False

        self.notify()