<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_distance_matrix(source, target, weights=None):
 """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. """

    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