code: def test_padded_nd_indices(self):
      tf.random.set_seed(1)
      # batch_size, list_size = 2, 3.
      is_valid = [[True, True, True], [True, True, False]]
      # Disable shuffling.
      indices, mask = utils.padded_nd_indices(is_valid, shuffle=False)
  
      # shape = [2, 3, 2] = [batch_size, list_size, 2].
      self.assertAllEqual(
          indices,
          [  # batch_size = 2.
              [[0, 0], [0, 1], [0, 2]],  # list_size = 3.
              [[1, 0], [1, 1], [1, 0]],  # list_size = 3.
          ],
      )
      # shape = [2, 3] = [batch_size, list_size]
      self.assertAllEqual(
          mask, [[True, True, True], [True, True, False]]
      )
  
      # Enable shuffling.
      indices, mask = utils.padded_nd_indices(
          is_valid, shuffle=True, seed=87124
      )
  
      # shape = [2, 3, 2] = [batch_size, list_size, 2].
      self.assertAllEqual(
          indices,
          [  # batch_size = 2.
              [[0, 0], [0, 1], [0, 2]],  # list_size = 3.
              [[1, 1], [1, 0], [1, 1]],  # list_size = 3
          ],
      )
      # shape = [2, 3] = [batch_size, list_size]
      self.assertAllEqual(
          mask, [[True, True, True], [True, True, False]]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import tensorflow
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 15 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_padded_nd_indices() without return types