code: def _predictive_sequential(
      model,
      posterior_samples,
      model_args,
      model_kwargs,
      num_samples,
      sample_sites,
      return_trace=False,
  ):
      collected = []
      samples = [
          {k: v[i] for k, v in posterior_samples.items()}
          for i in range(num_samples)
      ]
      for i in range(num_samples):
          trace = poutine.trace(
              poutine.condition(model, samples[i])
          ).get_trace(*model_args, **model_kwargs)
          if return_trace:
              collected.append(trace)
          else:
              collected.append(
                  {
                      site: trace.nodes[site]["value"]
                      for site in sample_sites
                  }
              )
  
      return (
          collected
          if return_trace
          else {
              site: torch.stack([s[site] for s in collected])
              for site in sample_sites
          }
      )
  
imports: import functools
  import traceback
  import warnings
  from collections import OrderedDict, defaultdict
  from functools import partial, reduce
  from itertools import product
  import torch
  from opt_einsum import shared_intermediates
  from torch.distributions import biject_to
  import pyro
  import pyro.poutine
  from pyro.distributions.util import broadcast_shape, logsumexp
  from pyro.infer import config_enumerate
  from pyro.infer.autoguide.initialization import InitMessenger, init_to_uniform
  from pyro.infer.util import is_validation_enabled
  from pyro.ops import stats
  from pyro.ops.contract import contract_to_tensor
  from pyro.ops.integrator import potential_grad
  from pyro.poutine.subsample_messenger import _Subsample
  from pyro.poutine.util import prune_subsample_sites
  from pyro.util import check_site_shape, ignore_jit_warnings
label_desc: Use image node_id 8 for calling a global function with example usage: _predictive_sequential(model, posterior_samples, model_args, model_kwargs, num_samples, sample_sites, return_trace) and returns: unknown