def read_batch(fh, batch_size):
    """
    Reads a batch (or smaller) chunk of lines.
    """
    lines = []
    for i in range(batch_size):
        l = fh.readline()
        if not l:
            break
        else:
            lines.append(l.strip())

    return lines