code: def testDistribution(self, dist_name, data):
      dist = data.draw(
          dhps.distributions(
              dist_name=dist_name,
              enable_vars=False,
              validate_args=False,
          )
      )
      seed = test_util.test_seed(sampler_type="stateless")
      sample_shape = [2, 1]
      with tfp_hps.no_tf_rank_errors(), kernel_hps.no_pd_errors():
          s1, lp1 = dist.experimental_sample_and_log_prob(
              sample_shape, seed=seed
          )
          s2 = dist.sample(sample_shape, seed=seed)
          self.assertAllClose(s1, s2, atol=1e-4)
  
          # Sanity-check the log prob. The actual values may differ arbitrarily (if
          # the `sample_and_log_prob` implementation is more stable) or be NaN, but
          # they should at least have the same shape.
          lp2 = dist.log_prob(s1)
          self.assertAllEqual(lp1.shape, lp2.shape)
  
imports: import collections
  from absl.testing import parameterized
  import hypothesis
  from hypothesis import strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python import distributions
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors import expm1
  from tensorflow_probability.python.bijectors import normal_cdf
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import hypothesis_testlib
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math.psd_kernels import hypothesis_testlib
label_desc: Use image node_id 1 for calling the SampleAndLogProbTest obj's underlying member method code with example usage: obj.testDistribution(dist_name, data) without return types