def _get_or_create_stream(self, stream_id, allowed_ids):
        """
        Gets a stream by its stream ID. Will create one if one does not already
        exist. Use allowed_ids to circumvent the usual stream ID rules for
        clients and servers.

        .. versionchanged:: 2.0.0
           Removed this function from the public API.
        """
        try:
            return self.streams[stream_id]
        except __HOLE__:
            return self._begin_new_stream(stream_id, allowed_ids)
dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py/H2Connection._get_or_create_stream