code: def _cum_func(
      func: Callable,
      values: np.ndarray,
      *,
      skipna: bool = True,
  ):
      """
      Accumulations for 1D datetimelike arrays.
  
      Parameters
      ----------
      func : np.cumsum, np.maximum.accumulate, np.minimum.accumulate
      values : np.ndarray
          Numpy array with the values (can be of any dtype that support the
          operation). Values is changed is modified inplace.
      skipna : bool, default True
          Whether to skip NA.
      """
      try:
          fill_value = {
              np.maximum.accumulate: np.iinfo(np.int64).min,
              np.cumsum: 0,
              np.minimum.accumulate: np.iinfo(np.int64).max,
          }[func]
      except KeyError:
          raise ValueError(
              f"No accumulation for {func} implemented on BaseMaskedArray"
          )
  
      mask = isna(values)
      y = values.view("i8")
      y[mask] = fill_value
  
      if not skipna:
          mask = np.maximum.accumulate(mask)
  
      result = func(y)
      result[mask] = iNaT
  
      if values.dtype.kind in ["m", "M"]:
          return result.view(values.dtype.base)
      return result
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/array_algos/datetimelike_accumulations.py
imports: from __future__ import annotations
  from typing import Callable
  import numpy
  from pandas._libs import iNaT
  from pandas.core.dtypes.missing import isna
label_desc: Use image node_id 1 for calling a global function with example usage: _cum_func(func, values) and returns: result, result