code: def extract_params(
      params,
      use_boxcox,
      use_trend,
      use_damped_trend,
      use_arma_errors,
      seasonal_periods,
      p,
      q,
  ):
      if use_boxcox:
          BoxCox_lambda = params[0]
          alpha = params[1]
          index = 2
      else:
          BoxCox_lambda = None
          alpha = params[0]
          index = 1
      if use_trend:
          beta = params[index]
          index += 1
          if use_damped_trend:
              phi = params[index]
              index += 1
          else:
              phi = 1.0
      else:
          beta = None
          phi = None
      gamma_one_v = params[index : index + len(seasonal_periods)]
      gamma_two_v = params[
          index
          + len(seasonal_periods) : index
          + 2 * len(seasonal_periods)
      ]
      index += 2 * len(seasonal_periods)
      ar_coeffs = None
      ma_coeffs = None
      if (
          use_arma_errors
      ):  # if arma_errors = True, then p or q must be non-zero
          if p != 0 and q != 0:
              ar_coeffs = params[index : index + p]
              ma_coeffs = params[index + p : index + p + q]
          elif p != 0:
              ar_coeffs = params[index : index + p]
          elif q != 0:
              ma_coeffs = params[index : index + q]
      return (
          BoxCox_lambda,
          alpha,
          beta,
          phi,
          gamma_one_v,
          gamma_two_v,
          ar_coeffs,
          ma_coeffs,
      )
  
imports: import warnings
  from functools import partial
  import numpy
  import pandas
  import scipy.linalg
  import statsmodels.api
  from numba import njit
  from numpy.polynomial.polynomial import Polynomial
  from scipy.special import inv_boxcox
  from scipy.stats import boxcox
  from scipy.optimize import minimize
  from statsmodels.tsa.stattools import adfuller
  from .arima import auto_arima_f
  from .utils import NOGIL, CACHE
label_desc: Use image node_id 9 for calling a global function with example usage: extract_params(params, use_boxcox, use_trend, use_damped_trend, use_arma_errors, seasonal_periods, p, q) and returns: BoxCox_lambda,  alpha,  beta,  phi,  gamma_one_v,  gamma_two_v,  ar_coeffs,  ma_coeffs