def METHOD_NAME(self, timeout, close):
    try:
        get_hub().switch()
        self.fail('Must raise Timeout')
    except gevent.Timeout as ex:
        if ex is not timeout:
            raise
        if close:
            ex.close()
        return ex