code: def test_no_change_inplace(self):
      # Test that calling rvs_to_value_vars in models with nested transformations
      # does not change the original rvs in place. See issue #5172
      with pm.Model() as m:
          one = pm.LogNormal("one", mu=0)
          two = pm.LogNormal("two", mu=pt.log(one))
  
          # We add potentials or deterministics that are not in topological order
          pm.Potential("two_pot", two)
          pm.Potential("one_pot", one)
  
      before = pytensor.clone_replace(m.free_RVs)
  
      # This call would change the model free_RVs in place in #5172
      replace_rvs_by_values(
          m.potentials,
          rvs_to_values=m.rvs_to_values,
          rvs_to_transforms=m.rvs_to_transforms,
      )
  
      after = pytensor.clone_replace(m.free_RVs)
      assert equal_computations(before, after)
  
imports: import numpy
  import pytensor
  import pytest
  from pytensor import function
  from pytensor import tensor
  from pytensor.compile import get_default_mode
  from pytensor.graph.basic import ancestors, equal_computations
  from pytensor.tensor.random.op import RandomVariable
  import pymc
  from pymc import SymbolicRandomVariable, inputvars
  from pymc.distributions.transforms import Interval
  from pymc.logprob.abstract import MeasurableVariable
  from pymc.logprob.basic import logp
  from pymc.logprob.utils import ParameterValueError, check_potential_measurability, dirac_delta, replace_rvs_by_values
  from pymc.testing import assert_no_rvs
  from tests.logprob.utils import create_pytensor_params, scipy_logprob_tester
label_desc: Use image node_id 4 for calling the TestReplaceRVsByValues obj's underlying member method code with example usage: obj.test_no_change_inplace() without return types