code: def run_edisgo_pool(ding0_file_list, run_args_opt,
                      workers=mp.cpu_count(), worker_lifetime=1):
      
      def collect_pool_results(result):
          results.append(result)
  
      results = []
  
      pool = mp.Pool(workers,
                     maxtasksperchild=worker_lifetime)
  
      for file in ding0_file_list:
          edisgo_args = [file] + run_args_opt
          pool.apply_async(func=run_edisgo_twice,
                           args=(edisgo_args,),
                           callback=collect_pool_results)
  
      pool.close()
      pool.join()
  
      # process results data
      all_costs_before_geno_import = [r[0] for r in results]
      all_grid_issues_before_geno_import = [r[1] for r in results]
      all_costs = [r[2] for r in results]
      all_grid_issues = [r[3] for r in results]
  
      return all_costs_before_geno_import, all_grid_issues_before_geno_import, \
             all_costs, all_grid_issues
docs: Use python multiprocessing toolbox for parallelization
  
      Several grids are analyzed in parallel.
  
      Parameters
      ----------
      ding0_file_list : list
          Ding0 grid data file names
      run_args_opt : list
          eDisGo options, see :func:`run_edisgo_basic` and
          :func:`run_edisgo_twice`
      workers: int
          Number of parallel process
      worker_lifetime : int
          Bunch of grids sequentially analyzed by a worker
  
      Returns
      -------
      all_costs_before_geno_import : list
          Grid extension cost before grid connection of new generators
      all_grid_issues_before_geno_import : list
          Remaining overloading or over-voltage issues in grid
      all_costs : list
          Grid extension cost due to grid connection of new generators
      all_grid_issues : list
          Remaining overloading or over-voltage issues in grid