code: def njit_accumulated_matrix(s1, s2, mask):
      """Compute the accumulated cost matrix score between two time series.
  
      Parameters
      ----------
      s1 : array-like, shape=(sz1, d)
          First time series.
      s2 : array-like, shape=(sz2, d)
          Second time series.
      mask : array-like, shape=(sz1, sz2)
          Mask. Unconsidered cells must have infinite values.
  
      Returns
      -------
      mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
      """
      l1 = s1.shape[0]
      l2 = s2.shape[0]
      cum_sum = numpy.full((l1 + 1, l2 + 1), numpy.inf)
      cum_sum[0, 0] = 0.0
  
      for i in range(l1):
          for j in range(l2):
              if numpy.isfinite(mask[i, j]):
                  cum_sum[i + 1, j + 1] = _njit_local_squared_dist(
                      s1[i], s2[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 3 for calling a global function with example usage: njit_accumulated_matrix(s1, s2, mask) and returns: cum_sum