#NEWLINE# def date( self , start , step_size , value , last_day_of_month ) : #NEWLINE# #INDENT# date = start #NEWLINE# if ( step_size == 'week' ) : #NEWLINE# #INDENT# date = ( date + datetime . timedelta ( weeks = value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( step_size == 'month' ) : #NEWLINE# #INDENT# date = self . add_months ( date , value ) #NEWLINE# if last_day_of_month : #NEWLINE# #INDENT# date = self . adjust_to_last_day_of_month ( date ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( step_size == 'year' ) : #NEWLINE# #INDENT# date = self . add_years ( date , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( step_size == 'hour' ) : #NEWLINE# #INDENT# date = ( date + datetime . timedelta ( hours = step_size ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( step_size == 'minute' ) : #NEWLINE# #INDENT# date = ( date + datetime . timedelta ( minutes = value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( step_size == 'second' ) : #NEWLINE# #INDENT# date = ( date + datetime . timedelta ( seconds = value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# date = ( date + datetime . timedelta ( days = value ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return date