code: def test_masked_probability(shapes, rates, X, X_masked):
      X = torch.tensor(numpy.array(X))
      y = [
          0.001497,
          0.092372,
          0.012607,
          0.000671,
          0.011402,
          0.000144,
          0.002768,
      ]
  
      d = Gamma(shapes, rates)
      mask = torch.ones_like(X).type(torch.bool)
      X_ = torch.masked.MaskedTensor(X, mask=mask)
  
      assert_array_almost_equal(y, d.probability(X_)._masked_data)
  
      y = [
          7.955700e-03,
          2.350480e-01,
          1.000000e00,
          6.706825e-04,
          3.706888e-01,
          1.435738e-04,
          1.534282e-02,
      ]
  
      assert_array_almost_equal(y, d.probability(X_masked)._masked_data)
  
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 41 for calling a global function with example usage: test_masked_probability(shapes, rates, X, X_masked) without return types