code: def test_oversampling(n_frames):
      events = basic_paradigm()
      frame_times = np.linspace(0, n_frames - 1, n_frames)
      X1 = make_first_level_design_matrix(
          frame_times, events, drift_model=None
      )
      X2 = make_first_level_design_matrix(
          frame_times, events, drift_model=None, oversampling=50
      )
      X3 = make_first_level_design_matrix(
          frame_times, events, drift_model=None, oversampling=10
      )
  
      # oversampling = 50 by default so X2 = X1, X3 \neq X1, X3 close to X2
      assert_almost_equal(X1.values, X2.values)
      assert_almost_equal(X2.values, X3.values, 0)
      assert (
          np.linalg.norm(X2.values - X3.values)
          / np.linalg.norm(X2.values)
          > 1.0e-4
      )
  
      # fir model, oversampling is forced to 1
      X4 = make_first_level_design_matrix(
          frame_times,
          events,
          hrf_model="fir",
          drift_model=None,
          fir_delays=range(4),
          oversampling=1,
      )
      X5 = make_first_level_design_matrix(
          frame_times,
          events,
          hrf_model="fir",
          drift_model=None,
          fir_delays=range(4),
          oversampling=10,
      )
      assert_almost_equal(X4.values, X5.values)
  
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 20 for calling a global function with example usage: test_oversampling(n_frames) without return types