code: def check_statistic(
      self,
      dist,
      statistic,
      expected_static_shape,
      expected_dynamic_shape,
  ):
      try:
          with tfp_hps.no_tf_rank_errors():
              result = getattr(dist, statistic)()
          msg = (
              "Shape {} of {} not compatible with expected {}.".format(
                  result.shape, statistic, expected_static_shape
              )
          )
          self.assertTrue(
              expected_static_shape.is_compatible_with(result.shape),
              msg,
          )
          self.assertAllEqual(
              self.evaluate(expected_dynamic_shape),
              self.evaluate(tf.shape(result)),
          )
      except NotImplementedError:
          pass
  
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 2 for calling the StatisticConsistentShapesTest obj's underlying member method code with example usage: obj.check_statistic(dist, statistic, expected_static_shape, expected_dynamic_shape) without return types