code: def mock_fusion_history():
      def wrapper(impl):
          def new_impl(self):
              target = "cupy._core._fusion_trace.TraceImpl"
              with mock.patch(target, CreateMock(target)) as m:
                  numpy_result = impl(self, numpy, m)
              with mock.patch(target, CreateMock(target)) as m:
                  cupy_result = impl(self, cupy, m)
              testing.assert_array_list_equal(numpy_result, cupy_result)
  
          return new_impl
  
      return wrapper
  
file_path: cupy/tests/cupy_tests/core_tests/fusion_tests/test_kernel_cache.py
imports: import unittest
  from unittest import mock
  import numpy
  import cupy
  from cupy import testing
label_desc: Use image node_id 1 for calling a global function with example usage: mock_fusion_history() and returns: wrapper, new_impl