def _normalize_step_parameters(steps, param_map, legacy=False, already_normalized=False):
 normalized_param_map = {}
 for step in steps:
  if already_normalized:
   param_dict = param_map.get(str(step.order_index), {})
  else:
   param_dict = _step_parameters(step, param_map, legacy=legacy)
  if param_dict:
   normalized_param_map[step.id] = param_dict
 return normalized_param_map

def _normalize_step_parameters ( steps , param_map , legacy = False , already_normalized = False ) : normalized_param_map = { } for step in steps : if already_normalized : param_dict = param_map . get ( str ( step . order_index ) , { } ) else : param_dict = _step_parameters ( step , param_map , legacy = legacy ) if param_dict : normalized_param_map [ step . id ] = param_dict return normalized_param_map
take a complex param_map that can reference parameters by step_id in the new flexible way or in the old one-parameter per tep fashion or by tool id and normalize the parameters so everything is referenced by a numeric step id .