code: def test_initialization(distributions):
      d1, d2, d3, d4, d12, d22, d32, d13 = distributions
  
      model = BayesianNetwork()
      assert len(model.distributions) == 0
      assert len(model.edges) == 0
      assert len(model._marginal_mapping) == 0
      assert len(model._factor_mapping) == 0
  
      assert len(model._factor_graph.factors) == 0
      assert len(model._factor_graph.marginals) == 0
      assert len(model._factor_graph._factor_idxs) == 0
      assert len(model._factor_graph._marginal_idxs) == 0
      assert sum(map(len, model._factor_graph._factor_edges)) == 0
      assert sum(map(len, model._factor_graph._marginal_edges)) == 0
  
      model = BayesianNetwork([d1])
      assert len(model.distributions) == 1
      assert len(model.edges) == 0
      assert len(model._marginal_mapping) == 1
      assert len(model._factor_mapping) == 1
  
      assert len(model._factor_graph.factors) == 1
      assert len(model._factor_graph.marginals) == 1
      assert len(model._factor_graph._factor_idxs) == 1
      assert len(model._factor_graph._marginal_idxs) == 1
      assert sum(map(len, model._factor_graph._factor_edges)) == 1
      assert sum(map(len, model._factor_graph._marginal_edges)) == 1
  
      model = BayesianNetwork([d1, d2])
      assert len(model.distributions) == 2
      assert len(model.edges) == 0
      assert len(model._marginal_mapping) == 2
      assert len(model._factor_mapping) == 2
  
      assert len(model._factor_graph.factors) == 2
      assert len(model._factor_graph.marginals) == 2
      assert len(model._factor_graph._factor_idxs) == 2
      assert len(model._factor_graph._marginal_idxs) == 2
      assert sum(map(len, model._factor_graph._factor_edges)) == 2
      assert sum(map(len, model._factor_graph._marginal_edges)) == 2
  
      model = BayesianNetwork([d1, d12], [(d1, d12)])
      assert len(model.distributions) == 2
      assert len(model.edges) == 1
      assert len(model._marginal_mapping) == 2
      assert len(model._factor_mapping) == 2
  
      assert len(model._factor_graph.factors) == 2
      assert len(model._factor_graph.marginals) == 2
      assert len(model._factor_graph._factor_idxs) == 2
      assert len(model._factor_graph._marginal_idxs) == 2
      assert sum(map(len, model._factor_graph._factor_edges)) == 3
      assert sum(map(len, model._factor_graph._marginal_edges)) == 3
  
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 6 for calling a global function with example usage: test_initialization(distributions) without return types