def assert_no_nan(mat, name='matrix'):
    try:
        assert(not any(np.isnan(mat)))
    except __HOLE__:
        print '%s contains NaN' % name
        print mat
        raise AssertionError
dataset/ETHPy150Open balajiln/mondrianforest/src/utils.py/assert_no_nan