code: def _njit_return_path(acc_cost_mat):
      """Return path from accumulated cost matrix.
  
      Parameters
      ----------
      acc_cost_mat : array-like, shape=(sz1, sz2)
          Accumulated cost matrix.
  
      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.
      """
      sz1, sz2 = acc_cost_mat.shape
      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 = numpy.array(
                  [
                      acc_cost_mat[i - 1][j - 1],
                      acc_cost_mat[i - 1][j],
                      acc_cost_mat[i][j - 1],
                  ]
              )
              argmin = numpy.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 7 for calling a global function with example usage: _njit_return_path(acc_cost_mat) and returns: path