code: def _subsequence_cost_matrix(subseq, longseq, be=None):
      """Compute the accumulated cost matrix score between a subsequence and
      a reference time series.
  
      Parameters
      ----------
      subseq : array-like, shape=(sz1, d)
          Subsequence time series.
      longseq : array-like, shape=(sz2, d)
          Reference time series.
      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, subseq, longseq)
      subseq = be.array(subseq)
      longseq = be.array(longseq)
      l1 = subseq.shape[0]
      l2 = longseq.shape[0]
      cum_sum = be.full((l1 + 1, l2 + 1), be.inf)
      cum_sum[0, :] = 0.0
  
      for i in range(l1):
          for j in range(l2):
              cum_sum[i + 1, j + 1] = _local_squared_dist(
                  subseq[i], longseq[j], be=be
              )
              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 20 for calling a global function with example usage: _subsequence_cost_matrix(subseq, longseq, be) and returns: cum_sum