def looks_like_ip(maybe_ip):
    if not maybe_ip[0].isdigit():
        return False

    try:
        socket.inet_aton(maybe_ip)
        return True
    except (AttributeError, UnicodeError):
        if IP_RE.match(maybe_ip):
            return True
    except socket.error:
        return False
Set the mask of aggregates that will actually be returned by the SELECT
dataset/ETHPy150Open john-kurkowski/tldextract/tldextract/remote.py/looks_like_ip--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/query.py/Query.set_aggregate_mask