code: def AssertBinomialQuantity(self, measured):
      p = 1.0 * self.n_buckets / self.samples
      mean = p * self.samples
      variance = p * (1 - p) * self.samples
      error = measured - mean
      # Given that the buckets were actually binomially distributed, this
      # fails with probability ~2E-9
      passed = error * error <= 36.0 * variance
      self.assertTrue(
          passed,
          "found a bucket with measured %d "
          "too far from expected %d" % (measured, mean),
      )
  
imports: import tensorflow
  from tensorboard.backend.event_processing import reservoir
label_desc: Use image node_id 2 for calling the ReservoirBucketStatisticalDistributionTest obj's underlying member method code with example usage: obj.AssertBinomialQuantity(measured) without return types