def test_isfinite():
 arr = np.random.random(100)
 assert isfinite(arr)
 arr[0] = np.nan
 assert (not isfinite(arr))
 arr[0] = np.inf
 assert (not isfinite(arr))
 arr[0] = (- np.inf)
 assert (not isfinite(arr))

def test_isfinite ( ) : arr = np . random . random ( 100 ) assert isfinite ( arr ) arr [ 0 ] = np . nan assert ( not isfinite ( arr ) ) arr [ 0 ] = np . inf assert ( not isfinite ( arr ) ) arr [ 0 ] = ( - np . inf ) assert ( not isfinite ( arr ) )
tests that pylearn2 .