code: def _get_indices(num_results, sequence_indices, dtype, name=None):
      """Generates starting points for the Halton sequence procedure.
  
      The k'th element of the sequence is generated starting from a positive integer
      which must be distinct for each `k`. It is conventional to choose the starting
      point as `k` itself (or `k+1` if k is zero based). This function generates
      the starting integers for the required elements and reshapes the result for
      later use.
  
      Args:
        num_results: Positive scalar `Tensor` of dtype int32. The number of samples
          to generate. If this parameter is supplied, then `sequence_indices`
          should be None.
        sequence_indices: `Tensor` of dtype int32 and rank 1. The entries
          index into the Halton sequence starting with 0 and hence, must be whole
          numbers. For example, sequence_indices=[0, 5, 6] will produce the first,
          sixth and seventh elements of the sequence. If this parameter is not None
          then `n` must be None.
        dtype: The dtype of the sample. One of `float32` or `float64`.
          Default is `float32`.
        name: Python `str` name which describes ops created by this function.
  
      Returns:
        indices: `Tensor` of dtype `dtype` and shape = `[n, 1, 1]`.
      """
      with tf.name_scope(name or "get_indices"):
          if sequence_indices is None:
              np_dtype = dtype_util.as_numpy_dtype(dtype)
              num_results_ = tf.get_static_value(num_results)
              if num_results_ is not None:
                  sequence_indices = ps.range(
                      np_dtype(num_results_), dtype=dtype
                  )
              else:
                  num_results = tf.cast(num_results, dtype=dtype)
                  sequence_indices = ps.range(num_results, dtype=dtype)
          else:
              sequence_indices = tf.cast(sequence_indices, dtype)
  
          # Shift the indices so they are 1 based.
          indices = sequence_indices + 1
  
          # Reshape to make space for the event dimension and the place value
          # coefficients.
          return tf.reshape(indices, [-1, 1, 1])
  
file_path: probability/tensorflow_probability/python/mcmc/sample_halton_sequence_lib.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 4 for calling a global function with example usage: _get_indices(num_results, sequence_indices, dtype, name) and returns: tf