code: def get_plate_stacks(trace):
      """
      This builds a dict mapping site name to a set of plate stacks.  Each
      plate stack is a list of :class:`CondIndepStackFrame`s corresponding to
      an :class:`plate`.  This information is used by :class:`Trace_ELBO` and
      :class:`TraceGraph_ELBO`.
      """
      return {
          name: [f for f in node["cond_indep_stack"] if f.vectorized]
          for name, node in trace.nodes.items()
          if node["type"] == "sample" and not site_is_subsample(node)
      }
  
imports: import math
  import numbers
  from collections import Counter, defaultdict
  from contextlib import contextmanager
  import torch
  from opt_einsum import shared_intermediates
  from opt_einsum.sharing import count_cached_ops
  from pyro.distributions.util import is_identically_zero
  from pyro.ops import packed
  from pyro.ops.einsum.adjoint import require_backward
  from pyro.ops.rings import MarginalRing
  from pyro.poutine.util import site_is_subsample
  from ..None import settings
label_desc: Use image node_id 9 for calling a global function with example usage: get_plate_stacks(trace) and returns: unknown