code: def _make_botorch_step(
      num_trials: int = -1,
      min_trials_observed: Optional[int] = None,
      enforce_num_trials: bool = True,
      max_parallelism: Optional[int] = None,
      model: ModelRegistryBase = Models.BOTORCH_MODULAR,
      model_kwargs: Optional[Dict[str, Any]] = None,
      winsorization_config: Optional[
          Union[WinsorizationConfig, Dict[str, WinsorizationConfig]]
      ] = None,
      no_winsorization: bool = False,
      should_deduplicate: bool = False,
      verbose: Optional[bool] = None,
      disable_progbar: Optional[bool] = None,
      jit_compile: Optional[bool] = None,
      derelativize_with_raw_status_quo: bool = False,
  ) -> GenerationStep:
      """Shortcut for creating a BayesOpt generation step."""
      model_kwargs = model_kwargs or {}
  
      winsorization_transform_config = _get_winsorization_transform_config(
          winsorization_config=winsorization_config,
          no_winsorization=no_winsorization,
          derelativize_with_raw_status_quo=derelativize_with_raw_status_quo,
      )
  
      derelativization_transform_config = {
          "use_raw_status_quo": derelativize_with_raw_status_quo
      }
      model_kwargs["transform_configs"] = model_kwargs.get(
          "transform_configs", {}
      )
      model_kwargs["transform_configs"][
          "Derelativize"
      ] = derelativization_transform_config
  
      if not no_winsorization:
          _, default_bridge_kwargs = model.view_defaults()
          default_transforms = default_bridge_kwargs["transforms"]
          transforms = model_kwargs.get(
              "transforms", default_transforms
          )
          model_kwargs["transforms"] = [
              cast(Type[Transform], Winsorize)
          ] + transforms
          if winsorization_transform_config is not None:
              model_kwargs["transform_configs"][
                  "Winsorize"
              ] = winsorization_transform_config
  
      if (
          MODEL_KEY_TO_MODEL_SETUP[model.value].model_class
          != ModularBoTorchModel
      ):
          if verbose is not None:
              model_kwargs.update({"verbose": verbose})
          if disable_progbar is not None:
              model_kwargs.update({"disable_progbar": disable_progbar})
          if jit_compile is not None:
              model_kwargs.update({"jit_compile": jit_compile})
      else:
          # TODO[T164389105] Rewrite choose_generation_strategy to be MBM first
          logger.info(
              "`verbose`, `disable_progbar`, and `jit_compile` are not yet supported "
              "when using `choose_generation_strategy` with ModularBoTorchModel, "
              "dropping these arguments."
          )
      return GenerationStep(
          model=model,
          num_trials=num_trials,
          # NOTE: ceil(-1 / 2) = 0, so this is safe to do when num trials is -1.
          min_trials_observed=min_trials_observed
          or ceil(num_trials / 2),
          enforce_num_trials=enforce_num_trials,
          max_parallelism=max_parallelism,
          # `model_kwargs` should default to `None` if empty
          model_kwargs=model_kwargs if len(model_kwargs) > 0 else None,
          should_deduplicate=should_deduplicate,
      )
  
imports: import logging
  import warnings
  from math import ceil
  from typing import Any, cast, Dict, Optional, Type, Union
  import torch
  from ax.core.experiment import Experiment
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.parameter import ChoiceParameter, ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.registry import MODEL_KEY_TO_MODEL_SETUP, ModelRegistryBase, Models
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.winsorize import Winsorize
  from ax.models.torch.botorch_modular.model import BoTorchModel
  from ax.models.types import TConfig
  from ax.models.winsorization_config import WinsorizationConfig
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 2 for calling a global function with example usage: _make_botorch_step(num_trials, min_trials_observed, enforce_num_trials, max_parallelism, model, model_kwargs, winsorization_config, no_winsorization, should_deduplicate, verbose, disable_progbar, jit_compile, derelativize_with_raw_status_quo) and returns: GenerationStep