code: def test_basic_scope():
      @scope
      def f1():
          return pyro.sample("x", dist.Bernoulli(0.5))
  
      @scope
      def f2():
          f1()
          return pyro.sample("y", dist.Bernoulli(0.5))
  
      tr1 = poutine.trace(f1).get_trace()
      assert "f1/x" in tr1.nodes
  
      tr2 = poutine.trace(f2).get_trace()
      assert "f2/f1/x" in tr2.nodes
      assert "f2/y" in tr2.nodes
  
file_path: pyro/tests/contrib/autoname/test_scoping.py
imports: import logging
  import torch
  import pyro
  import pyro.distributions.torch
  import pyro.poutine
  from pyro.contrib.autoname import name_count, scope
label_desc: Use image node_id 6 for calling a global function with example usage: test_basic_scope() and returns: pyro, pyro