code: def test_unvalued_ir_reversion(nested):
      """Make sure that un-valued IR rewrites are reverted."""
      x_rv = pt.random.normal()
      y_rv = pt.clip(x_rv, 0, 1)
      if nested:
          y_rv = y_rv + 5
      z_rv = pt.random.normal(y_rv, 1, name="z")
      z_vv = z_rv.clone()
  
      # Only the `z_rv` is "valued", so `y_rv` doesn't need to be converted into
      # measurable IR.
      rv_values = {z_rv: z_vv}
  
      z_fgraph, _, memo = construct_ir_fgraph(rv_values)
  
      # assert len(z_fgraph.preserve_rv_mappings.measurable_conversions) == 1
      assert (
          sum(
              isinstance(node.op, MeasurableVariable)
              for node in z_fgraph.apply_nodes
          )
          == 2
      )
  
file_path: pymc/tests/logprob/test_composite_logprob.py
imports: import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  import scipy.stats
  from pymc import draw, logp
  from pymc.logprob.abstract import MeasurableVariable
  from pymc.logprob.basic import conditional_logp
  from pymc.logprob.rewriting import construct_ir_fgraph
  from pymc.testing import assert_no_rvs
label_desc: Use image node_id 3 for calling a global function with example usage: test_unvalued_ir_reversion(nested) without return types