code: def cpmap(cores=1):
      
      if int(cores) == 1:
          yield itertools.imap
      else:
          if futures is None:
              raise ImportError("concurrent.futures not available")
          pool = futures.ProcessPoolExecutor(cores)
          yield pool.map
          pool.shutdown()
docs: Configurable parallel map context manager.
  
      Returns appropriate map compatible function based on configuration:
      - Local single core (the default)
      - Multiple local cores