code: def test_sort_by_scores_2d(self):
      scores = [[1.0, 3.0, 2.0], [1.0, 2.0, 3.0]]
      positions = [[1, 2, 3], [4, 5, 6]]
      names = [["a", "b", "c"], ["d", "e", "f"]]
      sorted_positions, sorted_names = utils.sort_by_scores(
          scores, [positions, names]
      )
      self.assertAllEqual(sorted_positions, [[2, 3, 1], [6, 5, 4]])
      self.assertAllEqual(
          sorted_names, [[b"b", b"c", b"a"], [b"f", b"e", b"d"]]
      )
  
      sorted_positions, sorted_names = utils.sort_by_scores(
          scores, [positions, names], topn=2
      )
      self.assertAllEqual(sorted_positions, [[2, 3], [6, 5]])
      self.assertAllEqual(sorted_names, [[b"b", b"c"], [b"f", b"e"]])
  
      sorted_positions, sorted_names = utils.sort_by_scores(
          [scores[0]], [[positions[0]], [names[0]]]
      )
      self.assertAllEqual(sorted_positions, [[2, 3, 1]])
      self.assertAllEqual(sorted_names, [[b"b", b"c", b"a"]])
  
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 4 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_sort_by_scores_2d() without return types