code: def test_probability(X, lambdas):
      p = [1.7]
      x = [[1.0], [2.0], [8.0], [3.7], [1.9]]
      y = [0.310562, 0.263978, 0.000316, 0.084325, 0.273987]
  
      d1 = Poisson(p)
      d2 = Poisson(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, 2.0, 4]]
      y = [0.009604]
  
      d1 = Poisson(lambdas)
      d2 = Poisson(numpy.array(lambdas, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      p = [1, 2, 4]
      x = [[1, 2, 1], [2, 2, 1], [0, 1, 0], [0, 0, 2]]
      y = [0.007295, 0.003648, 0.001824, 0.007295]
  
      d1 = Poisson(p)
      d2 = Poisson(numpy.array(p, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      p = [1.0, 2.0, 4.0]
      d1 = Poisson(p)
      d2 = Poisson(numpy.array(p, dtype=numpy.float64))
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      y = [
          0.011852,
          0.012803,
          0.029038,
          0.01568,
          0.003161,
          0.000184,
          0.007901,
      ]
  
      d1 = Poisson(lambdas)
      d2 = Poisson(numpy.array(lambdas, 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 Poisson
  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 14 for calling a global function with example usage: test_probability(X, lambdas) without return types