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

    """If remove rebooted, it lost our session so rebuld one and try again.
    """
    def decorator(self, *args, **kwargs):
        'Wrapper    function    to    refresh    session_id    on    PermissionError.'
        try:
            return func(self, *args, **kwargs)
        except PermissionError:
            _LOGGER.warning(('Invalid    session    detected.' + '    Tryign    to    refresh    session_id    and    re-run    the    rpc'))
            self.session_id = _get_session_id(self.url, self.username, self.password)
            return func(self, *args, **kwargs)
    return decorator