def renegotiate_keys(self):
self.completion_event = threading.Event()<EOL>self._send_kex_init()<EOL>while True:<EOL><INDENT>self.completion_event.wait(<NUM_LIT:0.1>)<EOL>if not self.active:<EOL><INDENT>e = self.get_exception()<EOL>if e is not None:<EOL><INDENT>raise e<EOL><DEDENT>raise SSHException('<STR_LIT>')<EOL><DEDENT>if self.completion_event.isSet():<EOL><INDENT>break<EOL><DEDENT><DEDENT>return<EOL>
Force this session to switch to new keys.  Normally this is done
automatically after the session hits a certain number of packets or
bytes sent or received, but this method gives you the option of forcing
new keys whenever you want.  Negotiating new keys causes a pause in
traffic both ways as the two sides swap keys and do computations.  This
method returns when the session has switched to new keys.

@raise SSHException: if the key renegotiation failed (which causes the
    session to end)