def is_trusted_ip(request):
 ip_addr = get_real_ip(request)
 return (ip_addr and any(((ip_addr in trusted_network) for trusted_network in request.app[KEY_TRUSTED_NETWORKS])))

def is_trusted_ip ( request ) : ip_addr = get_real_ip ( request ) return ( ip_addr and any ( ( ( ip_addr in trusted_network ) for trusted_network in request . app [ KEY_TRUSTED_NETWORKS ] ) ) )
test if request is from a trusted ip .