code: def _split_fantasy_points(
      X: Tensor, n_f: int
  ) -> Tuple[Tensor, Tensor]:
      r"""Split a one-shot optimization input into actual and fantasy points
  
      Args:
          X: A `batch_shape x (q + n_f) x d`-dim tensor of actual and fantasy
              points
  
      Returns:
          2-element tuple containing
  
          - A `batch_shape x q x d`-dim tensor `X_actual` of input candidates.
          - A `n_f x batch_shape x 1 x d`-dim tensor `X_fantasies` of fantasy
              points, where `X_fantasies[i, batch_idx]` is the i-th fantasy point
              associated with the batch indexed by `batch_idx`.
      """
      if n_f > X.size(-2):
          raise ValueError(
              f"n_f ({n_f}) must be less than the q-batch dimension of X ({X.size(-2)})"
          )
      split_sizes = [X.size(-2) - n_f, n_f]
      X_actual, X_fantasies = torch.split(X, split_sizes, dim=-2)
      # X_fantasies is b x num_fantasies x d, needs to be num_fantasies x b x 1 x d
      # for batch mode evaluation with batch shape num_fantasies x b.
      # b x num_fantasies x d --> num_fantasies x b x d
      X_fantasies = X_fantasies.permute(
          -2, *range(X_fantasies.dim() - 2), -1
      )
      # num_fantasies x b x 1 x d
      X_fantasies = X_fantasies.unsqueeze(dim=-2)
      return X_actual, X_fantasies
  
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 2 for calling a global function with example usage: _split_fantasy_points(X, n_f) and returns: X_actual,  X_fantasies