code: def _boxcox(x, lmbda=None, bounds=None):
      r"""Return a dataset transformed by a Box-Cox power transformation.
  
      Parameters
      ----------
      x : ndarray
          Input array.  Must be positive 1-dimensional.  Must not be constant.
      lmbda : {None, scalar}, optional
          If `lmbda` is not None, do the transformation for that value.
          If `lmbda` is None, find the lambda that maximizes the log-likelihood
          function and return it as the second output argument.
  
      Returns
      -------
      boxcox : ndarray
          Box-Cox power transformed array.
      maxlog : float, optional
          If the `lmbda` parameter is None, the second returned argument is
          the lambda that maximizes the log-likelihood function.
  
      See Also
      --------
      probplot, boxcox_normplot, boxcox_normmax, boxcox_llf
  
      Notes
      -----
      The Box-Cox transform is given by::
          y = (x**lmbda - 1) / lmbda,  for lmbda > 0
              log(x),                  for lmbda = 0
      `boxcox` requires the input data to be positive.  Sometimes a Box-Cox
      transformation provides a shift parameter to achieve this; `boxcox` does
      not.  Such a shift parameter is equivalent to adding a positive constant to
      `x` before calling `boxcox`.
      The confidence limits returned when ``alpha`` is provided give the interval
      where:
  
      .. math::
  
          llf(\hat{\lambda}) - llf(\lambda) < \frac{1}{2}\chi^2(1 - \alpha, 1),
      with ``llf`` the log-likelihood function and :math:`\chi^2` the chi-squared
      function.
  
      References
      ----------
      G.E.P. Box and D.R. Cox, "An Analysis of Transformations", Journal of the
      Royal Statistical Society B, 26, 211-252 (1964).
      """
      x = np.asarray(x)
      if x.ndim != 1:
          raise ValueError("Data must be 1-dimensional.")
  
      if x.size == 0:
          return x
  
      if np.all(x == x[0]):
          raise ValueError("Data must not be constant.")
  
      if any(x <= 0):
          raise ValueError("Data must be positive.")
  
      if lmbda is not None:  # single transformation
          from scipy.special import boxcox
  
          return boxcox(x, lmbda)
  
      # If lmbda=None, find the lmbda that maximizes the log-likelihood function.
      lmax = _box_norm(x, method="mle", bounds=bounds)
      y = _boxcox(x, lmax)
  
      return y, lmax
  
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 6 for calling a global function with example usage: _boxcox(x, lmbda, bounds) and returns: y,  lmax, x, boxcox