import time


def is_open(epoch, specs):
    """Given a list of spec classes (as returned by parse_opening_times),
       returns true if the time (in Unix epoch-seconds) is within the specified range"""
    t = time.gmtime(epoch)
    weekday = t.tm_wday  # Monday is 0, same as we use here
    hour = t.tm_hour + t.tm_min/60.0 + t.tm_sec/3600.0

    for spec in specs:
        if spec.is_within(weekday, hour):
            return True

    return False