code: def detect_framework_and_its_versions(model: object) -> bool:
      """Placeholder docstring"""
      model_base = model.__class__.__base__
  
      if object == model_base:
          model_base = model.__class__
  
      framework_string = str(model_base)
      logger.info("Inferred Framework string: %s", framework_string)
  
      py_tuple = platform.python_version_tuple()
  
      logger.info("Inferred Python version tuple: %s", py_tuple)
      fw = ""
      vs = ""
      if "torch" in framework_string:
          fw = "pytorch"
          try:
              import torch
  
              vs = torch.__version__.split("+")[0]
          except ImportError:
              raise Exception(
                  "Unable to import torch, check if pytorch is installed"
              )
      elif "xgb" in framework_string:
          fw = "xgboost"
          try:
              import xgboost
  
              vs = xgboost.__version__
          except ImportError:
              raise Exception(
                  "Unable to import xgboost, check if pytorch is installed"
              )
      else:
          raise Exception(
              "Unable to determine framework for tht base model"
              % framework_string
          )
  
      logger.info("Inferred framework and its version: %s %s", fw, vs)
  
      return [(fw, vs), py_tuple]
  
imports: from __future__ import absolute_import
  import secrets
  import hmac
  import hashlib
  import os
  import logging
  import sys
  import platform
  from collections import defaultdict
  from pathlib import Path
  import tempfile
  import yaml
  from sagemaker.model import Model
  from sagemaker.session import Session
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
  from sagemaker.s3_utils import parse_s3_url
  from sagemaker.utils import create_tar_file
label_desc: Use image node_id 10 for calling a global function with example usage: detect_framework_and_its_versions(model) and returns: list