code: def optimize_ces_target_fn(
      init_par,
      optimize_params,
      y,
      m,
      init_states,
      n_components,
      seasontype,
      nmse,
  ):
      x0 = [
          init_par[key] for key, val in optimize_params.items() if val
      ]
      x0 = np.array(x0, dtype=np.float32)
      if not len(x0):
          return
  
      init_alpha_0 = init_par["alpha_0"]
      init_alpha_1 = init_par["alpha_1"]
      init_beta_0 = init_par["beta_0"]
      init_beta_1 = init_par["beta_1"]
  
      opt_alpha_0 = optimize_params["alpha_0"]
      opt_alpha_1 = optimize_params["alpha_1"]
      opt_beta_0 = optimize_params["beta_0"]
      opt_beta_1 = optimize_params["beta_1"]
  
      res = nelder_mead_ces(
          x0,
          args=(
              init_alpha_0,
              init_alpha_1,
              init_beta_0,
              init_beta_1,
              opt_alpha_0,
              opt_alpha_1,
              opt_beta_0,
              opt_beta_1,
              y,
              m,
              init_states,
              n_components,
              seasontype,
              nmse,
          ),
          tol_std=1e-4,
          lower=np.array([0.01, 0.01, 0.01, 0.01]),
          upper=np.array([1.8, 1.9, 1.5, 1.5]),
          max_iter=1_000,
          adaptive=True,
      )
      return res
  
imports: import math
  from typing import Tuple
  import numpy
  from numba import njit
  from statsmodels.tsa.seasonal import seasonal_decompose
  from .ets import restrict_to_bounds, results
  from .utils import CACHE, NOGIL
label_desc: Use image node_id 11 for calling a global function with example usage: optimize_ces_target_fn(init_par, optimize_params, y, m, init_states, n_components, seasontype, nmse) and returns: res