code: def test_save_params(save_params, Kernel, options):
      save_params = list(save_params)
  
      def model():
          x = pyro.sample("x", dist.Normal(0, 1))
          with pyro.plate("plate", 2):
              y = pyro.sample("y", dist.Normal(x, 1))
              pyro.sample("obs", dist.Normal(y, 1), obs=torch.zeros(2))
  
      kernel = Kernel(model, **options)
      mcmc = MCMC(
          kernel, warmup_steps=2, num_samples=4, save_params=save_params
      )
      mcmc.run()
  
      samples = mcmc.get_samples()
      assert set(samples.keys()) == set(save_params)
  
      diagnostics = mcmc.diagnostics()
      diagnostics = {k: v for k, v in diagnostics.items() if k in "xy"}
      assert set(diagnostics.keys()) == set(save_params)
  
      mcmc.summary()
  
imports: import os
  from functools import partial
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.mcmc import HMC, NUTS
  from pyro.infer.mcmc.api import MCMC, StreamingMCMC, _MultiSampler, _UnarySampler
  from pyro.infer.mcmc.mcmc_kernel import MCMCKernel
  from pyro.infer.mcmc.util import initialize_model, select_samples
  from pyro.ops.streaming import StackStats, StatsOfDict
  from pyro.util import optional
  from tests.common import assert_close
label_desc: Use image node_id 12 for calling a global function with example usage: test_save_params(save_params, Kernel, options) without return types