def addItemBefore(self, caption, icon, command, itemToAddBefore):
        if self.isCheckable():
            raise ValueError, 'A checkable item cannot have children'

        newItem = None

        if self.hasChildren() and itemToAddBefore in self._itsChildren:
            try:
                index = self._itsChildren.index(itemToAddBefore)
            except ValueError:
                index = -1
            newItem = MenuItem(caption, icon, command, self._menu)
            newItem.setParent(self)
            self._itsChildren.append(index, newItem)
        else:
            newItem = self.addItem(caption, icon, command)
        self._menu.requestRepaint()
        return newItem
Remove the task from tasks list.
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/menu_bar.py/MenuItem.addItemBefore--crossover with--dataset/ETHPy150Open sjl/t/t.py/TaskDict.remove_task