code: def test_modules_from_state(self):
      callback = init.WeightInit(targets=["Mock"])
      model = MagicMock()
      state = {torchbearer.MODEL: model}
      callback.on_init(state)
      self.assertTrue(model.modules.call_count == 1)
  
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 1 for calling the TestWeightInit obj's underlying member method code with example usage: obj.test_modules_from_state() without return types