code: def __init__(self, dark_mode=True):
      super().__init__()
      central_dock_area = DockArea()
  
      # create plot widget (and  dock)
      self.plot_widget = pg.PlotWidget()
      plot_dock = Dock(name="Plot Widget Dock", closable=True)
      plot_dock.addWidget(self.plot_widget)
      central_dock_area.addDock(plot_dock)
  
      # create jupyter console widget (and  dock)
      self.jupyter_console_widget = JupyterConsoleWidget()
      jupyter_console_dock = Dock("Jupyter Console Dock")
      jupyter_console_dock.addWidget(self.jupyter_console_widget)
      central_dock_area.addDock(jupyter_console_dock)
      self.setCentralWidget(central_dock_area)
  
      app = QtWidgets.QApplication.instance()
      app.aboutToQuit.connect(
          self.jupyter_console_widget.shutdown_kernel
      )
  
      kernel = self.jupyter_console_widget.kernel_manager.kernel
      kernel.shell.push(dict(np=np, pw=self.plot_widget))
  
      # set dark mode
      if dark_mode:
          # Set Dark bg color via this relatively roundabout method
          self.jupyter_console_widget.set_default_style("linux")
  
file_path: pyqtgraph/pyqtgraph/examples/jupyter_console_example.py
imports: import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtWidgets
  from pyqtgraph.dockarea.Dock import Dock
  from pyqtgraph.dockarea.DockArea import DockArea
label_desc: Use image node_id 1 to create a new MainWindow object from inherited base classes: QtWidgets with example: obj = MainWindow(dark_mode)