def _map_and_prefix_keys(self, key_iterable, key_prefix):
<EOL>key_extra_len=len(key_prefix)<EOL>if key_prefix and self.do_check_key:<EOL><INDENT>self.check_key(key_prefix)<EOL><DEDENT>server_keys = {}<EOL>prefixed_to_orig_key = {}<EOL>for orig_key in key_iterable:<EOL><INDENT>if isinstance(orig_key, tuple):<EOL><INDENT>str_orig_key = str(orig_key[<NUM_LIT:1>])<EOL>server, key = self._get_server((orig_key[<NUM_LIT:0>], key_prefix + str_orig_key)) <EOL><DEDENT>else:<EOL><INDENT>str_orig_key = str(orig_key) <EOL>server, key = self._get_server(key_prefix + str_orig_key)<EOL><DEDENT>if self.do_check_key:<EOL><INDENT>self.check_key(str_orig_key, key_extra_len=key_extra_len)<EOL><DEDENT>if not server:<EOL><INDENT>continue<EOL><DEDENT>if server not in server_keys:<EOL><INDENT>server_keys[server] = []<EOL><DEDENT>server_keys[server].append(key)<EOL>prefixed_to_orig_key[key] = orig_key<EOL><DEDENT>return (server_keys, prefixed_to_orig_key)<EOL>
Compute the mapping of server (_Host instance) -> list of keys to stuff onto that server, as well as the mapping of
        prefixed key -> original key.