code: def _extract_transforms_and_configs(
      step: GenerationStep,
  ) -> Tuple[List[Type[Transform]], Dict[str, Any]]:
      """
      Extract Transforms and their configs from the GenerationStep. Prefer kwargs
      provided over the model's defaults.
      """
  
      kwargs = step.model_spec.model_kwargs or {}
      transforms = kwargs.get("transforms")
      transform_configs = kwargs.get("transform_configs")
  
      if transforms is not None and transform_configs is not None:
          return transforms, transform_configs
  
      model = step.model
      if isinstance(model, ModelRegistryBase):
          _, bridge_kwargs = model.view_defaults()
          transforms = transforms or bridge_kwargs.get("transforms")
          transform_configs = transform_configs or bridge_kwargs.get(
              "transform_configs"
          )
  
      return (transforms or [], transform_configs or {})
  
file_path: Ax/ax/telemetry/common.py
imports: from datetime import datetime
  from typing import Any, Dict, List, Tuple, Type
  from ax.core.experiment import Experiment
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.modelbridge_utils import extract_search_space_digest, transform_search_space
  from ax.modelbridge.registry import ModelRegistryBase, Models, SearchSpace
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.cast import Cast
label_desc: Use image node_id 2 for calling a global function with example usage: _extract_transforms_and_configs(step) and returns: unknown,  unknown, transforms,  transform_configs