def _build_workhour_lookup(schedule, lunch_hour):
    """Build a lookup dict to determine whether a given hour of a given day of
    week is a work hour.
    """
    res = {d: [False] * 24 for d in range(7)}
    for dow in res:
        if len(schedule[dow]) == 0:  # off day
            continue
        start_h, end_h = schedule[dow][0], schedule[dow][1]
        for wh in range(start_h, end_h):
            res[dow][wh] = True
        res[dow][lunch_hour] = False
    return res