code: def test_probability(X, shapes, rates):
      s, r = [1.7], [1.3]
      x = [[1.0], [2.0], [8.0], [3.7], [1.9]]
      y = [
          4.685216e-01,
          2.074282e-01,
          2.242917e-04,
          3.500235e-02,
          2.278939e-01,
      ]
  
      d1 = Gamma(s, r)
      d2 = Gamma(
          numpy.array(s, dtype=numpy.float64),
          numpy.array(r, 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.000293]
  
      d1 = Gamma(shapes, rates)
      d2 = Gamma(
          numpy.array(shapes, dtype=numpy.float64),
          numpy.array(rates, dtype=numpy.float64),
      )
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      s, r = [1, 2, 4], [2, 1, 3]
      x = [[1, 2, 1], [2, 2, 1], [3, 1, 1], [2, 1, 2]]
      y = [0.049242, 0.006664, 0.001226, 0.003608]
  
      d1 = Gamma(s, r)
      d2 = Gamma(
          numpy.array(s, dtype=numpy.int32),
          numpy.array(r, dtype=numpy.int32),
      )
  
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float32)
  
      s, r = [1.0, 2.0, 4.0], [2.0, 1.0, 3.0]
      d1 = Gamma(s, r)
      d2 = Gamma(
          numpy.array(s, dtype=numpy.float64),
          numpy.array(r, dtype=numpy.float64),
      )
      _test_predictions(x, y, d1.probability(x), torch.float32)
      _test_predictions(x, y, d2.probability(x), torch.float64)
  
      y = [
          0.001497,
          0.092372,
          0.012607,
          0.000671,
          0.011402,
          0.000144,
          0.002768,
      ]
  
      d1 = Gamma(shapes, rates)
      d2 = Gamma(
          numpy.array(shapes, dtype=numpy.float64),
          numpy.array(rates, 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 Gamma
  from ._utils import _test_initialization_raises_two_parameters
  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 15 for calling a global function with example usage: test_probability(X, shapes, rates) without return types