def split_list(l,N):
npmode = isinstance(l,np.ndarray)<EOL>if npmode:<EOL><INDENT>l=list(l)<EOL><DEDENT>g=np.concatenate((np.array([<NUM_LIT:0>]),np.cumsum(split_integer(len(l),length=N))))<EOL>s=[l[g[i]:g[i+<NUM_LIT:1>]] for i in range(N)]<EOL>if npmode:<EOL><INDENT>s=[np.array(sl) for sl in s]<EOL><DEDENT>return s<EOL>
Subdivide list into N lists