code: def _generate_serial2(func, args_gen, kw_gen=None, ntasks=None, progkw={},
                        verbose=None, nTasks=None):
      
      if verbose is None:
          verbose = 2
      if ntasks is None:
          ntasks = nTasks
      if ntasks is None:
          ntasks = len(args_gen)
      if verbose > 0:
          print('[ut._generate_serial2] executing %d %s tasks in serial' %
                  (ntasks, get_funcname(func)))
  
      # kw_gen can be a single dict applied to everything
      if kw_gen is None:
          kw_gen = [{}] * ntasks
      if isinstance(kw_gen, dict):
          kw_gen = [kw_gen] * ntasks
  
      # Get iterator with or without progress
      if verbose > 1:
          lbl = '(sergen) %s: ' % (get_funcname(func),)
          progkw_ = dict(freq=None, bs=True, adjust=False, freq_est='between')
          progkw_.update(progkw)
          args_gen = util_progress.ProgIter(args_gen, length=ntasks, lbl=lbl,
                                            **progkw_)
  
      for args, kw in zip(args_gen, kw_gen):
          result = func(*args, **kw)
          yield result
docs: internal serial generator