code: def assert_error(model, guide, elbo, match=None):
      """
      Assert that inference fails with an error.
      """
      pyro.get_param_store().clear()
      adam = optim.Adam({"lr": 1e-6})
      inference = infer.SVI(model, guide, adam, elbo)
      with pytest.raises(
          (
              NotImplementedError,
              UserWarning,
              KeyError,
              ValueError,
              RuntimeError,
          ),
          match=match,
      ):
          inference.step()
  
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 4 for calling a global function with example usage: assert_error(model, guide, elbo, match) without return types