code: def setFlag(self, flag, state=True):
          
          has_flag = self.testFlag(flag)
          if has_flag and not state:
              self.setFlags(self.flags() ^ flag)
          elif not has_flag and state:
              self.setFlags(self.flags() | flag)
docs: Sets whether or not the given flag is enabled or disabled.
          
          :param      flag | <XExporter.Flags>