code: def get_wrapped_model(
      model,
      channel_first: bool,
      softmax: bool,
      device: Optional[str] = None,
      model_predict_kwargs: Optional[Dict[str, Any]] = None,
  ) -> ModelInterface:
      """
      Identifies the type of a model object and wraps the model in an appropriate interface.
  
      Parameters
      ----------
      model: torch.nn.Module, tf.keras.Model
          A model this will be wrapped in the ModelInterface:
      channel_first: boolean, optional
           Indicates of the image dimensions are channel first, or channel last. Inferred from the input shape if None.
      softmax: boolean
          Indicates whether to use softmax probabilities or logits in model prediction. This is used for this __call__ only and won't be saved as attribute. If None, self.softmax is used.
      device: string
          Indicated the device on which a torch.Tensor is or will be allocated: "cpu" or "gpu".
      model_predict_kwargs: dict, optional
          Keyword arguments to be passed to the model's predict method.
  
      Returns
      -------
      model: ModelInterface
          A wrapped ModelInterface model.
      """
      if util.find_spec("tensorflow"):
          if isinstance(model, tf.keras.Model):
              return TensorFlowModel(
                  model=model,
                  channel_first=channel_first,
                  softmax=softmax,
                  model_predict_kwargs=model_predict_kwargs,
              )
      if util.find_spec("torch"):
          if isinstance(model, torch.nn.Module):
              return PyTorchModel(
                  model=model,
                  channel_first=channel_first,
                  softmax=softmax,
                  device=device,
                  model_predict_kwargs=model_predict_kwargs,
              )
      raise ValueError(
          "Model needs to be tf.keras.Model or torch.nn.Module."
      )
  
imports: import copy
  import re
  from importlib import util
  from typing import Any, Dict, Optional, Sequence, Tuple, Union, List, TypeVar
  import numpy
  from skimage.segmentation import slic, felzenszwalb
  from quantus.helpers import asserts
  from quantus.helpers.model.model_interface import ModelInterface
label_desc: Use image node_id 10 for calling a global function with example usage: get_wrapped_model(model, channel_first, softmax, device, model_predict_kwargs) and returns: TensorFlowModel, PyTorchModel