code: def accumulated_matrix_from_dist_matrix(dist_matrix, mask, be=None):
      """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.
      be : Backend object or string or None
          Backend. If `be` is an instance of the class `NumPyBackend` or the string `"numpy"`,
          the NumPy backend is used.
          If `be` is an instance of the class `PyTorchBackend` or the string `"pytorch"`,
          the PyTorch backend is used.
          If `be` is `None`, the backend is determined by the input arrays.
          See our :ref:`dedicated user-guide page <backend>` for more information.
  
      Returns
      -------
      mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
      """
      be = instantiate_backend(be, dist_matrix)
      dist_matrix = be.array(dist_matrix)
      l1, l2 = be.shape(dist_matrix)
      cum_sum = be.full((l1 + 1, l2 + 1), be.inf)
      cum_sum[0, 0] = 0.0
  
      for i in range(l1):
          for j in range(l2):
              if be.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 11 for calling a global function with example usage: accumulated_matrix_from_dist_matrix(dist_matrix, mask, be) and returns: cum_sum