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