code: def calculate_pareto_front(
      runhistory: RunHistory,
      configs: list[Configuration],
      config_instance_seed_budget_keys: list[
          list[InstanceSeedBudgetKey]
      ],
  ) -> list[Configuration]:
      """Compares the passed configurations and returns only the ones on the pareto front.
  
      Parameters
      ----------
      runhistory : RunHistory
          The runhistory containing the given configurations.
      configs : list[Configuration]
          The configurations from which the Pareto front should be computed.
      config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]]
          The instance-seed budget keys for the configurations on the basis of which the Pareto front should be computed.
  
      Returns
      -------
      pareto_front : list[Configuration]
          The pareto front computed from the given configurations.
      """
      costs = _get_costs(
          runhistory, configs, config_instance_seed_budget_keys
      )
  
      # The following code is an efficient pareto front implementation
      is_efficient = np.arange(costs.shape[0])
      next_point_index = (
          0  # Next index in the is_efficient array to search for
      )
      while next_point_index < len(costs):
          nondominated_point_mask = np.any(
              costs < costs[next_point_index], axis=1
          )
          nondominated_point_mask[next_point_index] = True
          is_efficient = is_efficient[
              nondominated_point_mask
          ]  # Remove dominated points
          costs = costs[nondominated_point_mask]
          next_point_index = (
              np.sum(nondominated_point_mask[:next_point_index]) + 1
          )
  
      new_incumbents = [configs[i] for i in is_efficient]
      return new_incumbents
  
imports: from __future__ import annotations
  import numpy
  from ConfigSpace import Configuration
  from smac.runhistory import RunHistory
  from smac.runhistory.dataclasses import InstanceSeedBudgetKey
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_pareto_front(runhistory, configs, config_instance_seed_budget_keys) and returns: new_incumbents