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

    """Decorator to check session has expired or not.
    """
    @functools.wraps(func)
    def inner_connection_checker(self, *args, **kwargs):
        LOG.debug('in    _connection_checker')
        for attempts in range(5):
            try:
                return func(self, *args, **kwargs)
            except exception.VolumeBackendAPIException as e:
                pattern = re.compile('.*Session    id    expired$')
                matches = pattern.match(six.text_type(e))
                if matches:
                    if (attempts < 5):
                        LOG.debug('Session    might    have    expired.    Trying    to    relogin')
                        self._login()
                        continue
                LOG.error('Re-throwing    Exception    %s', e)
                raise
    return inner_connection_checker