code: def diff(old, new, with_unchanged=False):
      paths = set(old.keys())
      paths.update(set(new.keys()))
  
      res: Dict[str, Dict] = defaultdict(dict)
      for path in paths:
          path_diff = _diff(
              old.get(path, {}).get("data", {}),
              new.get(path, {}).get("data", {}),
              with_unchanged,
          )
          if path_diff:
              res[path] = path_diff
      return dict(res)
  
file_path: dvc/dvc/utils/diff.py
imports: import json
  from collections import defaultdict
  from typing import Dict
  from .flatten import flatten
label_desc: Use image node_id 6 for calling a global function with example usage: diff(old, new, with_unchanged) and returns: dict