code: def newAction(
      parent,
      text,
      slot=None,
      shortcut=None,
      icon=None,
      tip=None,
      checkable=False,
      enabled=True,
      iconSize=None,
  ):
      """Create a new action and assign callbacks, shortcuts, etc."""
      a = QAction(text, parent)
      if icon is not None:
          if iconSize is not None:
              a.setIcon(newIcon(icon, iconSize))
          else:
              a.setIcon(newIcon(icon))
      if shortcut is not None:
          if isinstance(shortcut, (list, tuple)):
              a.setShortcuts(shortcut)
          else:
              a.setShortcut(shortcut)
      if tip is not None:
          a.setToolTip(tip)
          a.setStatusTip(tip)
      if slot is not None:
          a.triggered.connect(slot)
      if checkable:
          a.setCheckable(True)
      a.setEnabled(enabled)
      return a
  
imports: import hashlib
  import os
  import re
  import sys
  from math import sqrt
  import cv2
  import numpy
  from PyQt5.QtCore import QRegExp, QT_VERSION_STR
  from PyQt5.QtGui import QIcon, QRegExpValidator, QColor
  from PyQt5.QtWidgets import QPushButton, QAction, QMenu
  from libs.ustr import ustr
label_desc: Use image node_id 3 for calling a global function with example usage: newAction(parent, text, slot, shortcut, icon, tip, checkable, enabled, iconSize) and returns: a