code: def na_accum_func(
      values: ArrayLike, accum_func, *, skipna: bool
  ) -> ArrayLike:
      """
      Cumulative function with skipna support.
  
      Parameters
      ----------
      values : np.ndarray or ExtensionArray
      accum_func : {np.cumprod, np.maximum.accumulate, np.cumsum, np.minimum.accumulate}
      skipna : bool
  
      Returns
      -------
      np.ndarray or ExtensionArray
      """
      mask_a, mask_b = {
          np.cumprod: (1.0, np.nan),
          np.maximum.accumulate: (-np.inf, np.nan),
          np.cumsum: (0.0, np.nan),
          np.minimum.accumulate: (np.inf, np.nan),
      }[accum_func]
  
      # This should go through ea interface
      assert values.dtype.kind not in ["m", "M"]
  
      # We will be applying this function to block values
      if skipna and not issubclass(
          values.dtype.type, (np.integer, np.bool_)
      ):
          vals = values.copy()
          mask = isna(vals)
          vals[mask] = mask_a
          result = accum_func(vals, axis=0)
          result[mask] = mask_b
      else:
          result = accum_func(values, axis=0)
  
      return result
  
imports: from __future__ import annotations
  import functools
  import itertools
  import operator
  from typing import Any, Callable, cast
  import warnings
  import numpy
  from pandas._config import get_option
  from pandas._libs import NaT, NaTType, iNaT, lib
  from pandas._typing import ArrayLike, AxisInt, CorrelationMethod, Dtype, DtypeObj, F, Scalar, Shape, npt
  from pandas.compat._optional import import_optional_dependency
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_any_int_dtype, is_bool_dtype, is_complex, is_datetime64_any_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_scalar, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.missing import isna, na_value_for_dtype, notna
  from pandas.core.construction import extract_array
label_desc: Use image node_id 39 for calling a global function with example usage: na_accum_func(values, accum_func) and returns: result