code: def _calculate_deltas(
      times: np.ndarray | NDFrame,
      halflife: float | TimedeltaConvertibleTypes | None,
  ) -> npt.NDArray[np.float64]:
      """
      Return the diff of the times divided by the half-life. These values are used in
      the calculation of the ewm mean.
  
      Parameters
      ----------
      times : np.ndarray, Series
          Times corresponding to the observations. Must be monotonically increasing
          and ``datetime64[ns]`` dtype.
      halflife : float, str, timedelta, optional
          Half-life specifying the decay
  
      Returns
      -------
      np.ndarray
          Diff of the times divided by the half-life
      """
      unit = dtype_to_unit(times.dtype)
      if isinstance(times, ABCSeries):
          times = times._values
      _times = np.asarray(times.view(np.int64), dtype=np.float64)
      _halflife = float(Timedelta(halflife).as_unit(unit)._value)
      return np.diff(_times) / _halflife
  
imports: from __future__ import annotations
  import datetime
  from functools import partial
  from textwrap import dedent
  from typing import TYPE_CHECKING
  import numpy
  from pandas._libs.tslibs import Timedelta
  import pandas._libs.window.aggregations
  from pandas.util._decorators import doc
  from pandas.core.dtypes.common import is_datetime64_dtype, is_numeric_dtype
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.dtypes.missing import isna
  from pandas.core import common
  from pandas.core.arrays.datetimelike import dtype_to_unit
  from pandas.core.indexers.objects import BaseIndexer, ExponentialMovingWindowIndexer, GroupbyIndexer
  from pandas.core.util.numba_ import get_jit_arguments, maybe_use_numba
  from pandas.core.window.common import zsqrt
  from pandas.core.window.doc import _shared_docs, create_section_header, kwargs_numeric_only, numba_notes, template_header, template_returns, template_see_also, window_agg_numba_parameters
  from pandas.core.window.numba_ import generate_numba_ewm_func, generate_numba_ewm_table_func
  from pandas.core.window.online import EWMMeanState, generate_online_numba_ewma_func
  from pandas.core.window.rolling import BaseWindow, BaseWindowGroupby
label_desc: Use image node_id 2 for calling a global function with example usage: _calculate_deltas(times, halflife) and returns: unknown