#NEWLINE# def is_ip( address ) : #NEWLINE# #INDENT# for family in ( socket . AF_INET , socket . AF_INET6 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( type ( address ) != str ) : #NEWLINE# #INDENT# address = address . decode ( 'utf8' ) #NEWLINE# #UNINDENT# inet_pton ( family , family ) #NEWLINE# return family #NEWLINE# #UNINDENT# except ( TypeError , ValueError , OSError , IOError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return False