#NEWLINE# def test_nearest( self ) : #NEWLINE# #INDENT# x = self . x #NEWLINE# ( d , i ) = self . kdtree . query ( x , 1 ) #NEWLINE# assert_almost_equal ( ( x ** 2 ) , np . sum ( ( ( x - self . data [ i ] ) ** 2 ) ) ) #NEWLINE# eps = 1e-08 #NEWLINE# assert_ ( np . all ( ( np . sum ( ( ( self . data - x [ np . newaxis , : ] ) ** 2 ) , axis = 1 ) > ( ( d ** 2 ) - eps ) ) ) )