f.seek(offset, 1)
fmt = '>{}l'.format(leapcnt * 2)
size = struct.calcsize(fmt)
data = struct.unpack(fmt, f.read(size))
lst = [(data[i], data[i + 1]) for i in range(0, len(data), 2)]
assert all(lst[i][0] < lst[i + 1][0] for i in range(len(lst) - 1))
assert all(lst[i][1] == lst[i + 1][1] - 1 for i in range(len(lst) - 1))
return lst

def print_leaps(leap_lst):
    pass
Extract historic leap seconds from tzdata