code: def Validate(self, value, **_):
      
      if isinstance(value, rdfvalue.RDFString):
        # TODO(hanuszczak): Use `str` here.
        return Text(value)
  
      if isinstance(value, Text):
        return value
  
      if isinstance(value, bytes):
        return value.decode("utf-8")
  
      raise type_info.TypeValueError("Not a valid unicode string: %r" % value)
docs: Validates a python format representation of the value.