code: def __init__(
      self, parent=None, allowTransforms=True, hideCtrl=False, name=None
  ):
      QtWidgets.QWidget.__init__(self, parent)
      warnings.warn(
          "pyqtgrapoh.cavas will be deprecated in pyqtgraph and migrate to "
          "acq4.  Removal will occur after September, 2023.",
          DeprecationWarning,
          stacklevel=2,
      )
  
      self.ui = ui_template.Ui_Form()
      self.ui.setupUi(self)
      self.view = ViewBox()
      self.ui.view.setCentralItem(self.view)
      self.itemList = self.ui.itemList
      self.itemList.setSelectionMode(
          self.itemList.SelectionMode.ExtendedSelection
      )
      self.allowTransforms = allowTransforms
      self.multiSelectBox = SelectBox()
      self.view.addItem(self.multiSelectBox)
      self.multiSelectBox.hide()
      self.multiSelectBox.setZValue(1e6)
      self.ui.mirrorSelectionBtn.hide()
      self.ui.reflectSelectionBtn.hide()
      self.ui.resetTransformsBtn.hide()
  
      self.redirect = None  ## which canvas to redirect items to
      self.items = []
  
      self.view.setAspectLocked(True)
  
      grid = GridItem()
      self.grid = CanvasItem(grid, name="Grid", movable=False)
      self.addItem(self.grid)
  
      self.hideBtn = QtWidgets.QPushButton(">", self)
      self.hideBtn.setFixedWidth(20)
      self.hideBtn.setFixedHeight(20)
      self.ctrlSize = 200
      self.sizeApplied = False
      self.hideBtn.clicked.connect(self.hideBtnClicked)
      self.ui.splitter.splitterMoved.connect(self.splitterMoved)
  
      self.ui.itemList.itemChanged.connect(self.treeItemChanged)
      self.ui.itemList.sigItemMoved.connect(self.treeItemMoved)
      self.ui.itemList.itemSelectionChanged.connect(
          self.treeItemSelected
      )
      self.ui.autoRangeBtn.clicked.connect(self.autoRange)
      self.ui.redirectCheck.toggled.connect(self.updateRedirect)
      self.ui.redirectCombo.currentIndexChanged.connect(
          self.updateRedirect
      )
      self.multiSelectBox.sigRegionChanged.connect(
          self.multiSelectBoxChanged
      )
      self.multiSelectBox.sigRegionChangeFinished.connect(
          self.multiSelectBoxChangeFinished
      )
      self.ui.mirrorSelectionBtn.clicked.connect(
          self.mirrorSelectionClicked
      )
      self.ui.reflectSelectionBtn.clicked.connect(
          self.reflectSelectionClicked
      )
      self.ui.resetTransformsBtn.clicked.connect(
          self.resetTransformsClicked
      )
  
      self.resizeEvent()
      if hideCtrl:
          self.hideBtnClicked()
  
      if name is not None:
          self.registeredName = CanvasManager.instance().registerCanvas(
              self, name
          )
          self.ui.redirectCombo.setHostName(self.registeredName)
  
      self.menu = QtWidgets.QMenu()
      remAct = QtGui.QAction(
          translate("Context Menu", "Remove item"), self.menu
      )
      remAct.triggered.connect(self.removeClicked)
      self.menu.addAction(remAct)
      self.menu.remAct = remAct
      self.ui.itemList.contextMenuEvent = self.itemListContextMenuEvent
  
imports: import gc
  import importlib
  import weakref
  import warnings
  from ..graphicsItems.GridItem import GridItem
  from ..graphicsItems.ROI import ROI
  from ..graphicsItems.ViewBox import ViewBox
  from ..Qt import QT_LIB, QtCore, QtGui, QtWidgets
  from .None import CanvasTemplate_generic
  from .CanvasItem import CanvasItem, GroupCanvasItem
  from .CanvasManager import CanvasManager
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: QtWidgets with example: obj = Canvas(parent, allowTransforms, hideCtrl, name)