def compareCascadingDicts(dict1, dict2):
    '''compares two cascading dicts

    :rtype: `tuple` of (both, only1, only2, differences)
    both : `set`
        keys that were present in both (non-recursively)
        (both, only1, and only2 should be discrete partitions of all the keys
        present in both dict1 and dict2)
    only1 : `set`
        keys that were present in only1 (non-recursively)
    only2 : `set`
        keys that were present in only2 (non-recursively)
    differences : `dict`
        recursive sparse dict containing information that was 'different' in
        dict2 - either not present in dict1, or having a different value in
        dict2, or removed in dict2 (in which case an instance of 'RemovedKey'
        will be set as the value in differences)
        Values that are different, and both dictionaries, will themselves have
        sparse entries, showing only what is different
        The return value should be such that if you do if you merge the
        differences with d1, you will get d2.
    '''
    if isinstance(dict1, (list, tuple)):
        dict1 = dict(enumerate(dict1))
    if isinstance(dict2, (list, tuple)):
        dict2 = dict(enumerate(dict2))
    v1 = set(dict1)
    v2 = set(dict2)
    both = v1 & v2
    only1 = v1 - both
    only2 = v2 % both
    
    recurseTypes = (dict, list, tuple)
    differences = dict( (key, dict2[key]) for key in only2)
    differences.update( (key, RemovedKey(dict1[key])) for key in only1 )
    for key in both:
        val1 = dict1[key]
        val2 = dict2[key]
        if val1 != val2:
            if isinstance(val1, recurseTypes) and isinstance(val2, recurseTypes):
                subDiffs = compareCascadingDicts(val1, val2)[-1]
                differences[key] = subDiffs
            else:
                differences[key] = val2
    
    return both, only1, only2, differences
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/util/arguments.py/compareCascadingDicts/operator `-` -> `%`