code: def test_event_transfer():
      es = EventSegment(2)
      sample_data = np.asarray(
          [[1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1]]
      )
  
      with pytest.raises(NotFittedError):
          seg = es.find_events(sample_data.T)[0]
          pytest.fail("Should need to set variance")
  
      with pytest.raises(NotFittedError):
          seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0]
          pytest.fail("Should need to set patterns")
  
      es.set_event_patterns(np.asarray([[1, 0], [0, 1]]))
      seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0]
  
      events = np.argmax(seg, axis=1)
      assert np.array_equal(
          events, [0, 0, 0, 1, 1, 1, 1]
      ), "Failed to correctly transfer two events to new data"
  
file_path: brainiak/tests/eventseg/test_event.py
imports: from brainiak.eventseg.event import EventSegment
  from scipy.special import comb
  import numpy
  import pytest
  from sklearn.exceptions import NotFittedError
label_desc: Use image node_id 4 for calling a global function with example usage: test_event_transfer() without return types