code: def _sample_condition(
      exp_condition, frame_times, oversampling=50, min_onset=-24
  ):
      """Make a possibly oversampled event regressor from condition information.
  
      Parameters
      ----------
      exp_condition : arraylike of shape (3, n_events)
          yields description of events for this condition as a
          (onsets, durations, amplitudes) triplet
  
      frame_times : array of shape(n_scans)
          Sample time points.
  
      oversampling : int, default=50
          Factor for oversampling event regressor.
  
      min_onset : float, default=-24
          Minimal onset relative to frame_times[0] (in seconds)
          events that start before frame_times[0] + min_onset are not considered.
  
      Returns
      -------
      regressor : array of shape(over_sampling * n_scans)
          Possibly oversampled event regressor.
  
      frame_times_high_res : array of shape(over_sampling * n_scans)
          Time points used for regressor sampling.
  
      """
      # Find the high-resolution frame_times
      n_frames = frame_times.size
      min_onset = float(min_onset)
      n_frames_high_res = _compute_n_frames_high_res(
          frame_times, min_onset, oversampling
      )
  
      frame_times_high_res = np.linspace(
          frame_times.min() + min_onset,
          frame_times.max() * (1 + 1.0 / (n_frames - 1)),
          np.rint(n_frames_high_res).astype(int),
      )
  
      # Get the condition information
      onsets, durations, values = tuple(
          map(np.asanyarray, exp_condition)
      )
      if (onsets < frame_times[0] + min_onset).any():
          warnings.warn(
              (
                  "Some stimulus onsets are earlier "
                  f"than {frame_times[0] + min_onset} in the"
                  " experiment and are thus not considered in the model."
              ),
              UserWarning,
          )
  
      # Set up the regressor timecourse
      tmax = len(frame_times_high_res)
      regressor = np.zeros_like(frame_times_high_res).astype(np.float64)
      t_onset = np.minimum(
          np.searchsorted(frame_times_high_res, onsets), tmax - 1
      )
      for t, v in zip(t_onset, values):
          regressor[t] += v
      t_offset = np.minimum(
          np.searchsorted(frame_times_high_res, onsets + durations),
          tmax - 1,
      )
  
      # Handle the case where duration is 0 by offsetting at t + 1
      for i, t in enumerate(t_offset):
          if t < (tmax - 1) and t == t_onset[i]:
              t_offset[i] += 1
  
      for t, v in zip(t_offset, values):
          regressor[t] -= v
      regressor = np.cumsum(regressor)
  
      return regressor, frame_times_high_res
  
imports: import warnings
  from collections.abc import Iterable
  import numpy
  from scipy.stats import gamma
  from nilearn._utils import fill_doc
label_desc: Use image node_id 11 for calling a global function with example usage: _sample_condition(exp_condition, frame_times, oversampling, min_onset) and returns: regressor,  frame_times_high_res