

def increment_flow_control_window(self, increment, stream_id=None):
    '\n        Increment a flow control window, optionally for a single stream. Allows\n        the remote peer to send more data.\n\n        .. versionchanged:: 2.0.0\n           Rejects attempts to increment the flow control window by out of\n           range values with a ``ValueError``.\n\n        :param increment: The amount ot increment the flow control window by.\n        :type increment: ``int``\n        :param stream_id: (optional) The ID of the stream that should have its\n            flow control window opened. If not present or ``None``, the\n            connection flow control window will be opened instead.\n        :type stream_id: ``int`` or ``None``\n        :returns: Nothing\n        :raises: ``ValueError``\n        '
    if (not (1 <= increment <= self.MAX_WINDOW_INCREMENT)):
        raise ValueError(('Flow control increment must be between 1 and %d' % self.MAX_WINDOW_INCREMENT))
    self.state_machine.process_input(ConnectionInputs.SEND_WINDOW_UPDATE)
    if (stream_id is not None):
        stream = self.streams[stream_id]
        frames = stream.increase_flow_control_window(increment)
        stream.inbound_flow_control_window = guard_increment_window(stream.inbound_flow_control_window, increment)
    else:
        f = WindowUpdateFrame(0)
        f.window_increment = increment
        self.inbound_flow_control_window = guard_increment_window(self.inbound_flow_control_window, increment)
        frames = [f]
    self._prepare_for_sending(frames)

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