code: def test_metrics(self):
      dcg = DCGSlateMetric()
      ndcg = NDCGSlateMetric(
          SlateItemValues([1.0, 2.5, 2.0, 3.0, 1.5, 0.0])
      )
      item_rewards = SlateItemValues([2.0, 1.0, 0.0, 3.0, 1.5, 2.5])
      slate = Slate([SlateItem(1), SlateItem(3), SlateItem(2)])
      reward = dcg(slate.slots, slate.slot_values(item_rewards))
      self.assertAlmostEqual(reward, 5.416508275)
      reward = ndcg(slate.slots, slate.slot_values(item_rewards))
      self.assertAlmostEqual(reward, 0.473547669)
      slate = Slate([SlateItem(5), SlateItem(0), SlateItem(4)])
      reward = dcg(slate.slots, slate.slot_values(item_rewards))
      self.assertAlmostEqual(reward, 7.463857073)
      reward = ndcg(slate.slots, slate.slot_values(item_rewards))
      self.assertAlmostEqual(reward, 0.652540703)
  
file_path: ReAgent/reagent/ope/test/unit_tests/test_slate_estimators.py
imports: import random
  import unittest
  import torch
  from reagent.ope.estimators.slate_estimators import DCGSlateMetric, NDCGSlateMetric, Slate, SlateItem, SlateItemProbabilities, SlateItemValues, SlateSlotItemProbabilities, SlateSlots
label_desc: Use image node_id 4 for calling the TestEstimator obj's underlying member method code with example usage: obj.test_metrics() without return types