code: def blocking_writer(writer, output):
      
      result_type = None
      while True:
          ion_event = (yield result_type)
          for result_event in _drain(writer, ion_event):
              output.write(result_event.data)
          result_type = result_event.type
docs: Provides an implementation of using the writer co-routine with a file-like object.
  
      Args:
          writer (Coroutine): A writer co-routine.
          output (BaseIO): The file-like object to pipe events to.
  
      Yields:
          WriteEventType: Yields when no events are pending.
  
          Receives :class:`amazon.ion.core.IonEvent` to write to the ``output``.