code: def create_Si_dict(
      D: int,
      num_resamples: int,
      keep_resamples: bool,
      calc_second_order: bool,
  ):
      """initialize empty dict to store sensitivity indices"""
      S = ResultDict(
          (k, np.zeros(D)) for k in ("S1", "S1_conf", "ST", "ST_conf")
      )
  
      if keep_resamples:
          # Create entries to store intermediate resampling results
          S["S1_conf_all"] = np.zeros((num_resamples, D))
          S["ST_conf_all"] = np.zeros((num_resamples, D))
  
      if calc_second_order:
          S["S2"] = np.full((D, D), np.nan)
          S["S2_conf"] = np.full((D, D), np.nan)
  
      return S
  
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 5 for calling a global function with example usage: create_Si_dict(D, num_resamples, keep_resamples, calc_second_order) and returns: S