code: def test_show_event_plot(tmp_path):
      # test that the show code indeed (formally) runs
      onset = np.linspace(0, 19.0, 20)
      duration = np.full(20, 0.5)
      trial_idx = np.arange(20)
      # This makes 11 events in order to test cmap error
      trial_idx[11:] -= 10
      condition_ids = [
          "a",
          "b",
          "c",
          "d",
          "e",
          "f",
          "g",
          "h",
          "i",
          "j",
          "k",
      ]
  
      trial_type = np.array([condition_ids[i] for i in trial_idx])
  
      model_event = pd.DataFrame(
          {
              "onset": onset,
              "duration": duration,
              "trial_type": trial_type,
          }
      )
      # Test Dataframe
      fig = plot_event(model_event)
      assert fig is not None
  
      # Test List
      fig = plot_event([model_event, model_event])
      assert fig is not None
  
      # Test error
      with pytest.raises(ValueError):
          fig = plot_event(model_event, cmap="tab10")
  
      # Test save
      fig = plot_event(model_event, output_file=tmp_path / "event.png")
      assert (tmp_path / "event.png").exists()
      assert fig is None
      plot_event(model_event, output_file=tmp_path / "event.pdf")
      assert (tmp_path / "event.pdf").exists()
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn.glm.first_level.design_matrix import make_first_level_design_matrix
  from nilearn.glm.tests._testing import design_with_null_durations
  from nilearn.plotting.matrix_plotting import pad_contrast_matrix, plot_contrast_matrix, plot_design_matrix, plot_event, plot_matrix
label_desc: Use image node_id 17 for calling a global function with example usage: test_show_event_plot(tmp_path) without return types