code: def test_basic_scope():
      @autoname
      def f1():
          sample(dist.Normal(0, 1))
          return sample(dist.Bernoulli(0.5))
  
      @autoname(name="model")
      def f2():
          sample("x", dist.Bernoulli(0.5))
          return sample(dist.Normal(0.0, 1.0))
  
      tr1 = poutine.trace(f1).get_trace()
      assert "f1/Normal" in tr1.nodes
      assert "f1/Bernoulli" in tr1.nodes
  
      tr2 = poutine.trace(f2).get_trace()
      assert "model/x" in tr2.nodes
      assert "model/Normal" 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 1 for calling a global function with example usage: test_basic_scope() and returns: sample, sample