Wait ``timeout`` seconds until ``method(**kwargs)`` returns a ``value`` that *bool(value)==True*.
    Returns last ``value``.
     If time expired and ``fail_on_timeout`` specified, then raise TimeoutException.

    :param method:
    :param timeout:
    :param fail_on_timeout:
    :param kwargs:
    :return:

def wait(method, timeout, fail_on_timeout=None, **kwargs):
    """
    Wait ``timeout`` seconds until ``method(**kwargs)`` returns a ``value`` that *bool(value)==True*.
    Returns last ``value``.
     If time expired and ``fail_on_timeout`` specified, then raise TimeoutException.

    :param method:
    :param timeout:
    :param fail_on_timeout:
    :param kwargs:
    :return:
    """
    return Waiter(lambda value: bool(value)).start(method, timeout, fail_on_timeout, **kwargs)