code: def test_sort_by_scores_3d(self):
      scores = [[1.0, 3.0, 2.0], [1.0, 2.0, 3.0]]
      example_feature = [
          [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]],
          [[10.0, 20.0, 30.0], [40.0, 50.0, 60.0], [70.0, 80.0, 90.0]],
      ]
  
      sorted_example_feature = utils.sort_by_scores(
          scores, [example_feature]
      )[0]
      self.assertAllEqual(
          sorted_example_feature,
          [
              [[4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [1.0, 2.0, 3.0]],
              [
                  [70.0, 80.0, 90.0],
                  [40.0, 50.0, 60.0],
                  [10.0, 20.0, 30.0],
              ],
          ],
      )
  
      sorted_example_feature = utils.sort_by_scores(
          scores, [example_feature], topn=2
      )[0]
      self.assertAllEqual(
          sorted_example_feature,
          [
              [[4.0, 5.0, 6.0], [7.0, 8.0, 9.0]],
              [[70.0, 80.0, 90.0], [40.0, 50.0, 60.0]],
          ],
      )
  
      sorted_example_feature = utils.sort_by_scores(
          [scores[0]], [[example_feature[0]]]
      )[0]
      self.assertAllEqual(
          sorted_example_feature,
          [[[4.0, 5.0, 6.0], [7.0, 8.0, 9.0], [1.0, 2.0, 3.0]]],
      )
  
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 5 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_sort_by_scores_3d() without return types