code: def stationarity_test_adf(
      ts: TimeSeries,
      maxlag: Union[None, int] = None,
      regression: str = "c",
      autolag: Union[None, str] = "AIC",
  ) -> set:
      """
      Provides Augmented Dickey-Fuller unit root test for a time series,
      using :func:`statsmodels.tsa.stattools.adfuller`. See [1]_.
  
  
      Parameters
      ----------
      ts
          The time series to test.
      maxlag
          Maximum lag which is included in test, default value of 12*(nobs/100)^{1/4} is used when None.
      regression
          Constant and trend order to include in regression.
          "c" : constant only (default).
          "ct" : constant and trend.
          "ctt" : constant, and linear and quadratic trend.
          "n" : no constant, no trend.
      autolag
          Method to use when automatically determining the lag length among the values 0, 1, …, maxlag.
          If "AIC" (default) or "BIC", then the number of lags is chosen to minimize the corresponding
          information criterion. "t-stat" based choice of maxlag. Starts with maxlag and drops a lag
          until the t-statistic on the last lag length is significant using a 5%-sized test.
          If None, then the number of included lags is set to maxlag.
  
      Returns
      -------
      set
          | adf: The test statistic.
          | pvalue: MacKinnon's approximate p-value based on [2]_.
          | usedlag: The number of lags used.
          | nobs: The number of observations used for the ADF regression and calculation of the critical values.
          | critical: Critical values for the test statistic at the 1 %, 5 %, and 10 % levels. Based on [2]_.
          | icbest: The maximized information criterion if autolag is not None.
  
      References
      ----------
      .. [1] https://www.statsmodels.org/dev/generated/statsmodels.tsa.stattools.adfuller.html
      .. [2] MacKinnon (1994, 2010)
      """
  
      ts._assert_univariate()
      ts._assert_deterministic()
  
      return adfuller(
          ts.values(copy=False), maxlag, regression, autolag
      )
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from scipy.signal import argrelmax
  from scipy.stats import norm
  from statsmodels.tsa.seasonal import MSTL, STL, seasonal_decompose
  from statsmodels.tsa.stattools import acf, adfuller, grangercausalitytests, kpss, pacf
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from .missing_values import fill_missing_values
  from .utils import ModelMode, SeasonalityMode
label_desc: Use image node_id 9 for calling a global function with example usage: stationarity_test_adf(ts, maxlag, regression, autolag) and returns: adfuller