def valid_ip_address(addr): if not netaddr.valid_ipv4(addr) and not netaddr.valid_ipv6(addr): return False return True