code: def test_design_matrix_regressors_provided_manually(rng, frame_times):
      # test design matrix creation when regressors are provided manually
      ax = rng.standard_normal(size=(len(frame_times), 4))
      _, X, names = check_design_matrix(
          make_first_level_design_matrix(
              frame_times,
              drift_model="polynomial",
              drift_order=3,
              add_regs=ax,
          )
      )
      assert_almost_equal(X[:, 0], ax[:, 0])
      assert len(names) == 8
      assert X.shape[1] == 8
  
      # with pandas Dataframe
      axdf = pd.DataFrame(ax)
      _, X1, names = check_design_matrix(
          make_first_level_design_matrix(
              frame_times,
              drift_model="polynomial",
              drift_order=3,
              add_regs=axdf,
          )
      )
      assert_almost_equal(X1[:, 0], ax[:, 0])
      assert_array_equal(names[:4], np.arange(4))
  
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 6 for calling a global function with example usage: test_design_matrix_regressors_provided_manually(rng, frame_times) without return types