code: def compute_multi_brain_mask(
      target_imgs,
      threshold=0.5,
      connected=True,
      opening=2,
      memory=None,
      verbose=0,
      n_jobs=1,
      mask_type="whole-brain",
      **kwargs,
  ):
      """Compute the whole-brain, grey-matter or white-matter mask \
      for a list of images.
  
      The mask is calculated through the resampling of the corresponding
      MNI152 template mask onto the target image.
  
      .. versionadded:: 0.8.1
  
      Parameters
      ----------
      target_imgs : :obj:`list` of Niimg-like object
          See :ref:`extracting_data`.
          Images used to compute the mask. 3D and 4D images are accepted.
  
          .. note::
              The images in this list must be of same shape and affine.
              The mask is calculated with the first element of the list
              for only the shape/affine of the image is used for this
              masking strategy.
  
      threshold : :obj:`float`, default=0.5
          The value under which the :term:`MNI` template is cut off.
      %(connected)s
          Default=True.
      %(opening)s
          Default=2.
      %(mask_type)s
      %(memory)s
      %(verbose0)s
      %(n_jobs)s
  
          .. note::
              Argument not used but kept to fit the API
  
      **kwargs : optional arguments
          Arguments such as 'target_affine' are used in the call of other
          masking strategies, which then would raise an error for this function
          which does not need such arguments.
  
      Returns
      -------
      mask : :class:`nibabel.nifti1.Nifti1Image`
          The brain mask (3D image).
  
      See Also
      --------
      nilearn.masking.compute_brain_mask
      """
      if len(target_imgs) == 0:
          raise TypeError(
              f"An empty object - {target_imgs:r} - was passed instead of an "
              "image or a list of images"
          )
  
      # Check images in the list have the same FOV without loading them in memory
      imgs_generator = _utils.check_niimg(
          target_imgs, return_iterator=True
      )
      for _ in imgs_generator:
          pass
  
      mask = compute_brain_mask(
          target_imgs[0],
          threshold=threshold,
          connected=connected,
          opening=opening,
          memory=memory,
          verbose=verbose,
          mask_type=mask_type,
      )
      return mask
  
imports: import numbers
  import warnings
  import numpy
  from joblib import Parallel, delayed
  from scipy.ndimage import binary_dilation, binary_erosion
  from .None import _utils
  from ._utils import fill_doc
  from ._utils.cache_mixin import cache
  from ._utils.ndimage import get_border_data, largest_connected_component
  from ._utils.niimg import safe_get_data
  from .datasets import load_mni152_gm_template, load_mni152_template, load_mni152_wm_template
  from .image import get_data, new_img_like, resampling
label_desc: Use image node_id 10 for calling a global function with example usage: compute_multi_brain_mask(target_imgs, threshold, connected, opening, memory, verbose, n_jobs, mask_type) and returns: mask