code: def test_trans_cycle(n, p):
      A = librosa.sequence.transition_cycle(n, p)
  
      # Right shape
      assert A.shape == (n, n)
      # diag is correct
      assert np.allclose(np.diag(A), p)
  
      for i in range(n):
          assert A[i, np.mod(i + 1, n)] == 1 - A[i, i]
  
      # we have well-formed distributions
      assert np.all(A >= 0)
      assert np.allclose(A.sum(axis=1), 1)
  
imports: import numpy
  import pytest
  from test_core import srand
  import librosa
label_desc: Use image node_id 26 for calling a global function with example usage: test_trans_cycle(n, p) without return types