def _get_stream_by_id(self, stream_id):
        try:
            return self.streams[stream_id]
        except KeyError:
            outbound = self._stream_id_is_outbound(stream_id)
            highest_stream_id = (
                self.highest_outbound_stream_id if outbound else
                self.highest_inbound_stream_id
            )

            if stream_id > highest_stream_id:
                raise NoSuchStreamError(stream_id)
            else:
                raise StreamClosedError(stream_id)
Gets a stream by its stream ID. Raises NoSuchStreamError if the stream
dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py/H2Connection._get_stream_by_id