def METHOD_NAME(qres, ibs=None, gt_aids=None):
    """
    gets average percision using the PASCAL definition
    FIXME: Use only the groundtruth that could have been matched in the
    database. (shouldn't be an issue until we start using daid subsets)
    References:
        http://en.wikipedia.org/wiki/Information_retrieval
    """
    recall_range_, p_interp_curve = get_interpolated_precision_vs_recall_(
        qres, ibs=ibs, gt_aids=gt_aids
    )
    if recall_range_ is None:
        ave_p = np.nan
    else:
        ave_p = p_interp_curve.sum() / p_interp_curve.size
    return ave_p