code: def add_rev_selection_flags(
      experiments_subcmd_parser, command: str, default: bool = True
  ):
      experiments_subcmd_parser.add_argument(
          "-A",
          "--all-commits",
          action="store_true",
          default=False,
          help=(
              f"{command} all experiments in the repository "
              "(overrides `--rev` and `--num`)."
          ),
      )
      default_msg = " (HEAD by default)" if default else ""
      msg = (
          f"{command} experiments derived from the specified `<commit>` as "
          f"baseline{default_msg}."
      )
      experiments_subcmd_parser.add_argument(
          "--rev",
          type=str,
          action="append",
          default=None,
          help=msg,
          metavar="<commit>",
      )
      experiments_subcmd_parser.add_argument(
          "-n",
          "--num",
          type=int,
          default=1,
          dest="num",
          metavar="<num>",
          help=(
              f"{command} experiments from the last `num` commits "
              "(first parents) starting from the `--rev` baseline. "
              "Give a negative value to include all first-parent commits "
              "(similar to `git log -n`)."
          ),
      )
  
imports: from dvc.cli import formatter
  from dvc.cli.utils import append_doc_link, hide_subparsers_from_help
  from dvc.commands.experiments import apply, branch, clean, diff, exec_run, ls, pull, push, queue_worker, remove, rename, run, save, show
label_desc: Use image node_id 2 for calling a global function with example usage: add_rev_selection_flags(experiments_subcmd_parser, command, default) without return types