code: def add_bar(lw, name, cm):
      global num_bars
      lw.addLabel(name)
      imi = pg.ImageItem(bar_data)
      imi.setLookupTable(cm.getLookupTable(alpha=True))
      vb = lw.addViewBox(lockAspect=True, enableMouse=False)
      vb.addItem(imi)
      num_bars += 1
      lw.nextRow()
  
imports: import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 2 for calling a global function with example usage: add_bar(lw, name, cm) without return types