code: def test_eval_str():
      state = named.Object("state")
      state.x = 0
      state.ys = named.List()
      state.ys.add().foo = 1
      state.zs = named.Dict()
      state.zs[42].bar = 2
  
      assert state is eval(str(state))
      assert state.x is eval(str(state.x))
      assert state.ys is eval(str(state.ys))
      assert state.ys[0] is eval(str(state.ys[0]))
      assert state.ys[0].foo is eval(str(state.ys[0].foo))
      assert state.zs is eval(str(state.zs))
      assert state.zs[42] is eval(str(state.zs[42]))
      assert state.zs[42].bar is eval(str(state.zs[42].bar))
  
file_path: pyro/tests/contrib/autoname/test_named.py
imports: import torch
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.contrib.autoname import named
label_desc: Use image node_id 8 for calling a global function with example usage: test_eval_str() without return types