code: def njit_accumulated_matrix_from_dist_matrix(dist_matrix, mask):
      """Compute the accumulated cost matrix score between two time series using
      a precomputed distance matrix.
  
      Parameters
      ----------
      dist_matrix : array-like, shape=(sz1, sz2)
          Array containing the pairwise distances.
      mask : array-like, shape=(sz1, sz2)
          Mask. Unconsidered cells must have infinite values.
  
      Returns
      -------
      mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
      """
      l1, l2 = dist_matrix.shape
      cum_sum = numpy.full((l1 + 1, l2 + 1), numpy.inf)
      cum_sum[0, 0] = 0.0
  
      for i in prange(l1):
          for j in prange(l2):
              if numpy.isfinite(mask[i, j]):
                  cum_sum[i + 1, j + 1] = dist_matrix[i, j]
                  cum_sum[i + 1, j + 1] += min(
                      cum_sum[i, j + 1],
                      cum_sum[i + 1, j],
                      cum_sum[i, j],
                  )
      return cum_sum[1:, 1:]
  
imports: import warnings
  import numpy
  from numba import njit, prange
  from tslearn.backend import instantiate_backend
  from tslearn.utils import to_time_series
  from .utils import _cdist_generic
label_desc: Use image node_id 10 for calling a global function with example usage: njit_accumulated_matrix_from_dist_matrix(dist_matrix, mask) and returns: cum_sum