#NEWLINE# def _closest_result( result1 , result2 ) : #NEWLINE# #INDENT# if ( result1 is None ) : #NEWLINE# #INDENT# return result2 #NEWLINE# #UNINDENT# if ( result2 is None ) : #NEWLINE# #INDENT# return result1 #NEWLINE# #UNINDENT# if ( ( result1 [ 'start' ] < result2 [ 'start' ] ) and ( result2 [ 'end' ] < result1 [ 'end' ] ) ) : #NEWLINE# #INDENT# return result2 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return result1