code: def _relaxed_beta_binomial(
      concentration1, concentration0, total_count
  ):
      """
      Returns a moment-matched :class:`~pyro.distributions.Normal` approximating
      a :class:`~pyro.distributions.BetaBinomial` but allowing arbitrary real
      ``total_count`` and lower-bounding variance.
      """
      concentration1, concentration0, total_count = broadcast_all(
          concentration1, concentration0, total_count
      )
  
      c = concentration1 + concentration0
      beta_mean = concentration1 / c
      beta_variance = (
          concentration1 * concentration0 / (c * c * (c + 1))
      )
      mean = beta_mean * total_count
      variance = beta_variance * total_count * (c + total_count)
  
      scale = variance.clamp(min=_RELAX_MIN_VARIANCE).sqrt()
      return dist.Normal(mean, scale)
  
file_path: pyro/pyro/contrib/epidemiology/distributions.py
imports: import math
  from contextlib import contextmanager
  import torch
  from torch.distributions.utils import broadcast_all
  import pyro.distributions
  from pyro.distributions.util import is_validation_enabled
label_desc: Use image node_id 8 for calling a global function with example usage: _relaxed_beta_binomial(concentration1, concentration0, total_count) and returns: dist