code: def testSamplePoissonLowRates(self):
      # Low log rate (< log(10.)) samples would use Knuth's algorithm.
      rate = [1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5]
      log_rate = np.log(rate)
      num_samples = int(1e5)
      self.assertLess(
          self.evaluate(
              st.min_num_samples_for_dkwm_cdf_test(
                  discrepancy=0.04,
                  false_fail_rate=1e-9,
                  false_pass_rate=1e-9,
              )
          ),
          num_samples,
      )
  
      samples = poisson_lib._random_poisson_noncpu(
          shape=[num_samples],
          log_rates=log_rate,
          output_dtype=tf.float64,
          seed=test_util.test_seed(),
      )
  
      poisson = poisson_lib.Poisson(
          log_rate=log_rate, validate_args=True
      )
      self.evaluate(
          st.assert_true_cdf_equal_by_dkwm(
              samples,
              poisson.cdf,
              st.left_continuous_cdf_discrete_distribution(poisson),
              false_fail_rate=1e-9,
          )
      )
  
      self.assertAllMeansClose(
          self.evaluate(samples),
          stats.poisson.mean(rate),
          axis=0,
          rtol=0.01,
      )
      self.assertAllClose(
          self.evaluate(tf.math.reduce_variance(samples, axis=0)),
          stats.poisson.var(rate),
          rtol=0.05,
      )
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 4 for calling the PoissonSamplingTest obj's underlying member method code with example usage: obj.testSamplePoissonLowRates() without return types