

def isitemsimilar(v1, v2, verb=False, dtol=DTOL):
    '\n    Compare two values for differences\n\n    See :py:func:`isdicsimilar` for Parameters.\n\n    '
    r = True
    if (type(v1) != type(v2)):
        r = False
        if verb:
            print('Item has different type', type(v1), type(v2))
    elif isinstance(v1, dict):
        r = (r and isdicsimilar(v1, v2, verb=verb, dtol=dtol))
    elif isinstance(v1, list):
        r = (r and islistsimilar(v1, v2, verb=verb, dtol=dtol))
    elif isinstance(v1, (int, float)):
        if (abs((v1 - v2)) > dtol):
            r = False
            if verb:
                print('Key mismatch:', v1, v2)
    elif (v1 != v2):
        r = False
        if verb:
            print('Key mismatch:', v1, v2)
    return r

dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/util/misc.py isitemsimilar/original