code: def read_tfrecords(
      path, proto=None, max_records=None, compression_type=None
  ):
      """Yields the parsed records in a TFRecord file path.
  
      Note that path can be sharded filespec (path@N) in which case this function
      will read each shard in order; i.e. shard 0 will read each entry in order,
      then shard 1, ...
  
      Args:
        path: String. A path to a TFRecord file containing protos.
        proto: A proto class. proto.FromString() will be called on each serialized
          record in path to parse it.
        max_records: int >= 0 or None. Maximum number of records to read from path.
          If None, the default, all records will be read.
        compression_type: 'GZIP', 'ZLIB', '' (uncompressed), or None to autodetect
          based on file extension.
  
      Yields:
        proto.FromString() values on each record in path in order.
      """
      if sharded_file_utils.is_sharded_file_spec(path):
          paths = sharded_file_utils.generate_sharded_filenames(path)
      else:
          paths = [path]
  
      i = 0
      for path in paths:
          with Reader(
              path, proto, compression_type=compression_type
          ) as reader:
              for record in reader.iterate():
                  i += 1
                  if max_records is not None and i > max_records:
                      return
                  yield record
  
file_path: deepvariant/third_party/nucleus/io/tfrecord.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import heapq
  import contextlib2
  from third_party.nucleus.io import genomics_reader
  from third_party.nucleus.io import genomics_writer
  from third_party.nucleus.io import sharded_file_utils
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: read_tfrecords(path, proto, max_records, compression_type) without return types