code: def test_mask_stat_map():
      # Generate simple simulated data with one "spot"
      img, data = _simulate_img()
  
      # Try not to threshold anything
      mask_img, img, data_t, thresh = html_stat_map._mask_stat_map(
          img, threshold=None
      )
      assert np.max(get_data(mask_img)) == 0
  
      # Now threshold at zero
      mask_img, img, data_t, thresh = html_stat_map._mask_stat_map(
          img, threshold=0
      )
      assert np.min((data == 0) == get_data(mask_img))
  
imports: import base64
  import warnings
  from io import BytesIO
  import numpy
  import pytest
  from matplotlib import pyplot
  from nibabel import Nifti1Image
  from nilearn import datasets, image
  from nilearn.image import get_data, new_img_like
  from nilearn.plotting import html_stat_map
  from ..js_plotting_utils import colorscale
label_desc: Use image node_id 8 for calling a global function with example usage: test_mask_stat_map() without return types