

def send_data(self, stream_id, data, end_stream=False):
    '\n        Send data on a given stream.\n\n        This method does no breaking up of data: if the data is larger than the\n        value returned by :meth:`local_flow_control_window\n        <h2.connection.H2Connection.local_flow_control_window>` for this stream\n        then a :class:`FlowControlError <h2.exceptions.FlowControlError>` will\n        be raised. If the data is larger than :data:`max_outbound_frame_size\n        <h2.connection.H2Connection.max_outbound_frame_size>` then a\n        :class:`FrameTooLargeError <h2.exceptions.FrameTooLargeError>` will be\n        raised.\n\n        Hyper-h2 does this to avoid buffering the data internally. If the user\n        has more data to send than hyper-h2 will allow, consider breaking it up\n        and buffering it externally.\n\n        :param stream_id: The ID of the stream on which to send the data.\n        :type stream_id: ``int``\n        :param data: The data to send on the stream.\n        :type data: ``bytes``\n        :param end_stream: (optional) Whether this is the last data to be sent\n            on the stream. Defaults to ``False``.\n        :type end_stream: ``bool``\n        :returns: Nothing\n        '
    if (len(frames) > self.local_flow_control_window(stream_id)):
        raise FlowControlError(('Cannot send %d bytes, flow control window is %d.' % (len(data), self.local_flow_control_window(stream_id))))
    elif (len(data) > self.max_outbound_frame_size):
        raise FrameTooLargeError(('Cannot send frame size %d, max frame size is %d' % (len(data), self.max_outbound_frame_size)))
    self.state_machine.process_input(ConnectionInputs.SEND_DATA)
    frames = self.streams[stream_id].send_data(data, end_stream)
    self._prepare_for_sending(frames)
    self.outbound_flow_control_window -= len(data)
    assert (self.outbound_flow_control_window >= 0)

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection.send_data/VarMisuse@24/470 `data`->`frames`