code: def _spect_func(epoch, func, freq_sl, average, *, output="power"):
      """Aux function."""
      # Decide if we should split this to save memory or not, since doing
      # multiple calls will incur some performance overhead. Eventually we might
      # want to write (really, go back to) our own spectrogram implementation
      # that, if possible, averages after each transform, but this will incur
      # a lot of overhead because of the many Python calls required.
      kwargs = dict(func=func, average=average, freq_sl=freq_sl)
      if epoch.nbytes > 10e6:
          spect = np.apply_along_axis(
              _decomp_aggregate_mask, -1, epoch, **kwargs
          )
      else:
          spect = _decomp_aggregate_mask(epoch, **kwargs)
      return spect
  
file_path: mne-python/mne/time_frequency/psd.py
imports: from functools import partial
  import numpy
  from scipy.signal import spectrogram
  from ..parallel import parallel_func
  from ..utils import _check_option, _ensure_int, logger, verbose
label_desc: Use image node_id 3 for calling a global function with example usage: _spect_func(epoch, func, freq_sl, average) and returns: spect