#NEWLINE# def debug_contents( self , indent = 1 , file = sys . stdout , _ids = None ) : #NEWLINE# #INDENT# global _sequence_of_classes #NEWLINE# for element in self . sequenceElements : #NEWLINE# #INDENT# value = getattr ( self , element . name , None ) #NEWLINE# if ( element . optional and ( value is None ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( not element . optional ) and ( value is None ) ) : #NEWLINE# #INDENT# file . write ( ( "%s'%s' is a required element of %s\n" % ( ( '    ' * indent ) , element . name , self . __class__ . __name__ ) ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( element . klass in _sequence_of_classes ) : #NEWLINE# #INDENT# file . write ( ( '%s%s\n' % ( ( '    ' * indent ) , element . name ) ) ) #NEWLINE# helper = element . klass ( value ) #NEWLINE# helper . debug_contents ( ( indent + 1 ) , file , _ids ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if issubclass ( element . klass , ( Atomic , AnyAtomic ) ) : #NEWLINE# #INDENT# file . write ( ( '%s%s = %r\n' % ( ( '    ' * indent ) , element . name , value ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , element . klass ) : #NEWLINE# #INDENT# file . write ( ( '%s%s\n' % ( ( '    ' * indent ) , element . name ) ) ) #NEWLINE# value . debug_contents ( ( indent + 1 ) , file , _ids ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# file . write ( ( "%s'%s' must be a %s\n" % ( ( '    ' * indent ) , element . name , element . klass . __name__ ) ) )