def _prepare_rerp_data(raw, events, picks=None, decim=1):
 if (picks is None):
  picks = pick_types(raw.info, meg=True, eeg=True, ref_meg=True)
 info = pick_info(raw.info, picks)
 decim = int(decim)
 info['sfreq'] /= decim
 (data, times) = raw[:]
 data = data[picks, ::decim]
 if (len(set(events[:, 0])) < len(events[:, 0])):
  raise ValueError('`events` contains duplicate time points. Make sure all entries in the first column of `events` are unique.')
 events = events.copy()
 events[:, 0] -= raw.first_samp
 events[:, 0] //= decim
 if (len(set(events[:, 0])) < len(events[:, 0])):
  raise ValueError('After decimating, `events` contains duplicate time points. This means some events are too closely spaced for the requested decimation factor. Choose different events, drop close events, or choose a different decimation factor.')
 return (data, info, events)

def _prepare_rerp_data ( raw , events , picks = None , decim = 1 ) : if ( picks is None ) : picks = pick_types ( raw . info , meg = True , eeg = True , ref_meg = True ) info = pick_info ( raw . info , picks ) decim = int ( decim ) info [ 'sfreq' ] /= decim ( data , times ) = raw [ : ] data = data [ picks , : : decim ] if ( len ( set ( events [ : , 0 ] ) ) < len ( events [ : , 0 ] ) ) : raise ValueError ( '`events` contains duplicate time points. Make sure all entries in the first column of `events` are unique.' ) events = events . copy ( ) events [ : , 0 ] -= raw . first_samp events [ : , 0 ] //= decim if ( len ( set ( events [ : , 0 ] ) ) < len ( events [ : , 0 ] ) ) : raise ValueError ( 'After decimating, `events` contains duplicate time points. This means some events are too closely spaced for the requested decimation factor. Choose different events, drop close events, or choose a different decimation factor.' ) return ( data , info , events )
prepare events and data .