code: def _acf(
      data: pd.Series,
      diff: int = 0,
      lags: int = 40,
      adjusted: bool = False,
      fft: bool = False,
      alpha: float = 0.05,
      missing: str = "none",
  ) -> pd.DataFrame:
      data_clean = data.fillna(method="bfill").fillna(method="ffill")
      lags = min(lags, len(data_clean) // 2, len(data_clean))
      data_clean = pd.Series(
          np.diff(data_clean.values, diff),
          index=data_clean.index[diff:],
      )
      corr, conf = sms.acf(
          data_clean,
          nlags=lags,
          adjusted=adjusted,
          qstat=False,
          fft=fft,
          alpha=alpha,
          missing=missing,
      )
      return _stattools_make_df(corr, conf)
  
file_path: tslumen/tslumen/profile/correlation.py
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  from statsmodels.tsa import stattools
  from tslumen.profile.base import ProfilingFunction
label_desc: Use image node_id 2 for calling a global function with example usage: _acf(data, diff, lags, adjusted, fft, alpha, missing) and returns: _stattools_make_df