def _synthesize_stim_channel(events, n_samples):
 onset = events[:, 0]
 stim_channel = np.zeros(n_samples, int)
 for (onset, duration, trigger) in events:
  stim_channel[onset:(onset + duration)] = trigger
 return stim_channel

def _synthesize_stim_channel ( events , n_samples ) : onset = events [ : , 0 ] stim_channel = np . zeros ( n_samples , int ) for ( onset , duration , trigger ) in events : stim_channel [ onset : ( onset + duration ) ] = trigger return stim_channel
synthesize a stim channel from events read from an event file .