

def get_next_available_stream_id(self):
    '\n        Returns an integer suitable for use as the stream ID for the next\n        stream created by this endpoint. For server endpoints, this stream ID\n        will be even. For client endpoints, this stream ID will be odd. If no\n        stream IDs are available, raises :class:`NoAvailableStreamIDError\n        <h2.exceptions.NoAvailableStreamIDError>`.\n\n        .. warning:: The return value from this function does not change until\n                     the stream ID has actually been used by sending or pushing\n                     headers on that stream. For that reason, it should be\n                     called as close as possible to the actual use of the\n                     stream ID.\n\n        .. versionadded:: 2.0.0\n\n        :raises: :class:`NoAvailableStreamIDError\n            <h2.exceptions.NoAvailableStreamIDError>`\n        :returns: The next free stream ID this peer can use to initiate a\n            stream.\n        :rtype: ``int``\n        '
    if (not self.highest_outbound_stream_id):
        return (1 if self.client_side else 2)
    next_stream_id = (self.highest_outbound_stream_id + 2)
    if (next_stream_id > self.HIGHEST_ALLOWED_STREAM_ID):
        raise NoAvailableStreamIDError('Exhausted allowed stream IDs')
    return next_stream_id

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection.get_next_available_stream_id/original