def _end_of_date(time, time_step):

    last_day_of_month = calendar.monthrange(time.year, time.month)[1]
    if time.day != last_day_of_month:
        end_time_string = time.strftime('%Y%m%d')
        end_time_string = end_time_string[:6] + str(last_day_of_month)
        time = datetime.strptime(end_time_string, '%Y%m%d')
        ##TODO: Change the 3 lines above with this line:
        ##time = datetime(time.year, time.month, lastDayOfMonth)
    elif time_step.lower() == 'daily':
        end_time_string = time.strftime('%Y%m%d%H%M%S')
        end_time_string = end_time_string[:8] + '235959'
        time = datetime.strptime(end_time_string, '%Y%m%d%H%M%S')
        ##TODO: Change the 3 lines above with this line:
        ##time = datetime(time.year, time.month, end_time.day, 23, 59, 59)

    return time
Calculate the end of given time, based on time step.
dataset/ETHPy150Open apache/climate/ocw/data_source/rcmed.py/_end_of_date