def _compare_dicts(d1, d2):
    """Given two dictionaries, return what keys were added, removed, changed or might be changed
    """
    added, removed, changed, maybe_changed = [], [], [], []
    all_keys = set(d1).union(set(d2))
    for k in all_keys:
        if k not in d1:
            added.append(k)
        elif k not in d2:
            removed.append(k)
        elif d1[k] is d2[k]:
            continue
        else:
            try:
                if d1[k] != d2[k]:
                    changed.append(k)
            except:
                maybe_changed.append(k)
    return added, changed, removed, maybe_changed
