code: def _is_white_noise(
      data: pd.Series,
      data_name: Optional[str] = None,
      lags: List[int] = [24, 48],
      alpha: float = 0.05,
      verbose: bool = False,
      data_kwargs: Optional[Dict] = None,
  ) -> Tuple[Union[bool, List[bool]], Optional[pd.DataFrame]]:
      """Performs the Ljung-Box test for testing if a time series is White Noise
  
      H0: The data is consistent with white noise
      Ha: The data is not consistent with white noise.
  
      Parameters
      ----------
      data : pd.Series
          Time Series data on which the test needs to be performed
      lags : List[int], optional
          The lags used to test the autocorrelation for white noise, by default [24, 48]
      alpha : float, optional
          Significance Level, by default 0.05
      verbose : bool, optional
          If False, returns boolean value(s) for whether the data is white noise
          or not. If True, then it returns the detailed results dataframe along
          with the boolean value(s), by default False
      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
  
          >>> _is_white_noise(data=data, data_kwargs={"order_list": [1, 2]})
          >>> _is_white_noise(data=data, data_kwargs={"lags_list": [1, [1, 12]]})
  
      Returns
      -------
      Tuple[Union[bool, List[bool]], Optional[pd.DataFrame]]
          If verbose=False, returns boolean value(s) for whether the data is white
          noise or not. If test for lags/orders are not requested, then returns a
          single boolean value corresponding to the data. If tests are requested
          for lags/orders (using kwargs), then returns a list of boolean values
          corresponding to the data and the lags/order specified by user (in that
          order). If verbose=True, then it returns the detailed results dataframe
          along with the boolean value(s).
      """
  
      test_category = "White Noise"
  
      # Step 1: Get list of all data that needs to be tested ----
      diff_list, name_list = _get_diff_name_list(
          data=data, data_name=data_name, data_kwargs=data_kwargs
      )
  
      # Step 2: Test all data ----
      results_list = []
      is_white_noise_list = []
      for data_, name_ in zip(diff_list, name_list):
          # Step 2A: Validate inputs and adjust as needed ----
          if len(data_) == 0:
              # Differencing led to no remaining data, hence skip it
              continue
  
          lags_ = [lag for lag in lags if lag < len(data_)]
          lags_ = None if len(lags_) == 0 else lags_
  
          # Step 2B: Run test ----
          if data_.isna().sum() == 0:
              results = sm.stats.acorr_ljungbox(
                  data_, lags=lags_, return_df=True
              )
          else:
              raise MissingDataError(
                  "White Noise Test (Ljung-Box) can not be run on data with missing "
                  "values. Please check input data type."
              )
  
          # Step 2C: Cleanup results ----
          # When all values are same, results are NA, hence replace with True
          results[test_category] = np.where(
              ~results["lb_pvalue"].isna(),
              results["lb_pvalue"] > alpha,
              True,
          )
          is_white_noise = (
              False if results[test_category].all() is False else True
          )
          results.rename(
              columns={
                  "lb_stat": "Test Statictic",
                  "lb_pvalue": "p-value",
              },
              inplace=True,
          )
          results["Data"] = name_
  
          # Long Format
          results.reset_index(inplace=True)
          results.rename(columns={"index": "Setting"}, inplace=True)
          results = pd.melt(
              results,
              id_vars=["Setting", "Data"],
              var_name="index",
              value_name="Value",
          )
  
          # Step 2D: Update list of all results ----
          results_list.append(results)
          is_white_noise_list.append(is_white_noise)
  
      # Step 3: Combine all results ----
      results = pd.concat(results_list)
      results.reset_index(inplace=True)
  
      # Step 4: Add Settings & Format Results ----
      def add_and_format_settings(row):
          row["Setting"] = {"alpha": alpha, "K": row["Setting"]}
          return row
  
      results = results.apply(add_and_format_settings, axis=1)
      results = _format_test_results(
          results, test_category, "Ljung-Box"
      )
  
      # Step 5: Return values ----
      if len(is_white_noise_list) == 1:
          is_white_noise_list = is_white_noise_list[0]
      if verbose:
          return is_white_noise_list, results
      else:
          return is_white_noise_list
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  import statsmodels.api
  from pmdarima.arima.utils import ndiffs, nsdiffs
  from statsmodels.tools.sm_exceptions import MissingDataError
  from statsmodels.tsa.api import kpss
  from statsmodels.tsa.stattools import adfuller
  from pycaret.internal.logging import get_logger
  from pycaret.internal.tests import _format_test_results
  from pycaret.internal.tests.stats import _is_gaussian, _summary_stats
  from pycaret.utils.time_series import _get_diff_name_list
  from pycaret.utils.time_series.exceptions import MissingDataError
label_desc: Use image node_id 6 for calling a global function with example usage: _is_white_noise(data, data_name, lags, alpha, verbose, data_kwargs) and returns: row, is_white_noise_list,  results, is_white_noise_list