code: def testSamplesAgreeWithPdfForSamplesOverSmallRange(self):
      # Testing that samples and pdf agree for a small range is important because
      # it makes sure the bin edges are consistent.
  
      # Make an exponential with mean 5.
      qdist = qd.QuantizedDistribution(
          distribution=exponential.Exponential(rate=0.2),
          validate_args=True,
      )
      # Standard error should be less than 1 / (2 * sqrt(n_samples)).
      # We check for results off by 5.2+ standard errors to have an overall false
      # positive rate of ~1e-6.
      n_samples = 10000
      stddev_err_bound = 5.2 / (2 * np.sqrt(n_samples))
      samps = self.evaluate(
          qdist.sample((n_samples,), seed=test_util.test_seed())
      )
      # The smallest value the samples can take on is 1, which corresponds to
      # the interval (0, 1].  Recall we use ceiling in the sampling definition.
      self.assertLess(0.5, samps.min())
      x_vals = np.arange(1, 11).astype(np.float32)
      pmf_vals = self.evaluate(qdist.prob(x_vals))
      for ii in range(10):
          self.assertAllClose(
              pmf_vals[ii],
              (samps == x_vals[ii]).mean(),
              atol=stddev_err_bound,
          )
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import quantized_distribution
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 6 for calling the QuantizedDistributionTest obj's underlying member method code with example usage: obj.testSamplesAgreeWithPdfForSamplesOverSmallRange() without return types