code: def test_plot_threshold_for_uint8(affine_eye, plot_func):
      """Mask was applied in [-threshold, threshold] which is problematic
      for uint8 data. See https://github.com/nilearn/nilearn/issues/611
      for more details.
      """
      data = 10 * np.ones((10, 10, 10), dtype="uint8")
      # Having a zero minimum value is important to reproduce
      # https://github.com/nilearn/nilearn/issues/762
      if plot_func == plot_stat_map:
          data[0, 0, 0] = 0
      else:
          data[0, 0] = 0
      img = Nifti1Image(data, affine_eye)
      threshold = np.array(5, dtype="uint8")
      kwargs = {"threshold": threshold, "display_mode": "z"}
      if plot_func == plot_stat_map:
          kwargs["bg_img"] = None
          kwargs["cut_coords"] = [0]
      display = plot_func(img, colorbar=True, **kwargs)
      # Next two lines retrieve the numpy array from the plot
      ax = list(display.axes.values())[0].ax
      plotted_array = ax.images[0].get_array()
      # Make sure that there is one value masked
      assert plotted_array.mask.sum() == 1
      # Make sure that the value masked is in the corner. Note that the
      # axis orientation seem to be flipped, hence (0, 0) -> (-1, 0)
      assert plotted_array.mask[-1, 0]
      # Save execution time and memory
      plt.close()
  
imports: import matplotlib.pyplot
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn.conftest import _affine_mni
  from nilearn.datasets import load_mni152_template
  from nilearn.image import get_data, reorder_img
  from nilearn.plotting import plot_anat, plot_carpet, plot_epi, plot_glass_brain, plot_img, plot_prob_atlas, plot_roi, plot_stat_map
  from nilearn.plotting.img_plotting import MNI152TEMPLATE
label_desc: Use image node_id 8 for calling a global function with example usage: test_plot_threshold_for_uint8(affine_eye, plot_func) without return types