code: def get_generation_strategy(
      with_experiment: bool = False,
      with_callable_model_kwarg: bool = True,
      with_completion_criteria: int = 0,
      with_generation_nodes: bool = False,
  ) -> GenerationStrategy:
      if with_generation_nodes:
          gs = sobol_gpei_generation_node_gs()
          gs._nodes[0]._model_spec_to_gen_from = ModelSpec(
              model_enum=Models.SOBOL,
              model_kwargs={"init_position": 3},
              model_gen_kwargs={"some_gen_kwarg": "some_value"},
          )
          if with_callable_model_kwarg:
              # pyre-ignore[16]: testing hack to test serialization of callable kwargs
              # in generation steps.
              gs._nodes[0]._model_spec_to_gen_from.model_kwargs[
                  "model_constructor"
              ] = get_sobol
      else:
          gs = choose_generation_strategy(
              search_space=get_search_space(), should_deduplicate=True
          )
          if with_callable_model_kwarg:
              # pyre-ignore[16]: testing hack to test serialization of callable kwargs
              # in generation steps.
              gs._steps[0].model_kwargs["model_constructor"] = get_sobol
      if with_experiment:
          gs._experiment = get_experiment()
  
      if with_completion_criteria > 0:
          gs._steps[0].num_trials = -1
          gs._steps[0].completion_criteria = [
              MinimumPreferenceOccurances(metric_name="m1", threshold=3)
          ] * with_completion_criteria
      return gs
  
imports: from logging import Logger
  from typing import Any, Dict, List, Optional, Type
  import numpy
  from ax.core.base_trial import TrialStatus
  from ax.core.experiment import Experiment
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.parameter import FixedParameter, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.dispatch_utils import choose_generation_strategy
  from ax.modelbridge.factory import get_sobol
  from ax.modelbridge.generation_node import GenerationNode
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.model_spec import ModelSpec
  from ax.modelbridge.registry import Models
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.int_to_float import IntToFloat
  from ax.modelbridge.transition_criterion import MaxGenerationParallelism, MaxTrials, MinimumPreferenceOccurances, MinTrials
  from ax.models.torch.botorch_modular.surrogate import Surrogate
  from ax.utils.common.logger import get_logger
  from ax.utils.testing.core_stubs import get_experiment, get_search_space, get_search_space_for_value
  from botorch.acquisition.monte_carlo import qNoisyExpectedImprovement
  from botorch.models.fully_bayesian import SaasFullyBayesianSingleTaskGP
  from botorch.models.transforms.input import InputTransform, Normalize
  from botorch.models.transforms.outcome import OutcomeTransform, Standardize
label_desc: Use image node_id 9 for calling a global function with example usage: get_generation_strategy(with_experiment, with_callable_model_kwarg, with_completion_criteria, with_generation_nodes) and returns: gs