code: def diff(
      repo: "Repo",
      a_rev: str = "HEAD",
      b_rev: str = "workspace",
      all: bool = False,  # noqa: A002
      **kwargs,
  ) -> DiffResult:
      if repo.scm.no_commits:
          return {}
  
      metrics = repo.metrics.show(
          revs=[a_rev, b_rev], hide_workspace=False, **kwargs
      )
      return _diff(metrics, a_rev, b_rev, with_unchanged=all)
  
file_path: dvc/dvc/repo/metrics/diff.py
imports: from typing import TYPE_CHECKING, Dict, TypedDict, Union
  from funcy import compact
  from dvc.utils.diff import diff
  from dvc.utils.diff import format_dict
label_desc: Use image node_id 2 for calling a global function with example usage: diff(repo, a_rev, b_rev, all) and returns: _diff, dict