<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def comments_nb_counts():
 """Get number of comments for the record `recid`."""

    recid = request.view_args.get('recid')

    if recid is None:
        return
    elif recid == 0:
        return 0
    else:
        return CmtRECORDCOMMENT.count(*[
            CmtRECORDCOMMENT.id_bibrec == recid,
            CmtRECORDCOMMENT.star_score == 0,
            CmtRECORDCOMMENT.status.notin_(['dm', 'da'])
        ])