code: def _check_kernel(kernel: str) -> str:
      kernel = kernel.replace("-", "").replace("_", "").lower()
      if kernel not in KERNEL_ESTIMATORS:
          est = "\n".join(sorted(k for k in KERNEL_ESTIMATORS))
          raise ValueError(
              f"kernel is not a known kernel estimator. Must be one of:\n {est}"
          )
      return kernel
  
imports: from __future__ import annotations
  from typing import Any, NamedTuple, cast
  import pandas
  from statsmodels.iolib.summary import Summary
  from statsmodels.regression.linear_model import OLS, RegressionResults
  import arch.covariance.kernel
  from arch.typing import ArrayLike1D, ArrayLike2D, UnitRootTrend
  from arch.utility.array import ensure1d, ensure2d
  from arch.utility.timeseries import add_trend
label_desc: Use image node_id 1 for calling a global function with example usage: _check_kernel(kernel) and returns: kernel