code: def test_masked_log_probability(shapes, rates, X, X_masked):
      X = torch.tensor(numpy.array(X))
      y = [
          -6.504198,
          -2.381927,
          -4.373503,
          -7.307214,
          -4.473963,
          -8.848661,
          -5.889609,
      ]
  
      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.log_probability(X_)._masked_data)
  
      y = [
          -4.833867,
          -1.447965,
          0.0,
          -7.307215,
          -0.992392,
          -8.848662,
          -4.177108,
      ]
  
      assert_array_almost_equal(
          y, d.log_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 42 for calling a global function with example usage: test_masked_log_probability(shapes, rates, X, X_masked) without return types