code: def _guerrero(x, sp, bounds=None):
      """Estimate lambda using the Guerrero method as described in [1]_.
  
      Parameters
      ----------
      x : ndarray
          Input array. Must be 1-dimensional.
      sp : integer
          Seasonal periodicity value. Must be an integer >= 2.
      bounds : {None, (float, float)}, optional
          Bounds on lambda to be used in minimization.
  
      Returns
      -------
      lambda : float
          Lambda value that minimizes the coefficient of variation of
          variances of the time series in different periods after
          Box-Cox transformation [Guerrero].
  
      References
      ----------
      .. [1] V.M. Guerrero, "Time-series analysis supported by Power
         Transformations ", Journal of Forecasting, vol. 12, pp. 37-48, 1993.
      """
      from scipy.stats import variation
  
      if sp is None or not is_int(sp) or sp < 2:
          raise ValueError(
              "Guerrero method requires an integer seasonal periodicity (sp) value >= 2."
          )
  
      x = np.asarray(x)
      if x.ndim != 1:
          raise ValueError("Data must be 1-dimensional.")
  
      num_obs = len(x)
      len_prefix = num_obs % sp
  
      x_trimmed = x[len_prefix:]
      x_mat = x_trimmed.reshape((-1, sp))
      x_mean = np.mean(x_mat, axis=1)
  
      # [Guerrero, Eq.(5)] uses an unbiased estimation for
      # the standard deviation
      x_std = np.std(x_mat, axis=1, ddof=1)
  
      def _eval_guerrero(lmb, x_std, x_mean):
          x_ratio = x_std / x_mean ** (1 - lmb)
          x_ratio_cv = variation(x_ratio)
          return x_ratio_cv
  
      optimizer = _make_boxcox_optimizer(bounds)
      return optimizer(_eval_guerrero, args=(x_std, x_mean))
  
imports: import numpy
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import is_int
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 5 for calling a global function with example usage: _guerrero(x, sp, bounds) and returns: optimizer, x_ratio_cv