code: def testCanConstructAndSampleDistribution(self, data):
      # TODO(b/169874884): Implement `width` parameters to work around the need
      # for a high > low` joint constraint.
      # NormalInverseGaussian needs |skewness| < tailweight
      high_gt_low_constraint_dists = (
          "Bates",
          "NormalInverseGaussian",
          "PERT",
          "Triangular",
          "TruncatedCauchy",
          "TruncatedNormal",
          "Uniform",
      )
      not_annotated_dists = (
          "Empirical|event_ndims=0",
          "Empirical|event_ndims=1",
          "Empirical|event_ndims=2",
          "FiniteDiscrete",
          "IncrementLogProb",
          # cov_perturb_factor is not annotated since its shape
          # could be a vector or a matrix.
          "MultivariateNormalDiagPlusLowRankCovariance",
          "MultivariateStudentTLinearOperator",
          "PoissonLogNormalQuadratureCompound",
          "StoppingRatioLogistic",
      )
      non_trainable_dists = (
          high_gt_low_constraint_dists
          + not_annotated_dists
          + dhps.INSTANTIABLE_META_DISTS
      )
  
      non_trainable_tensor_params = (
          "atol",
          "rtol",
          "eigenvectors",  # TODO(b/171872834): DeterminantalPointProcess
          "total_count",
          "num_samples",
          "df",  # Can't represent constraint that Wishart df > dimension.
          "mean_direction",
      )  # TODO(b/118492439): Add `UnitVector` bijector.
      non_trainable_non_tensor_params = (
          "batch_shape",  # SphericalUniform, at least, has explicit batch shape
          "dimension",
          "dtype",
      )
  
      dist = data.draw(
          dhps.distributions(
              eligibility_filter=(
                  lambda name: name not in non_trainable_dists
              )
          )
      )
      sample_shape = tuple(
          self.evaluate(
              tf.concat(
                  [
                      dist.batch_shape_tensor(),
                      dist.event_shape_tensor(),
                  ],
                  axis=0,
              )
          )
      )
  
      params = type(dist).parameter_properties(num_classes=2)
      params64 = type(dist).parameter_properties(
          dtype=tf.float64, num_classes=2
      )
  
      new_parameters = {}
      seeds = {
          k: s
          for (k, s) in zip(
              params.keys(),
              samplers.split_seed(test_util.test_seed(), n=len(params)),
          )
      }
      for param_name, param in params.items():
          if param_name in non_trainable_tensor_params:
              new_parameters[param_name] = dist.parameters[param_name]
          elif param.is_preferred:
              b = param.default_constraining_bijector_fn()
              unconstrained_shape = b.inverse_event_shape_tensor(
                  param.shape_fn(sample_shape=sample_shape)
              )
              unconstrained_param = samplers.normal(
                  unconstrained_shape, seed=seeds[param_name]
              )
              new_parameters[param_name] = b.forward(
                  unconstrained_param
              )
  
              # Check that passing a float64 `eps` works with float64 parameters.
              b_float64 = params64[
                  param_name
              ].default_constraining_bijector_fn()
              b_float64(tf.cast(unconstrained_param, tf.float64))
  
      # Copy over any non-Tensor parameters.
      new_parameters.update(
          {
              k: v
              for (k, v) in dist.parameters.items()
              if k in non_trainable_non_tensor_params
          }
      )
  
      # Sanity check that we got valid parameters.
      new_parameters["validate_args"] = True
      new_dist = type(dist)(**new_parameters)
      x = self.evaluate(new_dist.sample(seed=test_util.test_seed()))
      self.assertEqual(sample_shape, x.shape)
  
      # Valid parameters should give non-nan samples.
      self.assertAllFalse(np.isnan(x))
  
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 ParameterPropertiesTest obj's underlying member method code with example usage: obj.testCanConstructAndSampleDistribution(data) without return types