code: def run(self):
      from dvc.exceptions import DvcException
  
      if not self.args.targets:
          self.args.targets = [None]
  
      for target in self.args.targets:
          try:
              self.repo.commit(
                  target,
                  with_deps=self.args.with_deps,
                  recursive=self.args.recursive,
                  force=self.args.force,
              )
          except DvcException:
              logger.exception(
                  "failed to commit%s", (" " + target) if target else ""
              )
              return 1
      return 0
  
file_path: dvc/dvc/commands/commit.py
imports: from dvc.cli import completion, formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.log import logger
label_desc: Use image node_id 1 for calling the CmdCommit obj's underlying member method code with example usage: obj.run() and returns: int, int