#NEWLINE# def flann_from_typedbytes( inp , tempdir = _not_passed ) : #NEWLINE# #INDENT# if ( tempdir is _not_passed ) : #NEWLINE# #INDENT# tempdir = DEFAULT_TEMPDIR #NEWLINE# #UNINDENT# register_read_ndarray ( inp ) #NEWLINE# length = inp . read_int ( ) #NEWLINE# pts = inp . _read ( ) #NEWLINE# index_bytes = inp . read_bytestring ( ) #NEWLINE# with tempfile . NamedTemporaryFile ( dir = tempdir ) as f : #NEWLINE# #INDENT# f . write ( index_bytes ) #NEWLINE# f . flush ( ) #NEWLINE# del index_bytes #NEWLINE# index = cyflann . FLANNIndex ( ) #NEWLINE# index . load_index ( f . name , pts ) #NEWLINE# #UNINDENT# return index