#NEWLINE# def test_memmap( ) : #NEWLINE# #INDENT# asflt = ( lambda x : as_float_array ( x , copy = False ) ) #NEWLINE# with NamedTemporaryFile ( prefix = 'sklearn-test' ) as tmp : #NEWLINE# #INDENT# M = np . memmap ( tmp , shape = ( 10 , 10 ) , dtype = np . float32 ) #NEWLINE# M [ : ] = 0 #NEWLINE# for f in ( check_array , np . asarray , asflt ) : #NEWLINE# #INDENT# X = f ( M ) #NEWLINE# X [ : ] = 1 #NEWLINE# assert_array_equal ( X . ravel ( ) , M . ravel ( ) ) #NEWLINE# X [ : ] = 0