code: def test_ndcg_setup(self):
      wiki_rel = sps.lil_matrix(np.array([3, 2, 3, 0, 1, 2]))
      wiki_rank = np.array([1, 2, 3, 4, 5, 6])
  
      # at 10
      rel, k_mask, ror, ror_at_k = _setup_ndcg(wiki_rank, wiki_rel)
  
      self.assertIsNotNone(rel)
      self.assertEqual(
          len(k_mask), 5
      )  # all non-zero elements in relevance where rank <= k
      self.assertEqual(len(k_mask), len(ror_at_k))
      ror_cnt = sum(
          [v[0] == v[1] for v in zip(ror.data, [1, 2, 3, 5, 6])]
      )
      self.assertEqual(ror_cnt, len(k_mask))
  
file_path: tensorrec/test/test_eval.py
imports: from unittest import TestCase
  from numpy.random import shuffle
  import numpy
  import scipy.sparse
  from tensorrec import TensorRec
  from tensorrec.eval import recall_at_k, precision_at_k, f1_score_at_k, ndcg_at_k
  from tensorrec.eval import _setup_ndcg, _idcg, _dcg
  from tensorrec.util import generate_dummy_data_with_indicator
label_desc: Use image node_id 7 for calling the EvalTestCase obj's underlying member method code with example usage: obj.test_ndcg_setup() without return types