#NEWLINE# def date_in_range( date_to_check , reference , lower_window = 10 , upper_window = 10 ) : #NEWLINE# #INDENT# if ( not date_to_check ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# ret = ( ( reference - timedelta ( days = lower_window ) ) <= date_to_check <= ( reference + timedelta ( days = upper_window ) ) ) #NEWLINE# return ret