code: def test_write_and_read(self, matrix):
      with test_utils.tmp_dir() as directory:
          path = os.path.join(directory, "matrix.mat")
          smallnorb_builder.write_binary_matrix(path, matrix)
          restored_matrix = smallnorb_tfds.read_binary_matrix(path)
          np.testing.assert_allclose(restored_matrix, matrix)
  
file_path: datasets/tensorflow_datasets/testing/fake_data_generation/smallnorb_test.py
imports: import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_datasets.datasets.smallnorb import smallnorb_dataset_builder
  from tensorflow_datasets.testing import test_utils
  from tensorflow_datasets.testing.fake_data_generation import smallnorb
label_desc: Use image node_id 1 for calling the SmallnorbTest obj's underlying member method code with example usage: obj.test_write_and_read(matrix) without return types