import time


def repeat_time(sched_time, repeat):
    """Next scheduled time for repeating event. Asserts that the
    time is not in the past.

    Args:
        sched_time (float): Scheduled unix time for the event
        repeat (float):     Repeat period in seconds

    Returns: (float) time for next event
    """
    next_time = sched_time + repeat
    if next_time < time.time():
        # Schedule at an offset to assure no doubles
        next_time = time.time() + repeat
    return next_time