human
What is a the Python code you requested given the following:
Complete the below
def action_method(wrapped):

    ''''Wrapper to provide the right conflict info report data when a method
    that calls Configurator.action calls another that does the same.  Not a
    documented API but used by some external systems.'
    '''
assistant
#Here is the Python code you requested.
    def wrapper(self, *arg, **kw):
        if (self._ainfo is None):
            self._ainfo = []
        info = kw.pop('_info', None)
        backframes = (kw.pop('_backframes', 0) + 2)
        if (is_nonstr_iter(info) and (len(info) == 4)):
            info = ActionInfo(*info)
        if (info is None):
            try:
                f = traceback.extract_stack(limit=4)
                last_frame = ActionInfo(*f[(-1)])
                if (last_frame.function == 'extract_stack'):
                    f.pop()
                info = ActionInfo(*f[(- backframes)])
            except:
                info = ActionInfo(None, 0, '', '')
        self._ainfo.append(info)
        try:
            result = wrapped(self, *arg, **kw)
        finally:
            self._ainfo.pop()
        return result
    if hasattr(wrapped, '__name__'):
        functools.update_wrapper(wrapper, wrapped)
    wrapper.__docobj__ = wrapped
    return wrapper