code: def step_based_gs_only(f: Callable[..., T]) -> Callable[..., T]:
      """
      For use as a decorator on functions only implemented for GenerationStep based
      GenerationStrategies. Mainly useful for older GenerationStrategies.
      """
  
      @wraps(f)
      def impl(
          self: "GenerationStrategy",
          *args: List[Any],
          **kwargs: Dict[str, Any],
      ) -> T:
          if self.is_node_based:
              raise UnsupportedError(
                  f"{f.__name__} is not supported for GenerationNode based"
                  " GenerationStrategies."
              )
          return f(self, *args, **kwargs)
  
      return impl
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import wraps
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
  import pandas
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generation_strategy_interface import GenerationStrategyInterface
  from ax.core.generator_run import GeneratorRun
  from ax.core.observation import ObservationFeatures
  from ax.core.utils import extend_pending_observations, get_pending_observation_features_based_on_trial_status
  from ax.exceptions.core import DataRequiredError, UnsupportedError, UserInputError
  from ax.exceptions.generation_strategy import GenerationStrategyCompleted, GenerationStrategyMisconfiguredException
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.generation_node import GenerationNode, GenerationStep
  from ax.modelbridge.model_spec import FactoryFunctionModelSpec
  from ax.modelbridge.registry import _extract_model_state_after_gen, ModelRegistryBase
  from ax.modelbridge.transition_criterion import TrialBasedCriterion
  from ax.utils.common.logger import _round_floats_for_logging, get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
label_desc: Use image node_id 1 for calling a global function with example usage: step_based_gs_only(f) and returns: impl, f