code: def testPoissonSample(self):
      lam_v = 4.0
      lam = tf.constant(lam_v)
      # Choosing `n >= (k/rtol)**2, roughly ensures our sample mean should be
      # within `k` std. deviations of actual up to rtol precision.
      n = int(100e3)
      poisson = self._make_poisson(rate=lam)
      samples = poisson.sample(n, seed=test_util.test_seed())
      sample_values = self.evaluate(samples)
      self.assertEqual(samples.shape, (n,))
      self.assertEqual(sample_values.shape, (n,))
      self.assertAllClose(
          sample_values.mean(), stats.poisson.mean(lam_v), rtol=0.01
      )
      self.assertAllClose(
          sample_values.var(), stats.poisson.var(lam_v), rtol=0.013
      )
  
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 20 for calling the PoissonTest obj's underlying member method code with example usage: obj.testPoissonSample() without return types