code: def run_write_read_test(
      self,
      file,
      serializer,
      w_args,
      w_kwargs,
      r_args,
      r_kwargs,
      error_msg,
  ):
      try:
          delete_file_if_exists(file)
  
          ds_expected = SeededFakeDataFlow()
          serializer.save(ds_expected, file, *w_args, **w_kwargs)
          ds_actual = serializer.load(file, *r_args, **r_kwargs)
  
          ds_actual.reset_state()
          ds_expected.reset_state()
  
          for dp_expected, dp_actual in zip(
              ds_expected.__iter__(), ds_actual.__iter__()
          ):
              self.assertEqual(dp_expected[0], dp_actual[0])
              self.assertTrue(np.allclose(dp_expected[1], dp_actual[1]))
      except ImportError:
          print(error_msg)
  
file_path: tensorpack/tensorpack/dataflow/serialize_test.py
imports: import tempfile
  import numpy
  import os
  import unittest
  from tensorpack.dataflow import HDF5Serializer, LMDBSerializer, NumpySerializer, TFRecordSerializer
  from tensorpack.dataflow.base import DataFlow
label_desc: Use image node_id 1 for calling the SerializerTest obj's underlying member method code with example usage: obj.run_write_read_test(file, serializer, w_args, w_kwargs, r_args, r_kwargs, error_msg) without return types