code: def generate_fake_fmri_data_and_design(
      shapes, rk=3, affine=np.eye(4), random_state=0
  ):
      """Generate random :term:`fMRI` time series \
      and design matrices of given shapes.
  
      Parameters
      ----------
      shapes : :obj:`list` of length-4 :obj:`tuple`s of :obj:`int`
          Shapes of the fmri data to be generated.
  
      rk : :obj:`int`, default=3
          Number of columns in the design matrix to be generated.
  
      affine : :obj:`numpy.ndarray`, default=np.eye(4)
          Affine of returned images. Must be a 4x4 array.
  
      random_state : :obj:`int` or :obj:`numpy.random.RandomState` instance, \
                     default=0
          Random number generator, or seed.
  
      Returns
      -------
      mask : Niimg-like object
          3D mask giving non-zero voxels.
  
      fmri_data : :obj:`list`
          A 4D volume represented by a list of 3D Niimg-like objects.
  
      design_matrices : :obj:`list`
          A list of pd.DataFrame
  
      """
      fmri_data = []
      design_matrices = []
      rand_gen = np.random.default_rng(random_state)
      for i, shape in enumerate(shapes):
          data = rand_gen.standard_normal(shape)
          data[1:-1, 1:-1, 1:-1] += 100
          fmri_data.append(Nifti1Image(data, affine))
          columns = rand_gen.choice(
              list(string.ascii_lowercase), size=rk, replace=False
          )
          design_matrices.append(
              pd.DataFrame(
                  rand_gen.standard_normal((shape[3], rk)),
                  columns=columns,
              )
          )
      mask = Nifti1Image(
          (rand_gen.random(shape[:3]) > 0.5).astype(np.int8), affine
      )
      return mask, fmri_data, design_matrices
  
imports: from __future__ import annotations
  import itertools
  import json
  import string
  from pathlib import Path
  import numpy
  import pandas
  import scipy.linalg
  import scipy.signal
  from nibabel import Nifti1Image
  from scipy.ndimage import binary_dilation
  from nilearn import datasets, image, maskers, masking
  from nilearn._utils import as_ndarray, logger
  from nilearn.interfaces.bids.utils import bids_entities, check_bids_label, create_bids_filename
  from nilearn.interfaces.fmriprep.tests._testing import get_legal_confound
label_desc: Use image node_id 7 for calling a global function with example usage: generate_fake_fmri_data_and_design(shapes, rk, affine, random_state) and returns: mask,  fmri_data,  design_matrices