#NEWLINE# def _VerifyProtoMapping( cls ) : #NEWLINE# #INDENT# "Verifies that each property on the class has an associated proto mapping.\n\n    First checks if there is a _custom_property_to_proto dictionary present and\n    then overrides the class to proto mapping found in _property_to_proto.\n\n    Then, for each property (NDB or alias), tries to add a mapping first by\n    checking for a message field attribute, and then by trying to infer based\n    on property subclass.\n\n    Raises:\n      TypeError: if a key from _custom_property_to_proto is not a valid NBD\n          property. (We don't allow EndpointsAliasProperty here because it\n          is not meant to be subclassed and defines a message_field).\n      TypeError: if after checking _custom_property_to_proto, message_field and\n          inference from a superclass, no appropriate mapping is found in\n          _property_to_proto.\n    " #NEWLINE# custom_property_to_proto = getattr ( cls , '_custom_property_to_proto' , None ) #NEWLINE# if isinstance ( custom_property_to_proto , dict ) : #NEWLINE# #INDENT# for ( key , value ) in custom_property_to_proto . iteritems ( ) : #NEWLINE# #INDENT# if ( not utils . IsSubclass ( key , ndb . Property ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Invalid property class: %s.' % ( key , ) ) ) #NEWLINE# #UNINDENT# cls . _property_to_proto [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# for prop in cls . _EndpointsPropertyItervalues ( ) : #NEWLINE# #INDENT# property_class = prop . __class__ #NEWLINE# cls . _TryAddMessageField ( property_class ) #NEWLINE# cls . _TryInferSuperclass ( property_class ) #NEWLINE# if ( property_class not in cls . _property_to_proto ) : #NEWLINE# #INDENT# raise TypeError ( ( 'No converter present for property %s' % ( property_class . __name__ , ) ) )