code: def test_add_edge_raises(distributions):
      d1, d2, d3, d4, d12, d22, d32, d13 = distributions
  
      model = BayesianNetwork([d1, d2, d12, d22, d13])
  
      assert_raises(ValueError, model.add_edge, d1, d1)
      assert_raises(ValueError, model.add_edge, d2, d1)
      assert_raises(ValueError, model.add_edge, d12, d1)
      assert_raises(ValueError, model.add_edge, None, d1)
      assert_raises(ValueError, model.add_edge, d1, None)
      assert_raises(ValueError, model.add_edge, d3, d1)
      assert_raises(ValueError, model.add_edge, d1, d3)
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.bayesian_network import BayesianNetwork
  from pomegranate.distributions import Exponential
  from pomegranate.distributions import Categorical
  from pomegranate.distributions import ConditionalCategorical
  from nose.tools import assert_raises
  from numpy.testing import assert_array_equal
  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_edge_raises(distributions) without return types