human
Complete this python program:
def _shown_elem_with_wait(context, by, wait_time=MAX_WAIT_TIME):
assistant
#Here is the Python code you requested.

    """Tries to find an element with an explicit timeout.
    Tries to scroll to an element and uses WebElement.is_displayed()
    "Private" function to hide Selenium details.
    context: a behave context
    by: A tuple selector used by Selenium
    wait_time: The max time to wait in seconds
    Returns the element if found or None
    """
    def _visibility():
        try:
            elem = context.browser.find_element(by[0], by[1])
            context.browser.execute_script(('$(window).scrollLeft(%s);$(window).scrollTop(%s);' % (elem.location['x'], elem.location['y'])))
            return elem.is_displayed()
        except NoSuchElementException:
            return False
    try:
        return WebDriverWait(context.browser, wait_time).until((lambda browser: _visibility()))
    except TimeoutException:
        return None