code: def __init__(self, globals, locals, parent=None):
      self.globals = globals
      self.locals = locals
      self._lastCommandRow = None
      self._commandBuffer = []  # buffer to hold multiple lines of input
      self.stdoutInterceptor = StdoutInterceptor(self.write)
      self.ps1 = ">>> "
      self.ps2 = "... "
  
      QtWidgets.QWidget.__init__(self, parent=parent)
  
      self._setupUi()
  
      # define text styles
      isDark = (
          self.output.palette()
          .color(QtGui.QPalette.ColorRole.Base)
          .value()
          < 128
      )
      outputBlockFormat = QtGui.QTextBlockFormat()
      outputFirstLineBlockFormat = QtGui.QTextBlockFormat(
          outputBlockFormat
      )
      outputFirstLineBlockFormat.setTopMargin(5)
      outputCharFormat = QtGui.QTextCharFormat()
      outputCharFormat.setFontWeight(QtGui.QFont.Weight.Normal)
      cmdBlockFormat = QtGui.QTextBlockFormat()
      cmdBlockFormat.setBackground(
          mkBrush("#335" if isDark else "#CCF")
      )
      cmdCharFormat = QtGui.QTextCharFormat()
      cmdCharFormat.setFontWeight(QtGui.QFont.Weight.Bold)
      self.textStyles = {
          "command": (cmdCharFormat, cmdBlockFormat),
          "output": (outputCharFormat, outputBlockFormat),
          "output_first_line": (
              outputCharFormat,
              outputFirstLineBlockFormat,
          ),
      }
  
      self.input.ps1 = self.ps1
      self.input.ps2 = self.ps2
  
imports: import code, sys, traceback
  from ..Qt import QtWidgets, QtGui, QtCore
  from ..functions import mkBrush
  from .CmdInput import CmdInput
label_desc: Use image node_id 1 to create a new ReplWidget object from inherited base classes: QtWidgets with example: obj = ReplWidget(globals, locals, parent)