code: def test_nuts_conjugate_gaussian(
      fixture,
      num_samples,
      warmup_steps,
      expected_means,
      expected_precs,
      mean_tol,
      std_tol,
  ):
      pyro.get_param_store().clear()
      nuts_kernel = NUTS(fixture.model)
      mcmc = MCMC(nuts_kernel, num_samples, warmup_steps)
      mcmc.run(fixture.data)
      samples = mcmc.get_samples()
      for i in range(1, fixture.chain_len + 1):
          param_name = "loc_" + str(i)
          latent = samples[param_name]
          latent_loc = latent.mean(0)
          latent_std = latent.std(0)
          expected_mean = (
              torch.ones(fixture.dim) * expected_means[i - 1]
          )
          expected_std = 1 / torch.sqrt(
              torch.ones(fixture.dim) * expected_precs[i - 1]
          )
  
          # Actual vs expected posterior means for the latents
          logger.debug(
              "Posterior mean (actual) - {}".format(param_name)
          )
          logger.debug(latent_loc)
          logger.debug(
              "Posterior mean (expected) - {}".format(param_name)
          )
          logger.debug(expected_mean)
          assert_equal(
              rmse(latent_loc, expected_mean).item(), 0.0, prec=mean_tol
          )
  
          # Actual vs expected posterior precisions for the latents
          logger.debug("Posterior std (actual) - {}".format(param_name))
          logger.debug(latent_std)
          logger.debug(
              "Posterior std (expected) - {}".format(param_name)
          )
          logger.debug(expected_std)
          assert_equal(
              rmse(latent_std, expected_std).item(), 0.0, prec=std_tol
          )
  
imports: import logging
  import os
  from collections import namedtuple
  import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  import pyro.poutine
  from pyro.contrib.conjugate.infer import BetaBinomialPair, GammaPoissonPair, collapse_conjugate, posterior_replay
  from pyro.infer import SVI, TraceEnum_ELBO
  from pyro.infer.autoguide import AutoDelta
  from pyro.infer.mcmc import MCMC, NUTS, ArrowheadMassMatrix
  from pyro.util import ignore_jit_warnings
  from tests.common import assert_close, assert_equal
  from .test_hmc import GaussianChain, rmse
label_desc: Use image node_id 3 for calling a global function with example usage: test_nuts_conjugate_gaussian(fixture, num_samples, warmup_steps, expected_means, expected_precs, mean_tol, std_tol) without return types