code: def test_prior():
      K = 10
      T = 100
  
      es = EventSegment(K)
      mp = es.model_prior(T)[0]
  
      p_bound = np.zeros((T, K - 1))
      norm = comb(T - 1, K - 1)
      for t in range(T - 1):
          for k in range(K - 1):
              # See supplementary material of Neuron paper
              # https://doi.org/10.1016/j.neuron.2017.06.041
              p_bound[t + 1, k] = (
                  comb(t, k) * comb(T - t - 2, K - k - 2) / norm
              )
      p_bound = np.cumsum(p_bound, axis=0)
  
      mp_gt = np.zeros((T, K))
      for k in range(K):
          if k == 0:
              mp_gt[:, k] = 1 - p_bound[:, 0]
          elif k == K - 1:
              mp_gt[:, k] = p_bound[:, k - 1]
          else:
              mp_gt[:, k] = p_bound[:, k - 1] - p_bound[:, k]
  
      assert np.all(
          np.isclose(mp, mp_gt)
      ), "Prior does not match analytic solution"
  
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 8 for calling a global function with example usage: test_prior() without return types