code: def create_task_list(D, calc_second_order, n_processors):
      """
      Create list with one entry (key, parameter 1, parameter 2) per sobol
      index (+conf.). This is used to supply parallel tasks to
      multiprocessing.Pool
      """
      tasks_first_order = [
          [d, j, None]
          for j in range(D)
          for d in ("S1", "S1_conf", "ST", "ST_conf")
      ]
  
      # Add second order (+conf.) to tasks
      tasks_second_order = []
      if calc_second_order:
          tasks_second_order = [
              [d, j, k]
              for j in range(D)
              for k in range(j + 1, D)
              for d in ("S2", "S2_conf")
          ]
  
      if n_processors is None:
          n_processors = min(
              cpu_count(),
              len(tasks_first_order) + len(tasks_second_order),
          )
  
      if not calc_second_order:
          tasks = np.array_split(tasks_first_order, n_processors)
      else:
          # merges both lists alternating its elements and splits the
          # resulting lists into n_processors sublists
          tasks = np.array_split(
              [
                  v
                  for v in sum(
                      zip_longest(
                          tasks_first_order[::-1], tasks_second_order
                      ),
                      (),
                  )
                  if v is not None
              ],
              n_processors,
          )
  
      return tasks, n_processors
  
imports: from types import MethodType
  from warnings import warn
  from scipy.stats import norm
  import numpy
  import pandas
  from .None import common_args
  from ..util import read_param_file, ResultDict, extract_group_names, _check_groups
  from multiprocessing import Pool, cpu_count
  from functools import partial
  from itertools import combinations, zip_longest
label_desc: Use image node_id 8 for calling a global function with example usage: create_task_list(D, calc_second_order, n_processors) and returns: tasks,  n_processors