code: def auto_ces(
      y,
      m,
      model="Z",
      alpha_0=None,
      alpha_1=None,
      beta_0=None,
      beta_1=None,
      opt_crit="lik",
      nmse=3,
      ic="aicc",
  ):
      # converting params to floats
      # to improve numba compilation
      if alpha_0 is None:
          alpha_0 = np.nan
      if alpha_1 is None:
          alpha_1 = np.nan
      if beta_0 is None:
          beta_0 = np.nan
      if beta_1 is None:
          beta_1 = np.nan
      if nmse < 1 or nmse > 30:
          raise ValueError("nmse out of range")
      # refit model not implement yet
      if model not in ["Z", "N", "S", "P", "F"]:
          raise ValueError("Invalid model type")
  
      seasontype = model
      if m < 1 or len(y) < 2 * m or m == 1:
          seasontype = "N"
      n = len(y)
      npars = 2
      if seasontype == "P":
          npars += 1
      if seasontype in ["F", "Z"]:
          npars += 2
      # ses for non-optimized tiny datasets
      if n <= npars:
          # we need HoltWintersZZ function
          raise NotImplementedError("tiny datasets")
      if seasontype == "Z":
          seasontype = ["N", "S", "P", "F"]
      best_ic = np.inf
      for stype in seasontype:
          fit = cesmodel(
              y=y,
              m=m,
              seasontype=stype,
              alpha_0=alpha_0,
              alpha_1=alpha_1,
              beta_0=beta_0,
              beta_1=beta_1,
              nmse=nmse,
          )
          fit_ic = fit[ic]
          if not np.isnan(fit_ic):
              if fit_ic < best_ic:
                  model = fit
                  best_ic = fit_ic
      if np.isinf(best_ic):
          raise Exception("no model able to be fitted")
      return model
  
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 16 for calling a global function with example usage: auto_ces(y, m, model, alpha_0, alpha_1, beta_0, beta_1, opt_crit, nmse, ic) and returns: model