def chunker(seq, chunk_size):
    """Given a sequence, returns that sequence chunked into sublists of the given chunk_size.

    When len(seq) is evenly divisible by chunk_size, all chunks are the same size.

    When len(seq) is not evenly divisible by chunk_size, the last chunk is smaller than all the
    others.
    """
    # could be inefficient with really long lists, benchmark?
    # alternatively use itertools
    return (seq[pos:pos + chunk_size] for pos in range(0, len(seq), chunk_size))