code: def test_beta_binomial_log_prob(total_count, shape):
      concentration0 = torch.randn(shape).exp()
      concentration1 = torch.randn(shape).exp()
      value = torch.arange(1.0 + total_count)
  
      num_samples = 100000
      probs = dist.Beta(concentration1, concentration0).sample(
          (num_samples,)
      )
      log_probs = dist.Binomial(total_count, probs).log_prob(value)
      expected = log_probs.logsumexp(0) - math.log(num_samples)
  
      actual = BetaBinomial(
          concentration1, concentration0, total_count
      ).log_prob(value)
      assert_close(actual, expected, rtol=0.02)
  
file_path: pyro/tests/distributions/test_conjugate.py
imports: import math
  import pytest
  import torch
  import pyro.distributions
  from pyro.distributions import BetaBinomial, DirichletMultinomial, GammaPoisson
  from tests.common import assert_close
label_desc: Use image node_id 4 for calling a global function with example usage: test_beta_binomial_log_prob(total_count, shape) without return types