def _step_parameters(step, param_map, legacy=False):
 param_dict = param_map.get(step.tool_id, {}).copy()
 if legacy:
  param_dict.update(param_map.get(str(step.id), {}))
 else:
  param_dict.update(param_map.get(str(step.order_index), {}))
 step_uuid = step.uuid
 if step_uuid:
  uuid_params = param_map.get(str(step_uuid), {})
  param_dict.update(uuid_params)
 if param_dict:
  if (('param' in param_dict) and ('value' in param_dict)):
   param_dict[param_dict['param']] = param_dict['value']
   del param_dict['param']
   del param_dict['value']
 new_params = _flatten_step_params(param_dict)
 return new_params

def _step_parameters ( step , param_map , legacy = False ) : param_dict = param_map . get ( step . tool_id , { } ) . copy ( ) if legacy : param_dict . update ( param_map . get ( str ( step . id ) , { } ) ) else : param_dict . update ( param_map . get ( str ( step . order_index ) , { } ) ) step_uuid = step . uuid if step_uuid : uuid_params = param_map . get ( str ( step_uuid ) , { } ) param_dict . update ( uuid_params ) if param_dict : if ( ( 'param' in param_dict ) and ( 'value' in param_dict ) ) : param_dict [ param_dict [ 'param' ] ] = param_dict [ 'value' ] del param_dict [ 'param' ] del param_dict [ 'value' ] new_params = _flatten_step_params ( param_dict ) return new_params
update step parameters based on the user-provided param_map dict .