human
Complete this python program:
def get_time_points(interval, start_time=None, stop_time=None):
assistant
#Here is the Python code you requested.

    """Return time points for given interval type.
    Time points are in reverse chronological order to match the sort of
    queries this will be used with. If start_time and stop_time are not
    specified they will be picked based on the interval.
    """
    def truncate_datetime(dt):
        dt = dt.replace(minute=0, second=0, microsecond=0)
        if (interval in ('day', 'month')):
            dt = dt.replace(hour=0)
        if (interval == 'month'):
            dt = dt.replace(day=1)
        return dt
    if (start_time and stop_time):
        (start_time, stop_time) = sorted([start_time, stop_time])
        stop_time = truncate_datetime(stop_time)
    else:
        stop_time = datetime.datetime.utcnow()
        stop_time = truncate_datetime(stop_time)
        range = time_range_by_interval[interval]
        start_time = (stop_time - range)
    step = timedelta_by_name(interval)
    current_time = stop_time
    time_points = []
    while (current_time >= start_time):
        time_points.append(current_time)
        if (interval != 'month'):
            current_time -= step
        else:
            current_time = decrement_month(current_time)
    return time_points