code: def _njit_soft_dtw(D, R, gamma):
      """Compute soft dynamic time warping.
  
      Parameters
      ----------
      D : array-like, shape=(m, n), dtype=float64
      R : array-like, shape=(m+2, n+2), dtype=float64
      gamma : float64
          Regularization parameter.
      """
      m = D.shape[0]
      n = D.shape[1]
  
      # Initialization.
      R[: m + 1, 0] = DBL_MAX
      R[0, : n + 1] = DBL_MAX
      R[0, 0] = 0
  
      # DP recursion.
      for i in range(1, m + 1):
          for j in range(1, n + 1):
              # D is indexed starting from 0.
              R[i, j] = D[i - 1, j - 1] + _njit_softmin3(
                  R[i - 1, j], R[i - 1, j - 1], R[i, j - 1], gamma
              )
  
file_path: tslearn/tslearn/metrics/soft_dtw_fast.py
imports: import numpy
  from numba import njit, prange
  from tslearn.backend.backend import instantiate_backend
label_desc: Use image node_id 3 for calling a global function with example usage: _njit_soft_dtw(D, R, gamma) without return types