def global_request(self, kind, data=None, wait=True):
if wait:<EOL><INDENT>self.completion_event = threading.Event()<EOL><DEDENT>m = Message()<EOL>m.add_byte(chr(MSG_GLOBAL_REQUEST))<EOL>m.add_string(kind)<EOL>m.add_boolean(wait)<EOL>if data is not None:<EOL><INDENT>m.add(*data)<EOL><DEDENT>self._log(DEBUG, '<STR_LIT>' % kind)<EOL>self._send_user_message(m)<EOL>if not wait:<EOL><INDENT>return None<EOL><DEDENT>while True:<EOL><INDENT>self.completion_event.wait(<NUM_LIT:0.1>)<EOL>if not self.active:<EOL><INDENT>return None<EOL><DEDENT>if self.completion_event.isSet():<EOL><INDENT>break<EOL><DEDENT><DEDENT>return self.global_response<EOL>
Make a global request to the remote host.  These are normally
extensions to the SSH2 protocol.

@param kind: name of the request.
@type kind: str
@param data: an optional tuple containing additional data to attach
    to the request.
@type data: tuple
@param wait: C{True} if this method should not return until a response
    is received; C{False} otherwise.
@type wait: bool
@return: a L{Message} containing possible additional data if the
    request was successful (or an empty L{Message} if C{wait} was
    C{False}); C{None} if the request was denied.
@rtype: L{Message}