docs: def validate_mixture(supports_mixture: SupportsMixture):
      """Validates that the mixture's tuple are valid probabilities."""
      mixture_tuple = mixture(supports_mixture, None)
      if mixture_tuple is None:
          raise TypeError('{}_mixture did not have a _mixture_ method'.format(
              supports_mixture))
  
      def validate_probability(p, p_str):
          if p < 0:
              raise ValueError('{} was less than 0.'.format(p_str))
          elif p > 1:
              raise ValueError('{} was greater than 1.'.format(p_str))
  
      total = 0.0
      for p, val in mixture_tuple:
          validate_probability(p, '{}\'s probability'.format(str(val)))
          total += p
      if not np.isclose(total, 1.0):
          raise ValueError('Sum of probabilities of a mixture was not 1.0')