code: def test_log_prob_restricted(posterior):
      """Test log probability against sampled model with restriction."""
      fit = posterior.sample(
          num_chains=num_chains, num_samples=num_samples
      )
      y = fit["y"][0][0]
      y = posterior.unconstrain_pars({"y": y})[0]
      lp__ = fit["lp__"][0][0]
      lp = posterior.log_prob(
          unconstrained_parameters=[y], adjust_transform=False
      )
      assert np.allclose(lp__, lp + y)
      adjusted_lp = posterior.log_prob(
          unconstrained_parameters=[y], adjust_transform=True
      )
      assert np.allclose(lp__, adjusted_lp)
  
imports: import numpy
  import pytest
  import stan
label_desc: Use image node_id 3 for calling a global function with example usage: test_log_prob_restricted(posterior) without return types