def check_initialized(self):
    """Check class for initialization status.

    Check that all required fields are initialized

    Raises:
      ValidationError: If message is not initialized.
    """
    for name, field in self.__by_name.iteritems():
      value = getattr(self, name)
      if value is None:
        if field.required:
          raise ValidationError("Message %s is missing required field %s" %
                                (type(self).__name__, name))
      else:
        try:
          if (isinstance(field, MessageField) and
              issubclass(field.type, MessageField)):
            if field.repeated:
              for item in value:
                item.check_initialized()
            else:
              value.check_initialized()
        except __HOLE__, err:
          if not hasattr(err, 'message_name'):
            err.message_name = type(self).__name__
          raise
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/messages.py/Message.check_initialized