#NEWLINE# def __init__( self , driver , timeout , poll_frequency = POLL_FREQUENCY , ignored_exceptions = None ) : #NEWLINE# #INDENT# 'Constructor, takes a WebDriver instance and timeout in seconds.\n\n           :Args:\n            - driver - Instance of WebDriver (Ie, Firefox, Chrome or Remote)\n            - timeout - Number of seconds before timing out\n            - poll_frequency - sleep interval between calls\n              By default, it is 0.5 second.\n            - ignored_exceptions - iterable structure of exception classes ignored during calls.\n              By default, it contains NoSuchElementException only.\n\n           Example:\n            from selenium.webdriver.support.ui import WebDriverWait \n\n            element = WebDriverWait(driver, 10).until(lambda x: x.find_element_by_id("someId")) \n\n            is_disappeared = WebDriverWait(driver, 30, 1, (ElementNotVisibleException)).\\ \n\n                        until_not(lambda x: x.find_element_by_id("someId").is_displayed())\n        ' #NEWLINE# self . _driver = driver #NEWLINE# self . _timeout = timeout #NEWLINE# self . _poll = poll_frequency #NEWLINE# if ( self . _poll == 0 ) : #NEWLINE# #INDENT# self . _poll = POLL_FREQUENCY #NEWLINE# #UNINDENT# exceptions = list ( IGNORED_EXCEPTIONS ) #NEWLINE# if ( ignored_exceptions is not None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# exceptions . extend ( iter ( ignored_exceptions ) ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# exceptions . append ( ignored_exceptions ) #NEWLINE# #UNINDENT# #UNINDENT# self . _ignored_exceptions = tuple ( exceptions )