code: def test_mutual_recur():
      @autoname
      def model1(n):
          sample("a", dist.Bernoulli(0.5))
          if n <= 0:
              return
          else:
              return model2(n - 1)
  
      @autoname
      def model2(n):
          sample("b", dist.Bernoulli(0.5))
          if n <= 0:
              return
          else:
              model1(n)
  
      expected_names = [
          "model2/b",
          "model2/model1/a",
          "model2/model1/model2/b",
      ]
      tr = poutine.trace(model2).get_trace(1)
      actual_names = [
          name
          for name, node in tr.nodes.items()
          if node["type"] == "sample"
          and type(node["fn"]).__name__ != "_Subsample"
      ]
      assert expected_names == actual_names
  
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 13 for calling a global function with example usage: test_mutual_recur() and returns: model2