code: def _validate(options: text_classifier_options.TextClassifierOptions):
      """Validates that `model_options` and `supported_model` are compatible.
  
      Args:
        options: Options for creating and training a text classifier.
  
      Raises:
        ValueError if there is a mismatch between `model_options` and
        `supported_model`.
      """
  
      if options.model_options is None:
          return
  
      if isinstance(
          options.model_options, mo.AverageWordEmbeddingModelOptions
      ) and (
          options.supported_model
          != ms.SupportedModels.AVERAGE_WORD_EMBEDDING_CLASSIFIER
      ):
          raise ValueError(
              "Expected AVERAGE_WORD_EMBEDDING_CLASSIFIER,"
              f" got {options.supported_model}"
          )
      if isinstance(options.model_options, mo.BertModelOptions) and (
          not isinstance(
              options.supported_model.value(), ms.BertClassifierSpec
          )
      ):
          raise ValueError(
              f"Expected a Bert Classifier, got {options.supported_model}"
          )
  
imports: import abc
  import os
  import tempfile
  from typing import Any, Optional, Sequence, Tuple
  import tensorflow
  from tensorflow_addons import optimizers
  import tensorflow_hub
  from mediapipe.model_maker.python.core.data import dataset
  from mediapipe.model_maker.python.core.tasks import classifier
  from mediapipe.model_maker.python.core.utils import hub_loader
  from mediapipe.model_maker.python.core.utils import loss_functions
  from mediapipe.model_maker.python.core.utils import metrics
  from mediapipe.model_maker.python.core.utils import model_util
  from mediapipe.model_maker.python.core.utils import quantization
  from mediapipe.model_maker.python.text.text_classifier import bert_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import dataset
  from mediapipe.model_maker.python.text.text_classifier import hyperparameters
  from mediapipe.model_maker.python.text.text_classifier import model_options
  from mediapipe.model_maker.python.text.text_classifier import model_spec
  from mediapipe.model_maker.python.text.text_classifier import model_with_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import preprocessor
  from mediapipe.model_maker.python.text.text_classifier import text_classifier_options
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_writer
  from mediapipe.tasks.python.metadata.metadata_writers import text_classifier
label_desc: Use image node_id 1 for calling a global function with example usage: _validate(options) without return types