code: def main():
      root = RootOptimumCLICommand(
          "Optimum CLI tool", usage="optimum-cli"
      )
      parser = root.parser
  
      for subcommand_cls in OPTIMUM_CLI_SUBCOMMANDS:
          register_optimum_cli_subcommand(
              subcommand_cls, parent_command=root
          )
  
      commands_in_register = dynamic_load_commands_in_register()
      command2command_instance = resolve_command_to_command_instance(
          root,
          [
              parent_command_cls
              for _, parent_command_cls in commands_in_register
              if parent_command_cls is not None
          ],
      )
  
      for (
          command_or_command_info,
          parent_command,
      ) in commands_in_register:
          if parent_command is None:
              parent_command_instance = root
          else:
              parent_command_instance = command2command_instance[
                  parent_command
              ]
          register_optimum_cli_subcommand(
              command_or_command_info,
              parent_command=parent_command_instance,
          )
  
      args = parser.parse_args()
  
      if not hasattr(args, "func"):
          parser.print_help()
          exit(1)
  
      # Run
      service = args.func(args)
      service.run()
  
file_path: optimum/optimum/commands/optimum_cli.py
imports: import importlib
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Type, Union
  from ..utils import logging
  from .base import BaseOptimumCLICommand, CommandInfo, RootOptimumCLICommand
  from .env import EnvironmentCommand
  from .export import ExportCommand
  from .onnxruntime import ONNXRuntimeCommand
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types