def METHOD_NAME(y, m):
    data_positive = min(y) > 0
    errortype = ['add', 'mul']
    trendtype = [None, 'add']
    seasontype = [None, 'add', 'mul']
    damped = [True, False]
    best_ic = np.inf
    for etype in errortype:
        for ttype in trendtype:
            for stype in seasontype:
                for dtype in damped:
                    if ttype is None and dtype:
                        continue
                    if etype == 'add' and (ttype == 'mul' and stype == 'mul'):
                        continue
                    if etype == 'mul' and ttype == 'mul' and stype == 'add':
                        continue
                    if (not data_positive) and etype == 'mul':
                        continue
                    if stype in ['add', 'mul'] and m == 1:
                        continue
                    model = ETSModel(y, error=etype, trend=ttype, damped_trend=dtype, 
                                    seasonal=stype, seasonal_periods=m)
                    model = model.fit(disp=False)
                    fit_ic = model.aicc
                    if not np.isnan(fit_ic):
                        if fit_ic < best_ic:
                            best_model = model
    return best_model