Пример #1
0
def worst_asns(address):
    if not address:
        return None

    _ = addr_to_int(address)
    for prefix, mask, name in WORST_ASNS.get(address.split('.')[0], {}):
        if _ & mask == prefix:
            return name

    return None
Пример #2
0
def worst_asns(address):
    if not address:
        return None

    _ = addr_to_int(address)
    for prefix, mask, name in WORST_ASNS.get(address.split('.')[0], {}):
        if _ & mask == prefix:
            return name

    return None
Пример #3
0
def worst_asns(address):
    if not address:
        return None

    try:
        _ = addr_to_int(address)
        for prefix, mask, name in WORST_ASNS.get(address.split('.')[0], {}):
            if _ & mask == prefix:
                return name
    except (IndexError, ValueError):
        pass

    return None
Пример #4
0
def worst_asns(address):
    if not address:
        return None

    try:
        _ = addr_to_int(address)
        for prefix, mask, name in WORST_ASNS.get(address.split('.')[0], {}):
            if _ & mask == prefix:
                return name
    except (IndexError, ValueError):
        pass

    return None