code: def test_confounds_standardization():
      # Tests for confounds standardization
      # See Issue #2584
      # Code from @pbellec
      #
      eps = 10e-10
  
      # Signal is not standardized
      # Explicit standardization of confounds
      assert (
          _confounds_regression(
              standardize_signal=False, standardize_confounds=True
          )
          < 10.0 * eps
      )
  
      # Signal is z-scored with string arg
      # Explicit standardization of confounds
      assert (
          _confounds_regression(
              standardize_signal="zscore_sample",
              standardize_confounds=True,
          )
          < eps
      )
  
      # Signal is psc standardized
      # Explicit standardization of confounds
      assert (
          _confounds_regression(
              standardize_signal="psc", standardize_confounds=True
          )
          < 10.0 * eps
      )
  
      # Signal is not standardized
      # Confounds are not standardized
      # In this case, the regression should fail...
      assert (
          _confounds_regression(
              standardize_signal=False, standardize_confounds=False
          )
          > 100
      )
  
      # Signal is z-scored with string arg
      # Confounds are not standardized
      # In this case, the regression should fail...
      assert (
          _confounds_regression(
              standardize_signal="zscore_sample",
              standardize_confounds=False,
          )
          > 100
      )
  
      # Signal is psc standardized
      # Confounds are not standardized
      # In this case, the regression should fail...
      assert (
          _confounds_regression(
              standardize_signal="psc", standardize_confounds=False
          )
          > 100
      )
  
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 5 for calling a global function with example usage: test_confounds_standardization() without return types