#NEWLINE# def getall( self , elclass , depth = maxint , collect = None ) : #NEWLINE# #INDENT# if ( collect is None ) : #NEWLINE# #INDENT# collection = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# collection = collect #NEWLINE# #UNINDENT# for el in self . _children : #NEWLINE# #INDENT# if isinstance ( el , elclass ) : #NEWLINE# #INDENT# collection . append ( el ) #NEWLINE# #UNINDENT# if ( depth > 0 ) : #NEWLINE# #INDENT# el . getall ( elclass , ( depth - 1 ) , collection ) #NEWLINE# #UNINDENT# #UNINDENT# return collection