def METHOD_NAME(self, event):
    """Clean up the integrated console in napari."""
    # Disconnect theme update
    # self.viewer.events.theme.disconnect(self._update_theme)
    if self.kernel_client is not None:
        self.kernel_client.stop_channels()
    if self.kernel_manager is not None and self.kernel_manager.has_kernel:
        self.kernel_manager.shutdown_kernel()
    # RichJupyterWidget doesn't clean these up
    self._completion_widget.deleteLater()
    self._call_tip_widget.deleteLater()
    self.deleteLater()
    event.accept()