code: def test_masked_probability(scales, X, X_masked):
      X = torch.tensor(numpy.array(X))
      y = [
          0.03154,
          0.136937,
          0.021209,
          0.005289,
          0.010383,
          0.000292,
          0.023891,
      ]
  
      d = Exponential(scales)
      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 = [
          8.708810e-02,
          4.629630e-01,
          1.000000e00,
          5.288587e-03,
          3.187519e-01,
          2.919201e-04,
          7.495064e-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 Exponential
  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 40 for calling a global function with example usage: test_masked_probability(scales, X, X_masked) without return types