code: def test_mutual_recur():
      @scope
      def model1(n):
          pyro.sample("a", dist.Bernoulli(0.5))
          if n <= 0:
              return
          else:
              return model2(n - 1)
  
      @scope
      def model2(n):
          pyro.sample("b", dist.Bernoulli(0.5))
          if n <= 0:
              return
          else:
              model1(n)
  
      names = set(
          [
              "_INPUT",
              "_RETURN",
              "model2/b",
              "model2/model1/a",
              "model2/model1/model2/b",
          ]
      )
      tr_names = set(
          [
              name
              for name in poutine.trace(name_count(model2)).get_trace(1)
          ]
      )
      assert names == tr_names
  
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 4 for calling a global function with example usage: test_mutual_recur() and returns: model2