code: def testFilterItemsByKey(self):
      r = reservoir.Reservoir(100, seed=0)
      for i in range(10):
          r.AddItem("key1", i)
          r.AddItem("key2", i)
  
      self.assertEqual(len(r.Items("key1")), 10)
      self.assertEqual(len(r.Items("key2")), 10)
  
      self.assertEqual(r.FilterItems(lambda x: x <= 7, "key2"), 2)
      self.assertEqual(len(r.Items("key2")), 8)
      self.assertEqual(len(r.Items("key1")), 10)
  
      self.assertEqual(r.FilterItems(lambda x: x <= 3, "key1"), 6)
      self.assertEqual(len(r.Items("key1")), 4)
      self.assertEqual(len(r.Items("key2")), 8)
  
imports: import tensorflow
  from tensorboard.backend.event_processing import reservoir
label_desc: Use image node_id 8 for calling the ReservoirTest obj's underlying member method code with example usage: obj.testFilterItemsByKey() without return types