def looks_like_ip(maybe_ip):
    """Does the given str look like an IP address?"""
    if not maybe_ip[0].isdigit():
        return False

    try:
        socket.inet_aton(maybe_ip)
        return True
    except (__HOLE__, UnicodeError):
        if IP_RE.match(maybe_ip):
            return True
    except socket.error:
        return False
dataset/ETHPy150Open john-kurkowski/tldextract/tldextract/remote.py/looks_like_ip