code: def plot_autocorrelation(
      df,
      col,
      plot_type="acf",
      n_lags=40,
      fft=False,
      compute_backend=None,
      viz_backend=None,
      **kwargs,
  ):
      """Correlation estimate using partial autocorrelation or autocorrelation.
  
      Statistics are computed using the statsmodels API.
  
      Args:
          df: The dataframe with datetime index
          col: The feature of interest
          plot_type: Choose between 'acf' or 'pacf. Defaults to "pacf".
          n_lags: Number of lags to return autocorrelation for. Defaults to 40.
          fft: If True, computes ACF via fourier fast transform (FFT). Defaults to False.
          compute_backend: Select computing backend. Defaults to None (pandas).
          viz_backend: Select visualization backend. Defaults to None (seaborn).
          **kwargs: Keyword arguments
  
      Raises:
          ValueError: Invalid input data type.
          ValueError: `col` not found in dataframe.
  
      Returns:
          The visualization
      """
      if not _is_dataframe(df):
          raise ValueError("Unsupported input data type")
      if isinstance(col, str):
          if col not in df.columns:
              raise ValueError(f"{col} not found in dataframe")
      if viz_backend == "plotly":
          data, white_noise = _get_compute_backend(
              compute_backend, df
          ).compute_autocorrelation(
              df[col],
              plot_type=plot_type,
              n_lags=n_lags,
              fft=fft,
              **kwargs,
          )
          fig = _get_viz_backend(viz_backend).viz_plot_autocorrelation(
              data,
              plot_type=plot_type,
              white_noise=white_noise,
              n_lags=n_lags,
              **kwargs,
          )
      else:
          fig = _get_viz_backend(viz_backend).viz_plot_autocorrelation(
              df[col],
              plot_type=plot_type,
              n_lags=n_lags,
              fft=fft,
              **kwargs,
          )
      return fig
  
imports: import warnings
  from typing import Optional
  import matplotlib.pyplot
  import seaborn
  import pandas
  import numpy
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from plotly.offline import init_notebook_mode, iplot
  from data_describe.config._config import get_option
  from data_describe.backends import _get_viz_backend, _get_compute_backend
  from data_describe.compat import _is_dataframe, _compat, _requires, _in_notebook
label_desc: Use image node_id 3 for calling a global function with example usage: plot_autocorrelation(df, col, plot_type, n_lags, fft, compute_backend, viz_backend) and returns: fig