

def reset_stream(self, stream_id, error_code=0):
    '\n        Reset a stream.\n\n        This method forcibly closes a stream by sending a RST_STREAM frame for\n        a given stream. This is not a graceful closure. To gracefully end a\n        stream, try the :meth:`end_stream\n        <h2.connection.H2Connection.end_stream>` method.\n\n        :param stream_id: The ID of the stream to reset.\n        :type stream_id: ``int``\n        :param error_code: (optional) The error code to use to reset the\n            stream. Defaults to :data:`NO_ERROR <h2.errors.NO_ERROR>`.\n        :type error_code: ``int``\n        :returns: Nothing\n        '
    self.state_machine.process_input(ConnectionInputs.SEND_RST_STREAM)
    stream = self._get_stream_by_id(stream_id)
    frames = stream.reset_stream(error_code)
    self._prepare_for_sending(frames)
    self._reset_streams.add(stream_id)
    del self.streams[stream_id]

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