Function generator.

    Args:
        white_list (dict): dict with PREFIXES and CONSTANTS keys (list values).

    Returns:
        func: a function to check if a URL is...

def url_is(white_list):
    """
    Function generator.

    Args:
        white_list (dict): dict with PREFIXES and CONSTANTS keys (list values).

    Returns:
        func: a function to check if a URL is...
    """
    def func(url):
        prefixes = white_list.get('PREFIXES', ())
        for prefix in prefixes:
            if url.startswith(prefix):
                return True
        constants = white_list.get('CONSTANTS', ())
        for exact_url in constants:
            if url == exact_url:
                return True
        return False
    return func