code: def set_result (self, msg, valid=True, overwrite=False):
          
          if self.has_result and not overwrite:
              log.warn(LOG_CHECK,
                "Double result %r (previous %r) for %s", msg, self.result, self)
          else:
              self.has_result = True
          if not isinstance(msg, unicode):
              log.warn(LOG_CHECK, "Non-unicode result for %s: %r", self, msg)
          elif not msg:
              log.warn(LOG_CHECK, "Empty result for %s", self)
          self.result = msg
          self.valid = valid
          # free content data
          self.data = None
docs: Set result string and validity.