code: def recommend_best_out_of_sample_point(
      model: TorchModel,
      bounds: List[Tuple[float, float]],
      objective_weights: Tensor,
      outcome_constraints: Optional[Tuple[Tensor, Tensor]] = None,
      linear_constraints: Optional[Tuple[Tensor, Tensor]] = None,
      fixed_features: Optional[Dict[int, float]] = None,
      model_gen_options: Optional[TConfig] = None,
      target_fidelities: Optional[Dict[int, float]] = None,
  ) -> Optional[Tensor]:
      """
      Identify the current best point by optimizing the posterior mean of the model.
      This is "out-of-sample" because it considers un-observed designs as well.
  
      Return None if no such point can be identified.
  
      Args:
          model: A TorchModel.
          bounds: A list of (lower, upper) tuples for each column of X.
          objective_weights: The objective is to maximize a weighted sum of
              the columns of f(x). These are the weights.
          outcome_constraints: A tuple of (A, b). For k outcome constraints
              and m outputs at f(x), A is (k x m) and b is (k x 1) such that
              A f(x) <= b.
          linear_constraints: A tuple of (A, b). For k linear constraints on
              d-dimensional x, A is (k x d) and b is (k x 1) such that
              A x <= b.
          fixed_features: A map {feature_index: value} for features that
              should be fixed to a particular value in the best point.
          model_gen_options: A config dictionary that can contain
              model-specific options. See `TorchOptConfig` for details.
          target_fidelities: A map {feature_index: value} of fidelity feature
              column indices to their respective target fidelities. Used for
              multi-fidelity optimization.
  
      Returns:
          A d-array of the best point, or None if no feasible point exists.
      """
      options = model_gen_options or {}
      fixed_features = fixed_features or {}
      acf_options = options.get("acquisition_function_kwargs", {})
      optimizer_options = options.get("optimizer_kwargs", {})
  
      X_observed = get_observed(
          Xs=model.Xs,  # pyre-ignore: [16]
          objective_weights=objective_weights,
          outcome_constraints=outcome_constraints,
      )
  
      if hasattr(model, "_get_best_point_acqf"):
          (
              acq_function,
              non_fixed_idcs,
          ) = model._get_best_point_acqf(  # pyre-ignore: [16]
              X_observed=X_observed,
              objective_weights=objective_weights,
              mc_samples=acf_options.get("mc_samples", 512),
              fixed_features=fixed_features,
              target_fidelities=target_fidelities,
              outcome_constraints=outcome_constraints,
              seed_inner=acf_options.get("seed_inner", None),
              qmc=acf_options.get("qmc", True),
          )
      else:
          raise RuntimeError(
              "The model should implement _get_best_point_acqf."
          )
  
      inequality_constraints = _to_inequality_constraints(
          linear_constraints
      )
      # TODO: update optimizers to handle inequality_constraints
      # (including transforming constraints b/c of fixed features)
      if inequality_constraints is not None:
          raise UnsupportedError(
              "Inequality constraints are not supported!"
          )
  
      return_best_only = optimizer_options.get("return_best_only", True)
      bounds_ = torch.tensor(
          bounds, dtype=model.dtype, device=model.device
      )
      bounds_ = bounds_.transpose(-1, -2)
      if non_fixed_idcs is not None:
          bounds_ = bounds_[..., non_fixed_idcs]
  
      opt_options: Dict[str, Union[bool, float, int, str]] = {
          "batch_limit": 8,
          "maxiter": 200,
          "method": "L-BFGS-B",
          "nonnegative": False,
      }
      opt_options.update(optimizer_options.get("options", {}))
      candidates, _ = optimize_acqf(
          acq_function=acq_function,
          bounds=bounds_,
          q=1,
          num_restarts=optimizer_options.get("num_restarts", 60),
          raw_samples=optimizer_options.get("raw_samples", 1024),
          inequality_constraints=inequality_constraints,
          fixed_features=None,  # handled inside the acquisition function
          options=opt_options,
          return_best_only=return_best_only,
      )
      rec_point = candidates.detach().cpu()
      if isinstance(acq_function, FixedFeatureAcquisitionFunction):
          rec_point = acq_function._construct_X_full(rec_point)
      if return_best_only:
          rec_point = rec_point.view(-1)
      return rec_point
  
imports: import functools
  from copy import deepcopy
  from random import randint
  from typing import Any, Callable, Dict, List, Optional, Protocol, Tuple, Type, Union
  import torch
  from ax.models.model_utils import best_observed_point, get_observed
  from ax.models.torch.utils import _to_inequality_constraints
  from ax.models.torch_base import TorchModel
  from ax.models.types import TConfig
  from botorch.acquisition import get_acquisition_function
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.fixed_feature import FixedFeatureAcquisitionFunction
  from botorch.acquisition.objective import ConstrainedMCObjective, GenericMCObjective
  from botorch.acquisition.utils import get_infeasible_cost
  from botorch.exceptions.errors import UnsupportedError
  from botorch.fit import fit_gpytorch_mll
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.models.gp_regression_fidelity import SingleTaskMultiFidelityGP
  from botorch.models.gpytorch import GPyTorchModel
  from botorch.models.model import Model
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.models.multitask import MultiTaskGP
  from botorch.models.transforms.input import Warp
  from botorch.optim.optimize import optimize_acqf
  from botorch.utils import get_objective_weights_transform, get_outcome_constraint_transforms
  from botorch.utils.multi_objective.scalarization import get_chebyshev_scalarization
  from botorch.utils.transforms import is_ensemble
  from gpytorch.kernels import MaternKernel, ScaleKernel
  from gpytorch.kernels.kernel import Kernel
  from gpytorch.mlls.exact_marginal_log_likelihood import ExactMarginalLogLikelihood
  from gpytorch.mlls.leave_one_out_pseudo_likelihood import LeaveOneOutPseudoLikelihood
  from gpytorch.mlls.sum_marginal_log_likelihood import SumMarginalLogLikelihood
  from gpytorch.priors import Prior
  from gpytorch.priors.lkj_prior import LKJCovariancePrior
  from gpytorch.priors.torch_priors import GammaPrior, LogNormalPrior
  from torch import Tensor
label_desc: Use image node_id 11 for calling a global function with example usage: recommend_best_out_of_sample_point(model, bounds, objective_weights, outcome_constraints, linear_constraints, fixed_features, model_gen_options, target_fidelities) and returns: rec_point