code: def test_initialization_raises():
      m1 = Categorical([[0.5, 0.5]])
      m2 = Categorical([[0.5, 0.5]])
  
      f1 = Categorical([[0.8, 0.1]])
      f2 = JointCategorical([[[0.2, 0.1], [0.1, 0.6]]])
  
      assert_raises(ValueError, FactorGraph, [m1, m2], [f1, f2])
      assert_raises(
          ValueError, FactorGraph, [f1, f2], [m1, m2], [(f1, f2)]
      )
      assert_raises(
          ValueError, FactorGraph, [f1, f2], [m1, m2], [(m1, m2)]
      )
      assert_raises(
          ValueError, FactorGraph, [f1, f2], [m1, m2], [(f1, m1)]
      )
      assert_raises(ValueError, FactorGraph, None, None, [(f1, m1)])
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.factor_graph import FactorGraph
  from pomegranate.distributions import Exponential
  from pomegranate.distributions import Categorical
  from pomegranate.distributions import JointCategorical
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_initialization_raises() without return types