code: def make_loss_metric_fn(
      loss_key, weights_feature_name=None, lambda_weight=None, name=None
  ):
      """Creates a metric based on a loss.
  
      Args:
        loss_key: A key in `RankingLossKey`.
        weights_feature_name: A `string` specifying the name of the weights feature
          in `features` dict.
        lambda_weight: A `_LambdaWeight` object.
        name: A `string` used as the name for this metric.
  
      Returns:
        A metric fn with the following Args:
        * `labels`: A `Tensor` of the same shape as `predictions` representing
        graded relevance.
        * `predictions`: A `Tensor` with shape [batch_size, list_size]. Each value
        is the ranking score of the corresponding example.
        * `features`: A dict of `Tensor`s that contains all features.
      """
  
      return _LossMetricFunctionMaker(
          loss_key, weights_feature_name, lambda_weight, name
      ).make()
  
imports: from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
  import tensorflow
  from tensorflow_ranking.python import losses_impl
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 2 for calling a global function with example usage: make_loss_metric_fn(loss_key, weights_feature_name, lambda_weight, name) and returns: _LossMetricFunctionMaker