def test_read_epochs_bad_events():
 (raw, events, picks) = _get_data()
 epochs = Epochs(raw, np.array([[raw.first_samp, 0, event_id]]), event_id, tmin, tmax, picks=picks)
 with warnings.catch_warnings(record=True):
  evoked = epochs.average()
 epochs = Epochs(raw, np.array([[raw.first_samp, 0, event_id]]), event_id, tmin, tmax, picks=picks)
 assert_true(repr(epochs))
 epochs.drop_bad()
 assert_true(repr(epochs))
 with warnings.catch_warnings(record=True):
  evoked = epochs.average()
 epochs = Epochs(raw, np.array([[raw.last_samp, 0, event_id]]), event_id, tmin, tmax, picks=picks)
 with warnings.catch_warnings(record=True):
  evoked = epochs.average()
  assert evoked
 warnings.resetwarnings()

def test_read_epochs_bad_events ( ) : ( raw , events , picks ) = _get_data ( ) epochs = Epochs ( raw , np . array ( [ [ raw . first_samp , 0 , event_id ] ] ) , event_id , tmin , tmax , picks = picks ) with warnings . catch_warnings ( record = True ) : evoked = epochs . average ( ) epochs = Epochs ( raw , np . array ( [ [ raw . first_samp , 0 , event_id ] ] ) , event_id , tmin , tmax , picks = picks ) assert_true ( repr ( epochs ) ) epochs . drop_bad ( ) assert_true ( repr ( epochs ) ) with warnings . catch_warnings ( record = True ) : evoked = epochs . average ( ) epochs = Epochs ( raw , np . array ( [ [ raw . last_samp , 0 , event_id ] ] ) , event_id , tmin , tmax , picks = picks ) with warnings . catch_warnings ( record = True ) : evoked = epochs . average ( ) assert evoked warnings . resetwarnings ( )
test epochs when events are at the beginning or the end of the file .