def _chunks ( l , n ) : for i in xrange ( 0 , len ( l ) , n ) : yield l [ i : i + n ]
how to split a list into unequal size chunks python
Yield successive n - sized chunks from l .
def _chunks(l, n):
    """ Yield successive n-sized chunks from l.

    http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python
    """
    for i in xrange(0, len(l), n):
        yield l[i:i+n]