code: def main() -> None:
      """Run as standalone python application."""
      parse_last_positional_argument_as_model_path()
      arg_parser = create_argument_parser()
      cmdline_arguments = arg_parser.parse_args()
  
      log_level = getattr(cmdline_arguments, "loglevel", None)
      logging_config_file = getattr(
          cmdline_arguments, "logging_config_file", None
      )
      configure_logging_and_warnings(
          log_level,
          logging_config_file,
          warn_only_once=True,
          filter_repeated_logs=True,
      )
  
      tf_env.setup_tf_environment()
      tf_env.check_deterministic_ops()
  
      # insert current path in syspath so custom modules are found
      sys.path.insert(1, os.getcwd())
  
      try:
          if hasattr(cmdline_arguments, "func"):
              rasa.utils.io.configure_colored_logging(log_level)
  
              result = plugin_manager().hook.configure_commandline(
                  cmdline_arguments=cmdline_arguments
              )
              endpoints_file = result[0] if result else None
  
              rasa.telemetry.initialize_telemetry()
              rasa.telemetry.initialize_error_reporting()
              plugin_manager().hook.init_telemetry(
                  endpoints_file=endpoints_file
              )
              plugin_manager().hook.init_managers(
                  endpoints_file=endpoints_file
              )
              plugin_manager().hook.init_anonymization_pipeline(
                  endpoints_file=endpoints_file
              )
              # configure structlog
              configure_structlog(log_level)
  
              cmdline_arguments.func(cmdline_arguments)
          elif hasattr(cmdline_arguments, "version"):
              print_version()
          else:
              # user has not provided a subcommand, let's print the help
              logger.error("No command specified.")
              arg_parser.print_help()
              sys.exit(1)
      except RasaException as e:
          # these are exceptions we expect to happen (e.g. invalid training data format)
          # it doesn't make sense to print a stacktrace for these if we are not in
          # debug mode
          logger.debug(
              "Failed to run CLI command due to an exception.",
              exc_info=e,
          )
          print_error(f"{e.__class__.__name__}: {e}")
          sys.exit(1)
  
imports: import argparse
  import logging
  import os
  import platform
  import sys
  from rasa_sdk import __version__
  from rasa.constants import MINIMUM_COMPATIBLE_VERSION
  from rasa.utils.log_utils import configure_structlog
  import rasa.telemetry
  import rasa.utils.io
  import rasa.utils.tensorflow.environment
  from rasa import version
  from rasa.cli import data, export, interactive, run, scaffold, shell, telemetry, test, train, visualize, x, evaluate
  from rasa.cli.arguments.default_arguments import add_logging_options
  from rasa.cli.utils import parse_last_positional_argument_as_model_path
  from rasa.plugin import plugin_manager
  from rasa.shared.exceptions import RasaException
  from rasa.shared.utils.cli import print_error
  from rasa.utils.common import configure_logging_and_warnings
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types