code: def get_provided_model(
      arg_model: Text,
  ) -> Optional[Union[Text, Path]]:
      """Checks model path input and selects model from it."""
      model_path = rasa.cli.utils.get_validated_path(
          arg_model, "model", DEFAULT_MODELS_PATH
      )
  
      return (
          model.get_latest_model(model_path)
          if os.path.isdir(model_path)
          else model_path
      )
  
imports: import argparse
  import logging
  import os
  from pathlib import Path
  from typing import List, Optional, Text, Union
  from rasa import model
  from rasa.cli import SubParsersAction
  from rasa.cli.arguments import interactive
  import rasa.cli.train
  import rasa.cli.utils
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.shared.constants import ASSISTANT_ID_DEFAULT_VALUE, ASSISTANT_ID_KEY, DEFAULT_ENDPOINTS_PATH, DEFAULT_MODELS_PATH
  from rasa.shared.data import TrainingType
  from rasa.shared.importers.importer import TrainingDataImporter
  import rasa.shared.utils.cli
  import rasa.utils.common
label_desc: Use image node_id 5 for calling a global function with example usage: get_provided_model(arg_model) and returns: unknown