def hash_vector(self, v, querying=False):
bucket_keys = []<EOL>if querying:<EOL><INDENT>for lshash in self.child_hashes:<EOL><INDENT>for bucket_key in lshash.hash_vector(v, querying):<EOL><INDENT>prefixed_key = lshash.hash_name+'<STR_LIT:_>'+bucket_key<EOL>if prefixed_key in self.bucket_key_map:<EOL><INDENT>bucket_keys.extend(self.bucket_key_map[prefixed_key].keys())<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for lshash in self.child_hashes:<EOL><INDENT>for bucket_key in lshash.hash_vector(v, querying):<EOL><INDENT>perm_keys = self.permuted_keys(bucket_key)<EOL>perm_keys.append(bucket_key)<EOL>bucket_keys.append(lshash.hash_name+'<STR_LIT:_>'+bucket_key)<EOL>for perm_key in perm_keys:<EOL><INDENT>prefixed_key = lshash.hash_name+'<STR_LIT:_>'+perm_key<EOL>if not prefixed_key in self.bucket_key_map:<EOL><INDENT>self.bucket_key_map[prefixed_key] = {}<EOL><DEDENT>for variant in perm_keys:<EOL><INDENT>prefixed_variant = lshash.hash_name+'<STR_LIT:_>'+variant<EOL>self.bucket_key_map[prefixed_key][prefixed_variant] = <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return bucket_keys<EOL>
Hashes the vector and returns the bucket key as string.