def exclude_lan_ips(local_ip):
    """
    Given a candidate that may be a Public IP address, check that it is not
    a LAN IP address.  If it is not a LAN IP address, return the input
    unchanged.  Otherwise return None.

    Parameters
    ----------
    local_ip : unicode or None

    Returns
    -------
    local_ip : unicode or None
    """
    # 2016-05-15 got a result 192.168.0.255, LAN IP instead
    # of public IP.
    if isinstance(local_ip, bytes):
        local_ip = local_ip.decode('utf-8')

    if local_ip is None:
        pass
    elif local_ip.startswith('192.168.'):
        # This is an address on the local LAN
        local_ip = None
    elif local_ip in ['10.0.0.0', '8.8.8.8']:
        # 10.0 is another LAN address I think
        # 8.8.8.8 is Google DNS server, which was incorrectly
        # returned 2018-05-28 for reasons unknown
        local_ip = None
    else:
        pass
    return local_ip