code: def testSampleAndLogProbUnivariate(self):
      loc = np.float32([-1.0, 1])
      scale = np.float32([0.1, 0.5])
      ind = independent.Independent(
          distribution=normal.Normal(loc=loc, scale=scale),
          reinterpreted_batch_ndims=1,
          validate_args=True,
      )
  
      x = ind.sample(
          [4, 5], seed=test_util.test_seed(hardcoded_seed=42)
      )
      log_prob_x = ind.log_prob(x)
      x_, actual_log_prob_x = self.evaluate([x, log_prob_x])
  
      self.assertEqual([], ind.batch_shape)
      self.assertEqual([2], ind.event_shape)
      self.assertEqual([4, 5, 2], x.shape)
      self.assertEqual([4, 5], log_prob_x.shape)
  
      expected_log_prob_x = sp_stats.norm(loc, scale).logpdf(x_).sum(-1)
      self.assertAllClose(
          expected_log_prob_x, actual_log_prob_x, rtol=1e-5, atol=1e-6
      )
  
imports: import functools
  import os
  from absl.testing import parameterized
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling the IndependentDistributionTest obj's underlying member method code with example usage: obj.testSampleAndLogProbUnivariate() without return types