def compare_dicts(old=None, new=None):
    ret = {}
    for key in set((new or {})).union((old or {})):
        if key not in old:
            # New key
            ret[key] = {'old': '',
                        'new': new[key]}
        elif key not in new:
            # Key removed
            ret[key] = {'new': '',
                        'old': old[key]}
        elif new[key] != old[key]:
            # Key modified
            ret[key] = {'old': old[key],
                        'new': new[key]}
    return ret
Template settings for an Incident Response System
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/compare_dicts--crossover with--dataset/ETHPy150Open sahana/eden/modules/templates/IRS/config.py/config