#NEWLINE# def _VerifyMessageFieldsSchema( cls ) : #NEWLINE# #INDENT# 'Verifies that the preset message fields correspond to actual properties.\n\n    If no message fields schema was set on the class, sets the schema using the\n    default fields determing by the NDB properties and alias properties defined.\n\n    In either case, converts the passed in fields to an instance of\n       MessageFieldsSchema and sets that as the value of _message_fields_schema\n       on the class.\n\n    Raises:\n      TypeError: if a message fields schema was set on the class that is not a\n          list, tuple, dictionary, or MessageFieldsSchema instance.\n    ' #NEWLINE# message_fields_schema = getattr ( cls , '_message_fields_schema' , None ) #NEWLINE# base_schema = getattr ( BASE_MODEL_CLASS , '_message_fields_schema' , None ) #NEWLINE# if ( ( message_fields_schema is None ) or ( message_fields_schema == base_schema ) ) : #NEWLINE# #INDENT# message_fields_schema = cls . _DefaultFields ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( message_fields_schema , ( list , tuple , dict , MessageFieldsSchema ) ) ) : #NEWLINE# #INDENT# raise TypeError ( ( BAD_FIELDS_SCHEMA_TEMPLATE % ( cls . __name__ , message_fields_schema . __class__ . __name__ ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for attr in message_fields_schema : #NEWLINE# #INDENT# _VerifyProperty ( cls , attr ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# cls . _message_fields_schema = MessageFieldsSchema ( attr , name = cls . __name__ )