code: def testSample(self, dist_fn, sample_shape):
      one = self.dtype(1.0)
      two = self.dtype(2.0)
      seed_stream = test_util.test_seed_stream()
      dist = getattr(self, dist_fn)()
  
      sample = dist.sample(sample_shape, seed=seed_stream())
  
      uniform_sample = tf.random.uniform(
          sample.shape, maxval=one, dtype=self.dtype, seed=seed_stream()
      )
      sign = tf.where(uniform_sample < 0.5, -one, one)
      student_t_sample = self.evaluate(
          sign
          * two_piece_student_t.standardize(
              sample,
              loc=dist.loc,
              scale=dist.scale,
              skewness=dist.skewness,
          )
      )
  
      # Note that the standard error for the sample mean is ~ sigma / sqrt(n).
      # The sample variance similarly is dependent on scale and n.
      # Thus, the tolerances below are very sensitive to number of samples
      # as well as the variances chosen.
      self.assertDTypeEqual(sample, self.dtype)
      self.assertAllEqual(
          student_t_sample.shape, sample_shape + dist.batch_shape
      )
      self.assertAllClose(np.mean(student_t_sample), 0.0, atol=0.1)
      self.assertAllClose(
          np.std(student_t_sample),
          self.evaluate(tf.math.sqrt(dist.df / (dist.df - two))),
          atol=0.1,
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import two_piece_student_t
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 8 for calling the _TwoPieceStudentTTest obj's underlying member method code with example usage: obj.testSample(dist_fn, sample_shape) without return types