human
Complete the below
def _connection_checker(func):

    ''''Decorator to re-establish and re-run the api if session has expired.'
    '''

=====
What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    @functools.wraps(func)
    def inner_connection_checker(self, *args, **kwargs):
        for attempts in range(2):
            try:
                return func(self, *args, **kwargs)
            except Exception as e:
                if ((attempts < 1) and re.search('Failed    to    execute', six.text_type(e))):
                    LOG.info('Session    might    have    expired.    Trying    to    relogin')
                    self.login()
                    continue
                else:
                    LOG.error('Re-throwing    Exception    %s', e)
                    raise
    return inner_connection_checker