code: def test_beta_binomial(sample_shape, batch_shape):
      concentration1 = torch.randn(batch_shape).exp()
      concentration0 = torch.randn(batch_shape).exp()
      total = 10
      obs = dist.Binomial(total, 0.2).sample(sample_shape + batch_shape)
  
      f = dist.Beta(concentration1, concentration0)
      g = dist.Beta(1 + obs, 1 + total - obs)
      fg, log_normalizer = f.conjugate_update(g)
  
      x = fg.sample(sample_shape)
      assert_close(
          f.log_prob(x) + g.log_prob(x), fg.log_prob(x) + log_normalizer
      )
  
imports: import pytest
  import torch
  import pyro.distributions
  from tests.common import assert_close
label_desc: Use image node_id 1 for calling a global function with example usage: test_beta_binomial(sample_shape, batch_shape) without return types