code: def test_read_write_tfrecords(self, filename):
      protos, path = self.write_test_protos(filename)
  
      # Create our generator of records from read_tfrecords.
      reader = tfrecord.read_tfrecords(path, reference_pb2.ContigInfo)
  
      # Make sure it's actually a generator.
      self.assertEqual(type(reader), types.GeneratorType)
  
      # Check the round-trip contents.
      if "@" in filename:
          # Sharded outputs are striped across shards, so order isn't preserved.
          self.assertCountEqual(protos, reader)
      else:
          self.assertEqual(protos, list(reader))
  
file_path: deepvariant/third_party/nucleus/io/tfrecord_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import types
  from absl.testing import absltest
  from absl.testing import parameterized
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import reference_pb2
  from third_party.nucleus.testing import test_utils
label_desc: Use image node_id 2 for calling the IOTest obj's underlying member method code with example usage: obj.test_read_write_tfrecords(filename) without return types