def hash_vector(self, v, querying=False):
bucket_keys = []<EOL>if querying:<EOL><INDENT>for child_hash in self.child_hashes:<EOL><INDENT>lshash = child_hash['<STR_LIT>']<EOL>if not lshash.hash_name in self.permutation.permutedIndexs:<EOL><INDENT>raise AttributeError('<STR_LIT>' % lshash.hash_name)<EOL><DEDENT>for bucket_key in lshash.hash_vector(v, querying):<EOL><INDENT>neighbour_keys = self.permutation.get_neighbour_keys(lshash.hash_name,bucket_key)<EOL>for n in neighbour_keys:<EOL><INDENT>bucket_keys.append(lshash.hash_name+'<STR_LIT:_>'+n)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for child_hash in self.child_hashes:<EOL><INDENT>lshash = child_hash['<STR_LIT>']<EOL>for bucket_key in lshash.hash_vector(v, querying):<EOL><INDENT>child_hash['<STR_LIT>'][bucket_key] = bucket_key<EOL>bucket_keys.append(lshash.hash_name+'<STR_LIT:_>'+bucket_key)<EOL><DEDENT><DEDENT><DEDENT>return bucket_keys<EOL>
Hashes the vector and returns the bucket key as string.