code: def test_dB_computation():
      """Test dB computation in plot methods (gh 11091)."""
      ampl = 2.0
      data = np.full((3, 2, 3), ampl**2)  # already power
      complex_data = np.full(
          (3, 2, 3), ampl + 0j
      )  # ampl → power when plotting
      times = np.array([0.1, 0.2, 0.3])
      freqs = np.array([0.10, 0.20])
      info = mne.create_info(
          ["MEG 001", "MEG 002", "MEG 003"],
          1000.0,
          ["mag", "mag", "mag"],
      )
      kwargs = dict(
          times=times,
          freqs=freqs,
          nave=20,
          comment="test",
          method="crazy-tfr",
      )
      tfr = AverageTFR(info, data=data, **kwargs)
      complex_tfr = AverageTFR(info, data=complex_data, **kwargs)
      plot_kwargs = dict(dB=True, combine="mean", vmin=0, vmax=7)
      fig1 = tfr.plot(**plot_kwargs)[0]
      fig2 = complex_tfr.plot(**plot_kwargs)[0]
      # since we're fixing vmin/vmax, equal colors should mean ~equal input data
      quadmesh1 = fig1.axes[0].collections[0]
      quadmesh2 = fig2.axes[0].collections[0]
      if hasattr(quadmesh1, "_mapped_colors"):  # fails on compat/old
          assert_array_equal(
              quadmesh1._mapped_colors, quadmesh2._mapped_colors
          )
  
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 10 for calling a global function with example usage: test_dB_computation() without return types