code: def test_make_average_relevance_position_fn(self):
      with tf.Graph().as_default():
          scores = [[1.0, 3.0, 2.0], [1.0, 2.0, 3.0]]
          labels = [[0.0, 0.0, 1.0], [0.0, 1.0, 2.0]]
          weights = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
          weights_feature_name = "weights"
          features = {weights_feature_name: weights}
          m = metrics_lib.make_ranking_metric_fn(
              metrics_lib.RankingMetricKey.ARP
          )
          m_w = metrics_lib.make_ranking_metric_fn(
              metrics_lib.RankingMetricKey.ARP,
              weights_feature_name=weights_feature_name,
          )
          self._check_metrics(
              [
                  (m([labels[0]], [scores[0]], features), 2.0),
                  (
                      m(labels, scores, features),
                      (1.0 * 2.0 + 2.0 * 1.0 + 1.0 * 2.0) / 4.0,
                  ),
                  (
                      m_w(labels, scores, features),
                      (
                          3.0 * 1.0 * 2.0
                          + 6.0 * 2.0 * 1.0
                          + 5 * 1.0 * 2.0
                      )
                      / (3.0 + 12.0 + 5.0),
                  ),
              ]
          )
  
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 6 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_make_average_relevance_position_fn() without return types