code: def test_save_plot_stat_map(params, img_3d_mni, tmp_path):
      """Test saving figure to file in different ways."""
      filename = tmp_path / "test.png"
      display = plot_stat_map(
          img_3d_mni, output_file=filename, **params
      )
      assert display is None
      display = plot_stat_map(img_3d_mni, **params)
      display.savefig(filename)
      plt.close()
  
imports: import matplotlib.pyplot
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn.conftest import _rng
  from nilearn.datasets import load_mni152_template
  from nilearn.image import get_data
  from nilearn.image.resampling import coord_transform
  from nilearn.plotting import plot_stat_map
  from nilearn.plotting.find_cuts import find_cut_slices
label_desc: Use image node_id 2 for calling a global function with example usage: test_save_plot_stat_map(params, img_3d_mni, tmp_path) without return types