code: def testShape(self, dist_fn):
      dist = getattr(self, dist_fn)()
  
      expected_batch_shape = dist.skewness.shape
      self.assertEqual(
          list(self.evaluate(dist.batch_shape_tensor())),
          list(expected_batch_shape),
      )
      self.assertEqual(dist.batch_shape, expected_batch_shape)
      self.assertAllEqual(self.evaluate(dist.event_shape_tensor()), [])
      self.assertEqual(dist.event_shape, tf.TensorShape([]))
  
      n = 10
      sample = dist.sample(n, seed=test_util.test_seed())
      results = [sample]
  
      for method in ("log_prob", "cdf", "survival_function"):
          results.append(getattr(dist, method)(sample))
  
      probs = dist.cdf(sample)
      results.append(dist.quantile(probs))
  
      for result in results:
          self.assertAllEqual(
              [n] + list(self.evaluate(dist.batch_shape_tensor())),
              result.shape,
          )
          self.assertAllEqual(
              [n] + list(self.evaluate(dist.batch_shape_tensor())),
              self.evaluate(result).shape,
          )
          self.assertAllEqual([n] + dist.batch_shape, result.shape)
          self.assertAllEqual(
              [n] + dist.batch_shape, self.evaluate(result).shape
          )
  
      for method in ("mean", "variance", "mode"):
          result = getattr(dist, method)()
          self.assertAllEqual(
              self.evaluate(dist.batch_shape_tensor()), result.shape
          )
          self.assertAllEqual(
              self.evaluate(dist.batch_shape_tensor()),
              self.evaluate(result).shape,
          )
          self.assertAllEqual(dist.batch_shape, result.shape)
          self.assertAllEqual(
              dist.batch_shape, self.evaluate(result).shape
          )
  
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 7 for calling the _TwoPieceStudentTTest obj's underlying member method code with example usage: obj.testShape(dist_fn) without return types