code: def test_assert_logprob():
      rv = pt.random.normal()
      assert_op = Assert("Test assert")
      # Example: Add assert that rv must be positive
      assert_rv = assert_op(rv, rv > 0)
      assert_rv.name = "assert_rv"
  
      assert_vv = assert_rv.clone()
      assert_logp = conditional_logp({assert_rv: assert_vv})[assert_vv]
  
      # Check valid value is correct and doesn't raise
      # Since here the value to the rv satisfies the condition, no error is raised.
      valid_value = 3.0
      np.testing.assert_allclose(
          assert_logp.eval({assert_vv: valid_value}),
          stats.norm.logpdf(valid_value),
      )
  
      # Check invalid value
      # Since here the value to the rv is negative, an exception is raised as the condition is not met
      with pytest.raises(AssertionError, match="Test assert"):
          assert_logp.eval({assert_vv: -5.0})
  
file_path: pymc/tests/logprob/test_checks.py
imports: import re
  import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  from pytensor.raise_op import Assert
  from scipy import stats
  from pymc.distributions import Dirichlet
  from pymc.logprob.basic import conditional_logp
  from tests.distributions.test_multivariate import dirichlet_logpdf
label_desc: Use image node_id 2 for calling a global function with example usage: test_assert_logprob() without return types