def is_valid_gateway(name, ip_addr, **kwargs):
    if isinstance(ip_addr, list):
        return all([
            is_valid_gateway(name, item, **kwargs) for item in ip_addr
        ])
    if not is_valid_ip(ip_addr):
        return False
    ip = netaddr.IPAddress(ip_addr)
    if ip.is_private() or ip.is_public():
        return True
    logging.debug('%s invalid gateway %s', name, ip_addr)
    return False
Retrieve one page of email list
dataset/ETHPy150Open openstack/compass-core/compass/db/validator.py/is_valid_gateway--crossover with--dataset/ETHPy150Open bradfitz/addressbooker/gdata/apps/service.py/AppsService.RetrievePageOfEmailLists