code: def get_weighted_mc_objective_and_objective_thresholds(
      objective_weights: Tensor, objective_thresholds: Tensor
  ) -> Tuple[WeightedMCMultiOutputObjective, Tensor]:
      r"""Construct weighted objective and apply the weights to objective thresholds.
  
      Args:
          objective_weights: The objective is to maximize a weighted sum of
              the columns of f(x). These are the weights.
          objective_thresholds: A tensor containing thresholds forming a reference point
              from which to calculate pareto frontier hypervolume. Points that do not
              dominate the objective_thresholds contribute nothing to hypervolume.
  
      Returns:
          A two-element tuple with the objective and objective thresholds:
  
              - The objective
              - The objective thresholds
  
      """
      nonzero_idcs = objective_weights.nonzero(as_tuple=False).view(-1)
      objective_weights = objective_weights[nonzero_idcs]
      objective_thresholds = objective_thresholds[nonzero_idcs]
      objective = WeightedMCMultiOutputObjective(
          weights=objective_weights, outcomes=nonzero_idcs.tolist()
      )
      objective_thresholds = torch.mul(
          objective_thresholds, objective_weights
      )
      return objective, objective_thresholds
  
imports: from __future__ import annotations
  from typing import Callable, cast, Dict, List, Optional, Tuple, Union
  import torch
  from ax.exceptions.core import AxError
  from ax.models.torch.botorch_defaults import NO_FEASIBLE_POINTS_MESSAGE
  from ax.models.torch.utils import _get_X_pending_and_observed, get_outcome_constraint_transforms, subset_model
  from ax.models.torch_base import TorchModel
  from ax.utils.common.typeutils import checked_cast, not_none
  from botorch.acquisition import get_acquisition_function
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.multi_objective.logei import qLogExpectedHypervolumeImprovement, qLogNoisyExpectedHypervolumeImprovement
  from botorch.acquisition.multi_objective.monte_carlo import qExpectedHypervolumeImprovement, qNoisyExpectedHypervolumeImprovement
  from botorch.acquisition.multi_objective.objective import WeightedMCMultiOutputObjective
  from botorch.acquisition.multi_objective.utils import get_default_partitioning_alpha
  from botorch.models.model import Model
  from botorch.optim.optimize import optimize_acqf_list
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.posteriors.posterior import Posterior
  from botorch.posteriors.posterior_list import PosteriorList
  from botorch.utils.multi_objective.hypervolume import infer_reference_point
  from botorch.utils.multi_objective.pareto import is_non_dominated
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: get_weighted_mc_objective_and_objective_thresholds(objective_weights, objective_thresholds) and returns: objective,  objective_thresholds