code: def _get_warp_matrices(warp_path, be):
      """Convert warping path sequence to matrices.
  
      Parameters
      ----------
      warp_path : list of tuple of two indices that are matched together, length = m
          First output of the dtw_path function.
      be : Backend object or string
          Backend.
  
      Returns
      -------
      Wx : array-like, shape=(m, nx)
          Matrix. The number of steps to match the two sequences is equal to m.
      Wy : array-like, shape=(m, ny)
          Matrix.
      """
      be = instantiate_backend(be, warp_path[0][0])
      # number of indices for the alignment
      m = len(warp_path)
      # number of frame of each sequence
      # (for DTW, the last two indices are matched)
      nx = warp_path[-1][0] + 1
      ny = warp_path[-1][1] + 1
      Wx = be.zeros((m, nx), dtype=be.float64)
      Wy = be.zeros((m, ny), dtype=be.float64)
  
      for i, match in enumerate(warp_path):
          Wx[i, match[0]] = 1
          Wy[i, match[1]] = 1
  
      return Wx, Wy
  
file_path: tslearn/tslearn/metrics/ctw.py
imports: import numpy
  from sklearn.cross_decomposition import CCA
  from tslearn.backend import instantiate_backend
  from ..utils import to_time_series
  from .dtw_variants import dtw_path
  from .utils import _cdist_generic
label_desc: Use image node_id 1 for calling a global function with example usage: _get_warp_matrices(warp_path, be) and returns: Wx,  Wy