async def send_data(<EOL>self,<EOL>stream_id: int,<EOL>data: bytes,<EOL>end_stream: bool = False,<EOL>):
if self.closed:<EOL><INDENT>raise ConnectionClosedError<EOL><DEDENT>stream = self._get_stream(stream_id)<EOL>if stream.closed:<EOL><INDENT>raise StreamClosedError(stream_id)<EOL><DEDENT>remaining = data<EOL>while len(remaining) > <NUM_LIT:0>:<EOL><INDENT>await asyncio.gather(<EOL>self._writable.wait(),<EOL>self._window_open(stream.id),<EOL>)<EOL>remaining_size = len(remaining)<EOL>window_size = self._h2.local_flow_control_window(stream.id)<EOL>max_frame_size = self._h2.max_outbound_frame_size<EOL>send_size = min(remaining_size, window_size, max_frame_size)<EOL>if send_size == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>logger.debug(<EOL>f'<STR_LIT>'<EOL>f'<STR_LIT>'<EOL>)<EOL>to_send = remaining[:send_size]<EOL>remaining = remaining[send_size:]<EOL>end = (end_stream is True and len(remaining) == <NUM_LIT:0>)<EOL>self._h2.send_data(stream.id, to_send, end_stream=end)<EOL>self._flush()<EOL>if self._h2.local_flow_control_window(stream.id) == <NUM_LIT:0>:<EOL><INDENT>stream.window_open.clear()<EOL><DEDENT><DEDENT>
Send data, respecting the receiver's flow control instructions. If
        the provided data is larger than the connection's maximum outbound
        frame size, it will be broken into several frames as appropriate.