code: def open_console(self, client=None):
          
          if not client:
              client = self.get_current_client()
          if self.ipyconsole is not None:
              kernel_id = client.get_kernel_id()
              if not kernel_id:
                  QMessageBox.critical(
                      self, _('Error opening console'),
                      _('There is no kernel associated to this notebook.'))
                  return
              self.ipyconsole._create_client_for_kernel(kernel_id, None, None,
                                                        None)
              ipyclient = self.ipyconsole.get_current_client()
              ipyclient.allow_rename = False
              self.ipyconsole.rename_client_tab(ipyclient,
                                                client.get_short_name())
docs: Open an IPython console for the given client or the current one.