code: def remove_menu(self, name):
          
          if name not in self._menus:
              raise exceptions.MenuNotFound(
                  "Menu {!r} was not found. It might be deleted, or belong to another menu manager.".format(name))
  
          self._menu.removeAction(self._menus[name].menuAction())
          del self._menus[name]
docs: Remove a top-level menu.
  
          Only removes menus created by the same menu manager.