def isport(value):
    """
    Return whether or not given value represents a valid port.
    If the value represents a valid port, this function returns ``True``, otherwise ``False``.

    Examples::

        >>> isport('8080')
        True

        >>> isport('65536')
        False

    :param value: string to validate port
    """
    try:
        return 0 < int(value) < 65536
    except ValueError:
        return False