code: def test_docstring_example(self):
      # Produce the first 1000 members of the Halton sequence in 3 dimensions.
      num_results = 1000
      dim = 3
      sample, params = random.halton.sample(
          dim, num_results=num_results, seed=127
      )
  
      # Evaluate the integral of x_1 * x_2^2 * x_3^3  over the three dimensional
      # hypercube.
      powers = tf.range(1.0, limit=dim + 1)
      integral = tf.reduce_mean(
          input_tensor=tf.reduce_prod(
              input_tensor=sample**powers, axis=-1
          )
      )
      true_value = 1.0 / tf.reduce_prod(input_tensor=powers + 1.0)
  
      # Produces a relative absolute error of 1.7%.
      self.assertAllClose(
          self.evaluate(integral), self.evaluate(true_value), rtol=0.02
      )
  
      # Now skip the first 1000 samples and recompute the integral with the next
      # thousand samples. The sequence_indices argument can be used to do this.
  
      sequence_indices = tf.range(
          start=1000, limit=1000 + num_results, dtype=tf.int32
      )
      sample_leaped, _ = random.halton.sample(
          dim,
          sequence_indices=sequence_indices,
          randomization_params=params,
      )
  
      integral_leaped = tf.reduce_mean(
          input_tensor=tf.reduce_prod(
              input_tensor=sample_leaped**powers, axis=-1
          )
      )
      self.assertAllClose(
          self.evaluate(integral_leaped),
          self.evaluate(true_value),
          rtol=0.05,
      )
  
imports: import numpy
  from six.moves import range
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math import random
label_desc: Use image node_id 6 for calling the HaltonSequenceTest obj's underlying member method code with example usage: obj.test_docstring_example() without return types