code: def run(self):
      from dvc.utils.humanize import get_summary
  
      stats, exc = None, None
      try:
          stats = self.repo.checkout(
              targets=self.args.targets,
              with_deps=self.args.with_deps,
              force=self.args.force,
              relink=self.args.relink,
              recursive=self.args.recursive,
              allow_missing=self.args.allow_missing,
          )
      except CheckoutError as _exc:
          exc = _exc
          stats = exc.stats
  
      if self.args.summary:
          default_message = "No changes."
          msg = get_summary(
              sorted(stats.items(), key=operator.itemgetter(0))
          )
          ui.write(msg or default_message)
      else:
          log_changes(stats)
  
      if exc:
          raise exc
  
      if self.args.relink:
          msg = "Relinked successfully"
          ui.write(msg)
      return 0
  
file_path: dvc/dvc/commands/checkout.py
imports: import operator
  from dvc.cli import completion, formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.exceptions import CheckoutError
  from dvc.ui import ui
label_desc: Use image node_id 1 for calling the CmdCheckout obj's underlying member method code with example usage: obj.run() and returns: int