def wait_until_condition(browser, condition, timeout=10, frequency=1.0):
 WebDriverWait(browser.driver, timeout=timeout, poll_frequency=frequency, ignored_exceptions=(ElementNotVisibleException, StaleElementReferenceException)).until((lambda x: condition(browser)))

def wait_until_condition ( browser , condition , timeout = 10 , frequency = 1.0 ) : WebDriverWait ( browser . driver , timeout = timeout , poll_frequency = frequency , ignored_exceptions = ( ElementNotVisibleException , StaleElementReferenceException ) ) . until ( ( lambda x : condition ( browser ) ) )
wait until the condition has been met .