class_docstr: Container for the target function run information.
  
  Most importantly, the runhistory contains an efficient mapping from each evaluated configuration to the
  empirical cost observed on either the full instance set or a subset. The cost is the average over all
  observed costs for one configuration:
  
  * If using budgets for a single instance, only the cost on the highest observed budget is returned.
  * If using instances as the budget, the average cost over all evaluated instances is returned.
  * Theoretically, the runhistory object can handle instances and budgets at the same time. This is
    neither used nor tested.
  
  Note
  ----
  Guaranteed to be picklable.
  
  Parameters
  ----------
  multi_objective_algorithm : AbstractMultiObjectiveAlgorithm | None, defaults to None
      The multi-objective algorithm is required to scalarize the costs in case of multi-objective.
  overwrite_existing_trials : bool, defaults to false
      Overwrites a trial (combination of configuration, instance, budget and seed) if it already exists.
docstr: Return the sum of costs of a configuration. This is the sum of costs of all instance-seed
  pairs.
  
  Parameters
  ----------
  config : Configuration
      Configuration to calculate objective for.
  instance_seed_budget_keys : list, optional (default=None)
      List of tuples of instance-seeds-budget keys. If None, the runhistory is
      queried for all trials of the given configuration.
  normalize : bool, optional (default=False)
      Normalizes the costs wrt objective bounds in the multi-objective setting.
      Only a float is returned if normalize is True. Warning: The value can change
      over time because the objective bounds are changing. Also, the objective weights are
      incorporated.
  
  Returns
  -------
  sum_cost: float | list[float]
      Sum of costs of config. In case of multiple objectives, the costs are summed up for each
      objective individually.
docstr_tok: ["Return","the","sum","of","costs","of","a","configuration",".","This","is","the","sum","of","costs","of","all","instance-seed","pairs",".","Parameters","--","--","--","--","--","config",":","Configuration","Configuration","to","calculate","objective","for",".","instance_seed_budget_keys",":","list",",","optional","(","default=None",")","List","of","tuples","of","instance-seeds-budget","keys",".","If","None",",","the","runhistory","is","queried","for","all","trials","of","the","given","configuration",".","normalize",":","bool",",","optional","(","default=False",")","Normalizes","the","costs","wrt","objective","bounds","in","the","multi-objective","setting",".","Only","a","float","is","returned","if","normalize","is","True",".","Warning",":","The","value","can","change","over","time","because","the","objective","bounds","are","changing",".","Also",",","the","objective","weights","are","incorporated",".","Returns","--","--","--","-","sum_cost",":","float","|","list","[","float","]","Sum","of","costs","of","config",".","In","case","of","multiple","objectives",",","the","costs","are","summed","up","for","each","objective","individually","."]
code: def sum_cost(
      self,
      config: Configuration,
      instance_seed_budget_keys: list[InstanceSeedBudgetKey]
      | None = None,
      normalize: bool = False,
  ) -> float | list[float]:
      """Return the sum of costs of a configuration. This is the sum of costs of all instance-seed
      pairs.
  
      Parameters
      ----------
      config : Configuration
          Configuration to calculate objective for.
      instance_seed_budget_keys : list, optional (default=None)
          List of tuples of instance-seeds-budget keys. If None, the runhistory is
          queried for all trials of the given configuration.
      normalize : bool, optional (default=False)
          Normalizes the costs wrt objective bounds in the multi-objective setting.
          Only a float is returned if normalize is True. Warning: The value can change
          over time because the objective bounds are changing. Also, the objective weights are
          incorporated.
  
      Returns
      -------
      sum_cost: float | list[float]
          Sum of costs of config. In case of multiple objectives, the costs are summed up for each
          objective individually.
      """
      costs = self._cost(config, instance_seed_budget_keys)
      if costs:
          if self._n_objectives > 1:
              # Each objective is summed separately
              # [[100, 200], [20, 10]] -> [120, 210]
              summed_costs = np.sum(costs, axis=0).tolist()
  
              if normalize:
                  assert self.multi_objective_algorithm is not None
                  normalized_costs = normalize_costs(
                      summed_costs, self._objective_bounds
                  )
  
                  return self.multi_objective_algorithm(
                      normalized_costs
                  )
              else:
                  return summed_costs
  
      return float(np.sum(costs))
  
imports: from __future__ import annotations
  from typing import Any, Iterable, Iterator, Mapping, cast
  import json
  from collections import OrderedDict
  from pathlib import Path
  import numpy
  from ConfigSpace import Configuration, ConfigurationSpace
  from smac.constants import MAXINT
  from smac.multi_objective.abstract_multi_objective_algorithm import AbstractMultiObjectiveAlgorithm
  from smac.runhistory.dataclasses import InstanceSeedBudgetKey, InstanceSeedKey, TrialInfo, TrialKey, TrialValue
  from smac.runhistory.enumerations import StatusType
  from smac.utils.configspace import get_config_hash
  from smac.utils.logging import get_logger
  from smac.utils.multi_objective import normalize_costs
label_desc: Use image node_id 25 for calling the RunHistory obj's underlying member method code with example usage: obj.sum_cost(config, instance_seed_budget_keys, normalize) and returns: float, self, summed_costs