<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def make_spindles(events, power_peaks, powers, dat_det, dat_orig, time, s_freq):
 """Create dict for each spindle, based on events of time points. Parameters events : ndarray (dtype='int') N x 3 matrix with start, peak, end samples, and peak frequency power_peaks : ndarray (dtype='float') peak in power spectrum for each event powers : ndarray (dtype='float') average power in power spectrum for each event dat_det : ndarray (dtype='float') vector with the data after detection-transformation (to compute peak) dat_orig : ndarray (dtype='float') vector with the raw data on which detection was performed time : ndarray (dtype='float') vector with time points s_freq : float sampling frequency Returns ------- list of dict list of all the spindles, with information about start_time, peak_time, end_time (s), peak_val (signal units), area_under_curve (signal units * s), peak_freq (Hz) """

    i, events = _remove_duplicate(events, dat_det)
    power_peaks = power_peaks[i]

    spindles = []
    for i, one_peak, one_pwr in zip(events, power_peaks, powers):
        one_spindle = {'start': time[i[0]],
                       'end': time[i[2] - 1],
                       'peak_time': time[i[1]],
                       'peak_val_det': dat_det[i[1]],
                       'peak_val_orig': dat_orig[i[1]],
                       'dur': (i[2] - i[0]) / s_freq,
                       'auc_det': sum(dat_det[i[0]:i[2]]) / s_freq,
                       'auc_orig': sum(dat_orig[i[0]:i[2]]) / s_freq,
                       'rms_det': sqrt(mean(square(dat_det[i[0]:i[2]]))),
                       'rms_orig': sqrt(mean(square(dat_orig[i[0]:i[2]]))),
                       'power_orig': one_pwr,
                       'peak_freq': one_peak,
                       'ptp_det': ptp(dat_det[i[0]:i[2]]),
                       'ptp_orig': ptp(dat_orig[i[0]:i[2]])
                       }
        spindles.append(one_spindle)

    return spindles