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