code: def test_standardization(rng):
      data_shape = (9, 9, 5)
      n_samples = 500
  
      signals = rng.standard_normal(
          size=(np.prod(data_shape), n_samples)
      )
      means = (
          rng.standard_normal(size=(np.prod(data_shape), 1)) * 50 + 1000
      )
      signals += means
      img = nibabel.Nifti1Image(
          signals.reshape(data_shape + (n_samples,)),
          np.eye(4),
      )
  
      mask = nibabel.Nifti1Image(np.ones(data_shape), np.eye(4))
  
      # z-score
      masker = NiftiMasker(mask, standardize="zscore_sample")
      trans_signals = masker.fit_transform(img)
  
      np.testing.assert_almost_equal(trans_signals.mean(0), 0)
      np.testing.assert_almost_equal(trans_signals.std(0), 1, decimal=3)
  
      # psc
      masker = NiftiMasker(mask, standardize="psc")
      trans_signals = masker.fit_transform(img)
  
      np.testing.assert_almost_equal(trans_signals.mean(0), 0)
      np.testing.assert_almost_equal(
          trans_signals,
          (signals / signals.mean(1)[:, np.newaxis] * 100 - 100).T,
      )
  
imports: import os
  import shutil
  import warnings
  from tempfile import mkdtemp
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn._utils import data_gen, exceptions, testing
  from nilearn._utils.class_inspect import get_params
  from nilearn.image import get_data, index_img
  from nilearn.maskers import NiftiMasker
  from nilearn.maskers.nifti_masker import _filter_and_mask
label_desc: Use image node_id 24 for calling a global function with example usage: test_standardization(rng) without return types