# Path: aiobotocore/eventstream.py
# class AioEventStream(EventStream):
#     async def _create_raw_event_generator(self):
#         event_stream_buffer = EventStreamBuffer()
#         async for chunk, _ in self._raw_stream.iter_chunks():
#             event_stream_buffer.add_data(chunk)
#             for event in event_stream_buffer:
#                 yield event
# 
#     def __iter__(self):
#         raise NotImplementedError('Use async-for instead')
# 
#     def __aiter__(self):
#         return self.__anext__()
# 
#     async def __anext__(self):
#         async for event in self._event_generator:
#             parsed_event = self._parse_event(event)
#             if parsed_event:
#                 yield parsed_event
# 
#     async def get_initial_response(self):
#         try:
#             async for event in self._event_generator:
#                 event_type = event.headers.get(':event-type')
#                 if event_type == 'initial-response':
#                     return event
# 
#                 break
#         except StopIteration:
#             pass
#         raise NoInitialResponseError()


import asyncio
import pytest
import botocore.parsers
import aiobotocore.session
from contextlib import AsyncExitStack
from aiobotocore.eventstream import AioEventStream
                   .output_shape.members['Payload'])
    parser = botocore.parsers.EventStreamXMLParser()
    sr = FakeStreamReader(TEST_STREAM_DATA)

    event_stream = AioEventStream(
        sr,
        outputshape,
        parser,
        operation_name
    )

    with pytest.raises(NotImplementedError):
        for _ in event_stream:
            pass


@pytest.mark.asyncio
async def test_kinesis_stream_json_parser(exit_stack: AsyncExitStack):
    # unfortunately moto doesn't support kinesis register_stream_consumer +
    # subscribe_to_shard yet
    stream_name = "my_stream"
    stream_arn = consumer_arn = None
    consumer_name = 'consumer'

    session = aiobotocore.session.AioSession()

    kinesis_client = await exit_stack.enter_async_context(
        session.create_client('kinesis'))
    await kinesis_client.create_stream(StreamName=stream_name, ShardCount=1)


# Path: aiobotocore/eventstream.py
# class AioEventStream(EventStream):
#     async def _create_raw_event_generator(self):
#         event_stream_buffer = EventStreamBuffer()
#         async for chunk, _ in self._raw_stream.iter_chunks():
#             event_stream_buffer.add_data(chunk)
#             for event in event_stream_buffer:
#                 yield event
# 
#     def __iter__(self):
#         raise NotImplementedError('Use async-for instead')
# 
#     def __aiter__(self):
#         return self.__anext__()
# 
#     async def __anext__(self):
#         async for event in self._event_generator:
#             parsed_event = self._parse_event(event)
#             if parsed_event:
#                 yield parsed_event
# 
#     async def get_initial_response(self):
#         try:
#             async for event in self._event_generator:
#                 event_type = event.headers.get(':event-type')
#                 if event_type == 'initial-response':
#                     return event
# 
#                 break
#         except StopIteration:
#             pass
#         raise NoInitialResponseError()


# Path: tests/test_eventstreams.py
import asyncio
import pytest
import botocore.parsers
import aiobotocore.session
from contextlib import AsyncExitStack
from aiobotocore.eventstream import AioEventStream

                   .output_shape.members['Payload'])
    parser = botocore.parsers.EventStreamXMLParser()
    sr = FakeStreamReader(TEST_STREAM_DATA)

    event_stream = AioEventStream(
        sr,
        outputshape,
        parser,
        operation_name
    )

    with pytest.raises(NotImplementedError):
        for _ in event_stream:
            pass


@pytest.mark.asyncio
async def test_kinesis_stream_json_parser(exit_stack: AsyncExitStack):
    # unfortunately moto doesn't support kinesis register_stream_consumer +
    # subscribe_to_shard yet
    stream_name = "my_stream"
    stream_arn = consumer_arn = None
    consumer_name = 'consumer'

    session = aiobotocore.session.AioSession()

    kinesis_client = await exit_stack.enter_async_context(
        session.create_client('kinesis'))
    await kinesis_client.create_stream(StreamName=stream_name, ShardCount=1)


    while (describe_response := (await kinesis_client.describe_stream(