code: def test_log_prob_matches(model1, model2, design):
      trace = poutine.trace(model1).get_trace(design)
      trace.compute_log_prob()
      ks = [k for k in trace.nodes.keys() if not k.startswith("_")]
      data = {l: trace.nodes[l]["value"] for l in ks}
      lp = {l: trace.nodes[l]["log_prob"] for l in ks}
      cond_model = pyro.condition(model2, data=data)
      cond_trace = poutine.trace(cond_model).get_trace(design)
      cond_trace.compute_log_prob()
      assert trace.nodes.keys() == cond_trace.nodes.keys()
      lp2 = {l: trace.nodes[l]["log_prob"] for l in ks}
      for l in lp.keys():
          assert_equal(lp[l], lp2[l])
  
file_path: pyro/tests/contrib/oed/test_glmm.py
imports: import pytest
  import torch
  from torch.distributions.transforms import AffineTransform, SigmoidTransform
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.contrib.oed.glmm import group_linear_model, known_covariance_linear_model, logistic_regression_model, normal_inverse_gamma_linear_model, sigmoid_model, zero_mean_unit_obs_sd_lm
  from tests.common import assert_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_log_prob_matches(model1, model2, design) without return types