#NEWLINE# def is_valid_public_ip( ip_address ) : #NEWLINE# #INDENT# 'Returns whether IP address is both valid AND, per RFC 1918, not reserved as\n    private' #NEWLINE# if ( not is_valid_ip ( ip_address ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# PRIVATE_IPS_PREFIX = ( '10.' , '172.16.' , '172.17.' , '172.18.' , '172.19.' , '172.20.' , '172.21.' , '172.22.' , '172.23.' , '172.24.' , '172.25.' , '172.26.' , '172.27.' , '172.28.' , '172.29.' , '172.30.' , '172.31.' , '192.168.' , '127.' ) #NEWLINE# return ( not ip_address . startswith ( ip_address ) )