'Create an evoked object from epoch data.'

def _evoked_from_epoch_data(self, data, info, picks, n_events, kind, comment):

    info = deepcopy(info)
    evoked = EvokedArray(data, info, tmin=self.times[0], comment=comment, nave=n_events, kind=kind, verbose=self.verbose)
    evoked.times = self.times.copy()
    if (picks is None):
        picks = _pick_data_channels(evoked.info, exclude=[])
    ch_names = [evoked.ch_names[p] for p in picks]
    evoked.pick_channels(ch_names)
    if (len(evoked.info['ch_names']) == 0):
        raise ValueError('No    data    channel    found    when    averaging.')
    if (evoked.nave < 1):
        warn('evoked    object    is    empty    (based    on    less    than    1    epoch)')
    return evoked
