def validate_port(confvar):
  port_val = confvar.get()
  error_res = [(confvar, 'Port should be an integer between 0 and 65535 (inclusive).')]
  try:
    port = int(port_val)
    if port < 0 or port > 65535:
      return error_res
  except ValueError:
    return error_res
  return [ ]
Validate that the value of confvar is between [0, 65535].
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/lib/conf.py/validate_port