code: def validate_activation(classifier_activation, weights):
      """validates that the classifer_activation is compatible with the weights.
  
      Args:
        classifier_activation: str or callable activation function
        weights: The pretrained weights to load.
  
      Raises:
        ValueError: if an activation other than `None` or `softmax` are used with
          pretrained weights.
      """
      if weights is None:
          return
  
      classifier_activation = activations.get(classifier_activation)
      if classifier_activation not in {
          activations.get("softmax"),
          activations.get(None),
      }:
          raise ValueError(
              "Only `None` and `softmax` activations are allowed "
              "for the `classifier_activation` argument when using "
              "pretrained weights, with `include_top=True`; Received: "
              f"classifier_activation={classifier_activation}"
          )
  
file_path: keras/keras/applications/imagenet_utils.py
imports: import json
  import warnings
  import numpy
  from keras import activations
  from keras import backend
  from keras import ops
  from keras.api_export import keras_export
  from keras.utils import file_utils
label_desc: Use image node_id 7 for calling a global function with example usage: validate_activation(classifier_activation, weights) without return types