code: def _return_path(acc_cost_mat, be=None):
      """Return path from accumulated cost matrix.
  
      Parameters
      ----------
      acc_cost_mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
      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, acc_cost_mat)
      sz1, sz2 = be.shape(acc_cost_mat)
      path = [(sz1 - 1, sz2 - 1)]
      while path[-1] != (0, 0):
          i, j = path[-1]
          if i == 0:
              path.append((0, j - 1))
          elif j == 0:
              path.append((i - 1, 0))
          else:
              arr = be.array(
                  [
                      acc_cost_mat[i - 1][j - 1],
                      acc_cost_mat[i - 1][j],
                      acc_cost_mat[i][j - 1],
                  ]
              )
              argmin = be.argmin(arr)
              if argmin == 0:
                  path.append((i - 1, j - 1))
              elif argmin == 1:
                  path.append((i - 1, j))
              else:
                  path.append((i, 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 8 for calling a global function with example usage: _return_path(acc_cost_mat, be) and returns: path