code: def assert_warning(model, guide, elbo):
      """
      Assert that inference works but with a warning.
      """
      pyro.get_param_store().clear()
      adam = optim.Adam({"lr": 1e-6})
      inference = infer.SVI(model, guide, adam, elbo)
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          inference.step()
          assert len(w), "No warnings were raised"
          for warning in w:
              print(warning)
  
imports: import warnings
  import pytest
  import funsor
  from funsor.testing import xfail_param
  from funsor.util import get_backend
label_desc: Use image node_id 5 for calling a global function with example usage: assert_warning(model, guide, elbo) without return types