code: def test_values_meter_transition(self):
      # test with 2 BarStateSpaces
      bss1 = BarStateSpace(2, 1, 1)  # states 01
      bss2 = BarStateSpace(3, 1, 1)  # states 234
      btm1 = BarTransitionModel(bss1, 100)
      btm2 = BarTransitionModel(bss2, 100)
      tm = MultiPatternTransitionModel(
          [btm1, btm2], transition_prob=0.25
      )
      self.assertIsInstance(tm.transition_prob, np.ndarray)
      self.assertTrue(tm.num_states == 5)
      self.assertTrue(tm.num_transitions == 7)
      self.assertTrue(np.allclose(tm.states, [1, 4, 0, 1, 4, 2, 3]))
      self.assertTrue(np.allclose(tm.pointers, [0, 2, 3, 5, 6, 7]))
      self.assertTrue(
          np.allclose(
              tm.probabilities, [0.75, 0.25, 1, 0.25, 0.75, 1, 1]
          )
      )
      states, prev_states, probs = tm.make_dense(
          tm.states, tm.pointers, tm.probabilities
      )
      self.assertTrue(np.allclose(prev_states, [1, 4, 0, 1, 4, 2, 3]))
      self.assertTrue(np.allclose(states, [0, 0, 1, 2, 2, 3, 4]))
      self.assertTrue(
          np.allclose(probs, [0.75, 0.25, 1, 0.25, 0.75, 1, 1])
      )
      # same with 3 bar lengths
      bss3 = BarStateSpace(4, 1, 1)  # states 5678
      btm3 = BarTransitionModel(bss3, 100)
      trans = np.array(
          [[0.6, 0.3, 0.25], [0.15, 0.6, 0.15], [0.25, 0.1, 0.6]]
      )
      tm = MultiPatternTransitionModel(
          [btm1, btm2, btm3], transition_prob=trans
      )
      self.assertIsInstance(tm.transition_prob, np.ndarray)
      self.assertTrue(tm.num_states == 9)
      self.assertTrue(tm.num_transitions == 15)
      self.assertTrue(
          np.allclose(
              tm.states, [1, 4, 8, 0, 1, 4, 8, 2, 3, 1, 4, 8, 5, 6, 7]
          )
      )
      self.assertTrue(
          np.allclose(tm.pointers, [0, 3, 4, 7, 8, 9, 12, 13, 14, 15])
      )
      self.assertTrue(
          np.allclose(
              tm.probabilities,
              [
                  0.6,
                  0.3,
                  0.25,
                  1,
                  0.15,
                  0.6,
                  0.15,
                  1,
                  1,
                  0.25,
                  0.1,
                  0.6,
                  1,
                  1,
                  1,
              ],
          )
      )
      states, prev_states, probs = tm.make_dense(
          tm.states, tm.pointers, tm.probabilities
      )
      self.assertTrue(
          np.allclose(
              prev_states, [1, 4, 8, 0, 1, 4, 8, 2, 3, 1, 4, 8, 5, 6, 7]
          )
      )
      self.assertTrue(
          np.allclose(
              states, [0, 0, 0, 1, 2, 2, 2, 3, 4, 5, 5, 5, 6, 7, 8]
          )
      )
      self.assertTrue(
          np.allclose(
              probs,
              [
                  0.6,
                  0.3,
                  0.25,
                  1,
                  0.15,
                  0.6,
                  0.15,
                  1,
                  1,
                  0.25,
                  0.1,
                  0.6,
                  1,
                  1,
                  1,
              ],
          )
      )
      # test with 2 BarStateSpaces with more tempi
      bss1 = BarStateSpace(2, 2, 5)
      bss2 = BarStateSpace(3, 2, 4)
      btm1 = BarTransitionModel(bss1, 100)
      btm2 = BarTransitionModel(bss2, 100)
      tm = MultiPatternTransitionModel([btm1, btm2])
      self.assertTrue(tm.num_states == 55)
      self.assertTrue(tm.num_transitions == 74)
      with self.assertRaises(ValueError):
          MultiPatternTransitionModel(
              [btm1, btm2], transition_prob=0.25
          )
      # same with same number of tempi
      bss1 = BarStateSpace(2, 2, 4)
      bss2 = BarStateSpace(3, 2, 4)
      btm1 = BarTransitionModel(bss1, 100)
      btm2 = BarTransitionModel(bss2, 100)
      tm = MultiPatternTransitionModel(
          [btm1, btm2], transition_prob=0.25
      )
      self.assertTrue(tm.num_states == 45)
      self.assertTrue(tm.num_transitions == 72)
  
imports: from __future__ import absolute_import, division, print_function
  import unittest
  from madmom.features.beats_hmm import *
label_desc: Use image node_id 4 for calling the TestMultiPatternTransitionModelClass obj's underlying member method code with example usage: obj.test_values_meter_transition() without return types