def isdicsimilar(dic1, dic2, verb=False, dtol=DTOL, ignore_pipe_display=False):
    """
    Compare two dictionaries for differences

    Float and int types compared within dtol. Lists and dictionaries are
    checked recursively all other checked by simple equivalence

    Parameters
    ----------
    dic1 : dict
        First dictionary of NMR parameters.
    dic2 : dict
        Second dictionary of NMR parameters
    verb : bool, optional
        Set True for verbose reporting.
    dtol : float, optional
        Maximum allowable difference between int and float elements if dic1
        and dic2.

    Returns
    -------
    r1 : bool
        True is dic1 and dic2 are similar, False if they differ.

    """
    # create copies of the two dictionaries
    dic1 = dict(dic1)
    dic2 = dict(dic2)

    # set return value to True
    r = True

    # create sets
    kset1 = set(dic1.keys())
    kset2 = set(dic2.keys())
    dset = set.difference(kset1, kset2)
    iset = set.intersection(kset1, kset2)

    if ignore_pipe_display is True:
        iset.discard('FDMIN')
        iset.discard('FDMAX')
        iset.discard('FDDISPMIN')
        iset.discard('FDDISPMAX')
        iset.discard('FDSCALEFLAG')

    # print out any keys not in both dictionaries
    if len(dset) != 0:
        r = False
        if verb:
            print("Keys not in both dictionaries:", dset)

    # loop over keys in both sets
    for k in iset:
        v1, v2 = dic1[k], dic2[k]

        if not isitemsimilar(v1, v2, verb=verb, dtol=dtol):
            print("For key:", k)
            r = False

    return r
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/util/misc.py/isdicsimilar/original