def is_github_ip(ip_str):
    if isinstance(ip_str, bytes):
        ip_str = ip_str.decode()

    ip = ipaddress.ip_address(ip_str)
    if ip.version == 6 and ip.ipv4_mapped:
        ip = ip.ipv4_mapped

    for block in load_github_hooks():
        if ip in ipaddress.ip_network(block):
            return True
    return False
Tests IpInList() with an IPv6 IP.
dataset/ETHPy150Open nickfrostatx/flask-hookserver/flask_hookserver.py/is_github_ip--crossover with--dataset/ETHPy150Open google/simian/src/tests/simian/mac/models/base_test.py/KeyValueCacheTest.testIpInListWhenIpv6