code: def test_compute_tfr_correct(method, decim):
      """Test that TFR actually gets us our freq back."""
      sfreq = 1000.0
      t = np.arange(1000) / sfreq
      f = 50.0
      data = np.sin(2 * np.pi * f * t)
      data *= np.hanning(data.size)
      data = data[np.newaxis, np.newaxis]
      freqs = np.arange(10, 111, 4)
      assert f in freqs
  
      # previous n_cycles=2 gives weird results for multitaper
      n_cycles = freqs * 0.25
      tfr = _compute_tfr(
          data,
          freqs,
          sfreq,
          method=method,
          decim=decim,
          n_cycles=n_cycles,
          output="power",
      )[0, 0]
      assert freqs[np.argmax(tfr.mean(-1))] == f
  
imports: import datetime
  import re
  from itertools import product
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.signal import morlet2
  import mne
  from mne import Epochs, EpochsArray, Info, Transform, create_info, pick_types, read_events
  from mne.io import read_raw_fif
  from mne.tests.test_epochs import assert_metadata_equal
  from mne.time_frequency import tfr_array_morlet, tfr_array_multitaper
  from mne.time_frequency.tfr import AverageTFR, EpochsTFR, _compute_tfr, _make_dpss, combine_tfr, cwt, fwhm, morlet, read_tfrs, tfr_morlet, tfr_multitaper, write_tfrs
  from mne.utils import catch_logging, grand_average
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll
label_desc: Use image node_id 15 for calling a global function with example usage: test_compute_tfr_correct(method, decim) without return types