#NEWLINE# def hash_vector( self , v , querying = False ) : #NEWLINE# #INDENT# '\n        Hashes the vector and returns the bucket key as string.\n        ' #NEWLINE# bucket_keys = [ ] #NEWLINE# if querying : #NEWLINE# #INDENT# for child_hash in self . child_hashes : #NEWLINE# #INDENT# lshash = child_hash [ 'hash' ] #NEWLINE# if ( not ( lshash . hash_name in self . permutation . permutedIndexs ) ) : #NEWLINE# #INDENT# raise AttributeError ( ( 'Permuted index is not existing for hash with name %s' % lshash . hash_name ) ) #NEWLINE# #UNINDENT# for bucket_key in lshash . hash_vector ( v , querying ) : #NEWLINE# #INDENT# neighbour_keys = self . permutation . get_neighbour_keys ( lshash . hash_name , bucket_key ) #NEWLINE# for n in neighbour_keys : #NEWLINE# #INDENT# bucket_keys . append ( ( ( lshash . hash_name + '_' ) + n ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for child_hash in self . child_hashes : #NEWLINE# #INDENT# lshash = child_hash [ 'hash' ] #NEWLINE# for bucket_key in lshash . hash_vector ( v , querying ) : #NEWLINE# #INDENT# child_hash [ 'bucket_keys' ] [ bucket_key ] = bucket_key #NEWLINE# bucket_keys . append ( ( ( lshash . hash_name + '_' ) + bucket_key ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return bucket_keys