#NEWLINE# def generate_date_range( start_date , end_date , period ) : #NEWLINE# #INDENT# while ( start_date <= end_date ) : #NEWLINE# #INDENT# next_start_date = ( start_date + period ) #NEWLINE# ( yield ( to_date ( start_date ) , to_date ( ( next_start_date - timedelta ( days = 1 ) ) ) ) ) #NEWLINE# start_date = next_start_date