code: def _add_command(
      subparsers: argparse._SubParsersAction, sub: CLICommand
  ) -> None:
      if isinstance(sub, ActionCommand) and sub.hide:
          sub_proc = subparsers.add_parser(sub.name, epilog=sub.epilog)
      else:
          sub_proc = subparsers.add_parser(
              sub.name,
              help=sub.help,
              description=sub.description or sub.help,
              epilog=sub.epilog,
          )
      sub_proc.formatter_class = LazyRichHelpFormatter
  
      if isinstance(sub, GroupCommand):
          _add_group_command(sub, sub_proc)
      elif isinstance(sub, ActionCommand):
          _add_action_command(sub, sub_proc)
      else:
          raise AirflowException("Invalid command definition.")
  
imports: from __future__ import annotations
  import argparse
  import logging
  import sys
  from argparse import Action
  from collections import Counter
  from functools import lru_cache
  from typing import TYPE_CHECKING, Iterable
  import lazy_object_proxy
  from rich_argparse import RawTextRichHelpFormatter, RichHelpFormatter
  from airflow.cli.cli_config import DAG_CLI_DICT, ActionCommand, DefaultHelpParser, GroupCommand, core_commands
  from airflow.cli.utils import CliConflictError
  from airflow.exceptions import AirflowException
  from airflow.executors.executor_loader import ExecutorLoader
  from airflow.utils.helpers import partition
  from airflow.www.extensions.init_auth_manager import get_auth_manager_cls
label_desc: Use image node_id 3 for calling a global function with example usage: _add_command(subparsers, sub) without return types