#NEWLINE# def get_tags( pieces , tag_name , matches = None ) : #NEWLINE# #INDENT# if ( matches is None ) : #NEWLINE# #INDENT# matches = [ ] #NEWLINE# #UNINDENT# for piece in pieces : #NEWLINE# #INDENT# if isinstance ( piece , str ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( piece . mode == 'num' ) : #NEWLINE# #INDENT# matches . append ( piece . current_text ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# get_tags ( piece . children , tag_name , matches ) #NEWLINE# #UNINDENT# #UNINDENT# return matches