code: def _input_transform_argparse_input_perturbation(
      input_transform_class: Type[InputPerturbation],
      search_space_digest: SearchSpaceDigest,
      dataset: Optional[SupervisedDataset] = None,
      input_transform_options: Optional[Dict[str, Any]] = None,
      torch_device: Optional[torch.device] = None,
      torch_dtype: Optional[torch.dtype] = None,
  ) -> Dict[str, Any]:
      """Extract the base input transform kwargs form the given arguments.
  
      Args:
          input_transform_class: Input transform class.
          dataset: Dataset containing feature matrix and the response.
          search_space_digest: Search space digest.
          input_transform_options: Input transform kwargs.
  
      Returns:
          A dictionary with input transform kwargs.
      """
  
      input_transform_options = input_transform_options or {}
  
      robust_digest = search_space_digest.robust_digest
  
      if robust_digest is None:
          raise ValueError(
              "Robust search space digest must be provided."
          )
  
      if len(robust_digest.environmental_variables) > 0:
          # TODO[T131759269]: support env variables.
          raise NotImplementedError(
              "Environmental variable support is not yet implemented."
          )
      if robust_digest.sample_param_perturbations is None:
          raise ValueError(
              "Robust digest needs to sample parameter perturbations."
          )
  
      samples = torch.as_tensor(
          robust_digest.sample_param_perturbations(),
          dtype=torch_dtype,
          device=torch_device,
      )
  
      input_transform_options.setdefault("perturbation_set", samples)
  
      input_transform_options.setdefault(
          "multiplicative", robust_digest.multiplicative
      )
  
      return input_transform_options
  
file_path: Ax/ax/models/torch/botorch_modular/input_constructors/input_transforms.py
imports: from __future__ import annotations
  from typing import Any, Dict, Optional, Type
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.models.torch.utils import normalize_indices
  from ax.utils.common.typeutils import _argparse_type_encoder
  from botorch.models.transforms.input import InputPerturbation, InputTransform, Normalize, Warp
  from botorch.utils.containers import SliceContainer
  from botorch.utils.datasets import RankingDataset, SupervisedDataset
  from botorch.utils.dispatcher import Dispatcher
label_desc: Use image node_id 4 for calling a global function with example usage: _input_transform_argparse_input_perturbation(input_transform_class, search_space_digest, dataset, input_transform_options, torch_device, torch_dtype) and returns: input_transform_options