code: def check_objective_thresholds_match_objectives(
      objectives_by_name: Dict[str, Objective],
      objective_thresholds: List[ObjectiveThreshold],
  ) -> None:
      """Error if thresholds on objective_metrics bound from the wrong direction or
      if there is a mismatch between objective thresholds and objectives.
      """
      obj_thresh_metrics = set()
      for threshold in objective_thresholds:
          metric_name = threshold.metric.name
          if metric_name not in objectives_by_name:
              raise UserInputError(
                  f"Objective threshold {threshold} is on metric '{metric_name}', "
                  f"but that metric is not among the objectives."
              )
          if metric_name in obj_thresh_metrics:
              raise UserInputError(
                  "More than one objective threshold specified for metric "
                  f"{metric_name}."
              )
          obj_thresh_metrics.add(metric_name)
  
          minimize = objectives_by_name[metric_name].minimize
          bounded_above = threshold.op == ComparisonOp.LEQ
          is_aligned = minimize == bounded_above
          if not is_aligned:
              raise UserInputError(
                  f"Objective threshold on {metric_name} bounds from "
                  f"{'above' if bounded_above else 'below'} "
                  f"but {metric_name} is being "
                  f"{'minimized' if minimize else 'maximized'}."
              )
  
imports: from itertools import groupby
  from logging import Logger
  from typing import Dict, List, Optional
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective, ScalarizedObjective
  from ax.core.outcome_constraint import ComparisonOp, ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.risk_measures import RiskMeasure
  from ax.exceptions.core import UserInputError
  from ax.utils.common.base import Base
  from ax.utils.common.logger import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: check_objective_thresholds_match_objectives(objectives_by_name, objective_thresholds) without return types