code: def test_ffb_5(backward):
      """
      def model(data):
          a = pyro.sample("a", dist.MultivariateNormal(zeros(2), eye(2)))
          b = pyro.sample("b", dist.MultivariateNormal(a, eye(2)))
          c = pyro.sample("c", dist.MultivariateNormal(b, eye(2)))
          d = pyro.sample("d", dist.MultivariateNormal(c, eye(2)))
          pyro.sample("e", dist.MultivariateNormal(d, eye(2)), obs=data)
      """
      num_samples = int(1e5)
  
      factors = {
          "a": random_gaussian(OrderedDict({"a": Reals[2]})),
          "b": random_gaussian(
              OrderedDict({"b": Reals[2], "a": Reals[2]})
          ),
          "c": random_gaussian(
              OrderedDict({"c": Reals[2], "b": Reals[2]})
          ),
          "d": random_gaussian(
              OrderedDict({"d": Reals[2], "c": Reals[2]})
          ),
          "e": random_gaussian(OrderedDict({"d": Reals[2]})),
      }
      eliminate = frozenset(["a", "b", "c", "d"])
      plates = frozenset()
  
      if backward == "sample":
          sample_inputs = {"particle": Bint[num_samples]}
          rng_key = (
              None
              if get_backend() != "jax"
              else np.array([0, 0], dtype=np.uint32)
          )
          (
              actual_samples,
              actual_log_prob,
          ) = forward_filter_backward_rsample(
              factors, eliminate, plates, sample_inputs, rng_key
          )
      elif backward == "precondition":
          samples, log_prob = forward_filter_backward_precondition(
              factors, eliminate, plates
          )
          actual_samples, actual_log_prob = substitute_aux(
              samples, log_prob, num_samples
          )
  
      assert set(actual_samples) == {"a", "b", "c", "d"}
      assert actual_samples["a"].output == Reals[2]
      assert actual_samples["b"].output == Reals[2]
      assert actual_samples["c"].output == Reals[2]
      assert actual_samples["d"].output == Reals[2]
      assert set(actual_samples["a"].inputs) == {"particle"}
      assert set(actual_samples["b"].inputs) == {"particle"}
      assert set(actual_samples["c"].inputs) == {"particle"}
      assert set(actual_samples["d"].inputs) == {"particle"}
      check_ffbr(
          factors, eliminate, plates, actual_samples, actual_log_prob
      )
  
imports: from collections import OrderedDict
  from typing import Dict, Tuple
  import numpy
  import pytest
  import funsor.ops
  from funsor.domains import Bint, Real, Reals
  from funsor.interpretations import memoize
  from funsor.montecarlo import extract_samples
  from funsor.recipes import forward_filter_backward_precondition, forward_filter_backward_rsample
  from funsor.terms import Lambda, Variable
  from funsor.testing import Tensor, assert_close, randn, random_gaussian
  from funsor.util import get_backend
label_desc: Use image node_id 8 for calling a global function with example usage: test_ffb_5(backward) without return types