code: def test_plot_psd_epochs(epochs):
      """Test plotting epochs psd (+topomap)."""
      spectrum = epochs.compute_psd()
      old_defaults = dict(picks="data", exclude="bads")
      spectrum.plot(
          average=True,
          amplitude=False,
          spatial_colors=False,
          **old_defaults,
      )
      spectrum.plot(
          average=False,
          amplitude=False,
          spatial_colors=True,
          **old_defaults,
      )
      spectrum.plot(
          average=False,
          amplitude=False,
          spatial_colors=False,
          **old_defaults,
      )
      # test plot_psd_topomap errors
      with pytest.raises(RuntimeError, match="No frequencies in band"):
          spectrum.plot_topomap(bands=dict(foo=(0, 0.01)))
      plt.close("all")
      # test defaults
      fig = spectrum.plot_topomap()
      assert (
          len(fig.axes) == 10
      )  # default: 5 bands (δ, θ, α, β, γ) + colorbars
      # test joint vlim
      fig = spectrum.plot_topomap(vlim="joint")
      vmin_0 = fig.axes[0].images[0].norm.vmin
      vmax_0 = fig.axes[0].images[0].norm.vmax
      assert all(
          vmin_0 == ax.images[0].norm.vmin for ax in fig.axes[1:5]
      )
      assert all(
          vmax_0 == ax.images[0].norm.vmax for ax in fig.axes[1:5]
      )
      # test support for single-bin bands and old-style list-of-tuple input
      fig = spectrum.plot_topomap(
          bands=[(20, "20 Hz"), (15, 25, "15-25 Hz")]
      )
      # test with a flat channel
      err_str = "for channel %s" % epochs.ch_names[2]
      epochs.get_data(copy=False)[0, 2, :] = 0
      for dB in [True, False]:
          with pytest.warns(UserWarning, match=err_str):
              epochs.compute_psd().plot(dB=dB)
  
imports: import platform
  import matplotlib.pyplot
  import numpy
  import pytest
  from mne import Epochs, EpochsArray, create_info
  from mne.datasets import testing
  from mne.event import make_fixed_length_events
  from mne.viz import plot_drop_log
label_desc: Use image node_id 15 for calling a global function with example usage: test_plot_psd_epochs(epochs) without return types