def irregular_grouper(seq, sizes):
    """
    Yield irregularly sized chunks of a sequence.
    @param seq: a sequence
    @param sizes: an iterable of sizes
    """
    i = 0
    for k in sizes:
        yield seq[i:i + k]
        i += k
