code: def test_reject_bad_inputs():
      """Demonstrate failute when initialized with bad inputs."""
      # test we get a ValueError if we don't use square trans_prob
      size = 2
      valid_emi_funcs = [
          (norm.pdf, {"loc": 0, "scale": 1}) for _ in range(size)
      ]
      # trans_mat must be square:
      with pytest.raises(ValueError):
          HMM(
              emission_funcs=valid_emi_funcs,
              transition_prob_mat=asarray(
                  [[0.5, 0.5], [0.2, 0.8], [0.9, 0.1]]
              ),
          )
      # trans_mat rows must sum to 1:
      with pytest.raises(ValueError):
          HMM(
              emission_funcs=valid_emi_funcs,
              transition_prob_mat=asarray([[10, 10], [0.2, 0.8]]),
          )
      # emi_funcs and trans mat must have shared dimension:
      with pytest.raises(ValueError):
          HMM(
              emission_funcs=valid_emi_funcs,
              transition_prob_mat=asarray(
                  [[0.25, 0.25, 0.5], [0.2, 0.7, 0.1], [0.3, 0.3, 0.4]]
              ),
          )
  
file_path: sktime/sktime/annotation/tests/test_hmm.py
imports: import numpy
  import pytest
  from numpy import array_equal, asarray
  from scipy.stats import norm
  from sktime.annotation.hmm import HMM
label_desc: Use image node_id 2 for calling a global function with example usage: test_reject_bad_inputs() without return types