def _from_proto_num(n):
    if n is None:
        return None
    if n == socket.IPPROTO_TCP:
        return 'tcp'
    elif n == socket.IPPROTO_UDP:
        return 'udp'
    else:
        assert False, 'unknown proto num %d' % n
dataset/ETHPy150Open facebook/gnlpy/ipvs.py/_from_proto_num/original