code: def test_add_marginal_raises():
      m = Categorical([[0.5, 0.5]])
      f = JointCategorical([[[0.2, 0.1], [0.1, 0.6]]])
  
      model = FactorGraph()
      assert_raises(ValueError, model.add_marginal, [m])
  
      model = FactorGraph()
      assert_raises(ValueError, model.add_marginal, None)
  
      model = FactorGraph()
      assert_raises(ValueError, model.add_marginal, Exponential())
  
      model = FactorGraph()
      assert_raises(ValueError, model.add_marginal, f)
  
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 11 for calling a global function with example usage: test_add_marginal_raises() without return types