def METHOD_NAME(ip):
    """
    Test if a given IP address is allowed or not
    based on the DISALLOWED_IPS rules.
    """
    if not DISALLOWED_IPS:
        return True
    ip_address = ipaddress.ip_address(force_str(ip, strings_only=True))
    for ip_network in DISALLOWED_IPS:
        if ip_address in ip_network:
            return False
    return True