code: def _limited_warping_length_cost(s1, s2, max_length, be=None):
      r"""Compute accumulated scores necessary fo L-DTW.
  
      Parameters
      ----------
      s1 : array-like, shape=(sz1, d)
          A time series.
      s2 : array-like, shape=(sz2, d)
          Another time series.
      max_length : int
          Maximum allowed warping path length. Should be an integer between
          XXX and YYY.  # TODO
      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
      -------
      dict_costs : dict
          Accumulated scores. This dict associates (i, j) pairs (keys) to
          dictionaries with desired length as key and associated score as value.
      """
      be = instantiate_backend(be, s1, s2)
      s1 = be.array(s1)
      s2 = be.array(s2)
      dict_costs = {}
      for i in range(s1.shape[0]):
          for j in range(s2.shape[0]):
              dict_costs[i, j] = {}
  
      # Init
      dict_costs[0, 0][0] = _local_squared_dist(s1[0], s2[0], be=be)
      for i in range(1, s1.shape[0]):
          pred = dict_costs[i - 1, 0][i - 1]
          dict_costs[i, 0][i] = pred + _local_squared_dist(
              s1[i], s2[0], be=be
          )
      for j in range(1, s2.shape[0]):
          pred = dict_costs[0, j - 1][j - 1]
          dict_costs[0, j][j] = pred + _local_squared_dist(
              s1[0], s2[j], be=be
          )
  
      # Main loop
      for i in range(1, s1.shape[0]):
          for j in range(1, s2.shape[0]):
              min_s = max(i, j)
              max_s = _max_steps(
                  i, j, max_length - 1, s1.shape[0], s2.shape[0]
              )
              for s in range(min_s, max_s + 1):
                  dict_costs[i, j][s] = _local_squared_dist(
                      s1[i], s2[j], be=be
                  )
                  dict_costs[i, j][s] += min(
                      dict_costs[i, j - 1].get(s - 1, be.inf),
                      dict_costs[i - 1, j].get(s - 1, be.inf),
                      dict_costs[i - 1, j - 1].get(s - 1, be.inf),
                  )
      return dict_costs
  
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 15 for calling a global function with example usage: _limited_warping_length_cost(s1, s2, max_length, be) and returns: dict_costs