code: def testBucketReservoirSamplingViaStatisticalProperties(self):
      # Not related to a 'ReservoirBucket', but instead number of buckets we put
      # samples into for testing the shape of the distribution
      b = reservoir._ReservoirBucket(_max_size=self.samples)
      # add one extra item because we always keep the most recent item, which
      # would skew the distribution; we can just slice it off the end instead.
      for i in range(self.total + 1):
          b.AddItem(i)
  
      divbins = [0] * self.n_buckets
      modbins = [0] * self.n_buckets
      # Slice off the last item when we iterate.
      for item in b.Items()[0:-1]:
          divbins[item // self.total_per_bucket] += 1
          modbins[item % self.n_buckets] += 1
  
      for bucket_index in range(self.n_buckets):
          divbin = divbins[bucket_index]
          modbin = modbins[bucket_index]
          self.AssertBinomialQuantity(divbin)
          self.AssertBinomialQuantity(modbin)
  
imports: import tensorflow
  from tensorboard.backend.event_processing import reservoir
label_desc: Use image node_id 3 for calling the ReservoirBucketStatisticalDistributionTest obj's underlying member method code with example usage: obj.testBucketReservoirSamplingViaStatisticalProperties() without return types