python/ray/_private/test_utils.py
def dicts_equal(dict1, dict2, abs_tol=1e-4):
    """Compares to dicts whose values may be floating point numbers."""

    if dict1.keys() != dict2.keys():
        return False

    for k, v in dict1.items():
        if (
            isinstance(v, float)
            and isinstance(dict2[k], float)
            and math.isclose(v, dict2[k], abs_tol=abs_tol)
        ):
            continue
        if v != dict2[k]:
            return False
    return True
Compares to dicts whose values may be floating point numbers.
Compares to dicts whose values may be floating point numbers.
Compares to dicts whose values may be floating point numbers .
def dicts_equal(dict1, dict2, abs_tol=1e-4):
    if dict1.keys() != dict2.keys():
        return False
    for k, v in dict1.items():
        if (
            isinstance(v, float)
            and isinstance(dict2[k], float)
            and math.isclose(v, dict2[k], abs_tol=abs_tol)
        ):
            continue
        if v != dict2[k]:
            return False
    return True
def dicts_equal ( dict1 , dict2 , abs_tol = 1e-4 ) : if dict1 . keys ( ) != dict2 . keys ( ) : return False for k , v in dict1 . items ( ) : if ( isinstance ( v , float ) and isinstance ( dict2 [ k ] , float ) and math . isclose ( v , dict2 [ k ] , abs_tol = abs_tol ) ) : continue if v != dict2 [ k ] : return False return True
Compares to dicts whose values may be floating point numbers.
Compares to dicts whose values may be floating point numbers .
"""Compares to dicts whose values may be floating point numbers."""
dict1
dict2
abs_tol