code: def _return_lcss_path_from_dist_matrix(
      dist_matrix, eps, mask, acc_cost_mat, sz1, sz2, be=None
  ):
      """Return the Longest Common Subsequence (LCSS) path from the distance matrix.
  
      Parameters
      ----------
      dist_matrix : array-like, shape=(sz1, sz2)
          Matrix of the pairwise distances between the values
          of a time series s1 and the values of a time series s2.
      eps : float
          Maximum matching distance threshold.
      mask : array-like, shape=(sz1, sz2)
          Mask. Unconsidered cells must have infinite values.
      acc_cost_mat : array-like, shape=(sz1 + 1, sz2 + 1)
          Accumulated cost matrix.
      sz1 : int
          Length of the first time series.
      sz2 : int
          Length of the second 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
      -------
      path : list of integer pairs
          Matching path represented as a list of index pairs. In each pair, the
          first index corresponds to a first time series s1 and the second one
          corresponds to a second time series s2.
      """
      be = instantiate_backend(be, dist_matrix, acc_cost_mat)
      dist_matrix = be.array(dist_matrix)
      acc_cost_mat = be.array(acc_cost_mat)
      i, j = (sz1, sz2)
      path = []
  
      while i > 0 and j > 0:
          if be.isfinite(mask[i - 1, j - 1]):
              if dist_matrix[i - 1, j - 1] <= eps:
                  path.append((i - 1, j - 1))
                  i, j = (i - 1, j - 1)
              elif acc_cost_mat[i - 1][j] > acc_cost_mat[i][j - 1]:
                  i = i - 1
              else:
                  j = j - 1
      return path[::-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 45 for calling a global function with example usage: _return_lcss_path_from_dist_matrix(dist_matrix, eps, mask, acc_cost_mat, sz1, sz2, be) and returns: path