code: def get_sample_names(tr):
      return set(
          [
              name
              for name, site in tr.nodes.items()
              if site["type"] == "sample" and not site["is_observed"]
          ]
      )
  
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 1 for calling a global function with example usage: get_sample_names(tr) and returns: set