code: def _get_base_cnn(
      base_model: Union[str, Model],
      pooling: str = "avg",
      weights: Union[str, None] = "imagenet",
      include_top: bool = False,
  ) -> Model:
      if isinstance(base_model, str):
          if base_model not in MODEL_DICT.keys():
              raise AssertionError(
                  f"base_model name must be in {tuple(MODEL_DICT.keys())}"
              )
          base_model = MODEL_DICT[base_model]
          base_model = base_model(
              include_top=include_top, pooling=pooling, weights=weights
          )
      return base_model
  
imports: import inspect
  from functools import partial
  from typing import Any, List, Optional, Union
  import matplotlib.cm
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_addons
  from PIL import Image
  from tensorflow import keras
  from tensorflow.keras.models import Model
  from tf_keras_vis.gradcam import Gradcam, GradcamPlusPlus
  from tf_keras_vis.utils import normalize
  from typeguard import check_argument_types, typechecked
  from chitra.import_utils import is_installed
  from .datagenerator import Dataset
label_desc: Use image node_id 1 for calling a global function with example usage: _get_base_cnn(base_model, pooling, weights, include_top) and returns: base_model