code: def test_docstring_example_runs(self):
      def target_log_prob_fn(x):
          prior = normal.Normal(loc=0.0, scale=1.0).log_prob(x)
          # Multimodal likelihood.
          likelihood = mixture_same_family.MixtureSameFamily(
              mixture_distribution=categorical.Categorical(
                  probs=[0.4, 0.6]
              ),
              components_distribution=normal.Normal(
                  loc=[-1.0, 1.0], scale=0.1
              ),
          ).log_prob(x)
          return prior + likelihood
  
      # Use importance sampling to infer an approximate posterior.
      seed = test_util.test_seed(sampler_type="stateless")
      approximate_posterior = importance_resample.ImportanceResample(
          proposal_distribution=normal.Normal(loc=0.0, scale=2.0),
          target_log_prob_fn=target_log_prob_fn,
          importance_sample_size=3,
          stochastic_approximation_seed=seed,
      )
  
      # Directly compute expectations under the posterior via importance weights.
      posterior_mean = (
          approximate_posterior.self_normalized_expectation(
              lambda x: x, seed=seed
          )
      )
      approximate_posterior.self_normalized_expectation(
          lambda x: (x - posterior_mean) ** 2, seed=seed
      )
  
      posterior_samples = approximate_posterior.sample(5, seed=seed)
      tf.reduce_mean(posterior_samples)
      tf.math.reduce_variance(posterior_samples)
  
      posterior_mean_efficient = (
          approximate_posterior.self_normalized_expectation(
              lambda x: x, sample_size=10, seed=seed
          )
      )
      approximate_posterior.self_normalized_expectation(
          lambda x: (x - posterior_mean_efficient) ** 2,
          sample_size=10,
          seed=seed,
      )
  
      # Approximate the posterior density.
      xs = tf.linspace(-3.0, 3.0, 101)
      approximate_posterior.prob(xs, sample_size=10, seed=seed)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.experimental.distributions import importance_resample
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.vi import csiszar_divergence
label_desc: Use image node_id 9 for calling the ImportanceResampleTest obj's underlying member method code with example usage: obj.test_docstring_example_runs() and returns: unknown