def is_rfc1918_ip(ip):
 if isinstance(ip, basestring):
  ip = _ip_to_number(ip)
 for (net, mask) in _nets:
  if ((ip & mask) == net):
   return True
 return False

def is_rfc1918_ip ( ip ) : if isinstance ( ip , basestring ) : ip = _ip_to_number ( ip ) for ( net , mask ) in _nets : if ( ( ip & mask ) == net ) : return True return False
checks if the given ip address is a rfc1918 one .