code: def prune_subsample_sites(trace: "Trace") -> "Trace":
      """
      Copies and removes all subsample sites from a trace.
      """
      trace = trace.copy()
      for name, site in list(trace.nodes.items()):
          if site_is_subsample(site):
              trace.remove_node(name)
      return trace
  
file_path: pyro/pyro/poutine/util.py
imports: from typing import TYPE_CHECKING, List, Optional
  from pyro import settings
label_desc: Use image node_id 5 for calling a global function with example usage: prune_subsample_sites(trace) and returns: trace