code: def check_stacked_transformer_requirements(
      config: "ModelConfig",
  ) -> None:  # noqa: F821
      """Checks that the transformer encoder type correctly configures `num_heads` and `hidden_size`"""
  
      def is_divisible(hidden_size: int, num_heads: int) -> bool:
          """Checks that hidden_size is divisible by num_heads."""
          return hidden_size % num_heads == 0
  
      sequence_types = [SEQUENCE, TEXT, TIMESERIES]
  
      for input_feature in config.input_features:
          if_type = input_feature.type
          encoder = input_feature.encoder
          if (
              if_type in sequence_types
              and encoder.type == "transformer"
              and not is_divisible(
                  encoder.hidden_size, encoder.num_heads
              )
          ):
              raise ConfigValidationError(
                  f"Input feature {input_feature.name} transformer encoder requires encoder.hidden_size to be divisible "
                  f"by encoder.num_heads. Found hidden_size {encoder.hidden_size} and num_heads {encoder.num_heads}."
              )
  
imports: from abc import ABC, abstractmethod
  from re import findall
  from typing import Callable, TYPE_CHECKING
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BINARY, CATEGORY, IMAGE, IN_MEMORY, MIN_QUANTIZATION_BITS_FOR_MERGE_AND_UNLOAD, MODEL_ECD, MODEL_GBM, MODEL_LLM, NUMBER, SEQUENCE, SET, TEXT, TIMESERIES, VECTOR
  from ludwig.error import ConfigValidationError
  from ludwig.utils.metric_utils import get_feature_to_metric_names_map_from_feature_collection
  from ludwig.utils.misc_utils import merge_dict
label_desc: Use image node_id 17 for calling a global function with example usage: check_stacked_transformer_requirements(config) and returns: unknown