code: def _accumulated_cost_matrix_region(cost_matrix, region):
      n_timestamps_1, n_timestamps_2 = cost_matrix.shape
      acc_cost_mat = np.ones((n_timestamps_1, n_timestamps_2)) * np.inf
      acc_cost_mat[0, 0 : region[1, 0]] = np.cumsum(
          cost_matrix[0, 0 : region[1, 0]]
      )
      acc_cost_mat[0 : region[1, 0], 0] = np.cumsum(
          cost_matrix[0 : region[1, 0], 0]
      )
      region_ = np.copy(region)
      region_[0] = np.maximum(region_[0], 1)
      for i in range(1, n_timestamps_1):
          for j in range(region_[0, i], region_[1, i]):
              acc_cost_mat[i, j] = cost_matrix[i, j] + min(
                  acc_cost_mat[i - 1][j - 1],
                  acc_cost_mat[i - 1][j],
                  acc_cost_mat[i][j - 1],
              )
      return acc_cost_mat
  
imports: import numpy
  from math import ceil, log2, sqrt
  from numba import njit, prange
  from sklearn.utils import check_array
label_desc: Use image node_id 10 for calling a global function with example usage: _accumulated_cost_matrix_region(cost_matrix, region) and returns: acc_cost_mat