code: def recommend_uppercase_d(data: pd.Series, sp: int, **kwargs) -> int:
      """Returns the recommended value of differencing order 'D' to use
  
      Parameters
      ----------
      data : pd.Series
          The data for which the differencing order needs to be calculated
  
      sp : int
          The number of seasonal periods (i.e., frequency of the time series)
  
      *kwargs: Keyword arguments that can be passed to the difference test.
          Values are:
              alpha : float, optional
                  Significance Value, by default 0.05
              test : str, optional
                  Type of unit root test of seasonality to use in order to detect
                  seasonal periodicity. Valid tests include (“ocsb”, “ch”).
                  Note that the CHTest is very slow for large data.
              max_D : int, optional
                  maximum seasonal differencing order to try, by default 2
  
      Returns
      -------
      int
          The differencing order to use
      """
      recommended_uppercase_d = nsdiffs(data, m=sp, **kwargs)
      return recommended_uppercase_d
  
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 10 for calling a global function with example usage: recommend_uppercase_d(data, sp) and returns: recommended_uppercase_d