code: def _diff_dicts(old_dict, new_dict, with_unchanged):
      new = _flatten(new_dict)
      old = _flatten(old_dict)
  
      res: Dict[str, Dict] = defaultdict(dict)
  
      xpaths = set(old.keys())
      xpaths.update(set(new.keys()))
      for xpath in xpaths:
          old_val = old[xpath]
          new_val = new[xpath]
          val_diff = _diff_vals(old_val, new_val, with_unchanged)
          if val_diff:
              res[xpath] = val_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 4 for calling a global function with example usage: _diff_dicts(old_dict, new_dict, with_unchanged) and returns: dict