def number_of_compliance_plugins_per_result(report_host, compliance_result):
    """
    Function returns number of all compliance plugins reported during scan for given compliance result for given target.
    :param report_host: report host element
    :param compliance_result:
        'PASSED'
        'FAILED'
        'WARNING'
    :return:  number of compliance plugins for given compliance result
    """
    compliance_counter = 0
    for report_item in report_host.findall('ReportItem'):
        compliance = report_item.find('cm:compliance-result', namespaces={
            'cm': 'http://www.nessus.org/cm'})
        if compliance is not None:
            if compliance.text == compliance_result:
                compliance_counter += 1
    return compliance_counter
