code: def design_with_nan_durations():
      durations = _durations()
      durations[2] = np.nan
      durations[5] = np.nan
      durations[8] = np.nan
      events = pd.DataFrame(
          {
              "trial_type": _conditions(),
              "onset": _onsets(),
              "duration": durations,
          }
      )
      return events
  
file_path: nilearn/nilearn/glm/tests/_testing.py
imports: import numpy
  import pandas
  from nilearn.conftest import _rng
label_desc: Use image node_id 9 for calling a global function with example usage: design_with_nan_durations() and returns: events