code: def create_ndcg_lambda_weight(topn=None, smooth_fraction=0.0):
      """Creates _LambdaWeight for NDCG metric."""
      return losses_impl.DCGLambdaWeight(
          topn,
          gain_fn=lambda labels: tf.pow(2.0, labels) - 1.0,
          rank_discount_fn=lambda rank: 1.0 / tf.math.log1p(rank),
          normalized=True,
          smooth_fraction=smooth_fraction,
      )
  
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 3 for calling a global function with example usage: create_ndcg_lambda_weight(topn, smooth_fraction) and returns: losses_impl