code: def _make_boxcox_optimizer(bounds=None, brack=(-2.0, 2.0)):
      from scipy import optimize
  
      # bounds is None, use simple Brent optimisation
      if bounds is None:
  
          def optimizer(func, args):
              return optimize.brent(func, brack=brack, args=args)
  
      # otherwise use bounded Brent optimisation
      else:
          # input checks on bounds
          if not isinstance(bounds, tuple) or len(bounds) != 2:
              raise ValueError(
                  f"`bounds` must be a tuple of length 2, but found: {bounds}"
              )
  
          def optimizer(func, args):
              return optimize.fminbound(
                  func, bounds[0], bounds[1], args=args
              )
  
      return optimizer
  
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 3 for calling a global function with example usage: _make_boxcox_optimizer(bounds, brack) and returns: optimizer, optimize, optimize