def batches(iterable, n=<NUM_LIT:1>):
l = len(iterable)<EOL>for ndx in range(<NUM_LIT:0>, l, n):<EOL><INDENT>yield iterable[ndx:min(ndx + n, l)]<EOL><DEDENT>
From http://stackoverflow.com/a/8290508/270334
:param n:
:param iterable: