code: def test_filter(self):
      mock = MagicMock()
      callback = init.WeightInit(
          initialiser=lambda m: m.test(),
          modules=[mock],
          targets=["Mock"],
      )
      callback.on_init({})
      self.assertTrue(mock.test.call_count == 1)
  
      mock = MagicMock()
      callback = init.WeightInit(
          initialiser=lambda m: m.test(),
          modules=[mock],
          targets=["Not"],
      )
      callback.on_init({})
      self.assertTrue(mock.test.call_count == 0)
  
file_path: torchbearer/tests/callbacks/test_init.py
imports: import torch
  from unittest import TestCase
  from mock import MagicMock, patch
  import torchbearer
  import torchbearer.callbacks.init
label_desc: Use image node_id 2 for calling the TestWeightInit obj's underlying member method code with example usage: obj.test_filter() without return types