def get_first_comments_or_remarks(recID=-1,
                                  ln=CFG_SITE_LANG,
                                  nb_comments='all',
                                  nb_reviews='all',
                                  voted=-1,
                                  reported=-1,
                                  user_info=None,
                                  show_reviews=False):
    """
    Gets nb number comments/reviews or remarks.
    In the case of comments, will get both comments and reviews
    Comments and remarks sorted by most recent date, reviews sorted by highest helpful score
    :param recID: record id
    :param ln: language
    :param nb_comments: number of comment or remarks to get
    :param nb_reviews: number of reviews or remarks to get
    :param voted: 1 if user has voted for a remark
    :param reported: 1 if user has reported a comment or review
    :return: if comment, tuple (comments, reviews) both being html of first nb comments/reviews
            if remark, tuple (remakrs, None)
    """
    _ = gettext_set_language(ln)
    warnings = []
    voted = wash_url_argument(voted, 'int')
    reported = wash_url_argument(reported, 'int')

    # check recID argument
    if not isinstance(recID, int):
        return ()
    # comment or review. NB: suppressed reference to basket (handled in
    # webbasket)
    if recID >= 1:
        if CFG_WEBCOMMENT_ALLOW_REVIEWS:
            res_reviews = query_retrieve_comments_or_remarks(
                recID=recID,
                display_order="hh",
                ranking=1,
                limit=nb_comments,
                user_info=user_info)
            nb_res_reviews = len(res_reviews)
            # check nb argument
            if isinstance(nb_reviews, int) and nb_reviews < len(res_reviews):
                first_res_reviews = res_reviews[:nb_reviews]
            else:
                first_res_reviews = res_reviews
        if CFG_WEBCOMMENT_ALLOW_COMMENTS:
            res_comments = query_retrieve_comments_or_remarks(
                recID=recID,
                display_order="od",
                ranking=0,
                limit=nb_reviews,
                user_info=user_info)
            nb_res_comments = len(res_comments)
            # check nb argument
            if isinstance(nb_comments, int) and nb_comments < len(
                    res_comments):
                first_res_comments = res_comments[:nb_comments]
            else:
                first_res_comments = res_comments
    else:  # error
        try:
            raise InvenioWebCommentError(
                _('%(recid)s is an invalid record ID', recid=recID))
        except InvenioWebCommentError as exc:
            register_exception()
            body = webcomment_templates.tmpl_error(exc.message, ln)
            return body
        # errors.append(('ERR_WEBCOMMENT_RECID_INVALID', recID)) #!FIXME dont
        # return error anywhere since search page

    # comment
    if recID >= 1:
        comments = reviews = ""
        if reported > 0:
            try:
                raise InvenioWebCommentWarning(
                    _('Your feedback has been recorded, many thanks.'))
            except InvenioWebCommentWarning as exc:
                register_exception(stream='warning')
                warnings.append((exc.message, 'green'))
            # warnings.append(('WRN_WEBCOMMENT_FEEDBACK_RECORDED_GREEN_TEXT',))
        elif reported == 0:
            try:
                raise InvenioWebCommentWarning(
                    _('Your feedback could not be recorded, please try again.'))
            except InvenioWebCommentWarning as exc:
                register_exception(stream='warning')
                warnings.append((exc.message, ''))
            # warnings.append(('WRN_WEBCOMMENT_FEEDBACK_NOT_RECORDED_RED_TEXT',))
        if CFG_WEBCOMMENT_ALLOW_COMMENTS:  # normal comments
            grouped_comments = group_comments_by_round(
                first_res_comments,
                ranking=0)
            comments = webcomment_templates.tmpl_get_first_comments_without_ranking(
                recID,
                ln,
                grouped_comments,
                nb_res_comments,
                warnings)
        if show_reviews:
            if CFG_WEBCOMMENT_ALLOW_REVIEWS:  # ranked comments
                # calculate average score
                avg_score = calculate_avg_score(res_reviews)
                if voted > 0:
                    try:
                        raise InvenioWebCommentWarning(
                            _('Your feedback has been recorded, many thanks.'))
                    except InvenioWebCommentWarning as exc:
                        register_exception(stream='warning')
                        warnings.append((exc.message, 'green'))
                    # warnings.append(('WRN_WEBCOMMENT_FEEDBACK_RECORDED_GREEN_TEXT',))
                elif voted == 0:
                    try:
                        raise InvenioWebCommentWarning(
                            _('Your feedback could not be recorded, please try again.'))
                    except InvenioWebCommentWarning as exc:
                        register_exception(stream='warning')
                        warnings.append((exc.message, ''))
                    # warnings.append(('WRN_WEBCOMMENT_FEEDBACK_NOT_RECORDED_RED_TEXT',))
                grouped_reviews = group_comments_by_round(
                    first_res_reviews,
                    ranking=0)
                reviews = webcomment_templates.tmpl_get_first_comments_with_ranking(
                    recID,
                    ln,
                    grouped_reviews,
                    nb_res_reviews,
                    avg_score,
                    warnings)
        return (comments, reviews)
    # remark
    else:
        return(webcomment_templates.tmpl_get_first_remarks(first_res_comments, ln, nb_res_comments), None)
Gets nb number comments/reviews or remarks.
    In the case of comments, will get both comments and reviews
    Comments and remarks sorted by most recent date, reviews sorted by highest helpful score
    :param recID: record id
    :param ln: language
    :param nb_comments: number of comment or remarks to get
    :param nb_reviews: number of reviews or remarks to get
    :param voted: 1 if user has voted for a remark
    :param reported: 1 if user has reported a comment or review
    :return: if comment, tuple (comments, reviews) both being html of first nb comments/reviews
            if remark, tuple (remakrs, None)