def parallelize_func(iterable, func, chunksz=<NUM_LIT:1>, n_jobs=<NUM_LIT:16>, *args, **kwargs):
chunker = func<EOL>chunks = more_itertools.chunked(iterable, chunksz)<EOL>chunks_results = Parallel(n_jobs=n_jobs, verbose=<NUM_LIT:50>)(<EOL>delayed(chunker)(chunk, *args, **kwargs) for chunk in chunks)<EOL>results = more_itertools.flatten(chunks_results)<EOL>return list(results)<EOL>
Parallelize a function over each element of an iterable.