code: def _get_permutations(num_results, dims, seed):
      """Uniform iid sample from the space of permutations.
  
      Draws a sample of size `num_results` from the group of permutations of degrees
      specified by the `dims` tensor. These are packed together into one tensor
      such that each row is one sample from each of the dimensions in `dims`. For
      example, if dims = [2,3] and num_results = 2, the result is a tensor of shape
      [2, 2 + 3] and the first row of the result might look like:
      [1, 0, 2, 0, 1]. The first two elements are a permutation over 2 elements
      while the next three are a permutation over 3 elements.
  
      Args:
        num_results: A positive scalar `Tensor` of integer type. The number of
          draws from the discrete uniform distribution over the permutation groups.
        dims: A 1D `Tensor` of the same dtype as `num_results`. The degree of the
          permutation groups from which to sample.
        seed: (Optional) Python integer to seed the random number generator.
  
      Returns:
        permutations: A `Tensor` of shape `[num_results, sum(dims)]` and the same
        dtype as `dims`.
      """
      sample_range = tf.range(num_results)
  
      def generate_one(d):
          def fn(i):
              if seed is None:
                  return tf.random.shuffle(tf.range(d))
              else:
                  return stateless.stateless_random_shuffle(
                      tf.range(d), seed=(seed + i, d)
                  )
  
          return tf.map_fn(
              fn,
              sample_range,
              parallel_iterations=1 if seed is not None else 10,
          )
  
      return tf.concat(
          [generate_one(d) for d in tf.unstack(dims)], axis=-1
      )
  
file_path: tf-quant-finance/tf_quant_finance/math/random_ops/halton/halton_impl.py
imports: import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math.random_ops import stateless
label_desc: Use image node_id 3 for calling a global function with example usage: _get_permutations(num_results, dims, seed) and returns: tf, tf, tf, stateless