code: def test_only_withs():
      def model1():
          with autoname(name="a"):
              with autoname(name="b"):
                  sample("x", dist.Bernoulli(0.5))
  
      tr1 = poutine.trace(model1).get_trace()
      assert "a/b/x" in tr1.nodes
  
      tr2 = poutine.trace(autoname(model1)).get_trace()
      assert "model1/a/b/x" in tr2.nodes
  
file_path: pyro/tests/contrib/autoname/test_autoname.py
imports: import torch
  import pyro
  import pyro.distributions.torch
  import pyro.poutine
  from pyro.contrib.autoname import autoname, sample
label_desc: Use image node_id 12 for calling a global function with example usage: test_only_withs() without return types