code: def _to_base_type(self, msg):
      
      ent = _message_to_entity(msg, self._modelclass)
      ent.blob_ = self._protocol_impl.encode_message(msg)
      return ent
docs: Convert a Message value to a Model instance (entity).