docs: def pmap(f, iterable, n=None, dummy=False, p=None):
      """
      parallel map of a function to an iterable
      if each item in iterable is itself an iterable, then
      automatically call f(*item) instead of f(item)
  
      Arguments:
        f: function
        iterable: any iterable where each item is sent to f
        n: number of cpus (default is number on machine)
        dummy: use dummy pool.
        p: existing pool to re-use
      """
  
      # make it easier to debug.
      if n == 1:
          for r in it.starmap(f, iterable):
              yield r
          raise StopIteration
  
  
      if p is None:
          po = pool(n, dummy)
      else:
          po = p
      assert hasattr(po, 'imap')
      f = _func_star(f)
  
      try:
          for r in po.imap(f, iterable):
              yield r
  
      # explicitly clean up created pool
      finally:
          if p is None:
              try:
                  po.close()
                  po.join()
              except:
                  pass