code: def test_beta_bernoulli(
      step_size, adapt_step_size, adapt_mass_matrix, full_mass
  ):
      def model(data):
          alpha = torch.tensor([1.1, 1.1])
          beta = torch.tensor([1.1, 1.1])
          p_latent = pyro.sample("p_latent", dist.Beta(alpha, beta))
          pyro.sample("obs", dist.Bernoulli(p_latent), obs=data)
          return p_latent
  
      true_probs = torch.tensor([0.9, 0.1])
      data = dist.Bernoulli(true_probs).sample(
          sample_shape=(torch.Size((1000,)))
      )
      nuts_kernel = NUTS(
          model,
          step_size=step_size,
          adapt_step_size=adapt_step_size,
          adapt_mass_matrix=adapt_mass_matrix,
          full_mass=full_mass,
      )
      mcmc = MCMC(nuts_kernel, num_samples=400, warmup_steps=200)
      mcmc.run(data)
      samples = mcmc.get_samples()
      assert_equal(samples["p_latent"].mean(0), true_probs, prec=0.02)
  
imports: import logging
  import os
  from collections import namedtuple
  import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  import pyro.poutine
  from pyro.contrib.conjugate.infer import BetaBinomialPair, GammaPoissonPair, collapse_conjugate, posterior_replay
  from pyro.infer import SVI, TraceEnum_ELBO
  from pyro.infer.autoguide import AutoDelta
  from pyro.infer.mcmc import MCMC, NUTS, ArrowheadMassMatrix
  from pyro.util import ignore_jit_warnings
  from tests.common import assert_close, assert_equal
  from .test_hmc import GaussianChain, rmse
label_desc: Use image node_id 5 for calling a global function with example usage: test_beta_bernoulli(step_size, adapt_step_size, adapt_mass_matrix, full_mass) and returns: p_latent