code: def check_stats(
      estimator: Optional[Any] = None,
      test: str = "all",
      alpha: float = 0.05,
      split: str = "all",
  ) -> pd.DataFrame:
      """This function is used to get summary statistics and run statistical
      tests on the original data or model residuals.
  
      Example
      --------
      >>> from pycaret.datasets import get_data
      >>> airline = get_data('airline')
      >>> from pycaret.time_series import *
      >>> exp_name = setup(data = airline,  fh = 12)
      >>> check_stats(test="summary")
      >>> check_stats(test="adf")
      >>> arima = create_model('arima')
      >>> check_stats(arima, test = 'white_noise')
  
  
      Parameters
      ----------
      estimator : sktime compatible object, optional
          Trained model object, by default None
  
  
      test : str, optional
          Name of the test to be performed, by default "all"
  
          Options are:
  
          * 'summary' - Summary Statistics
          * 'white_noise' - Ljung-Box Test for white noise
          * 'adf' - ADF test for difference stationarity
          * 'kpss' - KPSS test for trend stationarity
          * 'stationarity' - ADF and KPSS test
          * 'normality' - Shapiro Test for Normality
          * 'all' - All of the above tests
  
  
      alpha : float, optional
          Significance Level, by default 0.05
  
  
      split : str, optional
          The split of the original data to run the test on. Only applicable
          when test is run on the original data (not residuals), by default "all"
  
          Options are:
  
          * 'all' - Complete Dataset
          * 'train' - The Training Split of the dataset
          * 'test' - The Test Split of the dataset
  
  
      data_type : str, optional
          The data type to use for the statistical test, by default "transformed".
  
          User may wish to perform the tests on the original data set provided,
          the imputed dataset (if imputation is set) or the transformed dataset
          (which includes any imputation and transformation set by the user).
          This keyword can be used to specify which data type to use.
  
          Allowed values are: ["original", "imputed", "transformed"]
  
          NOTE:
          (1) If no imputation is specified, then testing on the "imputed"
              data type will produce the same results as the "original" data type.
          (2) If no transformations are specified, then testing the "transformed"
              data type will produce the same results as the "imputed" data type.
          (3) By default, tests are done on the "transformed" data since that
              is the data that is fed to the model during training.
  
  
      data_kwargs : Optional[Dict], optional
          Users can specify `lags list` or `order_list` to run the test for the
          data as well as for its lagged versions, by default None
  
          >>> check_stats(test="white_noise", data_kwargs={"order_list": [1, 2]})
          >>> check_stats(test="white_noise", data_kwargs={"lags_list": [1, [1, 12]]})
  
  
      Returns:
      --------
      pd.DataFrame
          Dataframe with the test results
      """
      return _CURRENT_EXPERIMENT.check_stats(
          estimator=estimator, test=test, alpha=alpha, split=split
      )
  
imports: import logging
  import os
  from typing import TYPE_CHECKING, Any, BinaryIO, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.time_series.forecasting.oop import TSForecastingExperiment
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 26 for calling a global function with example usage: check_stats(estimator, test, alpha, split) and returns: _CURRENT_EXPERIMENT