def _window_evoked(evoked, size):
 if isinstance(size, (float, int)):
  lsize = rsize = float(size)
 else:
  (lsize, rsize) = size
 evoked = evoked.copy()
 sfreq = float(evoked.info['sfreq'])
 lsize = int((lsize * sfreq))
 rsize = int((rsize * sfreq))
 lhann = signal.hann((lsize * 2))
 rhann = signal.hann((rsize * 2))
 window = np.r_[(lhann[:lsize], np.ones(((len(evoked.times) - lsize) - rsize)), rhann[(- rsize):])]
 evoked.data *= window[None, :]
 return evoked

def _window_evoked ( evoked , size ) : if isinstance ( size , ( float , int ) ) : lsize = rsize = float ( size ) else : ( lsize , rsize ) = size evoked = evoked . copy ( ) sfreq = float ( evoked . info [ 'sfreq' ] ) lsize = int ( ( lsize * sfreq ) ) rsize = int ( ( rsize * sfreq ) ) lhann = signal . hann ( ( lsize * 2 ) ) rhann = signal . hann ( ( rsize * 2 ) ) window = np . r_ [ ( lhann [ : lsize ] , np . ones ( ( ( len ( evoked . times ) - lsize ) - rsize ) ) , rhann [ ( - rsize ) : ] ) ] evoked . data *= window [ None , : ] return evoked
window evoked .