code: def testSample(self):
      one = tf.constant(1.0, dtype=self.dtype)
      seed_stream = test_util.test_seed_stream()
  
      dists = (
          self.make_two_piece_normal(),
          self.make_two_piece_normals(),
      )
      n = int(3e2)
      sample_shapes = ([n, n], [n * n])
  
      for dist, sample_shape in itertools.product(dists, sample_shapes):
          sample = dist.sample(sample_shape, seed=seed_stream())
  
          uniform_sample = tf.random.uniform(
              sample.shape,
              maxval=1.0,
              dtype=self.dtype,
              seed=seed_stream(),
          )
          sign = tf.where(uniform_sample < 0.5, -one, one)
          normal_sample = self.evaluate(
              sign
              * two_piece_normal.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.assertAllEqual(
              normal_sample.shape, sample_shape + dist.batch_shape
          )
          self.assertAllClose(np.mean(normal_sample), 0.0, atol=0.1)
          self.assertAllClose(np.std(normal_sample), 1.0, atol=0.1)
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import two_piece_normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 9 for calling the _TwoPieceNormalTest obj's underlying member method code with example usage: obj.testSample() without return types