code: def test_predict_proba_diamond(X_masked, distributions):
      d1, d2, d3, d4, d12, d22, d32, d13 = distributions
  
      model = BayesianNetwork(
          [d13, d22, d32, d4],
          [(d4, d22), (d4, d32), (d22, d13), (d32, d13)],
      )
      y_hat = model.predict_proba(X_masked)
  
      assert_array_almost_equal(
          y_hat[0],
          [
              [0.3000, 0.7000],
              [1.0000, 0.0000],
              [0.4700, 0.5300],
              [0.0000, 1.0000],
              [0.2416, 0.7584],
              [1.0000, 0.0000],
              [0.4700, 0.5300],
              [0.0000, 1.0000],
              [0.0000, 1.0000],
              [1.0000, 0.0000],
              [1.0000, 0.0000],
          ],
          4,
      )
  
      assert_array_almost_equal(
          y_hat[1],
          [
              [0.0000, 0.0000, 1.0000],
              [1.0000, 0.0000, 0.0000],
              [0.7000, 0.1000, 0.2000],
              [0.0000, 0.0000, 1.0000],
              [0.0000, 1.0000, 0.0000],
              [0.0000, 1.0000, 0.0000],
              [0.7000, 0.1000, 0.2000],
              [0.5147, 0.4706, 0.0147],
              [0.0000, 1.0000, 0.0000],
              [0.0000, 0.0000, 1.0000],
              [0.7204, 0.1844, 0.0952],
          ],
          4,
      )
  
      assert_array_almost_equal(
          y_hat[2],
          [
              [1.0000, 0.0000],
              [0.4000, 0.6000],
              [0.5000, 0.5000],
              [0.0000, 1.0000],
              [0.1387, 0.8613],
              [1.0000, 0.0000],
              [0.5000, 0.5000],
              [0.0000, 1.0000],
              [1.0000, 0.0000],
              [0.0000, 1.0000],
              [1.0000, 0.0000],
          ],
          4,
      )
  
      assert_array_almost_equal(
          y_hat[3],
          [
              [1.0000, 0.0000],
              [0.4500, 0.5500],
              [1.0000, 0.0000],
              [0.0000, 1.0000],
              [0.0968, 0.9032],
              [0.3488, 0.6512],
              [1.0000, 0.0000],
              [0.0000, 1.0000],
              [0.3488, 0.6512],
              [1.0000, 0.0000],
              [0.6818, 0.3182],
          ],
          4,
      )
  
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 20 for calling a global function with example usage: test_predict_proba_diamond(X_masked, distributions) without return types