def lookup(name):
    try:
        ip = netaddr.IPAddress(name)
        return __generator([ip])
    except Exception as e:
        pass

    try:
        subnet = netaddr.IPNetwork(name)
        return __generator(subnet)
    except Exception as e:
        pass

    try:
        glob = netaddr.IPGlob(name)
        return __generator(glob)
    except Exception as e:
        pass

    return None
A PETSc LGMap mapping process-local indices to global
dataset/ETHPy150Open radssh/radssh/radssh/core_plugins/ip.py/lookup--crossover with--dataset/ETHPy150Open OP2/PyOP2/pyop2/petsc_base.py/DataSet.lgmap