#NEWLINE# def fill_date_range( start_date , end_date , date_format = None ) : #NEWLINE# #INDENT# '\n    Function accepts start date, end date, and format (if dates are strings)\n    and returns a list of Python dates.\n    ' #NEWLINE# if date_format : #NEWLINE# #INDENT# start_date = datetime . strptime ( start_date , date_format ) . date ( ) #NEWLINE# end_date = datetime . strptime ( end_date , date_format ) . date ( ) #NEWLINE# #UNINDENT# date_list = [ ] #NEWLINE# while ( start_date <= end_date ) : #NEWLINE# #INDENT# date_list . append ( end_date ) #NEWLINE# start_date = ( start_date + timedelta ( days = 1 ) ) #NEWLINE# #UNINDENT# return date_list