def is_rule_exists_violation(rule, policies, exact_match=True):
    """Checks if the rule is the same as one of the policies.

    Args:
      rule (FirweallRule): A FirewallRule.
      policies (list): A list of FirewallRule that must have the rule.
      exact_match (bool): Whether to match the rule exactly.

    Returns:
      bool: If the required rule is in the policies.
    """
    if exact_match:
        result = []
        for policy in policies:
            if policy == rule:
                result.append(True)
            else:
                result.append(False)
        final_result = not any(result)
        return final_result
    result = []
    for policy in policies:
        if policy.is_equilvalent(rule):
            result.append(True)
        else:
            result.append(False)
    final_result = not any(result)
    return final_result