code: def updateFlags(self, label_new):
      # keep state of shared flags
      flags_old = self.getFlags()
  
      flags_new = {}
      for pattern, keys in self._flags.items():
          if re.match(pattern, label_new):
              for key in keys:
                  flags_new[key] = flags_old.get(key, False)
      self.setFlags(flags_new)
  
imports: import re
  from PyQt5 import QtCore
  from PyQt5 import QtGui
  from PyQt5 import QtWidgets
  from PyQt5.Qt import QT_VERSION_STR
  from libs.utils import newIcon, labelValidator
label_desc: Use image node_id 7 for calling the KeyDialog obj's underlying member method code with example usage: obj.updateFlags(label_new) without return types