def total_schedule(schedule):
    """Return the total number of 15 minute windows in which the schedule
    is set to replicate in a week. If the schedule is None it is
    assumed that the replication will happen in every 15 minute
    window.

    This is essentially a bit population count.
    """

    if schedule is None:
        return 84 * 8  # 84 bytes = 84 * 8 bits

    total = 0
    for byte in schedule:
        while byte != 0:
            total += byte & 1
            byte >>= 1
    return total