code: def test_multi_pca_score_single_subject_nb_components(mask_img):
      """Score is one for n_components == n_sample \
      in single subject configuration"""
      data, _, _, _ = _make_multi_pca_test_data(with_activation=False)
      multi_pca = _MultiPCA(
          mask=mask_img, random_state=0, memory_level=0, n_components=5
      )
      multi_pca.fit(data[0])
      s = multi_pca.score(data[0])
  
      assert_almost_equal(s, 1.0, 1)
  
      # Per component score
      multi_pca = _MultiPCA(
          mask=mask_img, random_state=0, memory_level=0, n_components=5
      )
      multi_pca.fit(data[0])
      masker = NiftiMasker(mask_img).fit()
      s = multi_pca._raw_score(
          masker.transform(data[0]), per_component=True
      )
  
      assert s.shape == (5,)
      assert np.all(s <= 1)
      assert np.all(s >= 0)
  
imports: import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal
  from nilearn._utils.testing import write_imgs_to_path
  from nilearn.conftest import _affine_eye, _rng
  from nilearn.decomposition._multi_pca import _MultiPCA
  from nilearn.maskers import MultiNiftiMasker, NiftiMasker
label_desc: Use image node_id 15 for calling a global function with example usage: test_multi_pca_score_single_subject_nb_components(mask_img) without return types