def get_ip(self, access='<STR_LIT>', addr_family=None, strict=None):
if addr_family not in ['<STR_LIT>', '<STR_LIT>', None]:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if access not in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.populate()<EOL><DEDENT>ip_addrs = [<EOL>ip_addr for ip_addr in self.ip_addresses<EOL>if ip_addr.access == access<EOL>]<EOL>preferred_family = addr_family if addr_family else '<STR_LIT>'<EOL>for ip_addr in ip_addrs:<EOL><INDENT>if ip_addr.family == preferred_family:<EOL><INDENT>return ip_addr.address<EOL><DEDENT><DEDENT>return ip_addrs[<NUM_LIT:0>].address if ip_addrs and not addr_family else None<EOL>
Return the server's IP address.

Params:
- addr_family: IPv4, IPv6 or None. None prefers IPv4 but will
               return IPv6 if IPv4 addr was not available.
- access: 'public' or 'private'