code: def _fixed_dcg(n, discount=np.log2):
      ranks = np.arange(1, n + 1)
      disc = discount(ranks)
      disc = np.maximum(disc, 1)
      disc = np.reciprocal(disc)
      return np.sum(disc)
  
file_path: lkpy/lenskit/metrics/topn.py
imports: import logging
  import warnings
  import numpy
  import pandas
label_desc: Use image node_id 11 for calling a global function with example usage: _fixed_dcg(n, discount) and returns: np