code: def _get_weighted_mo_objective(
      objective_weights: Tensor,
  ) -> WeightedMCMultiOutputObjective:
      """Constructs the `WeightedMCMultiOutputObjective` for the given
      objective weights.
      """
      nonzero_idcs = torch.nonzero(objective_weights).view(-1)
      objective_weights = objective_weights[nonzero_idcs]
      return WeightedMCMultiOutputObjective(
          weights=objective_weights, outcomes=nonzero_idcs.tolist()
      )
  
imports: from dataclasses import dataclass
  from logging import Logger
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Type
  import numpy
  import torch
  from ax.exceptions.core import UnsupportedError
  from ax.exceptions.model import ModelError
  from ax.models.model_utils import filter_constraints_and_fixed_features, get_observed
  from ax.models.random.sobol import SobolGenerator
  from ax.models.types import TConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.logger import get_logger
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.analytic import PosteriorMean
  from botorch.acquisition.fixed_feature import FixedFeatureAcquisitionFunction
  from botorch.acquisition.monte_carlo import qSimpleRegret, SampleReducingMCAcquisitionFunction
  from botorch.acquisition.multi_objective.analytic import MultiObjectiveAnalyticAcquisitionFunction
  from botorch.acquisition.multi_objective.monte_carlo import MultiObjectiveMCAcquisitionFunction
  from botorch.acquisition.multi_objective.multi_output_risk_measures import MARS, MultiOutputRiskMeasureMCObjective
  from botorch.acquisition.multi_objective.objective import IdentityMCMultiOutputObjective, WeightedMCMultiOutputObjective
  from botorch.acquisition.objective import ConstrainedMCObjective, GenericMCObjective, IdentityMCObjective, LinearMCObjective, MCAcquisitionObjective, PosteriorTransform, ScalarizedPosteriorTransform
  from botorch.acquisition.risk_measures import RiskMeasureMCObjective
  from botorch.acquisition.utils import get_infeasible_cost
  from botorch.models import ModelListGP, SingleTaskGP
  from botorch.models.model import Model
  from botorch.posteriors.fully_bayesian import GaussianMixturePosterior
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.posteriors.posterior_list import PosteriorList
  from botorch.sampling.normal import IIDNormalSampler, SobolQMCNormalSampler
  from botorch.utils.constraints import get_outcome_constraint_transforms
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.objective import get_objective_weights_transform
  from botorch.utils.sampling import sample_hypersphere, sample_simplex
  from torch import Tensor
label_desc: Use image node_id 9 for calling a global function with example usage: _get_weighted_mo_objective(objective_weights) and returns: WeightedMCMultiOutputObjective