code: def test_probability(X, probs):
      p = [0.32]
      x = [[1.0], [0.0], [1.0], [1.0], [0.0]]
      y = [0.32, 0.68, 0.32, 0.32, 0.68]
  
      d1 = Bernoulli(p)
      d2 = Bernoulli(numpy.array(p, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      x = [[1.0, 0.0, 1.0]]
      y = [0.00481]
  
      d1 = Bernoulli(probs)
      d2 = Bernoulli(numpy.array(probs, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      y = [
          0.00819,
          0.04329,
          0.00481,
          0.28971,
          0.05481,
          0.05481,
          0.03219,
      ]
  
      d1 = Bernoulli(probs)
      d2 = Bernoulli(numpy.array(probs, dtype=numpy.float64))
  
      _test_predictions(X, y, d1.probability(X), torch.float32)
      _test_predictions(X, y, d2.probability(X), torch.float64)
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Bernoulli
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_initialization
  from ._utils import _test_predictions
  from ._utils import _test_efd_from_summaries
  from ._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_probability(X, probs) without return types