code: def run(self):  # noqa: C901, PLR0912
      from dvc.repo.gc import _validate_args
  
      _validate_args(
          all_branches=self.args.all_branches,
          all_tags=self.args.all_tags,
          all_commits=self.args.all_commits,
          all_experiments=self.args.all_experiments,
          commit_date=self.args.commit_date,
          workspace=self.args.workspace,
          rev=self.args.rev,
          num=self.args.num,
          cloud=self.args.cloud,
          not_in_remote=self.args.not_in_remote,
      )
  
      # Don't prompt during dry run
      if self.args.dry:
          self.args.force = True
  
      if self.args.rev:
          self.args.num = self.args.num or 1
  
      msg = "This will remove all cache except items used in "
  
      msg += "the workspace"
      if self.args.all_commits:
          msg += " and all git commits"
      else:
          if self.args.all_branches and self.args.all_tags:
              msg += " and all git branches and tags"
          elif self.args.all_branches:
              msg += " and all git branches"
          elif self.args.all_tags:
              msg += " and all git tags"
          if self.args.commit_date:
              msg += f" and all git commits before date {self.args.commit_date}"
          if self.args.rev:
              msg += f" and last {self.args.num} commits from {self.args.rev}"
  
      if self.args.all_experiments:
          msg += " and all experiments"
  
      if self.args.not_in_remote:
          msg += " that are present in the DVC remote"
  
      if self.args.repos:
          msg += " of the current and the following repos:"
  
          for repo_path in self.args.repos:
              msg += "\n  - %s" % os.path.abspath(repo_path)
      else:
          msg += " of the current repo."
  
      logger.warning(msg)
  
      msg = "Are you sure you want to proceed?"
      if not self.args.force and not ui.confirm(msg):
          return 1
  
      self.repo.gc(
          all_branches=self.args.all_branches,
          all_tags=self.args.all_tags,
          all_commits=self.args.all_commits,
          all_experiments=self.args.all_experiments,
          commit_date=self.args.commit_date,
          cloud=self.args.cloud,
          remote=self.args.remote,
          force=self.args.force,
          jobs=self.args.jobs,
          repos=self.args.repos,
          workspace=self.args.workspace,
          rev=self.args.rev,
          num=self.args.num,
          not_in_remote=self.args.not_in_remote,
          dry=self.args.dry,
          skip_failed=self.args.skip_failed,
      )
      return 0
  
file_path: dvc/dvc/commands/gc.py
imports: import os
  from dvc.cli import formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.log import logger
  from dvc.ui import ui
label_desc: Use image node_id 1 for calling the CmdGC obj's underlying member method code with example usage: obj.run() and returns: int, int