code: def generate_numba_ewm_table_func(
      nopython: bool,
      nogil: bool,
      parallel: bool,
      com: float,
      adjust: bool,
      ignore_na: bool,
      deltas: tuple,
      normalize: bool,
  ):
      """
      Generate a numba jitted ewm mean or sum function applied table wise specified
      by values from engine_kwargs.
  
      Parameters
      ----------
      nopython : bool
          nopython to be passed into numba.jit
      nogil : bool
          nogil to be passed into numba.jit
      parallel : bool
          parallel to be passed into numba.jit
      com : float
      adjust : bool
      ignore_na : bool
      deltas : tuple
      normalize: bool
  
      Returns
      -------
      Numba function
      """
      if TYPE_CHECKING:
          import numba
      else:
          numba = import_optional_dependency("numba")
  
      @numba.jit(nopython=nopython, nogil=nogil, parallel=parallel)
      def ewm_table(
          values: np.ndarray,
          begin: np.ndarray,
          end: np.ndarray,
          minimum_periods: int,
      ) -> np.ndarray:
          alpha = 1.0 / (1.0 + com)
          old_wt_factor = 1.0 - alpha
          new_wt = 1.0 if adjust else alpha
          old_wt = np.ones(values.shape[1])
  
          result = np.empty(values.shape)
          weighted = values[0].copy()
          nobs = (~np.isnan(weighted)).astype(np.int64)
          result[0] = np.where(
              nobs >= minimum_periods, weighted, np.nan
          )
          for i in range(1, len(values)):
              cur = values[i]
              is_observations = ~np.isnan(cur)
              nobs += is_observations.astype(np.int64)
              for j in numba.prange(len(cur)):
                  if not np.isnan(weighted[j]):
                      if is_observations[j] or not ignore_na:
                          if normalize:
                              # note that len(deltas) = len(vals) - 1 and deltas[i]
                              # is to be used in conjunction with vals[i+1]
                              old_wt[j] *= (
                                  old_wt_factor ** deltas[i - 1]
                              )
                          else:
                              weighted[j] = old_wt_factor * weighted[j]
                          if is_observations[j]:
                              if normalize:
                                  # avoid numerical errors on constant series
                                  if weighted[j] != cur[j]:
                                      weighted[j] = (
                                          old_wt[j] * weighted[j]
                                          + new_wt * cur[j]
                                      )
                                      if normalize:
                                          weighted[j] = weighted[j] / (
                                              old_wt[j] + new_wt
                                          )
                                  if adjust:
                                      old_wt[j] += new_wt
                                  else:
                                      old_wt[j] = 1.0
                              else:
                                  weighted[j] += cur[j]
                  elif is_observations[j]:
                      weighted[j] = cur[j]
  
              result[i] = np.where(
                  nobs >= minimum_periods, weighted, np.nan
              )
  
          return result
  
      return ewm_table
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/window/numba_.py
imports: from __future__ import annotations
  import functools
  from typing import TYPE_CHECKING, Any, Callable
  import numpy
  from pandas._typing import Scalar
  from pandas.compat._optional import import_optional_dependency
  from pandas.core.util.numba_ import jit_user_function
label_desc: Use image node_id 5 for calling a global function with example usage: generate_numba_ewm_table_func(nopython, nogil, parallel, com, adjust, ignore_na, deltas, normalize) and returns: ewm_table, result