code: def _diff_dict(orig, new):
      
      final = {}
      for k, v in new.items():
          if isinstance(v, dict):
              v = _diff_dict(orig.get(k, {}), v)
              if len(v) > 0:
                  final[k] = v
          elif v != orig.get(k):
              final[k] = v
      for k, v in orig.items():
          if k not in new:
              final[k] = None
      return final
docs: Diff a nested dictionary, returning only key/values that differ.