import math


def check_nan(dict_):
    """
    Check nan for a dict.
    >>> dict_ = {'a': 0, 'b': 1, 'c': 0, 'd': 10}
    >>> check_nan(dict_)
    True
    >>> from math import nan
    >>> check_nan({'a': 0, 'b': nan, 'c': 0, 'd': nan}) 
    ArithmeticError: We find the loss(es) [b, d] nan in PairwiseDis.
    """
    # check nan
    flag_nan = [ key for key, loss in dict_.items() if math.isnan(loss) ]
    if len(flag_nan) > 0:
        str_keys_nan = ', '.join(flag_nan)
        raise ArithmeticError(f'We find the loss(es) [{str_keys_nan}] nan.')
    return True