<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_regressor(exp_condition, hrf_model, frame_times, con_id='cond', oversampling=50, fir_delays=None, min_onset=-24):
 """ This is the main function to convolve regressors with hrf model Parameters exp_condition : array-like of shape (3, n_events) yields description of events for this condition as a (onsets, durations, amplitudes) triplet hrf_model : {'spm', 'spm + derivative', 'spm + derivative + dispersion', 'glover', 'glover + derivative', 'fir', None} Name of the hrf model to be used frame_times : array of shape (n_scans) the desired sampling times con_id : string optional identifier of the condition oversampling : int, optional oversampling factor to perform the convolution fir_delays : 1D-array-like, optional delays (in seconds) used in case of a finite impulse reponse model min_onset : float, optional minimal onset relative to frame_times[0] (in seconds) events that start before frame_times[0] + min_onset are not considered Returns ------- computed_regressors: array of shape(n_scans, n_reg) computed regressors sampled at frame times reg_names: list of strings corresponding regressor names Notes ----- The different hemodynamic models can be understood as follows: 'spm': this is the hrf model used in SPM 'spm + derivative': SPM model plus its time derivative (2 regressors) 'spm + time + dispersion': idem, plus dispersion derivative (3 regressors) 'glover': this one corresponds to the Glover hrf 'glover + derivative': the Glover hrf + time derivative (2 regressors) 'glover + derivative + dispersion': idem + dispersion derivative (3 regressors) 'fir': finite impulse response basis, a set of delayed dirac models with arbitrary length. This one currently assumes regularly spaced frame times (i.e. fixed time of repetition). It is expected that spm standard and Glover model would not yield large differences in most cases. In case of glover and spm models, the derived regressors are orthogonalized wrt the main one. """

    # this is the average tr in this session, not necessarily the true tr
    tr = float(frame_times.max()) / (np.size(frame_times) - 1)

    # 1. create the high temporal resolution regressor
    hr_regressor, hr_frame_times = _sample_condition(
        exp_condition, frame_times, oversampling, min_onset)

    # 2. create the  hrf model(s)
    hkernel = _hrf_kernel(hrf_model, tr, oversampling, fir_delays)

    # 3. convolve the regressor and hrf, and downsample the regressor
    conv_reg = np.array([np.convolve(hr_regressor, h)[:hr_regressor.size]
                         for h in hkernel])

    # 4. temporally resample the regressors
    computed_regressors = _resample_regressor(
        conv_reg, hr_frame_times, frame_times)

    # 5. ortogonalize the regressors
    if hrf_model != 'fir':
        computed_regressors = _orthogonalize(computed_regressors)

    # 6 generate regressor names
    reg_names = _regressor_names(con_id, hrf_model, fir_delays=fir_delays)
    return computed_regressors, reg_names