#NEWLINE# def _last_descendant( self , is_initialized = True , accept_self = True ) : #NEWLINE# #INDENT# 'Finds the last element beneath this object to be parsed.' #NEWLINE# if ( is_initialized and self . next_sibling ) : #NEWLINE# #INDENT# last_child = accept_self . next_sibling . previous_element #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# last_child = self #NEWLINE# while ( isinstance ( last_child , Tag ) and last_child . contents ) : #NEWLINE# #INDENT# last_child = last_child . contents [ ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not accept_self ) and ( last_child == self ) ) : #NEWLINE# #INDENT# last_child = None #NEWLINE# #UNINDENT# return last_child