def test_fix_stim():
 raw = read_raw_fif(raw_fname, preload=True)
 raw._data[raw.ch_names.index('STI 014'), :3] = [0, (-32765), 0]
 with warnings.catch_warnings(record=True) as w:
  events = find_events(raw, 'STI 014')
 assert_true((len(w) >= 1))
 assert_true(any((('STI016' in str(ww.message)) for ww in w)))
 assert_array_equal(events[0], [(raw.first_samp + 1), 0, 32765])
 events = find_events(raw, 'STI 014', uint_cast=True)
 assert_array_equal(events[0], [(raw.first_samp + 1), 0, 32771])

def test_fix_stim ( ) : raw = read_raw_fif ( raw_fname , preload = True ) raw . _data [ raw . ch_names . index ( 'STI 014' ) , : 3 ] = [ 0 , ( - 32765 ) , 0 ] with warnings . catch_warnings ( record = True ) as w : events = find_events ( raw , 'STI 014' ) assert_true ( ( len ( w ) >= 1 ) ) assert_true ( any ( ( ( 'STI016' in str ( ww . message ) ) for ww in w ) ) ) assert_array_equal ( events [ 0 ] , [ ( raw . first_samp + 1 ) , 0 , 32765 ] ) events = find_events ( raw , 'STI 014' , uint_cast = True ) assert_array_equal ( events [ 0 ] , [ ( raw . first_samp + 1 ) , 0 , 32771 ] )
test fixing stim sti016 for neuromag .