code: def generate_distance_matrix(source, target, weights=None):
      
      if weights is None:
          weights = ones((source.shape[1], 1))
      sLen = source.shape[0]
      tLen = target.shape[0]
      distMat = zeros((sLen, tLen))
      for i in range(sLen):
          for j in range(tLen):
              distMat[i, j] = euclidean(source[i, :], target[j, :])
      return distMat
docs: Generates a local distance matrix for use in dynamic time warping.
  
      Parameters
      ----------
      source : 2D array
          Source matrix with features in the second dimension.
      target : 2D array
          Target matrix with features in the second dimension.
  
      Returns
      -------
      2D array
          Local distance matrix.