class_docstr: .. warning::
      This class is deprecated and will be removed in a future release.
      Use the :class:`~pyro.infer.predictive.Predictive` class instead.
  
  Generates and holds traces from the posterior predictive distribution,
  given model execution traces from the approximate posterior. This is
  achieved by constraining latent sites to randomly sampled parameter
  values from the model execution traces and running the model forward
  to generate traces with new response ("_RETURN") sites.
  :param model: arbitrary Python callable containing Pyro primitives.
  :param TracePosterior posterior: trace posterior instance holding samples from the model's approximate posterior.
  :param int num_samples: number of samples to generate.
  :param keep_sites: The sites which should be sampled from posterior distribution (default: all)
code: def _remove_dropped_nodes(self, trace):
      if self.keep_sites is None:
          return
      for name, site in list(trace.nodes.items()):
          if name not in self.keep_sites:
              trace.remove_node(name)
              continue
  
imports: import numbers
  import warnings
  from abc import ABCMeta, abstractmethod
  from collections import OrderedDict, defaultdict
  import torch
  import pyro.poutine
  from pyro.distributions import Categorical, Empirical
  from pyro.ops.stats import waic
  from pyro.poutine.util import site_is_subsample
label_desc: Use image node_id 3 for calling the TracePredictive obj's underlying member method code with example usage: obj._remove_dropped_nodes(trace) without return types