code: def test_dcg_nan():
      "NANs should be 0"
      assert _dcg(np.array([np.nan, 0.5])) == approx(0.5)
  
imports: import numpy
  import pandas
  from pytest import approx, mark
  from lenskit.metrics.topn import _dcg, dcg, ndcg, _bulk_ndcg
  from lenskit.topn import RecListAnalysis
  from lenskit.util.test import demo_recs
label_desc: Use image node_id 8 for calling a global function with example usage: test_dcg_nan() without return types