code: def beta_bernoulli():
      N = 1000
      true_probs = torch.tensor([0.2, 0.3, 0.4, 0.8, 0.5])
      data = dist.Bernoulli(true_probs).sample([N])
  
      def model(data=None):
          with pyro.plate("num_components", 5):
              beta = pyro.sample("beta", dist.Beta(1.0, 1.0))
              with pyro.plate("data", N):
                  pyro.sample("obs", dist.Bernoulli(beta), obs=data)
  
      return model, data, true_probs
  
file_path: pyro/tests/infer/mcmc/test_mcmc_util.py
imports: from functools import partial
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro.infer import Predictive
  from pyro.infer.autoguide import init_to_feasible, init_to_generated, init_to_mean, init_to_median, init_to_sample, init_to_uniform, init_to_value
  from pyro.infer.mcmc import NUTS
  from pyro.infer.mcmc.api import MCMC
  from pyro.infer.mcmc.util import initialize_model
  from pyro.util import optional
  from tests.common import assert_close, str_erase_pointers
label_desc: Use image node_id 1 for calling a global function with example usage: beta_bernoulli() and returns: model,  data,  true_probs