code: def _get_value_function(
      model: Model,
      objective: Optional[MCAcquisitionObjective] = None,
      posterior_transform: Optional[PosteriorTransform] = None,
      sampler: Optional[MCSampler] = None,
      project: Optional[Callable[[Tensor], Tensor]] = None,
      valfunc_cls: Optional[Type[AcquisitionFunction]] = None,
      valfunc_argfac: Optional[
          Callable[[Model], Dict[str, Any]]
      ] = None,
  ) -> AcquisitionFunction:
      r"""Construct value function (i.e. inner acquisition function)."""
      if valfunc_cls is not None:
          common_kwargs: Dict[str, Any] = {
              "model": model,
              "posterior_transform": posterior_transform,
          }
          if issubclass(valfunc_cls, MCAcquisitionFunction):
              common_kwargs["sampler"] = sampler
              common_kwargs["objective"] = objective
          kwargs = (
              valfunc_argfac(model=model)
              if valfunc_argfac is not None
              else {}
          )
          base_value_function = valfunc_cls(**common_kwargs, **kwargs)
      else:
          if objective is not None:
              base_value_function = qSimpleRegret(
                  model=model,
                  sampler=sampler,
                  objective=objective,
                  posterior_transform=posterior_transform,
              )
          else:
              base_value_function = PosteriorMean(
                  model=model, posterior_transform=posterior_transform
              )
  
      if project is None:
          return base_value_function
      else:
          return ProjectedAcquisitionFunction(
              base_value_function=base_value_function,
              project=project,
          )
  
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Any, Callable, Dict, Optional, Tuple, Type
  import torch
  from botorch import settings
  from botorch.acquisition.acquisition import AcquisitionFunction, MCSamplerMixin, OneShotAcquisitionFunction
  from botorch.acquisition.analytic import PosteriorMean
  from botorch.acquisition.cost_aware import CostAwareUtility
  from botorch.acquisition.monte_carlo import MCAcquisitionFunction, qSimpleRegret
  from botorch.acquisition.objective import MCAcquisitionObjective, PosteriorTransform
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.transforms import concatenate_pending_points, match_batch_shape, t_batch_mode_transform
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: _get_value_function(model, objective, posterior_transform, sampler, project, valfunc_cls, valfunc_argfac) and returns: base_value_function, ProjectedAcquisitionFunction