code: def _boxcox_normmax(
      x, bounds=None, brack=(-2.0, 2.0), method="pearsonr"
  ):
      optimizer = _make_boxcox_optimizer(bounds, brack)
  
      def _pearsonr(x):
          from scipy import stats
          from scipy.stats import distributions
  
          osm_uniform = _calc_uniform_order_statistic_medians(len(x))
          xvals = distributions.norm.ppf(osm_uniform)
  
          def _eval_pearsonr(lmbda, xvals, samps):
              y = _boxcox(samps, lmbda)
              yvals = np.sort(y)
              r, prob = stats.pearsonr(xvals, yvals)
              return 1 - r
  
          return optimizer(_eval_pearsonr, args=(xvals, x))
  
      def _mle(x):
          from scipy.stats import boxcox_llf
  
          def _eval_mle(lmb, data):
              # function to minimize
              return -boxcox_llf(lmb, data)
  
          return optimizer(_eval_mle, args=(x,))
  
      def _all(x):
          maxlog = np.zeros(2, dtype=float)
          maxlog[0] = _pearsonr(x)
          maxlog[1] = _mle(x)
          return maxlog
  
      methods = {"pearsonr": _pearsonr, "mle": _mle, "all": _all}
      if method not in methods.keys():
          raise ValueError("Method %s not recognized." % method)
  
      optimfunc = methods[method]
      return optimfunc(x)
  
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 4 for calling a global function with example usage: _boxcox_normmax(x, bounds, brack, method) and returns: optimfunc, optimizer, optimizer, maxlog, unknown, unknown