code: def test_async_writer_write_once(self):
      foldername = os.path.join(
          self.get_temp_dir(), "async_writer_write_once"
      )
      w = _AsyncWriter(foldername)
      filename = w._ev_writer._file_name
      bytes_to_write = b"hello world"
      w.add_event(bytes_to_write)
      w.close()
      with open(filename, "rb") as f:
          self.assertEqual(f.read(), bytes_to_write)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import glob
  import os
  from tensorboardX.event_file_writer import EventFileWriter
  from tensorboardX.event_file_writer import EventFileWriter
  from tensorboardX.proto import event_pb2
  from tensorboardX.proto.summary_pb2 import Summary
  from tensorboard.compat.tensorflow_stub.pywrap_tensorflow import PyRecordReader_New
  import unittest
label_desc: Use image node_id 2 for calling the AsyncWriterTest obj's underlying member method code with example usage: obj.test_async_writer_write_once() without return types