code: def test_posterior_linear_model(linear_model, one_point_design):
      pyro.set_rng_seed(42)
      pyro.clear_param_store()
      # Pre-train (large learning rate)
      posterior_eig(
          linear_model,
          one_point_design,
          "y",
          "w",
          num_samples=10,
          num_steps=250,
          guide=posterior_guide,
          optim=optim.Adam({"lr": 0.1}),
      )
      # Finesse (small learning rate)
      estimated_eig = posterior_eig(
          linear_model,
          one_point_design,
          "y",
          "w",
          num_samples=10,
          num_steps=250,
          guide=posterior_guide,
          optim=optim.Adam({"lr": 0.01}),
          final_num_samples=500,
      )
      expected_eig = linear_model_ground_truth(
          linear_model, one_point_design, "y", "w"
      )
      assert_equal(estimated_eig, expected_eig, prec=5e-2)
  
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  from pyro.contrib.oed.eig import donsker_varadhan_eig, laplace_eig, lfire_eig, marginal_eig, marginal_likelihood_eig, nmc_eig, posterior_eig, vnmc_eig
  from pyro.contrib.oed.glmm import known_covariance_linear_model
  from pyro.contrib.oed.glmm.guides import LinearModelLaplaceGuide
  from pyro.contrib.oed.util import linear_model_ground_truth
  from pyro.contrib.util import rmv, rvv
  from pyro.infer import Trace_ELBO
  from tests.common import assert_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_posterior_linear_model(linear_model, one_point_design) without return types