code: def comboState(w):
      ind = w.currentIndex()
      data = w.itemData(ind)
      if data is not None:
          try:
              if not data.isValid():
                  data = None
              else:
                  data = data.toInt()[0]
          except AttributeError:
              pass
      if data is None:
          return str(w.itemText(ind))
      else:
          return data
  
imports: import inspect
  import weakref
  from .Qt import QtCore, QtWidgets
label_desc: Use image node_id 3 for calling a global function with example usage: comboState(w) and returns: str, data