code: def to_data(x, name_to_dim=None, dim_type=DimType.LOCAL):
      import funsor
  
      if pyro.poutine.runtime.am_i_wrapped() and not name_to_dim:
          name_to_dim = _DIM_STACK.global_frame.name_to_dim.copy()
      assert not name_to_dim or not any(
          isinstance(dim, DimRequest) for dim in name_to_dim.values()
      )
      return funsor.to_data(x, name_to_dim=name_to_dim)
  
label_desc: Use image node_id 2 for calling a global function with example usage: to_data(x, name_to_dim, dim_type) and returns: funsor