code: async def wait_stream(aiterable):
      
      async with streamcontext(aiterable) as streamer:
          async for item in streamer:
              item
          try:
              return item
          except NameError:
              raise StreamEmpty()
docs: Wait for an asynchronous iterable to finish and return the last item.
  
      The iterable is executed within a safe stream context.
      A StreamEmpty exception is raised if the sequence is empty.