#NEWLINE# def _determine_move_range( self , r_move_range ) : #NEWLINE# #INDENT# "Determines if a move range is valid and should be included.\n\n        This performs some tests to try to eliminate trivial changes that\n        shouldn't have moves associated.\n\n        Specifically, a move range is valid if it has at least one line\n        with alpha-numeric characters and is at least 4 characters long when\n        stripped.\n\n        If the move range is valid, any trailing whitespace-only lines will\n        be stripped, ensuring it covers only a valid range of content.\n        " #NEWLINE# if ( not r_move_range ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# end_i = r_move_range . end #NEWLINE# lines = self . differ . a [ r_move_range . start : ( end_i + 1 ) ] #NEWLINE# new_end_i = None #NEWLINE# valid = False #NEWLINE# for ( i , line ) in enumerate ( reversed ( lines ) ) : #NEWLINE# #INDENT# line = line . strip ( ) #NEWLINE# if line : #NEWLINE# #INDENT# if ( ( len ( line ) >= 4 ) and self . ALPHANUM_RE . search ( line ) ) : #NEWLINE# #INDENT# valid = True #NEWLINE# #UNINDENT# if ( ( new_end_i is None ) or valid ) : #NEWLINE# #INDENT# new_end_i = ( end_i - i ) #NEWLINE# #UNINDENT# if valid : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# valid = ( valid and ( ( ( ( r_move_range - r_move_range . start ) + 1 ) >= self . MOVE_PREFERRED_MIN_LINES ) or ( len ( self . differ . a [ r_move_range . start ] . strip ( ) ) >= self . MOVE_MIN_LINE_LENGTH ) ) ) #NEWLINE# if ( not valid ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# assert ( new_end_i is not None ) #NEWLINE# return MoveRange ( r_move_range . start , new_end_i , r_move_range . groups )