code: def dict_diff(old, new):
      
      old_keys = viewkeys(old)
      new_keys = viewkeys(dict(new))
      out = {}
      for key in new_keys - old_keys:
          out[key] = new[key]
      for key in old_keys - new_keys:
          out[key] = None
      for key in old_keys & new_keys:
          if old[key] != new[key]:
              out[key] = new[key]
      return out
docs: Return a dict representing the differences between the dicts `old` and
      `new`. Deleted keys appear as a key with the value :data:`None`, added and
      changed keys appear as a key with the new value.