code: def test_masked_log_probability(distributions, X, X_masked):
      X = torch.tensor(numpy.array(X))
      y = [
          -5.504645,
          -6.714099,
          -3.57396,
          -6.754645,
          -5.57396,
          -7.82396,
          -4.57396,
      ]
  
      d3 = Exponential([4.0])
      d = IndependentComponents(
          [distributions[0], distributions[1], d3]
      )
      mask = torch.ones_like(X).type(torch.bool)
      X_ = torch.masked.MaskedTensor(X, mask=mask)
  
      assert_array_almost_equal(y, d.log_probability(X_))
  
      y = [
          -4.504645,
          -5.077805,
          0.0,
          -6.754645,
          -1.187666,
          -7.82396,
          -3.386294,
      ]
  
      assert_array_almost_equal(y, d.log_probability(X_masked))
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import Exponential
  from pomegranate.distributions import Gamma
  from pomegranate.distributions import Categorical
  from pomegranate.distributions import IndependentComponents
  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 27 for calling a global function with example usage: test_masked_log_probability(distributions, X, X_masked) without return types