onset_counter])) * temporal_resolution)
// For the appropriate number of indexes and duration, make this value 1idx_n = round(event_durations[onset_counter] * temporal_resolution)
stimfunction[onset_idx:offset_idx] = [weights[onset_counter]] * idx_n// Shorten the data if it"s too longiflen(stimfunction) > total_time * temporal_resolution:
stimfunction = stimfunction[0:int(total_time * temporal_resolution)]
After Change
// Generate the time course as empty, each element is a millisecond by// default
stimfunction = np.zeros((int(round(total_time * temporal_resolution)), 1))// Cycle through the onsetsfor onset_counter in list(range(len(onsets))):
// Adjust for the resolution