@secure_function
def mask(scope, ips, mask):
    """
    Applies the given IP mask (e.g. 255.255.255.0) to the given IP address
    (or list of IP addresses) and returns it.