code: def get_latest_model(
      model_path: Text = DEFAULT_MODELS_PATH,
  ) -> Optional[Text]:
      """Get the latest model from a path.
  
      Args:
          model_path: Path to a directory containing zipped models.
  
      Returns:
          Path to latest model in the given directory.
  
      """
      if not model_path:
          return None
  
      if not os.path.exists(model_path) or os.path.isfile(model_path):
          model_path = os.path.dirname(model_path)
  
      list_of_files = glob.glob(os.path.join(model_path, "*.tar.gz"))
  
      if len(list_of_files) == 0:
          return None
  
      return max(list_of_files, key=os.path.getmtime)
  
file_path: rasa/rasa/model.py
imports: import glob
  import hashlib
  import logging
  import os
  from pathlib import Path
  from subprocess import check_output, DEVNULL, CalledProcessError
  from typing import Text, Optional, Union
  from rasa.shared.constants import DEFAULT_MODELS_PATH
  from rasa.exceptions import ModelNotFound
label_desc: Use image node_id 2 for calling a global function with example usage: get_latest_model(model_path) and returns: max, None, None