def chunk(l, n):
newn = int(<NUM_LIT:1.0> * len(l) / n + <NUM_LIT:0.5>)<EOL>for i in range(<NUM_LIT:0>, n-<NUM_LIT:1>):<EOL><INDENT>yield l[i*newn:i*newn+newn]<EOL><DEDENT>yield l[n*newn-newn:]<EOL>
Yield n successive chunks from l.