code: def spy_decorator(method_to_decorate):
      """Fancy decorator to wrap an object while still calling it.
  
      See https://stackoverflow.com/a/41599695/433202
  
      """
      tmp_mock = mock.MagicMock()
  
      def wrapper(self, *args, **kwargs):
          tmp_mock(*args, **kwargs)
          return method_to_decorate(self, *args, **kwargs)
  
      wrapper.mock = tmp_mock
      return wrapper
  
imports: from contextlib import contextmanager
  from datetime import datetime
  from typing import Any
  from unittest import mock
  import dask.array
  import numpy
  from pyresample import create_area_def
  from pyresample.geometry import BaseDefinition, SwathDefinition
  from xarray import DataArray
  from satpy import Scene
  from satpy.composites import GenericCompositor, IncompatibleAreas
  from satpy.dataset import DataID, DataQuery
  from satpy.dataset.dataid import default_id_keys_config, minimal_default_keys_config
  from satpy.modifiers import ModifierBase
  from satpy.readers.file_handlers import BaseFileHandler
label_desc: Use image node_id 4 for calling a global function with example usage: spy_decorator(method_to_decorate) and returns: wrapper, method_to_decorate