code: def extract_scalar_history(trial_history, scalar_key="default"):
      """
      Extract scalar value from a list of intermediate results.
  
      Parameters
      ----------
      trial_history : list
          accumulated intermediate results of a trial
      scalar_key : str
          the key name that indicates the numeric number
  
      Raises
      ------
      RuntimeError
          Incorrect final result: the final result should be float/int,
          or a dict which has a key named "default" whose value is float/int.
      """
      return [
          extract_scalar_reward(ele, scalar_key)
          for ele in trial_history
      ]
  
imports: import copy
  from enum import Enum, unique
  from pathlib import Path
  from schema import And
  from .None import parameter_expressions
label_desc: Use image node_id 3 for calling a global function with example usage: extract_scalar_history(trial_history, scalar_key) and returns: unknown