code: def _detect_framework_and_version(model_base: str) -> Tuple[str, str]:
      """Parse fw based off the base model object and get version if possible"""
      fw = ""
      vs = ""
      if "torch" in model_base:
          fw = "pytorch"
          try:
              import torch
  
              vs = torch.__version__.split("+")[0]
          except ImportError:
              logger.warning(_VERSION_DETECTION_ERROR, fw)
      elif "xgb" in model_base:
          fw = "xgboost"
          try:
              import xgboost
  
              vs = xgboost.__version__
          except ImportError:
              logger.warning(_VERSION_DETECTION_ERROR, fw)
      elif "keras" in model_base or "tensorflow" in model_base:
          fw = "tensorflow"
          try:
              import tensorflow
  
              vs = tensorflow.__version__
          except ImportError:
              logger.warning(_VERSION_DETECTION_ERROR, fw)
  
      else:
          raise Exception(
              "Unable to determine required container for model base %s.\
                  Please specify container in model builder"
              % model_base
          )
  
      return (fw, vs)
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/detector/image_detector.py
imports: from __future__ import absolute_import
  from typing import Tuple, List
  import platform
  import re
  import logging
  from packaging import version
  from sagemaker import image_uris
label_desc: Use image node_id 6 for calling a global function with example usage: _detect_framework_and_version(model_base) and returns: fw,  vs