code: def adf_test(
      timeseries, autolag: str = "AIC", regression: str = "c", **kwargs
  ):
      """Compute the Augmented Dickey-Fuller (ADF) test for stationarity.
  
      Backend uses statsmodels.tsa.stattools.adfuller
  
      Args:
          timeseries: The timeseries
          autolag: Method to use when determining the number of lags. Defaults to 'AIC'. Choose between 'AIC', 'BIC', 't-stat', and None
          regression: Constant and trend order to include in regression. Choose between 'c','ct','ctt', and 'nc'
          **kwargs: Keyword arguments for adfuller
  
      Returns:
          Pandas dataframe containing the statistics
      """
      test = _compat["statsmodels.tsa.stattools"].adfuller(  # type: ignore
          timeseries, autolag=autolag, regression=regression, **kwargs
      )
      adf_output = pd.Series(
          test[0:4],
          index=[
              "Test Statistic",
              "p-value",
              "Lags Used",
              "Number of Observations Used",
          ],
      )
      for key, value in test[4].items():
          adf_output["Critical Value (%s)" % key] = value
      return pd.DataFrame(adf_output, columns=["stats"])
  
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 5 for calling a global function with example usage: adf_test(timeseries, autolag, regression) and returns: pd