def is_ip_addr(ip):
 try:
  socket.inet_aton(ip)
  return ip
 except:
  raise ArgumentTypeError(('%r is not an IP address!' % ip))

def is_ip_addr ( ip ) : try : socket . inet_aton ( ip ) return ip except : raise ArgumentTypeError ( ( '%r is not an IP address!' % ip ) )
check that the supplied value is an internet protocol address .