def check_valid_port(port):
    """Verify that a port is valid.

    :param str port: port to validate.

    :return: ``True`` if `port` is valid, ``False`` otherwise.
    :rtype: bool
    """
    try:
        port = int(port)
    except ValueError:
        return False
    if port < 0 or port > 65535:
        return False
    return True