def in6_isvalid(address):
 try:
  socket.inet_pton(socket.AF_INET6, address)
  return True
 except:
  return False

def in6_isvalid ( address ) : try : socket . inet_pton ( socket . AF_INET6 , address ) return True except : return False
return true if address is a valid ipv6 address string .