code: def _njit_subsequence_cost_matrix(subseq, longseq):
      """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.
  
      Returns
      -------
      mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
      """
      l1 = subseq.shape[0]
      l2 = longseq.shape[0]
      cum_sum = numpy.full((l1 + 1, l2 + 1), numpy.inf)
      cum_sum[0, :] = 0.0
  
      for i in range(l1):
          for j in range(l2):
              cum_sum[i + 1, j + 1] = _njit_local_squared_dist(
                  subseq[i], longseq[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 19 for calling a global function with example usage: _njit_subsequence_cost_matrix(subseq, longseq) and returns: cum_sum