code: def autocorr(ary, axis=-1):
      """Compute autocorrelation using FFT for every lag for the input array.
  
      See https://en.wikipedia.org/wiki/autocorrelation#Efficient_computation
  
      Parameters
      ----------
      ary : Numpy array
          An array containing MCMC samples
  
      Returns
      -------
      acorr: Numpy array same size as the input array
      """
      corr = autocov(ary, axis=axis)
      axis = axis = axis if axis > 0 else len(corr.shape) + axis
      norm = tuple(
          slice(None, None) if dim != axis else slice(None, 1)
          for dim, _ in enumerate(corr.shape)
      )
      with np.errstate(invalid="ignore"):
          corr /= corr[norm]
      return corr
  
imports: import warnings
  from collections.abc import Sequence
  from copy import copy
  from copy import deepcopy
  import numpy
  import pandas
  from scipy.fftpack import next_fast_len
  from scipy.interpolate import CubicSpline
  from scipy.stats.mstats import mquantiles
  from xarray import apply_ufunc
  from ..None import _log
  from ..utils import conditional_jit, conditional_vect, conditional_dask
  from .density_utils import histogram
label_desc: Use image node_id 2 for calling a global function with example usage: autocorr(ary, axis) and returns: corr