code: def test__extrapolate_out_mask():
      # Input data:
      initial_data = np.zeros((5, 5, 5))
      initial_data[1, 2, 2] = 1
      initial_data[2, 1, 2] = 2
      initial_data[2, 2, 1] = 3
      initial_data[3, 2, 2] = 4
      initial_data[2, 3, 2] = 5
      initial_data[2, 2, 3] = 6
      initial_mask = initial_data.copy() != 0
  
      # Expected result
      target_data = np.array(
          [
              [
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 1.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
              ],
              [
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 1.5, 0.0, 0.0],
                  [0.0, 2.0, 1.0, 3.5, 0.0],
                  [0.0, 0.0, 3.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
              ],
              [
                  [0.0, 0.0, 2.0, 0.0, 0.0],
                  [0.0, 2.5, 2.0, 4.0, 0.0],
                  [3.0, 3.0, 3.5, 6.0, 6.0],
                  [0.0, 4.0, 5.0, 5.5, 0.0],
                  [0.0, 0.0, 5.0, 0.0, 0.0],
              ],
              [
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 3.0, 0.0, 0.0],
                  [0.0, 3.5, 4.0, 5.0, 0.0],
                  [0.0, 0.0, 4.5, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
              ],
              [
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 4.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0, 0.0, 0.0],
              ],
          ]
      )
      target_mask = np.array(
          [
              [
                  [False, False, False, False, False],
                  [False, False, False, False, False],
                  [False, False, True, False, False],
                  [False, False, False, False, False],
                  [False, False, False, False, False],
              ],
              [
                  [False, False, False, False, False],
                  [False, False, True, False, False],
                  [False, True, True, True, False],
                  [False, False, True, False, False],
                  [False, False, False, False, False],
              ],
              [
                  [False, False, True, False, False],
                  [False, True, True, True, False],
                  [True, True, True, True, True],
                  [False, True, True, True, False],
                  [False, False, True, False, False],
              ],
              [
                  [False, False, False, False, False],
                  [False, False, True, False, False],
                  [False, True, True, True, False],
                  [False, False, True, False, False],
                  [False, False, False, False, False],
              ],
              [
                  [False, False, False, False, False],
                  [False, False, False, False, False],
                  [False, False, True, False, False],
                  [False, False, False, False, False],
                  [False, False, False, False, False],
              ],
          ]
      )
  
      # Test:
      extrapolated_data, extrapolated_mask = extrapolate_out_mask(
          initial_data, initial_mask, iterations=1
      )
      assert_array_equal(extrapolated_data, target_data)
      assert_array_equal(extrapolated_mask, target_mask)
  
imports: import warnings
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_array_equal
  from sklearn.preprocessing import StandardScaler
  from nilearn import masking
  from nilearn._utils import data_gen
  from nilearn._utils.exceptions import DimensionError
  from nilearn._utils.testing import write_imgs_to_path
  from nilearn.conftest import _rng
  from nilearn.image import get_data, high_variance_confounds
  from nilearn.maskers import NiftiMasker
  from nilearn.masking import _MaskWarning, _unmask_3d, _unmask_4d, compute_background_mask, compute_brain_mask, compute_epi_mask, compute_multi_brain_mask, compute_multi_epi_mask, extrapolate_out_mask, intersect_masks, unmask, unmask_from_to_3d_array
label_desc: Use image node_id 18 for calling a global function with example usage: test__extrapolate_out_mask() without return types