def dtw_distance(rep_one, rep_two, norm=True):
if not isinstance(rep_one, np.ndarray):<EOL><INDENT>rep_one = rep_one.to_array()<EOL><DEDENT>if not isinstance(rep_two, np.ndarray):<EOL><INDENT>rep_two = rep_two.to_array()<EOL><DEDENT>assert (rep_one.shape[<NUM_LIT:1>] == rep_two.shape[<NUM_LIT:1>])<EOL>distMat = generate_distance_matrix(rep_one, rep_two)<EOL>return regularDTW(distMat, norm=norm)<EOL>
Computes the distance between two representations with the same
    number of filters using Dynamic Time Warping.

    Parameters
    ----------
    rep_one : 2D array
        First representation to compare. First dimension is time in frames
        or samples and second dimension is the features.
    rep_two : 2D array
        Second representation to compare. First dimension is time in frames
        or samples and second dimension is the features.

    Returns
    -------
    float
        Distance of dynamically time warping `rep_one` to `rep_two`.