code: def test_compare_design_matrix_to_spm(block_duration, array):
      # Check that the nilearn design matrix is close enough to the SPM one
      # (it cannot be identical, because the hrf shape is different)
      events, frame_times = spm_paradigm(block_duration=block_duration)
      X1 = make_first_level_design_matrix(
          frame_times, events, drift_model=None
      )
      _, matrix, _ = check_design_matrix(X1)
  
      spm_design_matrix = DESIGN_MATRIX[array]
  
      assert ((spm_design_matrix - matrix) ** 2).sum() / (
          spm_design_matrix**2
      ).sum() < 0.1
  
imports: from os import path
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from nilearn._utils.data_gen import basic_paradigm
  from nilearn.glm.first_level.design_matrix import _convolve_regressors, check_design_matrix, create_cosine_drift, make_first_level_design_matrix, make_second_level_design_matrix
  from ._testing import block_paradigm, design_with_negative_onsets, modulated_block_paradigm, modulated_event_paradigm, spm_paradigm
label_desc: Use image node_id 23 for calling a global function with example usage: test_compare_design_matrix_to_spm(block_duration, array) without return types