code: def test_chains():
      es = EventSegment(
          5, event_chains=np.array(["A", "A", "B", "B", "B"])
      )
      sample_data = np.array([[0, 0, 0], [1, 1, 1]])
  
      with pytest.raises(RuntimeError):
          seg = es.fit(sample_data.T)[0]
          pytest.fail("Can't use fit() with event chains")
  
      es.set_event_patterns(
          np.array([[1, 1, 0, 0, 0], [0, 0, 1, 1, 1]])
      )
      seg = es.find_events(sample_data.T, 0.1)[0]
  
      ev = np.nonzero(seg > 0.99)[1]
      assert np.array_equal(
          ev, [2, 3, 4]
      ), "Failed to fit with multiple chains"
  
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 7 for calling a global function with example usage: test_chains() without return types