code: def test_model_guide():
      @autoname
      def model():
          sample("x", dist.HalfNormal(1))
          return sample(dist.Bernoulli(0.5))
  
      @autoname(name="model")
      def guide():
          sample("x", dist.Gamma(1, 1))
          return sample(dist.Bernoulli(0.5))
  
      model_tr = poutine.trace(model).get_trace()
      guide_tr = poutine.trace(guide).get_trace()
      assert "model/x" in model_tr.nodes
      assert "model/x" in guide_tr.nodes
      assert "model/Bernoulli" in model_tr.nodes
      assert "model/Bernoulli" in guide_tr.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 8 for calling a global function with example usage: test_model_guide() and returns: sample, sample