code: def test_categorical_chow_liu_raises(X, w):
      assert_raises(ValueError, _categorical_chow_liu, X, w, -1)
      assert_raises(TypeError, _categorical_chow_liu, X, w, [1.2, 1.1])
      assert_raises(ValueError, _categorical_chow_liu, X, w, None, -1)
      assert_raises(ValueError, _categorical_chow_liu, X, w, None, 0.3)
      assert_raises(
          ValueError, _categorical_chow_liu, X, w, None, [1, 2]
      )
  
      w = torch.tensor(w)
      assert_raises(
          ValueError, _categorical_chow_liu, X, w.unsqueeze(0)
      )
      assert_raises(
          ValueError, _categorical_chow_liu, X, w.unsqueeze(1)
      )
  
      X = numpy.array(X)
      n, d = X.shape
  
      assert_raises(ValueError, _categorical_chow_liu, X + 0.3, w)
      assert_raises(
          ValueError, _categorical_chow_liu, X.reshape(1, n, d), w
      )
      assert_raises(ValueError, _categorical_chow_liu, X - 1, w)
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.bayesian_network import BayesianNetwork
  from pomegranate.bayesian_network import _from_structure
  from pomegranate.bayesian_network import _learn_structure
  from pomegranate.bayesian_network import _categorical_exact
  from pomegranate.bayesian_network import _categorical_chow_liu
  from pomegranate.distributions import Categorical
  from pomegranate.distributions import ConditionalCategorical
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_categorical_chow_liu_raises(X, w) without return types