def parselines(input):
    """Return a buienradard input file as (level, (hh, mm)) tuples."""
    for line in input:
        line = line.strip()
        levelStr, hhmmStr = line.split('|')
        hhStr, mmStr = hhmmStr.split(':')
        yield int(levelStr), (int(hhStr), int(mmStr))
