def port_type(port):
    try:
        p = int(port)
        if not 1024 < p <= 65536:
            msg = 'The available port numbers are in (1024..65536] range.'
            raise ArgumentTypeError(msg)
        return p
    except ValueError:
        raise '{} is not a valid port'.format(port)
dataset/ETHPy150Open BasicWolf/kaylee/kaylee/manager/commands/run.py/port_type/original