code: def test_probability(X, probs):
      p = [[0.2, 0.8]]
      x = [[1], [0], [0], [1], [0]]
      y = [0.8, 0.2, 0.2, 0.8, 0.2]
  
      d1 = Categorical(p)
      d2 = Categorical(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, 2, 0]]
      y = [0.2 * 0.3 * 0.7]
  
      d1 = Categorical(probs)
      d2 = Categorical(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.042, 0.0075, 0.001, 0.003, 0.007, 0.001, 0.014]
  
      d1 = Categorical(probs)
      d2 = Categorical(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 Categorical
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_predictions
  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 13 for calling a global function with example usage: test_probability(X, probs) without return types