code: def mock_wrapper(method):
      mock = MagicMock()
  
      def wrapper(self, *args, **kwargs):
          mock(*args, **kwargs)
          return method(self, *args, **kwargs)
  
      wrapper.mock = mock
      return wrapper
  
file_path: pytorch/test/test_module_init.py
imports: import inspect
  import torch
  from unittest import mock
  from unittest.mock import MagicMock, patch
  from torch.testing._internal.common_dtype import floating_types
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes
  from torch.testing._internal.common_quantization import skipIfNoFBGEMM
  from torch.testing._internal.common_utils import TestCase, run_tests
label_desc: Use image node_id 3 for calling a global function with example usage: mock_wrapper(method) and returns: wrapper, method