code: def test_nesting():
      def nested():
          true_probs = torch.ones(5) * 0.7
          num_trials = torch.ones(5) * 1000
          num_success = dist.Binomial(num_trials, true_probs).sample()
          conditioned_model = poutine.condition(
              model, data={"obs": num_success}
          )
          nuts_kernel = NUTS(conditioned_model, adapt_step_size=True)
          mcmc_run = MCMC(
              nuts_kernel, num_samples=10, warmup_steps=2
          ).run(num_trials)
          return mcmc_run
  
      with poutine.trace() as tp:
          nested()
          nested()
  
      assert len(tp.trace.nodes) == 0
  
file_path: pyro/tests/infer/test_abstract_infer.py
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  import pyro.poutine
  from pyro.infer import SVI, Trace_ELBO
  from pyro.infer.autoguide import AutoLaplaceApproximation
  from pyro.infer.mcmc import MCMC, NUTS
  from tests.common import assert_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_nesting() and returns: mcmc_run