code: def load_mni152_gm_mask(resolution=None, threshold=0.2, n_iter=2):
      """Load the MNI152 grey-matter mask.
  
      This function takes the grey-matter MNI152 template and threshold it, in
      order to obtain the corresponding grey-matter mask.
  
      .. versionadded:: 0.8.1
  
      Parameters
      ----------
      resolution: int, default=1
          If resolution is different from 1, the template loaded is first
          re-sampled with the specified resolution.
  
      threshold : float, default=0.2
          Values of the grey-matter MNI152 template above this threshold will be
          included.
  
      n_iter: int, default=2
          Number of repetitions of :term:`dilation<Dilation>`
          and :term:`erosion<Erosion>` steps performed in
          scipy.ndimage.binary_closing function.
  
      Returns
      -------
      gm_mask_img : Nifti1Image, image corresponding to the grey-matter mask.
  
      Notes
      -----
      Refer to load_mni152_gm_template function for more information about the
      MNI152 grey-matter template.
  
      See Also
      --------
      nilearn.datasets.load_mni152_gm_template : for details about version of the
          MNI152 grey-matter template and related.
  
      """
      resolution = resolution or 1
  
      # Load MNI template
      gm_target = load_mni152_gm_template(resolution=resolution)
      gm_target_img = check_niimg(gm_target)
      gm_target_data = get_data(gm_target_img)
  
      gm_target_mask = (gm_target_data > threshold).astype("int8")
  
      gm_target_mask = binary_closing(gm_target_mask, iterations=n_iter)
      gm_mask_img = new_img_like(gm_target_img, gm_target_mask)
  
      return gm_mask_img
  
imports: import functools
  import os
  import warnings
  from pathlib import Path
  import numpy
  import pandas
  from scipy.ndimage import binary_closing
  from sklearn.utils import Bunch
  from .._utils import check_niimg, fill_doc
  from ..image import get_data, new_img_like, resampling
  from ._utils import fetch_files, get_dataset_descr, get_dataset_dir
label_desc: Use image node_id 6 for calling a global function with example usage: load_mni152_gm_mask(resolution, threshold, n_iter) and returns: gm_mask_img