def _assert_all_finite(X):
 X = np.asanyarray(X)
 if ((X.dtype.char in np.typecodes['AllFloat']) and (not np.isfinite(X.sum())) and (not np.isfinite(X).all())):
  raise ValueError(('Input contains NaN, infinity or a value too large for %r.' % X.dtype))

def _assert_all_finite ( X ) : X = np . asanyarray ( X ) if ( ( X . dtype . char in np . typecodes [ 'AllFloat' ] ) and ( not np . isfinite ( X . sum ( ) ) ) and ( not np . isfinite ( X ) . all ( ) ) ) : raise ValueError ( ( 'Input contains NaN, infinity or a value too large for %r.' % X . dtype ) )
like assert_all_finite .