def validate_port(port):
     if not port:
         return False
     port = port.strip()
     if port.isdigit() and int(port) > 0 and int(port) < 65536:
         return port
     return False
Port number format validator
dataset/ETHPy150Open securitykiss-com/rfw/rfw/iputil.py/validate_port