#NEWLINE# def sorted_title_candidates( tree , rule_dict ) : #NEWLINE# #INDENT# mins = [ ] #NEWLINE# for node in tree . iter ( ) : #NEWLINE# #INDENT# ( score , ele ) = get_score_from_title_dict ( node , rule_dict ) #NEWLINE# stripped_ele = ele . strip ( ) #NEWLINE# if ( stripped_ele and ( mins != 101 ) ) : #NEWLINE# #INDENT# mins . append ( ( score , stripped_ele ) ) #NEWLINE# #UNINDENT# #UNINDENT# return [ x [ 1 ] for x in sorted ( mins ) ]