<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _eval_wrapper(self, fit_key, q, chiA, chiB, **kwargs):
 """Evaluates the surfinBH7dq2 model. """

        chiA = np.array(chiA)
        chiB = np.array(chiB)

        # Warn/Exit if extrapolating
        allow_extrap = kwargs.pop('allow_extrap', False)
        self._check_param_limits(q, chiA, chiB, allow_extrap)

        omega0 = kwargs.pop('omega0', None)
        PN_approximant = kwargs.pop('PN_approximant', 'SpinTaylorT4')
        PN_dt = kwargs.pop('PN_dt', 0.1)
        PN_spin_order = kwargs.pop('PN_spin_order', 7)
        PN_phase_order = kwargs.pop('PN_phase_order', 7)
        omega_switch = kwargs.pop('omega_switch', 0.018)

        self._check_unused_kwargs(kwargs)

        if omega0 is None:
            # If omega0 is given, assume chiA, chiB are the coorbital frame
            # spins at t=-100 M.
            x = np.concatenate(([q], chiA, chiB))
        else:
            # If omega0 is given, evolve the spins from omega0
            # to t = -100 M from the peak.
            chiA_coorb_fitnode, chiB_coorb_fitnode, quat_fitnode, \
                orbphase_fitnode \
                = self._evolve_spins(q, chiA, chiB, omega0,
                    PN_approximant, PN_dt, PN_spin_order,
                    PN_phase_order, omega_switch)
            # x should contain coorbital frame spins at t=-100M
            x = np.concatenate(([q], chiA_coorb_fitnode, chiB_coorb_fitnode))


        def eval_vector_fit(x, fit_key):
            res = self._evaluate_fits(x, fit_key)
            fit_val = res.T[0]
            fit_err = res.T[1]
            if omega0 is not None:
                # If spins were given in inertial frame at omega0,
                # transform vectors and errors back to the same frame.
                fit_val = utils.transform_vector_coorb_to_inertial(fit_val,
                    orbphase_fitnode, quat_fitnode)
                fit_err = utils.transform_error_coorb_to_inertial(fit_val,
                    fit_err, orbphase_fitnode, quat_fitnode)
            return fit_val, fit_err


        if fit_key == 'mf' or fit_key == 'all':
            mf, mf_err = self._evaluate_fits(x, 'mf')
            if fit_key == 'mf':
                return mf, mf_err

        if fit_key == 'chif' or fit_key == 'all':
            chif, chif_err = eval_vector_fit(x, 'chif')
            if fit_key == 'chif':
                return chif, chif_err

        if fit_key == 'vf' or fit_key == 'all':
            vf, vf_err = eval_vector_fit(x, 'vf')
            if fit_key == 'vf':
                return vf, vf_err

        if fit_key == 'all':
            return mf, chif, vf, mf_err, chif_err, vf_err