code: def test_eval_metric(self):
      with tf.Graph().as_default():
          scores = [[1.0, 3.0, 2.0], [1.0, 2.0, 3.0], [3.0, 1.0, 2.0]]
          labels = [[0.0, 0.0, 1.0], [0.0, 1.0, 2.0], [0.0, 1.0, 0.0]]
          weights = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]
          gain_fn = lambda rel: rel
          rank_discount_fn = lambda rank: 1.0 / rank
          self._check_metrics(
              [
                  (
                      metrics_lib.mean_reciprocal_rank(labels, scores),
                      metrics_lib.eval_metric(
                          metric_fn=metrics_lib.mean_reciprocal_rank,
                          labels=labels,
                          predictions=scores,
                      ),
                  ),
                  (
                      metrics_lib.mean_reciprocal_rank(
                          labels, scores, topn=1
                      ),
                      metrics_lib.eval_metric(
                          metric_fn=metrics_lib.mean_reciprocal_rank,
                          labels=labels,
                          predictions=scores,
                          topn=1,
                      ),
                  ),
                  (
                      metrics_lib.mean_reciprocal_rank(
                          labels, scores, weights
                      ),
                      metrics_lib.eval_metric(
                          metric_fn=metrics_lib.mean_reciprocal_rank,
                          labels=labels,
                          predictions=scores,
                          weights=weights,
                      ),
                  ),
                  (
                      metrics_lib.discounted_cumulative_gain(
                          labels,
                          scores,
                          gain_fn=gain_fn,
                          rank_discount_fn=rank_discount_fn,
                      ),
                      metrics_lib.eval_metric(
                          metric_fn=metrics_lib.discounted_cumulative_gain,
                          labels=labels,
                          predictions=scores,
                          gain_fn=gain_fn,
                          rank_discount_fn=rank_discount_fn,
                      ),
                  ),
              ]
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import math
  import tensorflow
  from tensorflow_ranking.python import metrics
label_desc: Use image node_id 16 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_eval_metric() without return types