human
Complete this python program:
def _authenticated(func):
assistant
#Here is the Python program you requested.

    """Ensure the driver is authenticated to make a request.
    In do_setup() we fetch an auth token and store it. If that expires when
    we do API request, we\ll fetch a new one.
    """
    @functools.wraps(func)
    def func_wrapper(driver, *args, **kwargs):
        try:
            return func(driver, *args, **kwargs)
        except exception.NotAuthorized:
            if (args[0] == 'login'):
                raise
            driver.login()
            return func(driver, *args, **kwargs)
    return func_wrapper