def METHOD_NAME(self, shellwidget):
    """Remove widget associated to shellwidget."""
    shellwidget_id = id(shellwidget)
    if shellwidget_id in self._shellwidgets:
        widget = self._shellwidgets.pop(shellwidget_id)
        self._stack.removeWidget(widget)
        self.close_widget(widget)
        self.update_actions()